/home/techb158/balavpn.abdallabala.com/.next/cache/webpack/client-production
NameSizeModeActions
0.pack151902800666editdlrm
1.pack10575480666editdlrm
2.pack101655780666editdlrm
3.pack27605650666editdlrm
4.pack39280666editdlrm
5.pack534490666editdlrm
6.pack39280666editdlrm
7.pack39280666editdlrm
8.pack39280666editdlrm
9.pack222120666editdlrm
10.pack2434950666editdlrm
11.pack39280666editdlrm
12.pack39280666editdlrm
13.pack39280666editdlrm
14.pack27941130666editdlrm
15.pack404710666editdlrm
16.pack405510666editdlrm
17.pack4487160666editdlrm
index.pack38735700666editdlrm
index.pack.old38730950666editdlrm
Edit: /home/techb158/balavpn.abdallabala.com/.next/cache/webpack/client-production/3.pack (2760565B)
wpci*webpack/lib/cache/PackFileCacheStrategyPackContentItems Compilation/modules|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboard\page.jsx|app-pages-browserFlagDependencyExportsPlugin|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboard\page.jsx|app-pages-browserCompilation/codeGeneration|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboard\page.jsx|app-pages-browser|7e16abe844e36332|webpackCompilation/assets|chunk5105MinifierWebpackPlugin|static/chunks/app/dashboard/page-b1c4a66f026fada8.jsRealContentHashPlugin|analyse|static/chunks/app/dashboard/page-b1c4a66f026fada8.jswebpack/lib/NormalModulewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevn/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback, useMemo } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { api } from '../../lib/api-client'; import ErrorBoundary from '../../components/ErrorBoundary'; const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = useState([]); const add = useCallback(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ _jsx("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ _jsx("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ _jsxs("div", { className: "search-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ _jsx("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ _jsx("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ _jsxs("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ _jsx("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ _jsx("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ _jsxs("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ _jsx("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ _jsx("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = useMemo(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ _jsxs("div", { className: "metric-card", children: [ /*#__PURE__*/ _jsx("h3", { children: p.label }), /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ _jsx("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ _jsx("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ _jsxs("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Risk" }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('normalizedScore'); const [sortDir, setSortDir] = useState('desc'); const [page, setPage] = useState(0); const [selectedRisk, setSelectedRisk] = useState(null); const [showCreate, setShowCreate] = useState(false); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = useMemo(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ _jsx("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ _jsx("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ _jsxs("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ _jsx(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Score" }), /*#__PURE__*/ _jsx("br", {}), /*#__PURE__*/ _jsx("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Description" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.description ] }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ _jsx("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Mitigation" }), /*#__PURE__*/ _jsx(FormField, { label: "Risk *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('progressPercent'); const [sortDir, setSortDir] = useState('asc'); const [showCreate, setShowCreate] = useState(false); const [selectedMitigation, setSelectedMitigation] = useState(null); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const mitigations = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = useMemo(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: m.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ _jsx("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ _jsxs("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ _jsx(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = useState(false); const [showDecision, setShowDecision] = useState(false); const [decisionForm, setDecisionForm] = useState({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = useState(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Deployment Gate" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Criterion" }), /*#__PURE__*/ _jsx("th", { children: "Required" }), /*#__PURE__*/ _jsx("th", { children: "Actual" }), /*#__PURE__*/ _jsx("th", { children: "Status" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: c.name }) }), /*#__PURE__*/ _jsx("td", { children: c.required }), /*#__PURE__*/ _jsx("td", { children: c.actual }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Gate Decision" }), /*#__PURE__*/ _jsx(FormField, { label: "Decision", children: /*#__PURE__*/ _jsx(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reason", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Integration" }), /*#__PURE__*/ _jsx(FormField, { label: "Provider", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Base URL", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Auth Mode", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = useState(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ _jsxs("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ _jsx("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ _jsx("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ _jsx(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ _jsx("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ _jsx("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const load = useCallback(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); useEffect(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Audit Log" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Date" }), /*#__PURE__*/ _jsx("th", { children: "Action" }), /*#__PURE__*/ _jsx("th", { children: "Entity" }), /*#__PURE__*/ _jsx("th", { children: "Actor" }), /*#__PURE__*/ _jsx("th", { children: "Details" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ _jsxs("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ _jsxs("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "All Projects" }), /*#__PURE__*/ _jsxs("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ _jsx("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Project Settings" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Subtitle", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Project" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Project Type", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", {}) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet" }) }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } export default function DashboardPage() { const router = useRouter(); const searchParams = useSearchParams(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = useState(null); const [projects, setProjects] = useState([]); const [selectedProjectId, setSelectedProjectId] = useState(searchParams.get('projectId') || null); const [dashboard, setDashboard] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [retryCount, setRetryCount] = useState(0); const [showProjectSettings, setShowProjectSettings] = useState(false); const [showProjectManager, setShowProjectManager] = useState(false); const [workspaceId, setWorkspaceId] = useState(null); const { toasts, add } = useToast(); const onRefresh = useCallback(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = useCallback(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = useState(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ _jsx("div", { className: "shell-loading", children: /*#__PURE__*/ _jsx("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsx("p", { children: error }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ _jsx("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ _jsxs("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "dash-actions", children: [ /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ _jsx("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ _jsx(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ _jsx(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ _jsx(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ _jsx(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ _jsx(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ _jsx(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ _jsx(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ _jsx(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ _jsx(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ _jsx(ToastContainer, { toasts: toasts }) ] }); } exportsTypesideEffectFreenamespace  javascript/autoapp-pages-browserC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboardaliasfullySpecifiedmainFieldsfallback`$server-only$client-only$next/dist/compiled/client-only$next/dist/compiled/server-onlyC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\head.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\image.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\constants.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\router.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dynamic.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\script.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\link.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\form.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\navigation.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\headers.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\og.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\server.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\document.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\app.jsreact$react/compiler-runtime$react/jsx-dev-runtime$react/jsx-runtime$react-dom$react-dom/client$react-dom/server$react-dom/server.browser$react-dom/server.edge$react-dom/static$react-dom/static.browser$react-dom/static.edge$react-server-dom-webpack/client$react-server-dom-webpack/server$react-server-dom-webpack/server.node$react-server-dom-webpack/static$@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.tsnextnext/dist/compiled/server-only/indexnext/dist/compiled/client-only/indexnext/dist/client/components/noop-headnext/dist/api/imagenext/dist/api/constantsnext/dist/api/routernext/dist/api/app-dynamicnext/dist/api/scriptnext/dist/client/app-dir/linknext/dist/client/app-dir/formnext/dist/api/navigationnext/dist/api/headersnext/dist/api/ognext/dist/api/servernext/dist/api/documentnext/dist/api/appnext/dist/compiled/reactnext/dist/compiled/react/compiler-runtimenext/dist/compiled/react/jsx-dev-runtimenext/dist/compiled/react/jsx-runtimenext/dist/compiled/react-domnext/dist/compiled/react-dom/clientnext/dist/compiled/react-dom/server.browsernext/dist/build/webpack/alias/react-dom-server.jsnext/dist/compiled/react-dom/static.browsernext/dist/compiled/react-dom/static.edgenext/dist/compiled/react-server-dom-webpack/client.browsernext/dist/compiled/react-server-dom-webpack/server.browsernext/dist/compiled/react-server-dom-webpack/server.nodenext/dist/compiled/react-server-dom-webpack/static.browsernext/dist/client/dev/noop-turbopack-hmrC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next browsermodulemain`assertbufferconstantscryptodomainhttphttpsospathpunycodeprocessquerystringstreamstring_decodersystimersttyutilvmzlibeventssetImmediateC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\assert\assert.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\buffer\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\constants-browserify\constants.jsonC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\crypto-browserify\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\domain-browser\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\stream-http\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\https-browserify\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\os-browserify\browser.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\path-browserify\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\punycode\punycode.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\polyfills\process.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\querystring-es3\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\stream-browserify\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\string_decoder\string_decoder.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\util\util.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\timers-browserify\main.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\tty-browserify\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\vm-browserify\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\browserify-zlib\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\events\events.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\compiled\setimmediate\setImmediate.js~`cacheableparsedfileDependenciescontextDependenciesmissingDependenciesbuildDependenciesvalueDependencieshashassetsassetsInforscstrictexportsArgumenttopLevelDeclarationssnapshot webpack/lib/util/LazySetC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.jswebpack/DefinePlugin_hashff9a23f26abba7278c6b41bftypeactionIdsisClientRefclient  __webpack_exports__`useToastToastContainerSearchInputsortDataBadgeFormFieldInlineInputInlineSelectConfirmDeleteOverviewTabRiskFormModalRisksTabMitigationFormModalMitigationsTabGateTabIntegrationFormModalIntegrationsTabAuditTabProjectsTabProjectSettingsModalNewProjectModalProjectManagerModalTABSPAGE_SIZEDIMENSIONSLIFECYCLE_PHASESRISK_STATUSESMITIGATION_STATUSES*default*DashboardPagewebpack/lib/FileSystemInfoSnapshot +{yBC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboard\page.jsxsafeTimetimestamp!vyBvyBa057250d3bb7785dwebpack/lib/dependencies/HarmonyCompatibilityDependency dwebpack/lib/dependencies/ConstDependency`=@ a=@A `BA `=A@ `+AA| `;webpack/lib/dependencies/HarmonyExportHeaderDependencyA3WnA3Wn @ @ @gwebpack/lib/dependencies/HarmonyImportSideEffectDependencyreact/jsx-runtime a=@react `Bnext/navigation `=../../lib/api-client `+../../components/ErrorBoundary `;webpack/lib/dependencies/PureExpressionDependency Adefault a A$x c A c A0 c" AN c#(webpack/lib/dependencies/HarmonyImportSpecifierDependency useState A   c* *( useCallback A   c++ jsx_jsx AVZ   c@@  A   cB0B4 jsxs_jsxs A   cJJ  A    cMM  A   cQQ  AQ U    chh  A     coo  A    ctt  A>B   @`@`  A   @`@`  A   @`@`  A   @`%@`)  A   @`@`  A9>   @` @`%  A   @`@`#  A   @`@`"  A   @`@`#  Aei   @`&@`*  AW[   @`&@`* useMemo A   @`@`  A-)1)  {{ @`)@`-  A}))  ww @` @`$  A))  ss @`@` Fragment_Fragment A)) 4mm @`@`(  A(*,*  ii @`@`  A ++  ee @ `8@ `=  A++  aa @`*@`.  A%,),  ]] @`*@`.  A,,  YY @`*@`.  A--  UU @`@`  A..  QQ @$`"@$`' uv Ao/s/  MM @'`*@'`. |} A%0*0  II @*`R@*`W xy A'1,1  EE @/`6@/`; ij A22  AA @6`>@6`B ef Ac4g4  == @<`>@<`B ab A86<6  99 @D`6@D`: ]^ A66  55 @F`D@F`H de A99  11 @R`"@R`' UV A::  -- @U`*@U`. \] A::  )) @X`S@X`X XY A;;  %% @]`6@]`; IJ A==  !! @d`>@d`B PQ A ??   @j`>@j`C AB AAA   @v`6@v`: => AqBuB   @x`D@x`H .- AEE   @` @`( )( A FF   @`@`$ apipost AHH  AHH     @`@` )* AII   @`@` 01 A\JaJ   @` @`% !" A2K6K   @`@`"  AKK   @`@`"  AKL   @`,@`0  ALL   @`@`"  AM!M   @`,@`0  ANN   @`@`#    AOO   @`&@`*  AXP\P   @`4@`8  AuQyQ   @`&@`*  AQQ   @`4@`8  ARR   @`@`"  AVSZS   @`,@`0  ASTXT   @`@`#  A`UdU   @`&@`*  AUU   @`4@`8  AEWIW   @`&@`*  AWW   @`4@`8  AYY   @ `&@ `*  AYY   @ `4@ `8  A'[+[   @`@`"  A[[   @`,@`0  AV\[\   @`@`#  A\\   @!`&@!`*  A]]   @&`&@&`*  A__   @4` @4`(  A__   @5`"@5`*  A ``   @6`"@6`*  A7`?`   @7`@7`$  Ap`x`   @8`,@8`4  A``   @9`(@9`0  A``   @:`"@:`*  Aaa  ~~ @;`$@;`,  ABaJa  zz @<`$@<`,  Aaa  vv @=`.@=`6  Aaa  rr @>`$@>`,  Aaa  nn @?`@?`  Abb  jj @G`@G` \patchZ Aii  Aii  hh @k`@k` VU A9kBk  A9kB  ' @W`.@W`2  A  # @^`0@^`5JK AÕ 4  @^`6@^`?  A"   @``.@``3  A    @e`6@e`:  A   @g`D@g`H  A   @o`6@o`:  AJN    @q`D@q`H  Aםܝ   @`6@`;  A   @`>@`B  A.2   @`L@`P  AƢʢ   @`>@`B  Aim   @`L@`P  A   @`6@`:  A   @`D@`H  A   @`6@`;  A   @`>@`B  AW[  }} @`L@`P  Aw{  yy @`>@`B  A  uu @`L@`P  A04  qq @`>@`B  Aڲ޲  mm @`L@`P  AOS  ii @`6@`:  A  ee @`D@`H  A:?  aa @`.@`3  A  ]] @`6@`:  ABF  YY @`6@`: }~ A  UU @`6@`:  AϿԿ  QQ @`+@`0 Aտ޿ 4NN @`1@`: }~ A8=  JJ @`.@`3 yz A$  FF @ `6@ `; jk A  BB @ `>@ `B fg A  >> @`>@`B mn A  :: @`6@`; ^_ A#'  66 @`>@`B Z[ A26  22 @`>@`B ab A#  .. @`6@`; RS A  ** @ `>@ `B NO A  && @$`>@$`B UV A  "" @(`6@(`; FG A&*   @*`>@*`B BC A6:   @.`>@.`B IJ A  } @2`6@2`; :; A  y @4`>@4`B 67 A  u @8`>@8`B => A  q   @<`6@<`; ./ A&*  m @>`>@>`B *+ A59  i @B`>@B`B &' A  e @C`>@C`B -. A  a @H`6@H`;  A7;  ] @J`>@J`B  AIM  Y @N`>@N`B !" A49  U @R`6@R`;  A  Q @T`>@T`B  A  M @X`>@X`B  A  I @^`J@^`O  AOS  E @d`6@d`:  ADH  A @h`6@h`:    A   = @l`.@l`3  A   9 @q`6@q`:  A  5 @x`6@x`:  Ajn  1 @`[@`_  A  - @`.@`2  Ahl  ) @`<@`@  A37  % @`+@`/  A   @` @`(  A   @`@`$  A  A   @`@`  A   @`@`  AY^   @` @`%  A/3   @`@`"  A   @`@`"  A   @`,@`0  Arv   @`@`"  A   @`,@`0  A   @`@`"  A   @`,@`0  A   @`@`"  A   @`,@`0  A   @`@`#  A   || @`&@`*  A  xx @`4@`8  A  tt @`&@`*  Asw  pp @`4@`8  A  ll @`@`"  Ax|  hh @`,@`0  AY]  dd @#`@#`"  A  `` @%`,@%`0  A  \\ @*`@*`#  A   XX @-`&@-`* |} A  TT @2`&@2`* ml A  [QQ @@` @@`( hg A  MM @A`"@A`* dc AGO  II @B`"@B`* `_ A  EE @C`(@C`0 \[ A  AA @D`8@D`@ XW A  == @E`"@E`* TS A08  99 @F`$@F`, PO Abj  55 @G`$@G`, LK A  11 @H`.@H`6 HG A  -- @I`$@I`,  A  )) @J`@J`  A   %% @R`@R`  A  !! @X`@X`  A  A     @`@`   A    A     @`@` 9: A     @`)@`- 56 Af j      @` @`$ <= A       @`@` A   4 @`@`( 56 A     @`@` &' A     @`"@`& "# A     @`"@`&  A   @`@` %& A%*   @`(@`-  A   @`&@`*  A   @`4@`8  A   @`;@`@    A?C   @`&@`*  A   @`5@`:  A<@   @`6@`:  A   @`D@`H  Aqu   @`6@`:  A  ~ @`D@`H  A  z @`6@`:  A=A  v @`D@`H  A  r @`6@`:  A!  n @`D@`I  A  j @`B@`F  A!!  f @ `P@ `T  Ac%h%  b @`6@`;  A&&  ^ @`6@`:  A ''  Z @`D@`H  A()  V @*`.@*`2  A])a)  R @,`(@,`,  A))  N @0`(@0`,  Ad+h+  J @:`B@:`F  A,,  F @=`(@=`-  A--  B @D`&@D`*  A(.-.  > @J`&@J`+  A./  : @O`.@O`2  A//  6 @Q`<@Q`@  AE1I1  2 @Y`.@Y`2  A11  .~~ @[`<@[`@  A44  *zz @i`.@i`2  Am5q5  &vv @k`<@k`@  Ax7}7  "rr @t`.@t`3  A88  nn @{`6@{`:  A99  jj @}`D@}`H  AX<\<  ff @`6@`:  A<<  bb @`D@`H  A@@  ^^ @`.@`2  A@@   ZZ @`<@`@ ~ ABB  VV @`.@`2 z{ ACC  RR @`<@`@  AE E  NN @`&@`+ rs AEE  JJ @`.@`2 no AFF  FF @`.@`2 jk AfHjH  BB @`.@`2 fg AKK  >> @`+@`/ WV ALL  E;; @`(@`0 RQ ALL  77 @`,@`4 NM A)M1M  33 @`,@`4 JI AMM  // @`0@`8 !"  APP  APP  .. @`@`  ARR  ARR  )) @`@` GH AwT{T   @`)@`- CD ATT   @` @`$ JK A"U'U   @`@` A(U1U 4 @`@`( CD AcUhU   @`@` ?@ AUU     @ `"@ `' 01 A7V;V   @ `*@ `. ,- AVV   @`*@`. () AWW   @`"@`& $% AFXJX   @`0@`4  ! AYY   @"`@"` '( A ZZ   @$`(@$`-  AZZ   @'`&@'`*   AZZ   @(`4@(`9  A:[>[   @*`2@*`6    A[[   @-`2@-`6   A\\   @0`2@0`6  A%])]   @3`2@3`6  A^^   @9`&@9`*  A^^   @<`5@<`:  A9_=_   @>`6@>`:  A__   @?`D@?`H  Am`q`   @C`6@C`:  Aa!a   @F`6@F`:  Aaa   @I`6@I`:  Ab b   @J`D@J`H  AQdUd  ~ @V`.@V`2  Add  z @X`(@X`,  A9e>e  v @\`@\`  A;f?f  r @d`"@d`&  Asgwg  n @j`,@j`0  Ahhlh  j @o`"@o`&  Aii  f @w`*@w`.  Ajj  b @z`(@z`-  Akk  ^ @`&@`*  A l$l  Z @`&@`*  All  V @`4@`8  A8oxx @`.@`2  A3v7v  :tt @`.@`2  Axx  {qq @` @`(  Axx  mm @`@`$ _`^ A{{  A{{  ll @`@`  A||  bb @`@`  Ag}l}  ^^ @` @`%  A=~A~  ZZ @`@`" ~ A~~  VV @`@`" z{ A  RR @`,@`0 vw A  NN @`@`" rs A  JJ @`,@`0 no A  FF @`@`" jk AEI  BB @`,@`0 fg A  >> @ `@ `" bc Afj  :: @ `,@ `0 ij A҄ׄ  66 @`@`# Z[ AW[  22 @`&@`* VW AHL  .. @`&@`* GF A,4  5++ @-`(@-`0 XY Aňʈ  %% @/`@/` AˈԈ 4"" @/`@/`( QR A    @1`@1` MN A}   @4`"@4`' >? Aډމ   @6`*@6`. :; Ajn   @9`*@9`. 67 A{   @?`"@?`& 23 A     @A`0@A`4 ./ A   @I`@I` 56 A    @U`)@U`. &' A   @[`*@[`. "# A   @b`*@b`.  A   @h`*@h`.  AEI   @p`*@p`.  A   @v`C@v`G  Aɖ͖   @{`3@{`7  Alp   @`(@`,    A   @`2@`6  Adh   @`(@`,  A؛   @` @`(  A   @`"@`*  A6>   @`@`&  AWb   @`@` get A  A   @`@`& useEffect A    @@`   Amq   @`&@`*  A   @` @`$  A-1   @`$@`(  A}   @` @`$  A   @`-@`1  A59   @` @`$  A   @`@`45 A 4 @`@`(  A   @`@`  AZ_   @`"@`'  A   @`*@`.  ADH   @`*@`.  A<@   @`"@`&  A   @`0@`4  AȤ̤   @`@`  A',   @`(@`-  A   @`&@`*  A  {{ @`4@`9  AVZ  ww @`2@`6  A  ss @`2@`6  A  oo @`2@`6  A:>  kk @`2@`6  Aۨߨ  gg @`2@`6  AΩҩ  cc @`&@`*  A  __ @`5@`:  A  [[ @ `6@ `:  A  }WW @ `6@ `: {| A  ySS @ `D@ `H  A  uOO @ `6@ `; ~ A%*  qKK @ `>@ `C op AɲͲ  mGG @ `6@ `: kl A)-  iCC @% `6@% `: \[ A  J@@ @: `$@: `, WV A  << @; `.@; `6 SR A#+  88 @< `"@< `* *) A  A  77 @@ `@@ ` `a A   -- @J `@J ` A 4** @J `@J `( YZ ANS  && @L `@L ` UV Aźʺ  "" @O `"@O `' FG A"&   @Q `*@Q `. MN A   @T `*@T `/ >? A(,   @] `"@] `& :; A   @_ `0@_ `4 67 Aľ   @g `@g ` => A$     @i `(@i `- ./ A   @l `&@l `* 56 A   @m `4@m `9 &' ANR   @o `2@o `6 "# A   @r `2@r `6  A   @u `2@u `6  A04   @x `2@x `6  A   @{ `2@{ `6  A   @ `&@ `*  A   @ `5@ `:  A%*   @ `6@ `;  A   @ `>@ `B  A   @ `Z@ `^  A   @ `N@ `R  A   @ `6@ `:  A)-   @ `D@ `H  A   @ `6@ `:  A   @ `6@ `:  Agl   @ `6@ `;  A   @ `[@ `_  A"&  { @ `>@ `B  A  w @ `.@ `2  A\`  s @ `(@ `,  A  o @ `%@ `)  A@D  k @ `+@ `/  A  g @ `(@ `-  A  c @ `&@ `+  A  _ @ `&@ `*  Amr  [ @ `&@ `+  A   W @ `.@ `2  A6:  S @ `.@ `2  AGO   @ ` @ `(  At|   @ `@ `$ }!| A  A   @% `@% `  A    @. `@. `  Arw  || @1 ` @1 `%  AHL  xx @8 `@8 `"  A  tt @; `@; `"  A  pp @= `,@= `0  ASW  ll @E `@E `"  A  hh @G `,@G `0  A  dd @O `@O `"  A`d  `` @Q `,@Q `0  A  \\ @_ `@_ `"  A  XX @a `,@a `0  A  TT @n `@n `# xy Alp  PP @q `&@q `* tu A]a  LL @v `&@v `* ed A3;  SII @ ` @ `( `_ A`h  EE @ `@ `$ 786 A  A  DD @ `@ ` bc A  :: @ `@ ` ij ACH  66 @ ` @ `% Z[ A  22 @ `@ `" VW A  .. @ `@ `" RS A  ** @ `,@ `0 NO A#  && @ `@ `" JK A  "" @ `,@ `0 FG A   @ `@ `" BC A%)   @ `,@ `0 IJ AUZ   @ `@ `# :; A   @ `&@ `* 67 A   @ `&@ `* '& A     @ `$@ `, "! A   @ `.@ `6  AAI   @ `"@ `*  A  A   @ `@ ` +, A).   @ `@ ` '( A   @ `@ ` #$ A   @ `"@ `'  A   @ `*@ `.  A! %    @ `*@ `.  AY ^    @ `"@ `'   A     @# `"@# `&  A     @( `0@( `5  Ai m    @+ `.@+ `2  A     @, `<@, `A  A15   @. `:@. `>  A   @1 `:@1 `>  A   @4 `:@4 `>  A[_   @7 `:@7 `>  A   @: `:@: `>  A   @> `.@> `2  A"   @C `=@C `B  Aw|   @H `>@H `C  A    @J `F@J `J  A    @M `b@M `f  A   @W `>@W `B  A   @X `L@X `P  A   @] `>@] `B  A>B   @c `>@c `B  A   @i `>@i `C  A   @o `c@o `g  A""   @z `F@z `J  AC'G'   @ `6@ `:  A''  ~ @ `0@ `4  AL(P(  z @ `"@ `&  A((  v @ `0@ `4  A))  r|| @ `+@ `/  A**  nxx @ `(@ `-  A++  jtt @ `&@ `+  A,,  fpp @ `&@ `*  A..  bll @ `&@ `+  A..  ^hh @ `.@ `2  A//  Zdd @ `.@ `2  A22  V`` @ `%@ `)webpack/lib/dependencies/HarmonyExportSpecifierDependency@Ej @ @  useRouter A33   e]] @ `@ ` useSearchParams A4#4  XX @ `@ `( ml A44  RR @ `"@ `* ih A44  NN @ `$@ `, ed A 5(5  JJ @ `6@ `> a` Aw55  FF @ `&@ `. ]\ A55  BB @ `"@ `* YX A55  >> @ `@ `& UT A66  :: @ `(@ `0 QP AV6^6  66 @ `:@ `B ML A66  22 @ `8@ `@ IH A66  .. @ `*@ `2 KJ A(737  ** @ `@ `! GF Ar7}7  && @ `@ `% W A78>8  A78:8  %% @ `"@ `) R A::  A::     @ `)@ `0 M  A<<  A<<   @ `'@ `.  H A??  A??   @ `#@ `* IH A#A,A   @ @ `  %$ ABB     @% `6@% `> ,- ABB   @& `@@& `D () A(C,C   @( ` @( `$ /0 ACC   @, `>@, `C  ! AD D   @/ `@/ `  ADD   @3 `@3 ` #$ ADD   @6 `@6 `  AEE   @> `"@> `&  A GG   @C `W@C `[    A>HBH   @J `>@J `B  AII   @W `@W `no AII 4 @W `@W `(    A JJ   @Y `@Y `  AJJ  { @\ `"@\ `&  A~KK  w @b `0@b `5  AKK  s @d `.@d `3  ARMVM  o @k `6@k `:  APP  k @x `V@x `[  AKSOS  g @ `6@ `:  AUU  c @ `6@ `:  AhWlW  _ @ `.@ `2  AYY  [ @ `"@ `'  AZ Z  W @ `*@ `.  A[[  S @ `*@ `.  A]]  O @ `@ `  A]]  K @ `6@ `:  AY_]_  G @ `0@ `4 ErrorBoundary A^_k_ 4B @ `5@ `B  A__  > @ `(@ `,  A{``  : @ `0@ `4 A`` 47 @ `5@ `B  A``  3 @ `(@ `,  Abb  / @ `-@ `1 Abb 4, @ `2@ `?  Ac c  ( @ `(@ `,  AAdEd  $~~ @ `3@ `7 AFdSd 4! @ `8@ `E  Add  ww @ `(@ `,  Aee  ss @ `,@ `0 Aee 4xx @ `1@ `>  A>fBf  ll @ `(@ `,  Avgzg  hh @ `4@ `8 A{gg 4 mm @ `9@ `F  Agg  aa @ `(@ `,  Aii  ]] @ `-@ `1 A i-i 4bb @ `2@ `? ~ Axi|i  VV @ `(@ `, z{ A[j_j  RR @ `1@ `5 vw Akk  NN @ `0@ `4 rs Amn  JJ @ `@ ` webpack/lib/ModuleGraphRestoreProvidedData   nameprovidedcanMangleProvideterminalBindingexportsInfoK   sourcesdataruntimeRequirementsjavascriptwebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 4 webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcez// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(5155); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(2115); // EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(63); // EXTERNAL MODULE: ./src/lib/api-client.js var api_client = __webpack_require__(6282); ;// ./src/components/ErrorBoundary.jsx webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Component } from 'react'; class ErrorBoundary extends Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsxs("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } export { ErrorBoundary as default };  b={}N%)AD} __WEBPACK_MODULE_REFERENCE__1_5b22436f6d706f6e656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._buffersourcesizemapshash6 /* __next_internal_client_entry_do_not_use__ default auto */ class ErrorBoundary extends __WEBPACK_MODULE_REFERENCE__1_5b22436f6d706f6e656e74225d_directImport_asiSafe1__._ { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } {"finalSource":false}mapbufferedMap ReplaceSourceRawSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Component } from 'react'; class ErrorBoundary extends Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsxs("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } export { ErrorBoundary as default }; Y61123undefined125158undefined188196__WEBPACK_MODULE_REFERENCE__1_5b22436f6d706f6e656e74225d_directImport_asiSafe1__._undefined527531__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined646649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined805809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10891092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14051408__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22802315undefined`[JCJreact.Component(0,jsx_runtime.jsxs)(0,jsx_runtime.jsx)" ;// ./src/app/dashboard/page.jsx  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevn/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback, useMemo } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { api } from '../../lib/api-client'; import ErrorBoundary from '../../components/ErrorBoundary'; const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = useState([]); const add = useCallback(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ _jsx("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ _jsx("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ _jsxs("div", { className: "search-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ _jsx("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ _jsx("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ _jsxs("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ _jsx("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ _jsx("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ _jsxs("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ _jsx("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ _jsx("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = useMemo(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ _jsxs("div", { className: "metric-card", children: [ /*#__PURE__*/ _jsx("h3", { children: p.label }), /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ _jsx("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ _jsx("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ _jsxs("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Risk" }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('normalizedScore'); const [sortDir, setSortDir] = useState('desc'); const [page, setPage] = useState(0); const [selectedRisk, setSelectedRisk] = useState(null); const [showCreate, setShowCreate] = useState(false); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = useMemo(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ _jsx("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ _jsx("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ _jsxs("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ _jsx(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Score" }), /*#__PURE__*/ _jsx("br", {}), /*#__PURE__*/ _jsx("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Description" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.description ] }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ _jsx("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Mitigation" }), /*#__PURE__*/ _jsx(FormField, { label: "Risk *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('progressPercent'); const [sortDir, setSortDir] = useState('asc'); const [showCreate, setShowCreate] = useState(false); const [selectedMitigation, setSelectedMitigation] = useState(null); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const mitigations = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = useMemo(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: m.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ _jsx("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ _jsxs("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ _jsx(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = useState(false); const [showDecision, setShowDecision] = useState(false); const [decisionForm, setDecisionForm] = useState({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = useState(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Deployment Gate" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Criterion" }), /*#__PURE__*/ _jsx("th", { children: "Required" }), /*#__PURE__*/ _jsx("th", { children: "Actual" }), /*#__PURE__*/ _jsx("th", { children: "Status" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: c.name }) }), /*#__PURE__*/ _jsx("td", { children: c.required }), /*#__PURE__*/ _jsx("td", { children: c.actual }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Gate Decision" }), /*#__PURE__*/ _jsx(FormField, { label: "Decision", children: /*#__PURE__*/ _jsx(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reason", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Integration" }), /*#__PURE__*/ _jsx(FormField, { label: "Provider", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Base URL", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Auth Mode", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = useState(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ _jsxs("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ _jsx("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ _jsx("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ _jsx(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ _jsx("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ _jsx("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const load = useCallback(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); useEffect(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Audit Log" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Date" }), /*#__PURE__*/ _jsx("th", { children: "Action" }), /*#__PURE__*/ _jsx("th", { children: "Entity" }), /*#__PURE__*/ _jsx("th", { children: "Actor" }), /*#__PURE__*/ _jsx("th", { children: "Details" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ _jsxs("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ _jsxs("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "All Projects" }), /*#__PURE__*/ _jsxs("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ _jsx("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Project Settings" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Subtitle", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Project" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Project Type", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", {}) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet" }) }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } export default function DashboardPage() { const router = useRouter(); const searchParams = useSearchParams(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = useState(null); const [projects, setProjects] = useState([]); const [selectedProjectId, setSelectedProjectId] = useState(searchParams.get('projectId') || null); const [dashboard, setDashboard] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [retryCount, setRetryCount] = useState(0); const [showProjectSettings, setShowProjectSettings] = useState(false); const [showProjectManager, setShowProjectManager] = useState(false); const [workspaceId, setWorkspaceId] = useState(null); const { toasts, add } = useToast(); const onRefresh = useCallback(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = useCallback(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = useState(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ _jsx("div", { className: "shell-loading", children: /*#__PURE__*/ _jsx("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsx("p", { children: error }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ _jsx("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ _jsxs("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "dash-actions", children: [ /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ _jsx("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ _jsx(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ _jsx(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ _jsx(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ _jsx(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ _jsx(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ _jsx(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ _jsx(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ _jsx(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ _jsx(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ _jsx(ToastContainer, { toasts: toasts }) ] }); } @b`=_?A{VY Q T   >A_9=ehWZ-)0)}))))))(*+* +_+++%,(,,,--..o/r/%0)0'1+122c4f486;66699::::;_;== ? ?AAqBtBEE FFHHII\J`J2K5KKKKLLLM MNNO_OXP[PuQxQQQRRVSYSSTWT`UcUUUEWHWWWYYYY'[*[[[V\Z\\_\]]____ ``7`>`p`w`````aaBaIaaaaaaabbii9k_;kllNnQnnnnnno:o>opp qq rrlrprrr/s2syy{{||u}_x}Y\y|Ӄփ$'fibePSTX_ADӎ֎$'ȑ̑>A•!JMם۝_.1ƢɢilWZwz03ڲݲOR:>_BEϿӿտݿ8<##&25"&_)69&)587:IL48O_RDG  jmhk36Y]/2_ru svx{Y\_ GN07bi _    f i           %)?B<_?qt=@ !!c%g%&& ''()])`)))d+_g+,,--(.,..///E1H11144m5p5x7|78899X<[<<<@@@_@BBCCEEEEFFfHiHKKLLLL)M0MMMPPRRwTzTTT"U_&U(U0UcUgUUU7V:VVVWWFXIXYY ZZZZZZ:[=[[[\\%](]^_^^^9_<___m`p`a aaabbQdTddd9e=e;f>fsgvghhkhiijjk_k l#lll8o;oooLqOqqqjtntu u3v6vxxxx{{||g}k}=~@~~_~EHfi҄քWZHK,3ňɈˈӈ }ډ_݉jm{~ EHɖ̖lodg؛ߛ_6=Wa mp-0}58Z^D_G<?Ȥˤ'+VY:=ۨިΩѩ_%)ɲ̲),#* NRźɺ"%(+_þ#NQ03%)_),gk"%\_@Cmq  6_9GNt{ rvHKSV`cl_o]`3:`gCG"%(UY_AH)-! $ Y ]     i l   14_[^!w{  >A""C'_F'''L(O((())**++,,....//2233334"4444_4 5'5w5~5555566V6]66666(727r7|77898::<<??#A+AB_BBB(C+CCCD DDDDDEE GG>HAHIIII JJJJ~KKKKRM_UMPPKSNSUUhWkWYYZZ[[]]]]Y_\_^_j___{`~`````b_bbbc cAdDdFdRdddeeee>fAfvgyg{ggggii i,ixi{i[j^jkBkmn__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._/* __next_internal_client_entry_do_not_use__ default auto */ const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const add = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "search-wrap", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "metric-card", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: p.label }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "New Risk" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Title *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Dimension *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Domain", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Probability", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Impact", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Detectability", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Owner", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(''); const [sortKey, setSortKey] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._('normalizedScore'); const [sortDir, setSortDir] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._('desc'); const [page, setPage] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [selectedRisk, setSelectedRisk] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [showCreate, setShowCreate] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [editing, setEditing] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [editForm, setEditForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({}); const [updating, setUpdating] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [confirmDelete, setConfirmDelete] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [deleting, setDeleting] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const risks = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading..." }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: risk.title }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Title *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Dimension", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Domain", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Probability", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Impact", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Detectability", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Owner", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Score" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Description" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.description ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "New Mitigation" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Risk *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Title *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Status", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Progress %", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Due Date", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Owner", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(''); const [sortKey, setSortKey] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._('progressPercent'); const [sortDir, setSortDir] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._('asc'); const [showCreate, setShowCreate] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [selectedMitigation, setSelectedMitigation] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [editing, setEditing] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [editForm, setEditForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({}); const [updating, setUpdating] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [confirmDelete, setConfirmDelete] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [deleting, setDeleting] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const mitigations = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading..." }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: m.title }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Title *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Status", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Progress %", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Due Date", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Owner", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [showDecision, setShowDecision] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [decisionForm, setDecisionForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading..." }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { children: "Deployment Gate" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Criterion" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Required" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Actual" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Status" }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: c.name }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: c.required }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: c.actual }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "Gate Decision" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Decision", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Reason", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "New Integration" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Provider", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Base URL", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Auth Mode", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { children: "Integrations" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [loading, setLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(true); const [error, setError] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const load = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { children: "Audit Log" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Date" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Action" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Entity" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Actor" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Details" }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [confirmDelete, setConfirmDelete] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [showNew, setShowNew] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const handleDelete = async ()=>{ setDeleting(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { children: "All Projects" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Name" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Status" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Type" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Created" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "Project Settings" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Name *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Subtitle", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Status", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "New Project" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Name *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Project Type", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [confirmDelete, setConfirmDelete] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [showNew, setShowNew] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const handleDelete = async ()=>{ setDeleting(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Name" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Status" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Type" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Created" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", {}) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No projects yet" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } function DashboardPage() { const router = __WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._(); const searchParams = __WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [projects, setProjects] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [selectedProjectId, setSelectedProjectId] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(searchParams.get('projectId') || null); const [dashboard, setDashboard] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [loading, setLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(true); const [error, setError] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [retryCount, setRetryCount] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [showProjectSettings, setShowProjectSettings] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [showProjectManager, setShowProjectManager] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [workspaceId, setWorkspaceId] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const { toasts, add } = useToast(); const onRefresh = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shell-loading", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: error }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Overview", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Projects", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Risks", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Mitigations", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Gate", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Integrations", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Audit", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ToastContainer, { toasts: toasts }) ] }); }  vn/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback, useMemo } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { api } from '../../lib/api-client'; import ErrorBoundary from '../../components/ErrorBoundary'; const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = useState([]); const add = useCallback(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ _jsx("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ _jsx("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ _jsxs("div", { className: "search-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ _jsx("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ _jsx("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ _jsxs("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ _jsx("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ _jsx("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ _jsxs("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ _jsx("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ _jsx("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = useMemo(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ _jsxs("div", { className: "metric-card", children: [ /*#__PURE__*/ _jsx("h3", { children: p.label }), /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ _jsx("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ _jsx("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ _jsxs("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Risk" }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('normalizedScore'); const [sortDir, setSortDir] = useState('desc'); const [page, setPage] = useState(0); const [selectedRisk, setSelectedRisk] = useState(null); const [showCreate, setShowCreate] = useState(false); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = useMemo(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ _jsx("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ _jsx("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ _jsxs("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ _jsx(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Score" }), /*#__PURE__*/ _jsx("br", {}), /*#__PURE__*/ _jsx("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Description" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.description ] }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ _jsx("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Mitigation" }), /*#__PURE__*/ _jsx(FormField, { label: "Risk *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('progressPercent'); const [sortDir, setSortDir] = useState('asc'); const [showCreate, setShowCreate] = useState(false); const [selectedMitigation, setSelectedMitigation] = useState(null); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const mitigations = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = useMemo(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: m.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ _jsx("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ _jsxs("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ _jsx(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = useState(false); const [showDecision, setShowDecision] = useState(false); const [decisionForm, setDecisionForm] = useState({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = useState(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Deployment Gate" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Criterion" }), /*#__PURE__*/ _jsx("th", { children: "Required" }), /*#__PURE__*/ _jsx("th", { children: "Actual" }), /*#__PURE__*/ _jsx("th", { children: "Status" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: c.name }) }), /*#__PURE__*/ _jsx("td", { children: c.required }), /*#__PURE__*/ _jsx("td", { children: c.actual }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Gate Decision" }), /*#__PURE__*/ _jsx(FormField, { label: "Decision", children: /*#__PURE__*/ _jsx(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reason", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Integration" }), /*#__PURE__*/ _jsx(FormField, { label: "Provider", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Base URL", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Auth Mode", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = useState(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ _jsxs("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ _jsx("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ _jsx("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ _jsx(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ _jsx("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ _jsx("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const load = useCallback(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); useEffect(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Audit Log" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Date" }), /*#__PURE__*/ _jsx("th", { children: "Action" }), /*#__PURE__*/ _jsx("th", { children: "Entity" }), /*#__PURE__*/ _jsx("th", { children: "Actor" }), /*#__PURE__*/ _jsx("th", { children: "Details" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ _jsxs("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ _jsxs("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "All Projects" }), /*#__PURE__*/ _jsxs("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ _jsx("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Project Settings" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Subtitle", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Project" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Project Type", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", {}) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet" }) }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } export default function DashboardPage() { const router = useRouter(); const searchParams = useSearchParams(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = useState(null); const [projects, setProjects] = useState([]); const [selectedProjectId, setSelectedProjectId] = useState(searchParams.get('projectId') || null); const [dashboard, setDashboard] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [retryCount, setRetryCount] = useState(0); const [showProjectSettings, setShowProjectSettings] = useState(false); const [showProjectManager, setShowProjectManager] = useState(false); const [workspaceId, setWorkspaceId] = useState(null); const { toasts, add } = useToast(); const onRefresh = useCallback(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = useCallback(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = useState(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ _jsx("div", { className: "shell-loading", children: /*#__PURE__*/ _jsx("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsx("p", { children: error }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ _jsx("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ _jsxs("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "dash-actions", children: [ /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ _jsx("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ _jsx(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ _jsx(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ _jsx(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ _jsx(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ _jsx(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ _jsx(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ _jsx(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ _jsx(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ _jsx(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ _jsx(ToastContainer, { toasts: toasts }) ] }); } 61146undefined148213undefined215275undefined277319undefined321379undefined970977__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10001010__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined16221625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17221725__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19611965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined20562059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21852188__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined28972900__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30923096__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined32103213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36463649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40424046__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42594262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined45544557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48124815__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49214925__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined51355139__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53475350__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56005604__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57335736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59755978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65846590__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined1054110544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1062110624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1072710731__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1073310741__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1079210795__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102111025__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1116411167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1130111304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1151311516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176411768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1200612010__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1214312146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1232512329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1258312587__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1302613029__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1341113414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1388013883__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1402914032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1473014734__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1486714870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1504915053__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1530715311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1575015753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1613716141__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1686016863__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1700917012__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1788517892__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1793017937__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1862018622__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined1892818931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1903619040__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1925019253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1935419357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1945419457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1963719640__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1974119744__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2018320187__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2044820451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2056820571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2085320856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2096820971__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2122621229__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2133421337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2158721591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2185621859__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2197621979__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2234122344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2245622459__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2281122814__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2293322936__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2333523338__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2343323436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2363823642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2377123774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2401224015__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2447424481__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2452224529__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2458524592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2463124638__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2468824695__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2474424751__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2479524802__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2484824855__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2489824905__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2496024967__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2501225019__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2504725053__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2531425320__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2689626898__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2744927451__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2785827860__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2823828241__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2831828321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2840928413__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2841528423__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2847428478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2869728700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2894128944__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2919729200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2929229296__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2941929422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2948729490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3113431138__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3173031733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3193431938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3211732120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3260132604__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3268232685__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3291332916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3299432997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3340133404__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3374733750__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3382833831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3406934072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3415034153__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3465834661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3473934742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515235155__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3523335236__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3575135754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592435928__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3632136324__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3641736420__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3656336566__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3690036903__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3705037054__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3732037324__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3765637659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795037953__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3832438328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3833038338__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3842938433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3868438687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3883238835__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3934639349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3949839501__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4040740411__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4084040843__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4100641009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4167041673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4183341836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4249442497__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4265042653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4325843262__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4369543698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4386343866__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4466344666__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4482644829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4561645619__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4578645789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4667146674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4681746820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4741847422__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4759947602__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4793847941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4836748370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4910349107__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4910949117__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4920849212__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4969549699__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4982849831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5010350106__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5033450338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5046750470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5073850741__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5097450978__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5110751110__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5138451387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5161751621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5175051753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5202252025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5225052254__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5238352386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5266252665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5289752901__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5303053033__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5330153304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5337953382__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368253686__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5381553818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5408954092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5432454328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5445754460__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5472854731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5506655070__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5537555378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5562055623__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5582155825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5607656079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5648556488__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5693856941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5756657569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5770457707__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5816358166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5851758524__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5856258569__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5956159563__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined5988559888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5999359997__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6020760210__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6031760320__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6041660419__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6078660789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6088660889__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6106961072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6117361176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6161561618__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6171461717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6195461958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6221962222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6233862341__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6271162714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6283562838__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6325163254__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6335263355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6357763580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6367563678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6388063884__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6401364016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6425464257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6472864735__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6477664783__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6483964846__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6489664903__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6496964976__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6501965026__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6507265079__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6512265129__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6518465191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6523665243__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6527765283__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6554765553__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6575265758__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6754767549__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6797667978__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6837468377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6845468457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6854568549__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6855168559__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6861068614__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6883368836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6905669059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6931869321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6941369417__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6954069543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6960869611__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7089170895__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7148771490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7167471678__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7199671999__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7207772080__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7230572308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7238672389__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7268472687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7276572768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7316373166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7324473248__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7369573698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7413474137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7510775111__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7545075453__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7553175534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7602976032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7612576128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7626576268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7664476647__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7680076804__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7707077073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7735277356__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7756777570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7769977702__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7814978152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7828578288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7908279085__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7921379216__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7973679740__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8011380116__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8026480267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8098480987__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8114081143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8193581938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8206882071__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8257682579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8270682709__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8322783231__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8338483387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8368983692__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8407084073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8475184754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8516785174__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8522885235__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8528985296__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8543185438__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8623786239__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8677486776__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8715987162__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8723987242__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8733087334__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8733687344__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined8739587399__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8751487518__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8760787610__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8775487757__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8802188024__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8813488137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8849288495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8858788591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8871488717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8878288786__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8889088893__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8905589058__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8921989222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8938189384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8962389626__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8979789801__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8991389916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8999489997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9022190224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9039790400__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9057190574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9065290655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9121791220__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9131391316__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9144991453__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9170791710__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9201992022__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9226492267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9266292665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9281392817__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9308393086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9321693219__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9333393336__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9400894011__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9413294135__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9454094543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9465594658__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9533895342__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9549595498__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9579595798__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9642296429__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9646796474__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9720697208__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined9753197534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9763997643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9785397856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9796497967__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9806598068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9847698479__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9858598588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9878498787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9888598888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9907299075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9917499177__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9953899542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9967199674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9991299915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100396100403__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined100549100553__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100555100563__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined100614100618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100733100737__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100826100829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100970100973__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101243101246__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101356101359__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101658101661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102149102153__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined102394102397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102793102796__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103079103082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103493103496__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103808103811__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104137104140__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104556104559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104928104931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105060105063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105432105439__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105480105487__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105526105533__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105559105569__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined105708105710__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined105993106001__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined106093106096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106173106176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106285106288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106365106368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106469106472__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106549106552__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106658106662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106664106672__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined106723106727__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106842106846__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106935106938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107076107079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107324107327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107437107440__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107720107723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107815107819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined107942107945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108010108014__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined108118108121__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108278108281__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108440108443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108602108605__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108763108766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109006109009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109191109195__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined109307109310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109742109745__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109823109826__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined110221110225__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined110629110633__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined111305111308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined111657111660__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined112563112570__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112625112632__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112675112682__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112788112790__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined113165113169__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113171113179__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined113230113234__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113349113353__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113442113445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined113586113590__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113960113963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114073114076__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114368114371__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114463114467__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114590114593__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114658114662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114766114769__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114926114929__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115088115091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115248115251__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115411115414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115654115657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115955115959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116261116265__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116393116396__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined116621116624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117173117176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117720117723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117801117804__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118178118181__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118518118521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118887118891__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined119285119288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined119842119845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120828120831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120924120927__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121084121087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121408121411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121559121563__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined121829121833__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122112122115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122477122481__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122634122637__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122934122937__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined123719123726__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined123764123771__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined124373124375__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined124678124681__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined124786124790__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined125000125003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125112125115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125211125214__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125523125526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125624125627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125944125947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126048126051__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126613126616__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126712126715__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127207127211__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined127340127343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127581127584__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128051128058__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128096128103__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128407128409__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined128727128730__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128835128839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined129049129052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129156129159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129255129258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129567129570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129671129674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130236130239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130341130344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130901130905__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined131034131037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131275131278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131793131800__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131855131862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131905131912__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined132018132020__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined132393132397__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132516132520__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132835132839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined133143133146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133409133412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133721133725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134141134144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134354134358__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134505134508__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134581134585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134705134708__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134889134892__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135075135078__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135259135262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135446135449__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135624135627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135965135969__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136311136315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136459136462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined136711136714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137408137411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137497137500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137914137917__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138302138305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138719138723__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined139165139168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined139990139993__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141123141126__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141235141238__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141388141391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141502141505__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141803141806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141954141958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142224142228__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142507142510__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined142872142876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined143029143032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined143329143332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144007144010__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144305144319undefined144366144374__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined144404144418__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined144552144559__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144604144611__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144672144679__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144759144766__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144809144816__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144855144862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144911144918__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144982144989__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145055145062__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145114145121__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145192145202__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145266145276__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145463145465__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146125146127__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146602146604__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147406147408__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147747147755__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined148101148108__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined148182148185__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148264148267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148392148396__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148487148490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148614148617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148700148704__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148966148969__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149261149264__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149566149569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149961149965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined149967149975__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined150026150030__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150145150148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined150398150402__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150499150503__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150866150869__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined151802151806__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined152395152398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153036153039__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153448153451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153996154000__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined154140154143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined154548154551__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155022155025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155125155128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155481155484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155486155498__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155577155580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155771155774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155776155788__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155867155870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156331156334__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156336156348__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156424156427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156737156740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156742156754__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156836156839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157154157157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157159157171__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157246157249__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157558157561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157563157575__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157658157661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157979157982__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157984157996__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined158072158075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158299158302__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158687158690__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined159231159234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined_\Tc@ R  a ! m )$<9_Wse&.p../n/// 0>00j11A223[3,4v4n5_566y77v889 :; <==??@@CCXDDUEEFFHHlJJMMcN_NRjRRRUUVHWWWXY~YY)ZsZ'[q[[ \]#^(_r__1`KaabObNc_cdKdEeeffYgg iWiijqkk2l|l nUnnnopppqrs6t_ttt_?ufuuu@vqvvvEwswwwFx}xxxRynyyz{?|w.xŇg_7^*ҍM؎"ڕ*t=<gI-wŞ_Dܢ&^9ѧkMPDc 1{_ZdFi&rtùje@Ӿh<5"lK5_QN=5&q]X_`6[? Vbb:\= Th_gR8 l7C ( Y      6_"dvs L   K!"g""#|##5%%%*&&(''_'))8**o++, -~--:///G01.22234a44u55B66z7799:_l:::*;~;;<?<<<=@===>L>>>?@n@5AAHHlJJ5LLLMnM_MM N>NNeOOPPQ"R~RRESSSTYfY[\\]B^^^$_`O```b_Xbbb{dde_eghgifi0m|mnogooqqGrrsdst&uu vw_wvxxy_y`zzi||8}}fyÅWnQɎ Ցۓ'_ 8F6Ӝ'];ž5rƤEܦ&~ʧ̧N Y_֪ޫ(C5;9۱%Ʋ2ݵ)1{[_RGߺ)[LѾe )gQ_^=A+[%bX:_^` W D"$se T+9;f_Z?wQ;w2*~}_+ h   l   e   f    6   Anem_4~ sZC,v^NN TNq  Q""=%%&_.'* +@+++,},,1.}.../M// 0e00<112D333 5j556667_d7788899::m;;<<>g>??a@@AACEDeFFFGGHIXJJL_\LM0NZPP{TT"UlU VSVWWrXXYZ+[u[\+]]^7__bb c]cee#g_mgg"hh>iiiUjjklllnQnno2q|qq&rt^tt)uvav4xxxy2z_oz{{`||~}}0~z~~$YR΃4~x‡Q܋[Ō_wÎ: =ؓ YCa>әKJKJLE_-Ϣ_B*t?ݭ)-caθgۻ_%[r&r U~k `~f;xpj_/MBhosVi_'sy1_1}M PhW:_R((7i(rtZ'qs V%wX F H   * _    K  l,^(0,react.useState)(0,react.useCallback)(0,react.useMemo)jsx_runtime.Fragmentapi_client/* api */.FH(0,react.useEffect)(0,navigation.useRouter)(0,navigation.useSearchParams)ErrorBoundary sourcesizemapsg// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(5155); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(2115); // EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(63); // EXTERNAL MODULE: ./src/lib/api-client.js var api_client = __webpack_require__(6282); ;// ./src/components/ErrorBoundary.jsx /* __next_internal_client_entry_do_not_use__ default auto */ class ErrorBoundary extends react.Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "empty-state", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } ;// ./src/app/dashboard/page.jsx /* __next_internal_client_entry_do_not_use__ default auto */ const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = (0,react.useState)([]); const add = (0,react.useCallback)(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "search-wrap", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ (0,jsx_runtime.jsx)("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = (0,react.useMemo)(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "metric-card", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { children: p.label }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Risk" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Dimension *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Domain", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Probability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Impact", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Detectability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = (0,react.useState)(''); const [sortKey, setSortKey] = (0,react.useState)('normalizedScore'); const [sortDir, setSortDir] = (0,react.useState)('desc'); const [page, setPage] = (0,react.useState)(0); const [selectedRisk, setSelectedRisk] = (0,react.useState)(null); const [showCreate, setShowCreate] = (0,react.useState)(false); const [editing, setEditing] = (0,react.useState)(false); const [editForm, setEditForm] = (0,react.useState)({}); const [updating, setUpdating] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [deleting, setDeleting] = (0,react.useState)(false); const risks = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = (0,react.useMemo)(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api_client/* api */.FH.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api_client/* api */.FH.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: risk.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Dimension", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Domain", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Probability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Impact", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Detectability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Score" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Description" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.description ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api_client/* api */.FH.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Mitigation" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Risk *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Progress %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Due Date", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = (0,react.useState)(''); const [sortKey, setSortKey] = (0,react.useState)('progressPercent'); const [sortDir, setSortDir] = (0,react.useState)('asc'); const [showCreate, setShowCreate] = (0,react.useState)(false); const [selectedMitigation, setSelectedMitigation] = (0,react.useState)(null); const [editing, setEditing] = (0,react.useState)(false); const [editForm, setEditForm] = (0,react.useState)({}); const [updating, setUpdating] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [deleting, setDeleting] = (0,react.useState)(false); const mitigations = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = (0,react.useMemo)(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api_client/* api */.FH.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: m.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Progress %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Due Date", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = (0,react.useState)(false); const [showDecision, setShowDecision] = (0,react.useState)(false); const [decisionForm, setDecisionForm] = (0,react.useState)({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = (0,react.useState)(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api_client/* api */.FH.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api_client/* api */.FH.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Deployment Gate" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Criterion" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Required" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actual" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: c.name }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: c.required }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: c.actual }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Gate Decision" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Decision", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Reason", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Integration" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Provider", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Base URL", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Auth Mode", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = (0,react.useState)(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Integrations" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = (0,react.useState)([]); const [loading, setLoading] = (0,react.useState)(true); const [error, setError] = (0,react.useState)(null); const load = (0,react.useCallback)(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api_client/* api */.FH.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); (0,react.useEffect)(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Audit Log" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Date" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Action" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Entity" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actor" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Details" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [showNew, setShowNew] = (0,react.useState)(false); const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "All Projects" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Name" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Type" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Created" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Project Settings" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Subtitle", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Project" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Project Type", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [showNew, setShowNew] = (0,react.useState)(false); const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Name" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Type" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Created" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", {}) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No projects yet" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } function DashboardPage() { const router = (0,navigation.useRouter)(); const searchParams = (0,navigation.useSearchParams)(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = (0,react.useState)(null); const [projects, setProjects] = (0,react.useState)([]); const [selectedProjectId, setSelectedProjectId] = (0,react.useState)(searchParams.get('projectId') || null); const [dashboard, setDashboard] = (0,react.useState)(null); const [loading, setLoading] = (0,react.useState)(true); const [error, setError] = (0,react.useState)(null); const [retryCount, setRetryCount] = (0,react.useState)(0); const [showProjectSettings, setShowProjectSettings] = (0,react.useState)(false); const [showProjectManager, setShowProjectManager] = (0,react.useState)(false); const [workspaceId, setWorkspaceId] = (0,react.useState)(null); const { toasts, add } = useToast(); const onRefresh = (0,react.useCallback)(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = (0,react.useCallback)(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api_client/* api */.FH.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api_client/* api */.FH.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api_client/* api */.FH.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api_client/* api */.FH.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); (0,react.useEffect)(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = (0,react.useState)(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shell-loading", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "empty-state", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: error }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ (0,jsx_runtime.jsx)(ToastContainer, { toasts: toasts }) ] }); } {"finalSource":true} mapbufferedMap  ` ConcatSourceRawSourcez// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(5155); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(2115); // EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(63); // EXTERNAL MODULE: ./src/lib/api-client.js var api_client = __webpack_require__(6282); ;// ./src/components/ErrorBoundary.jsx  ReplaceSourceReplaceSourceRawSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Component } from 'react'; class ErrorBoundary extends Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsxs("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } export { ErrorBoundary as default }; Y61123undefined125158undefined188196__WEBPACK_MODULE_REFERENCE__1_5b22436f6d706f6e656e74225d_directImport_asiSafe1__._undefined527531__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined646649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined805809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10891092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14051408__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22802315undefined91172react.Componentundefined503579(0,jsx_runtime.jsxs)undefined694768(0,jsx_runtime.jsx)undefined9241000(0,jsx_runtime.jsxs)undefined12801354(0,jsx_runtime.jsx)undefined16671741(0,jsx_runtime.jsx)undefinedRawSource" ;// ./src/app/dashboard/page.jsx H61146undefined148213undefined215275undefined277319undefined321379undefined970977__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10001010__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined16221625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17221725__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19611965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined20562059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21852188__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined28972900__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30923096__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined32103213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36463649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40424046__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42594262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined45544557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48124815__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49214925__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined51355139__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53475350__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56005604__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57335736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59755978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65846590__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined1054110544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1062110624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1072710731__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1073310741__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1079210795__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102111025__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1116411167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1130111304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1151311516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176411768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1200612010__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1214312146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1232512329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1258312587__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1302613029__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1341113414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1388013883__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1402914032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1473014734__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1486714870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1504915053__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1530715311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1575015753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1613716141__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1686016863__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1700917012__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1788517892__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1793017937__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1862018622__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined1892818931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1903619040__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1925019253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1935419357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1945419457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1963719640__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1974119744__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2018320187__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2044820451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2056820571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2085320856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2096820971__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2122621229__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2133421337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2158721591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2185621859__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2197621979__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2234122344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2245622459__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2281122814__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2293322936__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2333523338__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2343323436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2363823642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2377123774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2401224015__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2447424481__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2452224529__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2458524592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2463124638__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2468824695__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2474424751__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2479524802__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2484824855__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2489824905__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2496024967__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2501225019__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2504725053__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2531425320__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2689626898__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2744927451__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2785827860__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2823828241__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2831828321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2840928413__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2841528423__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2847428478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2869728700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2894128944__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2919729200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2929229296__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2941929422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2948729490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3113431138__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3173031733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3193431938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3211732120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3260132604__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3268232685__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3291332916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3299432997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3340133404__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3374733750__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3382833831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3406934072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3415034153__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3465834661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3473934742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515235155__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3523335236__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3575135754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592435928__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3632136324__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3641736420__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3656336566__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3690036903__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3705037054__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3732037324__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3765637659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795037953__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3832438328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3833038338__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3842938433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3868438687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3883238835__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3934639349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3949839501__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4040740411__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4084040843__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4100641009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4167041673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4183341836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4249442497__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4265042653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4325843262__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4369543698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4386343866__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4466344666__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4482644829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4561645619__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4578645789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4667146674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4681746820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4741847422__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4759947602__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4793847941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4836748370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4910349107__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4910949117__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4920849212__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4969549699__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4982849831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5010350106__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5033450338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5046750470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5073850741__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5097450978__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5110751110__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5138451387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5161751621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5175051753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5202252025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5225052254__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5238352386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5266252665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5289752901__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5303053033__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5330153304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5337953382__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368253686__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5381553818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5408954092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5432454328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5445754460__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5472854731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5506655070__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5537555378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5562055623__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5582155825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5607656079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5648556488__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5693856941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5756657569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5770457707__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5816358166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5851758524__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5856258569__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5956159563__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined5988559888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5999359997__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6020760210__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6031760320__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6041660419__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6078660789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6088660889__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6106961072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6117361176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6161561618__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6171461717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6195461958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6221962222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6233862341__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6271162714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6283562838__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6325163254__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6335263355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6357763580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6367563678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6388063884__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6401364016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6425464257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6472864735__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6477664783__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6483964846__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6489664903__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6496964976__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6501965026__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6507265079__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6512265129__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6518465191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6523665243__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6527765283__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6554765553__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6575265758__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6754767549__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6797667978__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6837468377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6845468457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6854568549__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6855168559__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6861068614__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6883368836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6905669059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6931869321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6941369417__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6954069543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6960869611__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7089170895__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7148771490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7167471678__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7199671999__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7207772080__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7230572308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7238672389__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7268472687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7276572768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7316373166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7324473248__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7369573698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7413474137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7510775111__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7545075453__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7553175534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7602976032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7612576128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7626576268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7664476647__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7680076804__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7707077073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7735277356__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7756777570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7769977702__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7814978152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7828578288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7908279085__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7921379216__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7973679740__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8011380116__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8026480267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8098480987__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8114081143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8193581938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8206882071__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8257682579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8270682709__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8322783231__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8338483387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8368983692__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8407084073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8475184754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8516785174__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8522885235__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8528985296__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8543185438__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8623786239__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8677486776__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8715987162__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8723987242__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8733087334__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8733687344__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined8739587399__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8751487518__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8760787610__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8775487757__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8802188024__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8813488137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8849288495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8858788591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8871488717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8878288786__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8889088893__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8905589058__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8921989222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8938189384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8962389626__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8979789801__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8991389916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8999489997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9022190224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9039790400__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9057190574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9065290655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9121791220__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9131391316__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9144991453__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9170791710__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9201992022__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9226492267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9266292665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9281392817__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9308393086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9321693219__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9333393336__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9400894011__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9413294135__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9454094543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9465594658__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9533895342__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9549595498__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9579595798__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9642296429__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9646796474__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9720697208__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined9753197534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9763997643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9785397856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9796497967__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9806598068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9847698479__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9858598588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9878498787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9888598888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9907299075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9917499177__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9953899542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9967199674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9991299915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100396100403__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined100549100553__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100555100563__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined100614100618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100733100737__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100826100829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100970100973__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101243101246__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101356101359__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101658101661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102149102153__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined102394102397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102793102796__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103079103082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103493103496__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103808103811__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104137104140__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104556104559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104928104931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105060105063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105432105439__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105480105487__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105526105533__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105559105569__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined105708105710__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined105993106001__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined106093106096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106173106176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106285106288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106365106368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106469106472__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106549106552__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106658106662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106664106672__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined106723106727__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106842106846__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106935106938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107076107079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107324107327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107437107440__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107720107723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107815107819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined107942107945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108010108014__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined108118108121__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108278108281__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108440108443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108602108605__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108763108766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109006109009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109191109195__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined109307109310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109742109745__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109823109826__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined110221110225__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined110629110633__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined111305111308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined111657111660__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined112563112570__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112625112632__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112675112682__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112788112790__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined113165113169__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113171113179__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined113230113234__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113349113353__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113442113445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined113586113590__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113960113963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114073114076__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114368114371__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114463114467__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114590114593__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114658114662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114766114769__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114926114929__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115088115091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115248115251__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115411115414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115654115657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115955115959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116261116265__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116393116396__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined116621116624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117173117176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117720117723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117801117804__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118178118181__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118518118521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118887118891__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined119285119288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined119842119845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120828120831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120924120927__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121084121087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121408121411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121559121563__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined121829121833__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122112122115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122477122481__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122634122637__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122934122937__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined123719123726__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined123764123771__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined124373124375__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined124678124681__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined124786124790__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined125000125003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125112125115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125211125214__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125523125526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125624125627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125944125947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126048126051__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126613126616__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126712126715__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127207127211__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined127340127343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127581127584__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128051128058__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128096128103__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128407128409__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined128727128730__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128835128839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined129049129052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129156129159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129255129258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129567129570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129671129674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130236130239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130341130344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130901130905__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined131034131037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131275131278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131793131800__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131855131862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131905131912__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined132018132020__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined132393132397__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132516132520__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132835132839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined133143133146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133409133412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133721133725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134141134144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134354134358__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134505134508__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134581134585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134705134708__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134889134892__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135075135078__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135259135262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135446135449__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135624135627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135965135969__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136311136315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136459136462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined136711136714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137408137411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137497137500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137914137917__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138302138305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138719138723__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined139165139168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined139990139993__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141123141126__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141235141238__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141388141391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141502141505__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141803141806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141954141958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142224142228__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142507142510__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined142872142876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined143029143032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined143329143332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144007144010__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144305144319undefined144366144374__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined144404144418__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined144552144559__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144604144611__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144672144679__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144759144766__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144809144816__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144855144862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144911144918__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144982144989__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145055145062__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145114145121__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145192145202__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145266145276__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145463145465__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146125146127__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146602146604__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147406147408__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147747147755__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined148101148108__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined148182148185__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148264148267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148392148396__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148487148490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148614148617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148700148704__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148966148969__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149261149264__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149566149569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149961149965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined149967149975__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined150026150030__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150145150148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined150398150402__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150499150503__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150866150869__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined151802151806__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined152395152398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153036153039__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153448153451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153996154000__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined154140154143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined154548154551__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155022155025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155125155128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155481155484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155486155498__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155577155580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155771155774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155776155788__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155867155870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156331156334__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156336156348__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156424156427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156737156740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156742156754__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156836156839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157154157157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157159157171__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157246157249__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157558157561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157563157575__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157658157661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157979157982__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157984157996__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined158072158075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158299158302__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158687158690__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined159231159234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefinedc\655739(0,react.useState)undefined762852(0,react.useCallback)undefined14641538(0,jsx_runtime.jsx)undefined16351709(0,jsx_runtime.jsx)undefined19452021(0,jsx_runtime.jsxs)undefined21122186(0,jsx_runtime.jsx)undefined23122386(0,jsx_runtime.jsx)undefined30953169(0,jsx_runtime.jsx)undefined33613437(0,jsx_runtime.jsxs)undefined35513625(0,jsx_runtime.jsx)undefined40584132(0,jsx_runtime.jsx)undefined45254601(0,jsx_runtime.jsxs)undefined48144888(0,jsx_runtime.jsx)undefined51805254(0,jsx_runtime.jsx)undefined55095583(0,jsx_runtime.jsx)undefined56895765(0,jsx_runtime.jsxs)undefined59756051(0,jsx_runtime.jsxs)undefined62596333(0,jsx_runtime.jsx)undefined65836659(0,jsx_runtime.jsxs)undefined67886862(0,jsx_runtime.jsx)undefined71017175(0,jsx_runtime.jsx)undefined77817863(0,react.useMemo)undefined1181411888(0,jsx_runtime.jsx)undefined1196512039(0,jsx_runtime.jsx)undefined1214212218(0,jsx_runtime.jsxs)undefined1222012299jsx_runtime.Fragmentundefined1235012424(0,jsx_runtime.jsx)undefined1265012726(0,jsx_runtime.jsxs)undefined1286512939(0,jsx_runtime.jsx)undefined1307313147(0,jsx_runtime.jsx)undefined1335613430(0,jsx_runtime.jsx)undefined1367813754(0,jsx_runtime.jsxs)undefined1399214068(0,jsx_runtime.jsxs)undefined1420114275(0,jsx_runtime.jsx)undefined1445414530(0,jsx_runtime.jsxs)undefined1478414860(0,jsx_runtime.jsxs)undefined1529915373(0,jsx_runtime.jsx)undefined1575515829(0,jsx_runtime.jsx)undefined1629516369(0,jsx_runtime.jsx)undefined1651516589(0,jsx_runtime.jsx)undefined1728717363(0,jsx_runtime.jsxs)undefined1749617570(0,jsx_runtime.jsx)undefined1774917825(0,jsx_runtime.jsxs)undefined1807918155(0,jsx_runtime.jsxs)undefined1859418668(0,jsx_runtime.jsx)undefined1905219128(0,jsx_runtime.jsxs)undefined1984719921(0,jsx_runtime.jsx)undefined2006720141(0,jsx_runtime.jsx)undefined2101421098(0,react.useState)undefined2113621220(0,react.useState)undefined2190321964api_client/* api */.FHundefined2227022344(0,jsx_runtime.jsx)undefined2244922525(0,jsx_runtime.jsxs)undefined2273522809(0,jsx_runtime.jsx)undefined2291022984(0,jsx_runtime.jsx)undefined2308123155(0,jsx_runtime.jsx)undefined2333523409(0,jsx_runtime.jsx)undefined2351023584(0,jsx_runtime.jsx)undefined2402324099(0,jsx_runtime.jsxs)undefined2436024434(0,jsx_runtime.jsx)undefined2455124625(0,jsx_runtime.jsx)undefined2490724981(0,jsx_runtime.jsx)undefined2509325167(0,jsx_runtime.jsx)undefined2542225496(0,jsx_runtime.jsx)undefined2560125675(0,jsx_runtime.jsx)undefined2592526001(0,jsx_runtime.jsxs)undefined2626626340(0,jsx_runtime.jsx)undefined2645726531(0,jsx_runtime.jsx)undefined2689326967(0,jsx_runtime.jsx)undefined2707927153(0,jsx_runtime.jsx)undefined2750527579(0,jsx_runtime.jsx)undefined2769827772(0,jsx_runtime.jsx)undefined2817128245(0,jsx_runtime.jsx)undefined2834028414(0,jsx_runtime.jsx)undefined2861628692(0,jsx_runtime.jsxs)undefined2882128895(0,jsx_runtime.jsx)undefined2913329207(0,jsx_runtime.jsx)undefined2966629750(0,react.useState)undefined2979129875(0,react.useState)undefined2993130015(0,react.useState)undefined3005430138(0,react.useState)undefined3018830272(0,react.useState)undefined3032130405(0,react.useState)undefined3044930533(0,react.useState)undefined3057930663(0,react.useState)undefined3070630790(0,react.useState)undefined3084530929(0,react.useState)undefined3097431058(0,react.useState)undefined3108631168(0,react.useMemo)undefined3142931511(0,react.useMemo)undefined3308733148api_client/* api */.FHundefined3369933760api_client/* api */.FHundefined3416734228api_client/* api */.FHundefined3460634680(0,jsx_runtime.jsx)undefined3475734831(0,jsx_runtime.jsx)undefined3491934995(0,jsx_runtime.jsxs)undefined3499735076jsx_runtime.Fragmentundefined3512735203(0,jsx_runtime.jsxs)undefined3542235496(0,jsx_runtime.jsx)undefined3573735811(0,jsx_runtime.jsx)undefined3606436138(0,jsx_runtime.jsx)undefined3623036306(0,jsx_runtime.jsxs)undefined3642936503(0,jsx_runtime.jsx)undefined3656836642(0,jsx_runtime.jsx)undefined3828638362(0,jsx_runtime.jsxs)undefined3895439028(0,jsx_runtime.jsx)undefined3922939305(0,jsx_runtime.jsxs)undefined3948439558(0,jsx_runtime.jsx)undefined4003940113(0,jsx_runtime.jsx)undefined4019140265(0,jsx_runtime.jsx)undefined4049340567(0,jsx_runtime.jsx)undefined4064540719(0,jsx_runtime.jsx)undefined4112341197(0,jsx_runtime.jsx)undefined4154041614(0,jsx_runtime.jsx)undefined4169241766(0,jsx_runtime.jsx)undefined4200442078(0,jsx_runtime.jsx)undefined4215642230(0,jsx_runtime.jsx)undefined4273542809(0,jsx_runtime.jsx)undefined4288742961(0,jsx_runtime.jsx)undefined4337143445(0,jsx_runtime.jsx)undefined4352343597(0,jsx_runtime.jsx)undefined4411244186(0,jsx_runtime.jsx)undefined4435644432(0,jsx_runtime.jsxs)undefined4482544899(0,jsx_runtime.jsx)undefined4499245066(0,jsx_runtime.jsx)undefined4520945283(0,jsx_runtime.jsx)undefined4561745691(0,jsx_runtime.jsx)undefined4583845914(0,jsx_runtime.jsxs)undefined4618046256(0,jsx_runtime.jsxs)undefined4658846662(0,jsx_runtime.jsx)undefined4695347027(0,jsx_runtime.jsx)undefined4739847474(0,jsx_runtime.jsxs)undefined4747647555jsx_runtime.Fragmentundefined4764647722(0,jsx_runtime.jsxs)undefined4797348047(0,jsx_runtime.jsx)undefined4819248266(0,jsx_runtime.jsx)undefined4877748851(0,jsx_runtime.jsx)undefined4900049074(0,jsx_runtime.jsx)undefined4998050056(0,jsx_runtime.jsxs)undefined5048550559(0,jsx_runtime.jsx)undefined5072250796(0,jsx_runtime.jsx)undefined5145751531(0,jsx_runtime.jsx)undefined5169151765(0,jsx_runtime.jsx)undefined5242352497(0,jsx_runtime.jsx)undefined5265052724(0,jsx_runtime.jsx)undefined5332953405(0,jsx_runtime.jsxs)undefined5383853912(0,jsx_runtime.jsx)undefined5407754151(0,jsx_runtime.jsx)undefined5494855022(0,jsx_runtime.jsx)undefined5518255256(0,jsx_runtime.jsx)undefined5604356117(0,jsx_runtime.jsx)undefined5628456358(0,jsx_runtime.jsx)undefined5724057314(0,jsx_runtime.jsx)undefined5745757531(0,jsx_runtime.jsx)undefined5812958205(0,jsx_runtime.jsxs)undefined5838258456(0,jsx_runtime.jsx)undefined5879258866(0,jsx_runtime.jsx)undefined5929259366(0,jsx_runtime.jsx)undefined6009960175(0,jsx_runtime.jsxs)undefined6017760256jsx_runtime.Fragmentundefined6034760423(0,jsx_runtime.jsxs)undefined6090660982(0,jsx_runtime.jsxs)undefined6111161185(0,jsx_runtime.jsx)undefined6145761531(0,jsx_runtime.jsx)undefined6175961835(0,jsx_runtime.jsxs)undefined6196462038(0,jsx_runtime.jsx)undefined6230662380(0,jsx_runtime.jsx)undefined6261362689(0,jsx_runtime.jsxs)undefined6281862892(0,jsx_runtime.jsx)undefined6316663240(0,jsx_runtime.jsx)undefined6347063546(0,jsx_runtime.jsxs)undefined6367563749(0,jsx_runtime.jsx)undefined6401864092(0,jsx_runtime.jsx)undefined6431764393(0,jsx_runtime.jsxs)undefined6452264596(0,jsx_runtime.jsx)undefined6487264946(0,jsx_runtime.jsx)undefined6517865254(0,jsx_runtime.jsxs)undefined6538365457(0,jsx_runtime.jsx)undefined6572565799(0,jsx_runtime.jsx)undefined6587465948(0,jsx_runtime.jsx)undefined6624866324(0,jsx_runtime.jsxs)undefined6645366527(0,jsx_runtime.jsx)undefined6679866872(0,jsx_runtime.jsx)undefined6710467180(0,jsx_runtime.jsxs)undefined6730967383(0,jsx_runtime.jsx)undefined6765167725(0,jsx_runtime.jsx)undefined6806068136(0,jsx_runtime.jsxs)undefined6844168515(0,jsx_runtime.jsx)undefined6875768831(0,jsx_runtime.jsx)undefined6902969105(0,jsx_runtime.jsxs)undefined6935669430(0,jsx_runtime.jsx)undefined6983669910(0,jsx_runtime.jsx)undefined7036070434(0,jsx_runtime.jsx)undefined7105971133(0,jsx_runtime.jsx)undefined7126871342(0,jsx_runtime.jsx)undefined7179871872(0,jsx_runtime.jsx)undefined7222372307(0,react.useState)undefined7234572429(0,react.useState)undefined7342173482api_client/* api */.FHundefined7380473878(0,jsx_runtime.jsx)undefined7398374059(0,jsx_runtime.jsxs)undefined7426974343(0,jsx_runtime.jsx)undefined7445074524(0,jsx_runtime.jsx)undefined7462074694(0,jsx_runtime.jsx)undefined7506175135(0,jsx_runtime.jsx)undefined7523275306(0,jsx_runtime.jsx)undefined7548675560(0,jsx_runtime.jsx)undefined7566175735(0,jsx_runtime.jsx)undefined7617476248(0,jsx_runtime.jsx)undefined7634476418(0,jsx_runtime.jsx)undefined7665576731(0,jsx_runtime.jsxs)undefined7699277066(0,jsx_runtime.jsx)undefined7718277256(0,jsx_runtime.jsx)undefined7762677700(0,jsx_runtime.jsx)undefined7782177895(0,jsx_runtime.jsx)undefined7830878382(0,jsx_runtime.jsx)undefined7848078554(0,jsx_runtime.jsx)undefined7877678850(0,jsx_runtime.jsx)undefined7894579019(0,jsx_runtime.jsx)undefined7922179297(0,jsx_runtime.jsxs)undefined7942679500(0,jsx_runtime.jsx)undefined7973879812(0,jsx_runtime.jsx)undefined8028380367(0,react.useState)undefined8040880492(0,react.useState)undefined8054880632(0,react.useState)undefined8068280766(0,react.useState)undefined8083280916(0,react.useState)undefined8095981043(0,react.useState)undefined8108981173(0,react.useState)undefined8121681300(0,react.useState)undefined8135581439(0,react.useState)undefined8148481568(0,react.useState)undefined8160281684(0,react.useMemo)undefined8194882030(0,react.useMemo)undefined8222982311(0,react.useMemo)undefined8410084161api_client/* api */.FHundefined8458884649api_client/* api */.FHundefined8504585119(0,jsx_runtime.jsx)undefined8519685270(0,jsx_runtime.jsx)undefined8535885434(0,jsx_runtime.jsxs)undefined8543685515jsx_runtime.Fragmentundefined8556685642(0,jsx_runtime.jsxs)undefined8586185935(0,jsx_runtime.jsx)undefined8615586229(0,jsx_runtime.jsx)undefined8648886562(0,jsx_runtime.jsx)undefined8665486730(0,jsx_runtime.jsxs)undefined8685386927(0,jsx_runtime.jsx)undefined8699287066(0,jsx_runtime.jsx)undefined8834688422(0,jsx_runtime.jsxs)undefined8901489088(0,jsx_runtime.jsx)undefined8927289348(0,jsx_runtime.jsxs)undefined8966689740(0,jsx_runtime.jsx)undefined8981889892(0,jsx_runtime.jsx)undefined9011790191(0,jsx_runtime.jsx)undefined9026990343(0,jsx_runtime.jsx)undefined9063890712(0,jsx_runtime.jsx)undefined9079090864(0,jsx_runtime.jsx)undefined9125991333(0,jsx_runtime.jsx)undefined9141191487(0,jsx_runtime.jsxs)undefined9193492008(0,jsx_runtime.jsx)undefined9244492518(0,jsx_runtime.jsx)undefined9348893564(0,jsx_runtime.jsxs)undefined9390393977(0,jsx_runtime.jsx)undefined9405594129(0,jsx_runtime.jsx)undefined9462494698(0,jsx_runtime.jsx)undefined9479194865(0,jsx_runtime.jsx)undefined9500295076(0,jsx_runtime.jsx)undefined9545295526(0,jsx_runtime.jsx)undefined9567995755(0,jsx_runtime.jsxs)undefined9602196095(0,jsx_runtime.jsx)undefined9637496450(0,jsx_runtime.jsxs)undefined9666196735(0,jsx_runtime.jsx)undefined9686496938(0,jsx_runtime.jsx)undefined9738597459(0,jsx_runtime.jsx)undefined9759297666(0,jsx_runtime.jsx)undefined9846098534(0,jsx_runtime.jsx)undefined9866298736(0,jsx_runtime.jsx)undefined9925699332(0,jsx_runtime.jsxs)undefined9970599779(0,jsx_runtime.jsx)undefined99927100001(0,jsx_runtime.jsx)undefined100718100792(0,jsx_runtime.jsx)undefined100945101019(0,jsx_runtime.jsx)undefined101811101885(0,jsx_runtime.jsx)undefined102015102089(0,jsx_runtime.jsx)undefined102594102668(0,jsx_runtime.jsx)undefined102795102869(0,jsx_runtime.jsx)undefined103387103463(0,jsx_runtime.jsxs)undefined103616103690(0,jsx_runtime.jsx)undefined103992104066(0,jsx_runtime.jsx)undefined104444104518(0,jsx_runtime.jsx)undefined105196105270(0,jsx_runtime.jsx)undefined105683105767(0,react.useState)undefined105821105905(0,react.useState)undefined105959106043(0,react.useState)undefined106178106262(0,react.useState)undefined107061107122api_client/* api */.FHundefined107657107718api_client/* api */.FHundefined108101108175(0,jsx_runtime.jsx)undefined108252108326(0,jsx_runtime.jsx)undefined108414108490(0,jsx_runtime.jsxs)undefined108492108571jsx_runtime.Fragmentundefined108622108698(0,jsx_runtime.jsxs)undefined108813108889(0,jsx_runtime.jsxs)undefined108978109052(0,jsx_runtime.jsx)undefined109196109270(0,jsx_runtime.jsx)undefined109534109608(0,jsx_runtime.jsx)undefined109718109792(0,jsx_runtime.jsx)undefined110147110221(0,jsx_runtime.jsx)undefined110313110389(0,jsx_runtime.jsxs)undefined110512110586(0,jsx_runtime.jsx)undefined110651110727(0,jsx_runtime.jsxs)undefined110831110905(0,jsx_runtime.jsx)undefined111067111141(0,jsx_runtime.jsx)undefined111302111376(0,jsx_runtime.jsx)undefined111535111609(0,jsx_runtime.jsx)undefined111848111922(0,jsx_runtime.jsx)undefined112093112169(0,jsx_runtime.jsxs)undefined112281112355(0,jsx_runtime.jsx)undefined112433112507(0,jsx_runtime.jsx)undefined112731112805(0,jsx_runtime.jsx)undefined112978113052(0,jsx_runtime.jsx)undefined113223113297(0,jsx_runtime.jsx)undefined113375113449(0,jsx_runtime.jsx)undefined114011114085(0,jsx_runtime.jsx)undefined114178114252(0,jsx_runtime.jsx)undefined114385114461(0,jsx_runtime.jsxs)undefined114715114789(0,jsx_runtime.jsx)undefined115098115172(0,jsx_runtime.jsx)undefined115414115488(0,jsx_runtime.jsx)undefined115883115957(0,jsx_runtime.jsx)undefined116105116181(0,jsx_runtime.jsxs)undefined116447116521(0,jsx_runtime.jsx)undefined116651116725(0,jsx_runtime.jsx)undefined116839116913(0,jsx_runtime.jsx)undefined117585117659(0,jsx_runtime.jsx)undefined117780117854(0,jsx_runtime.jsx)undefined118259118333(0,jsx_runtime.jsx)undefined118445118519(0,jsx_runtime.jsx)undefined119199119275(0,jsx_runtime.jsxs)undefined119428119502(0,jsx_runtime.jsx)undefined119799119873(0,jsx_runtime.jsx)undefined120497120581(0,react.useState)undefined120619120703(0,react.useState)undefined121435121496api_client/* api */.FHundefined121819121893(0,jsx_runtime.jsx)undefined121998122074(0,jsx_runtime.jsxs)undefined122284122358(0,jsx_runtime.jsx)undefined122466122540(0,jsx_runtime.jsx)undefined122638122712(0,jsx_runtime.jsx)undefined123120123194(0,jsx_runtime.jsx)undefined123300123374(0,jsx_runtime.jsx)undefined123570123644(0,jsx_runtime.jsx)undefined123742123816(0,jsx_runtime.jsx)undefined124000124074(0,jsx_runtime.jsx)undefined124173124247(0,jsx_runtime.jsx)undefined124608124684(0,jsx_runtime.jsxs)undefined124813124887(0,jsx_runtime.jsx)undefined125125125199(0,jsx_runtime.jsx)undefined125680125764(0,react.useState)undefined125910125986(0,jsx_runtime.jsxs)undefined125988126067jsx_runtime.Fragmentundefined126118126194(0,jsx_runtime.jsxs)undefined126309126385(0,jsx_runtime.jsxs)undefined126474126548(0,jsx_runtime.jsx)undefined126689126763(0,jsx_runtime.jsx)undefined127033127107(0,jsx_runtime.jsx)undefined127217127291(0,jsx_runtime.jsx)undefined127590127664(0,jsx_runtime.jsx)undefined128152128228(0,jsx_runtime.jsxs)undefined128469128543(0,jsx_runtime.jsx)undefined128939129013(0,jsx_runtime.jsx)undefined129296129370(0,jsx_runtime.jsx)undefined129781129855(0,jsx_runtime.jsx)undefined130167130241(0,jsx_runtime.jsx)undefined130567130641(0,jsx_runtime.jsx)undefined131057131131(0,jsx_runtime.jsx)undefined131500131574(0,jsx_runtime.jsx)undefined131703131777(0,jsx_runtime.jsx)undefined132146132230(0,react.useState)undefined132271132355(0,react.useState)undefined132394132478(0,react.useState)undefined132504132594(0,react.useCallback)undefined132733132794api_client/* api */.FHundefined133077133163(0,react.useEffect)undefined133255133329(0,jsx_runtime.jsx)undefined133406133480(0,jsx_runtime.jsx)undefined133589133663(0,jsx_runtime.jsx)undefined133740133814(0,jsx_runtime.jsx)undefined133915133989(0,jsx_runtime.jsx)undefined134066134140(0,jsx_runtime.jsx)undefined134246134322(0,jsx_runtime.jsxs)undefined134324134403jsx_runtime.Fragmentundefined134454134530(0,jsx_runtime.jsxs)undefined134645134721(0,jsx_runtime.jsxs)undefined134810134884(0,jsx_runtime.jsx)undefined135022135096(0,jsx_runtime.jsx)undefined135341135415(0,jsx_runtime.jsx)undefined135525135599(0,jsx_runtime.jsx)undefined135879135953(0,jsx_runtime.jsx)undefined136045136121(0,jsx_runtime.jsxs)undefined136244136318(0,jsx_runtime.jsx)undefined136383136459(0,jsx_runtime.jsxs)undefined136563136637(0,jsx_runtime.jsx)undefined136794136868(0,jsx_runtime.jsx)undefined137027137101(0,jsx_runtime.jsx)undefined137260137334(0,jsx_runtime.jsx)undefined137492137566(0,jsx_runtime.jsx)undefined137806137880(0,jsx_runtime.jsx)undefined138062138138(0,jsx_runtime.jsxs)undefined138250138324(0,jsx_runtime.jsx)undefined138756138830(0,jsx_runtime.jsx)undefined138908138982(0,jsx_runtime.jsx)undefined139377139453(0,jsx_runtime.jsxs)undefined139857139933(0,jsx_runtime.jsxs)undefined140605140679(0,jsx_runtime.jsx)undefined141028141102(0,jsx_runtime.jsx)undefined142005142089(0,react.useState)undefined142144142228(0,react.useState)undefined142271142355(0,react.useState)undefined142461142522api_client/* api */.FHundefined142897142973(0,jsx_runtime.jsxs)undefined142975143054jsx_runtime.Fragmentundefined143105143181(0,jsx_runtime.jsxs)undefined143296143372(0,jsx_runtime.jsxs)undefined143461143535(0,jsx_runtime.jsx)undefined143676143752(0,jsx_runtime.jsxs)undefined144122144196(0,jsx_runtime.jsx)undefined144306144380(0,jsx_runtime.jsx)undefined144672144746(0,jsx_runtime.jsx)undefined144838144914(0,jsx_runtime.jsxs)undefined145037145111(0,jsx_runtime.jsx)undefined145176145252(0,jsx_runtime.jsxs)undefined145356145430(0,jsx_runtime.jsx)undefined145587145661(0,jsx_runtime.jsx)undefined145820145894(0,jsx_runtime.jsx)undefined146051146125(0,jsx_runtime.jsx)undefined146285146359(0,jsx_runtime.jsx)undefined146599146673(0,jsx_runtime.jsx)undefined146971147047(0,jsx_runtime.jsxs)undefined147349147425(0,jsx_runtime.jsxs)undefined147553147627(0,jsx_runtime.jsx)undefined147852147926(0,jsx_runtime.jsx)undefined148475148549(0,jsx_runtime.jsx)undefined149093149167(0,jsx_runtime.jsx)undefined149245149319(0,jsx_runtime.jsx)undefined149693149767(0,jsx_runtime.jsx)undefined150104150178(0,jsx_runtime.jsx)undefined150544150620(0,jsx_runtime.jsxs)undefined151014151088(0,jsx_runtime.jsx)undefined151642151716(0,jsx_runtime.jsx)undefined152699152773(0,jsx_runtime.jsx)undefined152866152940(0,jsx_runtime.jsx)undefined153097153171(0,jsx_runtime.jsx)undefined153492153566(0,jsx_runtime.jsx)undefined153714153790(0,jsx_runtime.jsxs)undefined154056154132(0,jsx_runtime.jsxs)undefined154411154485(0,jsx_runtime.jsx)undefined154847154923(0,jsx_runtime.jsxs)undefined155076155150(0,jsx_runtime.jsx)undefined155447155521(0,jsx_runtime.jsx)undefined156303156387(0,react.useState)undefined156425156509(0,react.useState)undefined157111157172api_client/* api */.FHundefined157475157549(0,jsx_runtime.jsx)undefined157654157730(0,jsx_runtime.jsxs)undefined157940158014(0,jsx_runtime.jsx)undefined158123158197(0,jsx_runtime.jsx)undefined158293158367(0,jsx_runtime.jsx)undefined158676158750(0,jsx_runtime.jsx)undefined158848158922(0,jsx_runtime.jsx)undefined159239159313(0,jsx_runtime.jsx)undefined159414159488(0,jsx_runtime.jsx)undefined160050160124(0,jsx_runtime.jsx)undefined160220160294(0,jsx_runtime.jsx)undefined160786160862(0,jsx_runtime.jsxs)undefined160991161065(0,jsx_runtime.jsx)undefined161303161377(0,jsx_runtime.jsx)undefined161844161928(0,react.useState)undefined161966162050(0,react.useState)undefined162354162415api_client/* api */.FHundefined162733162807(0,jsx_runtime.jsx)undefined162912162988(0,jsx_runtime.jsxs)undefined163198163272(0,jsx_runtime.jsx)undefined163376163450(0,jsx_runtime.jsx)undefined163546163620(0,jsx_runtime.jsx)undefined163929164003(0,jsx_runtime.jsx)undefined164104164178(0,jsx_runtime.jsx)undefined164740164814(0,jsx_runtime.jsx)undefined164916164990(0,jsx_runtime.jsx)undefined165547165623(0,jsx_runtime.jsxs)undefined165752165826(0,jsx_runtime.jsx)undefined166064166138(0,jsx_runtime.jsx)undefined166653166737(0,react.useState)undefined166792166876(0,react.useState)undefined166919167003(0,react.useState)undefined167109167170api_client/* api */.FHundefined167543167619(0,jsx_runtime.jsxs)undefined167738167814(0,jsx_runtime.jsxs)undefined168129168205(0,jsx_runtime.jsxs)undefined168509168583(0,jsx_runtime.jsx)undefined168846168920(0,jsx_runtime.jsx)undefined169229169305(0,jsx_runtime.jsxs)undefined169721169795(0,jsx_runtime.jsx)undefined170005170081(0,jsx_runtime.jsxs)undefined170228170302(0,jsx_runtime.jsx)undefined170375170451(0,jsx_runtime.jsxs)undefined170571170645(0,jsx_runtime.jsx)undefined170826170900(0,jsx_runtime.jsx)undefined171083171157(0,jsx_runtime.jsx)undefined171338171412(0,jsx_runtime.jsx)undefined171596171670(0,jsx_runtime.jsx)undefined171845171919(0,jsx_runtime.jsx)undefined172257172333(0,jsx_runtime.jsxs)undefined172675172751(0,jsx_runtime.jsxs)undefined172895172969(0,jsx_runtime.jsx)undefined173218173292(0,jsx_runtime.jsx)undefined173986174060(0,jsx_runtime.jsx)undefined174146174220(0,jsx_runtime.jsx)undefined174634174708(0,jsx_runtime.jsx)undefined175093175167(0,jsx_runtime.jsx)undefined175581175657(0,jsx_runtime.jsxs)undefined176099176173(0,jsx_runtime.jsx)undefined176995177069(0,jsx_runtime.jsx)undefined178199178273(0,jsx_runtime.jsx)undefined178382178456(0,jsx_runtime.jsx)undefined178606178680(0,jsx_runtime.jsx)undefined178791178865(0,jsx_runtime.jsx)undefined179163179237(0,jsx_runtime.jsx)undefined179385179461(0,jsx_runtime.jsxs)undefined179727179803(0,jsx_runtime.jsxs)undefined180082180156(0,jsx_runtime.jsx)undefined180518180594(0,jsx_runtime.jsxs)undefined180747180821(0,jsx_runtime.jsx)undefined181118181192(0,jsx_runtime.jsx)undefined181867181941(0,jsx_runtime.jsx)undefined182282182368(0,navigation.useRouter)undefined182398182496(0,navigation.useSearchParams)undefined182630182714(0,react.useState)undefined182759182843(0,react.useState)undefined182904182988(0,react.useState)undefined183068183152(0,react.useState)undefined183195183279(0,react.useState)undefined183318183402(0,react.useState)undefined183451183535(0,react.useState)undefined183599183683(0,react.useState)undefined183749183833(0,react.useState)undefined183885183969(0,react.useState)undefined184040184130(0,react.useCallback)undefined184194184284(0,react.useCallback)undefined184471184532api_client/* api */.FHundefined185192185253api_client/* api */.FHundefined185728185789api_client/* api */.FHundefined186591186652api_client/* api */.FHundefined186991187077(0,react.useEffect)undefined187423187507(0,react.useState)undefined187581187655(0,jsx_runtime.jsx)undefined187734187808(0,jsx_runtime.jsx)undefined187933188009(0,jsx_runtime.jsxs)undefined188100188174(0,jsx_runtime.jsx)undefined188298188372(0,jsx_runtime.jsx)undefined188455188531(0,jsx_runtime.jsxs)undefined188793188867(0,jsx_runtime.jsx)undefined189159189233(0,jsx_runtime.jsx)undefined189535189609(0,jsx_runtime.jsx)undefined190001190077(0,jsx_runtime.jsxs)undefined190079190158jsx_runtime.Fragmentundefined190209190285(0,jsx_runtime.jsxs)undefined190400190474(0,jsx_runtime.jsx)undefined190724190800(0,jsx_runtime.jsxs)undefined190897190973(0,jsx_runtime.jsxs)undefined191336191410(0,jsx_runtime.jsx)undefined192343192419(0,jsx_runtime.jsxs)undefined193008193082(0,jsx_runtime.jsx)undefined193720193794(0,jsx_runtime.jsx)undefined194203194277(0,jsx_runtime.jsx)undefined194822194898(0,jsx_runtime.jsxs)undefined195038195112(0,jsx_runtime.jsx)undefined195517195591(0,jsx_runtime.jsx)undefined196062196136(0,jsx_runtime.jsx)undefined196236196310(0,jsx_runtime.jsx)undefined196663196737(0,jsx_runtime.jsx)undefined196739196816ErrorBoundaryundefined196895196969(0,jsx_runtime.jsx)undefined197160197234(0,jsx_runtime.jsx)undefined197236197313ErrorBoundaryundefined197392197466(0,jsx_runtime.jsx)undefined197927198001(0,jsx_runtime.jsx)undefined198003198080ErrorBoundaryundefined198156198230(0,jsx_runtime.jsx)undefined198540198614(0,jsx_runtime.jsx)undefined198616198693ErrorBoundaryundefined198775198849(0,jsx_runtime.jsx)undefined199164199238(0,jsx_runtime.jsx)undefined199240199317ErrorBoundaryundefined199392199466(0,jsx_runtime.jsx)undefined199775199849(0,jsx_runtime.jsx)undefined199851199928ErrorBoundaryundefined200011200085(0,jsx_runtime.jsx)undefined200403200477(0,jsx_runtime.jsx)undefined200479200556ErrorBoundaryundefined200632200706(0,jsx_runtime.jsx)undefined200930201004(0,jsx_runtime.jsx)undefined201389201463(0,jsx_runtime.jsx)undefined202004202078(0,jsx_runtime.jsx)undefined `(jsx_runtimejsx_runtime_namespaceObjectjsx_runtime_defaultreact_namespaceObjectreact_defaultnavigationapi_clientyErrorBoundary_namespaceObjectpage_namespaceObject __webpack_require__.d__webpack_require__.r__webpack_require__ +webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSource` webpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5105],{ /***/ 63: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Vwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcey/* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7260); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceXexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map `/buffersourcesizemapshash/* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7260); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); //# sourceMappingURL=navigation.js.map {"finalSource":true}mapbufferedMap ConcatSourceRawSourcey/* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7260); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); ReplaceSourceRawSourceXexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map 047undefined /***/ }) buffersourcesizemapshash /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7260); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); //# sourceMappingURL=navigation.js.map /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; y/* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7260); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); ReplaceSourceRawSourceXexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map 047undefined RawSource /***/ }), /***/ 646:  swebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceimport(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\dashboard\\page.jsx"); @Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3399))buffersourcesizemapshashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3399)); {"finalSource":true}mapbufferedMap ReplaceSourceRawSourceimport(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\dashboard\\page.jsx"); l0220Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3399))undefined /***/ }) /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3399)); /***/ })  V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\dashboard\\page.jsx"); l0220Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3399))undefined, /***/ 3399:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource 4 webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcez// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(5155); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(2115); // EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(63); // EXTERNAL MODULE: ./src/lib/api-client.js var api_client = __webpack_require__(6282); ;// ./src/components/ErrorBoundary.jsx webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Component } from 'react'; class ErrorBoundary extends Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsxs("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } export { ErrorBoundary as default };  b={}N%)AD} __WEBPACK_MODULE_REFERENCE__1_5b22436f6d706f6e656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._buffersourcesizemapshash6 /* __next_internal_client_entry_do_not_use__ default auto */ class ErrorBoundary extends __WEBPACK_MODULE_REFERENCE__1_5b22436f6d706f6e656e74225d_directImport_asiSafe1__._ { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } {"finalSource":false}mapbufferedMap ReplaceSourceRawSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Component } from 'react'; class ErrorBoundary extends Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsxs("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } export { ErrorBoundary as default }; Y61123undefined125158undefined188196__WEBPACK_MODULE_REFERENCE__1_5b22436f6d706f6e656e74225d_directImport_asiSafe1__._undefined527531__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined646649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined805809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10891092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14051408__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22802315undefined`[JCJreact.Component(0,jsx_runtime.jsxs)(0,jsx_runtime.jsx)" ;// ./src/app/dashboard/page.jsx  webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourcevn/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback, useMemo } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { api } from '../../lib/api-client'; import ErrorBoundary from '../../components/ErrorBoundary'; const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = useState([]); const add = useCallback(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ _jsx("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ _jsx("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ _jsxs("div", { className: "search-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ _jsx("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ _jsx("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ _jsxs("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ _jsx("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ _jsx("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ _jsxs("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ _jsx("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ _jsx("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = useMemo(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ _jsxs("div", { className: "metric-card", children: [ /*#__PURE__*/ _jsx("h3", { children: p.label }), /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ _jsx("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ _jsx("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ _jsxs("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Risk" }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('normalizedScore'); const [sortDir, setSortDir] = useState('desc'); const [page, setPage] = useState(0); const [selectedRisk, setSelectedRisk] = useState(null); const [showCreate, setShowCreate] = useState(false); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = useMemo(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ _jsx("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ _jsx("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ _jsxs("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ _jsx(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Score" }), /*#__PURE__*/ _jsx("br", {}), /*#__PURE__*/ _jsx("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Description" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.description ] }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ _jsx("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Mitigation" }), /*#__PURE__*/ _jsx(FormField, { label: "Risk *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('progressPercent'); const [sortDir, setSortDir] = useState('asc'); const [showCreate, setShowCreate] = useState(false); const [selectedMitigation, setSelectedMitigation] = useState(null); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const mitigations = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = useMemo(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: m.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ _jsx("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ _jsxs("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ _jsx(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = useState(false); const [showDecision, setShowDecision] = useState(false); const [decisionForm, setDecisionForm] = useState({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = useState(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Deployment Gate" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Criterion" }), /*#__PURE__*/ _jsx("th", { children: "Required" }), /*#__PURE__*/ _jsx("th", { children: "Actual" }), /*#__PURE__*/ _jsx("th", { children: "Status" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: c.name }) }), /*#__PURE__*/ _jsx("td", { children: c.required }), /*#__PURE__*/ _jsx("td", { children: c.actual }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Gate Decision" }), /*#__PURE__*/ _jsx(FormField, { label: "Decision", children: /*#__PURE__*/ _jsx(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reason", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Integration" }), /*#__PURE__*/ _jsx(FormField, { label: "Provider", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Base URL", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Auth Mode", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = useState(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ _jsxs("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ _jsx("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ _jsx("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ _jsx(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ _jsx("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ _jsx("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const load = useCallback(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); useEffect(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Audit Log" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Date" }), /*#__PURE__*/ _jsx("th", { children: "Action" }), /*#__PURE__*/ _jsx("th", { children: "Entity" }), /*#__PURE__*/ _jsx("th", { children: "Actor" }), /*#__PURE__*/ _jsx("th", { children: "Details" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ _jsxs("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ _jsxs("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "All Projects" }), /*#__PURE__*/ _jsxs("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ _jsx("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Project Settings" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Subtitle", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Project" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Project Type", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", {}) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet" }) }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } export default function DashboardPage() { const router = useRouter(); const searchParams = useSearchParams(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = useState(null); const [projects, setProjects] = useState([]); const [selectedProjectId, setSelectedProjectId] = useState(searchParams.get('projectId') || null); const [dashboard, setDashboard] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [retryCount, setRetryCount] = useState(0); const [showProjectSettings, setShowProjectSettings] = useState(false); const [showProjectManager, setShowProjectManager] = useState(false); const [workspaceId, setWorkspaceId] = useState(null); const { toasts, add } = useToast(); const onRefresh = useCallback(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = useCallback(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = useState(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ _jsx("div", { className: "shell-loading", children: /*#__PURE__*/ _jsx("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsx("p", { children: error }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ _jsx("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ _jsxs("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "dash-actions", children: [ /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ _jsx("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ _jsx(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ _jsx(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ _jsx(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ _jsx(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ _jsx(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ _jsx(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ _jsx(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ _jsx(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ _jsx(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ _jsx(ToastContainer, { toasts: toasts }) ] }); } @b`=_?A{VY Q T   >A_9=ehWZ-)0)}))))))(*+* +_+++%,(,,,--..o/r/%0)0'1+122c4f486;66699::::;_;== ? ?AAqBtBEE FFHHII\J`J2K5KKKKLLLM MNNO_OXP[PuQxQQQRRVSYSSTWT`UcUUUEWHWWWYYYY'[*[[[V\Z\\_\]]____ ``7`>`p`w`````aaBaIaaaaaaabbii9k_;kllNnQnnnnnno:o>opp qq rrlrprrr/s2syy{{||u}_x}Y\y|Ӄփ$'fibePSTX_ADӎ֎$'ȑ̑>A•!JMם۝_.1ƢɢilWZwz03ڲݲOR:>_BEϿӿտݿ8<##&25"&_)69&)587:IL48O_RDG  jmhk36Y]/2_ru svx{Y\_ GN07bi _    f i           %)?B<_?qt=@ !!c%g%&& ''()])`)))d+_g+,,--(.,..///E1H11144m5p5x7|78899X<[<<<@@@_@BBCCEEEEFFfHiHKKLLLL)M0MMMPPRRwTzTTT"U_&U(U0UcUgUUU7V:VVVWWFXIXYY ZZZZZZ:[=[[[\\%](]^_^^^9_<___m`p`a aaabbQdTddd9e=e;f>fsgvghhkhiijjk_k l#lll8o;oooLqOqqqjtntu u3v6vxxxx{{||g}k}=~@~~_~EHfi҄քWZHK,3ňɈˈӈ }ډ_݉jm{~ EHɖ̖lodg؛ߛ_6=Wa mp-0}58Z^D_G<?Ȥˤ'+VY:=ۨިΩѩ_%)ɲ̲),#* NRźɺ"%(+_þ#NQ03%)_),gk"%\_@Cmq  6_9GNt{ rvHKSV`cl_o]`3:`gCG"%(UY_AH)-! $ Y ]     i l   14_[^!w{  >A""C'_F'''L(O((())**++,,....//2233334"4444_4 5'5w5~5555566V6]66666(727r7|77898::<<??#A+AB_BBB(C+CCCD DDDDDEE GG>HAHIIII JJJJ~KKKKRM_UMPPKSNSUUhWkWYYZZ[[]]]]Y_\_^_j___{`~`````b_bbbc cAdDdFdRdddeeee>fAfvgyg{ggggii i,ixi{i[j^jkBkmn__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__.___WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__.___WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._/* __next_internal_client_entry_do_not_use__ default auto */ const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const add = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "search-wrap", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "metric-card", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { children: p.label }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "New Risk" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Title *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Dimension *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Domain", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Probability", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Impact", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Detectability", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Owner", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(''); const [sortKey, setSortKey] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._('normalizedScore'); const [sortDir, setSortDir] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._('desc'); const [page, setPage] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [selectedRisk, setSelectedRisk] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [showCreate, setShowCreate] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [editing, setEditing] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [editForm, setEditForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({}); const [updating, setUpdating] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [confirmDelete, setConfirmDelete] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [deleting, setDeleting] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const risks = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading..." }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: risk.title }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Title *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Dimension", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Domain", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Probability", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Impact", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Detectability", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Owner", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Score" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: "Description" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("br", {}), selectedRisk.description ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "New Mitigation" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Risk *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Title *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Status", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Progress %", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Due Date", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Owner", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(''); const [sortKey, setSortKey] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._('progressPercent'); const [sortDir, setSortDir] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._('asc'); const [showCreate, setShowCreate] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [selectedMitigation, setSelectedMitigation] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [editing, setEditing] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [editForm, setEditForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({}); const [updating, setUpdating] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [confirmDelete, setConfirmDelete] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [deleting, setDeleting] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const mitigations = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = __WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading..." }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: m.title }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Title *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Status", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Progress %", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Due Date", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Owner", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [showDecision, setShowDecision] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [decisionForm, setDecisionForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading..." }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { children: "Deployment Gate" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Criterion" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Required" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Actual" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Status" }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: c.name }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: c.required }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: c.actual }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "Gate Decision" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Decision", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Reason", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "New Integration" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Provider", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Base URL", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Auth Mode", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { children: "Integrations" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [loading, setLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(true); const [error, setError] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const load = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { children: "Audit Log" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Date" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Action" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Entity" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Actor" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Details" }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [confirmDelete, setConfirmDelete] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [showNew, setShowNew] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const handleDelete = async ()=>{ setDeleting(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { children: "All Projects" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Name" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Status" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Type" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Created" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "Project Settings" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Name *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Subtitle", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Status", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [form, setForm] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { children: "New Project" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Name *", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Description", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(FormField, { label: "Project Type", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [confirmDelete, setConfirmDelete] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [showNew, setShowNew] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const handleDelete = async ()=>{ setDeleting(true); try { await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("table", { className: "table", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("thead", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Name" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Status" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Type" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", { children: "Created" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("th", {}) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: "No projects yet" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "modal-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } function DashboardPage() { const router = __WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._(); const searchParams = __WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [projects, setProjects] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [selectedProjectId, setSelectedProjectId] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(searchParams.get('projectId') || null); const [dashboard, setDashboard] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [loading, setLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(true); const [error, setError] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [retryCount, setRetryCount] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [showProjectSettings, setShowProjectSettings] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [showProjectManager, setShowProjectManager] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [workspaceId, setWorkspaceId] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const { toasts, add } = useToast(); const onRefresh = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = __WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await __WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shell-loading", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "empty-state", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: error }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-header", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "dash-actions", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Overview", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Projects", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Risks", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Mitigations", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Gate", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Integrations", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._, { name: "Audit", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ToastContainer, { toasts: toasts }) ] }); }  vn/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback, useMemo } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { api } from '../../lib/api-client'; import ErrorBoundary from '../../components/ErrorBoundary'; const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = useState([]); const add = useCallback(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ _jsx("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ _jsx("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ _jsxs("div", { className: "search-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ _jsx("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ _jsx("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ _jsxs("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ _jsx("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ _jsx("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ _jsxs("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ _jsx("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ _jsx("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = useMemo(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ _jsxs("div", { className: "metric-card", children: [ /*#__PURE__*/ _jsx("h3", { children: p.label }), /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ _jsx("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ _jsx("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ _jsxs("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Risk" }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('normalizedScore'); const [sortDir, setSortDir] = useState('desc'); const [page, setPage] = useState(0); const [selectedRisk, setSelectedRisk] = useState(null); const [showCreate, setShowCreate] = useState(false); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = useMemo(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ _jsx("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ _jsx("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ _jsxs("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ _jsx(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Score" }), /*#__PURE__*/ _jsx("br", {}), /*#__PURE__*/ _jsx("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Description" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.description ] }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ _jsx("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Mitigation" }), /*#__PURE__*/ _jsx(FormField, { label: "Risk *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('progressPercent'); const [sortDir, setSortDir] = useState('asc'); const [showCreate, setShowCreate] = useState(false); const [selectedMitigation, setSelectedMitigation] = useState(null); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const mitigations = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = useMemo(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: m.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ _jsx("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ _jsxs("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ _jsx(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = useState(false); const [showDecision, setShowDecision] = useState(false); const [decisionForm, setDecisionForm] = useState({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = useState(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Deployment Gate" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Criterion" }), /*#__PURE__*/ _jsx("th", { children: "Required" }), /*#__PURE__*/ _jsx("th", { children: "Actual" }), /*#__PURE__*/ _jsx("th", { children: "Status" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: c.name }) }), /*#__PURE__*/ _jsx("td", { children: c.required }), /*#__PURE__*/ _jsx("td", { children: c.actual }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Gate Decision" }), /*#__PURE__*/ _jsx(FormField, { label: "Decision", children: /*#__PURE__*/ _jsx(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reason", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Integration" }), /*#__PURE__*/ _jsx(FormField, { label: "Provider", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Base URL", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Auth Mode", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = useState(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ _jsxs("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ _jsx("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ _jsx("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ _jsx(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ _jsx("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ _jsx("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const load = useCallback(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); useEffect(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Audit Log" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Date" }), /*#__PURE__*/ _jsx("th", { children: "Action" }), /*#__PURE__*/ _jsx("th", { children: "Entity" }), /*#__PURE__*/ _jsx("th", { children: "Actor" }), /*#__PURE__*/ _jsx("th", { children: "Details" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ _jsxs("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ _jsxs("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "All Projects" }), /*#__PURE__*/ _jsxs("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ _jsx("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Project Settings" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Subtitle", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Project" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Project Type", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", {}) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet" }) }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } export default function DashboardPage() { const router = useRouter(); const searchParams = useSearchParams(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = useState(null); const [projects, setProjects] = useState([]); const [selectedProjectId, setSelectedProjectId] = useState(searchParams.get('projectId') || null); const [dashboard, setDashboard] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [retryCount, setRetryCount] = useState(0); const [showProjectSettings, setShowProjectSettings] = useState(false); const [showProjectManager, setShowProjectManager] = useState(false); const [workspaceId, setWorkspaceId] = useState(null); const { toasts, add } = useToast(); const onRefresh = useCallback(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = useCallback(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = useState(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ _jsx("div", { className: "shell-loading", children: /*#__PURE__*/ _jsx("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsx("p", { children: error }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ _jsx("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ _jsxs("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "dash-actions", children: [ /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ _jsx("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ _jsx(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ _jsx(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ _jsx(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ _jsx(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ _jsx(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ _jsx(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ _jsx(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ _jsx(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ _jsx(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ _jsx(ToastContainer, { toasts: toasts }) ] }); } 61146undefined148213undefined215275undefined277319undefined321379undefined970977__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10001010__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined16221625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17221725__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19611965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined20562059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21852188__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined28972900__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30923096__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined32103213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36463649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40424046__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42594262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined45544557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48124815__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49214925__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined51355139__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53475350__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56005604__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57335736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59755978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65846590__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined1054110544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1062110624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1072710731__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1073310741__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1079210795__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102111025__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1116411167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1130111304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1151311516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176411768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1200612010__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1214312146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1232512329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1258312587__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1302613029__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1341113414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1388013883__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1402914032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1473014734__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1486714870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1504915053__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1530715311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1575015753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1613716141__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1686016863__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1700917012__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1788517892__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1793017937__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1862018622__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined1892818931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1903619040__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1925019253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1935419357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1945419457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1963719640__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1974119744__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2018320187__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2044820451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2056820571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2085320856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2096820971__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2122621229__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2133421337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2158721591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2185621859__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2197621979__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2234122344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2245622459__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2281122814__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2293322936__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2333523338__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2343323436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2363823642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2377123774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2401224015__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2447424481__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2452224529__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2458524592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2463124638__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2468824695__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2474424751__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2479524802__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2484824855__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2489824905__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2496024967__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2501225019__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2504725053__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2531425320__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2689626898__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2744927451__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2785827860__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2823828241__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2831828321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2840928413__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2841528423__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2847428478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2869728700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2894128944__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2919729200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2929229296__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2941929422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2948729490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3113431138__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3173031733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3193431938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3211732120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3260132604__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3268232685__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3291332916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3299432997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3340133404__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3374733750__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3382833831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3406934072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3415034153__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3465834661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3473934742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515235155__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3523335236__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3575135754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592435928__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3632136324__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3641736420__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3656336566__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3690036903__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3705037054__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3732037324__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3765637659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795037953__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3832438328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3833038338__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3842938433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3868438687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3883238835__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3934639349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3949839501__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4040740411__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4084040843__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4100641009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4167041673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4183341836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4249442497__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4265042653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4325843262__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4369543698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4386343866__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4466344666__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4482644829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4561645619__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4578645789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4667146674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4681746820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4741847422__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4759947602__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4793847941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4836748370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4910349107__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4910949117__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4920849212__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4969549699__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4982849831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5010350106__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5033450338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5046750470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5073850741__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5097450978__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5110751110__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5138451387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5161751621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5175051753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5202252025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5225052254__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5238352386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5266252665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5289752901__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5303053033__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5330153304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5337953382__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368253686__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5381553818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5408954092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5432454328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5445754460__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5472854731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5506655070__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5537555378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5562055623__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5582155825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5607656079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5648556488__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5693856941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5756657569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5770457707__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5816358166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5851758524__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5856258569__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5956159563__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined5988559888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5999359997__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6020760210__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6031760320__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6041660419__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6078660789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6088660889__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6106961072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6117361176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6161561618__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6171461717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6195461958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6221962222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6233862341__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6271162714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6283562838__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6325163254__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6335263355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6357763580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6367563678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6388063884__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6401364016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6425464257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6472864735__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6477664783__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6483964846__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6489664903__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6496964976__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6501965026__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6507265079__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6512265129__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6518465191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6523665243__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6527765283__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6554765553__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6575265758__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6754767549__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6797667978__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6837468377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6845468457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6854568549__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6855168559__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6861068614__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6883368836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6905669059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6931869321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6941369417__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6954069543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6960869611__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7089170895__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7148771490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7167471678__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7199671999__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7207772080__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7230572308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7238672389__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7268472687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7276572768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7316373166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7324473248__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7369573698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7413474137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7510775111__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7545075453__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7553175534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7602976032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7612576128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7626576268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7664476647__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7680076804__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7707077073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7735277356__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7756777570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7769977702__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7814978152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7828578288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7908279085__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7921379216__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7973679740__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8011380116__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8026480267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8098480987__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8114081143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8193581938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8206882071__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8257682579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8270682709__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8322783231__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8338483387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8368983692__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8407084073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8475184754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8516785174__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8522885235__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8528985296__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8543185438__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8623786239__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8677486776__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8715987162__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8723987242__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8733087334__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8733687344__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined8739587399__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8751487518__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8760787610__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8775487757__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8802188024__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8813488137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8849288495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8858788591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8871488717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8878288786__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8889088893__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8905589058__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8921989222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8938189384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8962389626__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8979789801__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8991389916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8999489997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9022190224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9039790400__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9057190574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9065290655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9121791220__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9131391316__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9144991453__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9170791710__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9201992022__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9226492267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9266292665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9281392817__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9308393086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9321693219__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9333393336__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9400894011__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9413294135__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9454094543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9465594658__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9533895342__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9549595498__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9579595798__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9642296429__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9646796474__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9720697208__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined9753197534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9763997643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9785397856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9796497967__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9806598068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9847698479__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9858598588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9878498787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9888598888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9907299075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9917499177__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9953899542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9967199674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9991299915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100396100403__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined100549100553__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100555100563__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined100614100618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100733100737__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100826100829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100970100973__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101243101246__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101356101359__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101658101661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102149102153__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined102394102397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102793102796__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103079103082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103493103496__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103808103811__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104137104140__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104556104559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104928104931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105060105063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105432105439__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105480105487__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105526105533__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105559105569__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined105708105710__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined105993106001__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined106093106096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106173106176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106285106288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106365106368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106469106472__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106549106552__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106658106662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106664106672__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined106723106727__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106842106846__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106935106938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107076107079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107324107327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107437107440__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107720107723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107815107819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined107942107945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108010108014__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined108118108121__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108278108281__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108440108443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108602108605__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108763108766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109006109009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109191109195__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined109307109310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109742109745__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109823109826__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined110221110225__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined110629110633__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined111305111308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined111657111660__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined112563112570__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112625112632__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112675112682__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112788112790__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined113165113169__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113171113179__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined113230113234__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113349113353__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113442113445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined113586113590__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113960113963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114073114076__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114368114371__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114463114467__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114590114593__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114658114662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114766114769__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114926114929__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115088115091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115248115251__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115411115414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115654115657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115955115959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116261116265__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116393116396__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined116621116624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117173117176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117720117723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117801117804__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118178118181__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118518118521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118887118891__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined119285119288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined119842119845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120828120831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120924120927__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121084121087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121408121411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121559121563__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined121829121833__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122112122115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122477122481__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122634122637__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122934122937__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined123719123726__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined123764123771__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined124373124375__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined124678124681__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined124786124790__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined125000125003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125112125115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125211125214__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125523125526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125624125627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125944125947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126048126051__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126613126616__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126712126715__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127207127211__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined127340127343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127581127584__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128051128058__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128096128103__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128407128409__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined128727128730__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128835128839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined129049129052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129156129159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129255129258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129567129570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129671129674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130236130239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130341130344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130901130905__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined131034131037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131275131278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131793131800__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131855131862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131905131912__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined132018132020__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined132393132397__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132516132520__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132835132839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined133143133146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133409133412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133721133725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134141134144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134354134358__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134505134508__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134581134585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134705134708__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134889134892__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135075135078__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135259135262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135446135449__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135624135627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135965135969__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136311136315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136459136462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined136711136714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137408137411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137497137500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137914137917__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138302138305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138719138723__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined139165139168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined139990139993__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141123141126__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141235141238__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141388141391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141502141505__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141803141806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141954141958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142224142228__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142507142510__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined142872142876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined143029143032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined143329143332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144007144010__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144305144319undefined144366144374__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined144404144418__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined144552144559__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144604144611__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144672144679__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144759144766__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144809144816__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144855144862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144911144918__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144982144989__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145055145062__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145114145121__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145192145202__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145266145276__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145463145465__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146125146127__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146602146604__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147406147408__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147747147755__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined148101148108__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined148182148185__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148264148267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148392148396__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148487148490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148614148617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148700148704__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148966148969__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149261149264__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149566149569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149961149965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined149967149975__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined150026150030__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150145150148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined150398150402__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150499150503__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150866150869__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined151802151806__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined152395152398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153036153039__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153448153451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153996154000__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined154140154143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined154548154551__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155022155025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155125155128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155481155484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155486155498__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155577155580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155771155774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155776155788__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155867155870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156331156334__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156336156348__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156424156427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156737156740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156742156754__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156836156839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157154157157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157159157171__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157246157249__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157558157561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157563157575__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157658157661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157979157982__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157984157996__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined158072158075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158299158302__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158687158690__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined159231159234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined_\Tc@ R  a ! m )$<9_Wse&.p../n/// 0>00j11A223[3,4v4n5_566y77v889 :; <==??@@CCXDDUEEFFHHlJJMMcN_NRjRRRUUVHWWWXY~YY)ZsZ'[q[[ \]#^(_r__1`KaabObNc_cdKdEeeffYgg iWiijqkk2l|l nUnnnopppqrs6t_ttt_?ufuuu@vqvvvEwswwwFx}xxxRynyyz{?|w.xŇg_7^*ҍM؎"ڕ*t=<gI-wŞ_Dܢ&^9ѧkMPDc 1{_ZdFi&rtùje@Ӿh<5"lK5_QN=5&q]X_`6[? Vbb:\= Th_gR8 l7C ( Y      6_"dvs L   K!"g""#|##5%%%*&&(''_'))8**o++, -~--:///G01.22234a44u55B66z7799:_l:::*;~;;<?<<<=@===>L>>>?@n@5AAHHlJJ5LLLMnM_MM N>NNeOOPPQ"R~RRESSSTYfY[\\]B^^^$_`O```b_Xbbb{dde_eghgifi0m|mnogooqqGrrsdst&uu vw_wvxxy_y`zzi||8}}fyÅWnQɎ Ցۓ'_ 8F6Ӝ'];ž5rƤEܦ&~ʧ̧N Y_֪ޫ(C5;9۱%Ʋ2ݵ)1{[_RGߺ)[LѾe )gQ_^=A+[%bX:_^` W D"$se T+9;f_Z?wQ;w2*~}_+ h   l   e   f    6   Anem_4~ sZC,v^NN TNq  Q""=%%&_.'* +@+++,},,1.}.../M// 0e00<112D333 5j556667_d7788899::m;;<<>g>??a@@AACEDeFFFGGHIXJJL_\LM0NZPP{TT"UlU VSVWWrXXYZ+[u[\+]]^7__bb c]cee#g_mgg"hh>iiiUjjklllnQnno2q|qq&rt^tt)uvav4xxxy2z_oz{{`||~}}0~z~~$YR΃4~x‡Q܋[Ō_wÎ: =ؓ YCa>әKJKJLE_-Ϣ_B*t?ݭ)-caθgۻ_%[r&r U~k `~f;xpj_/MBhosVi_'sy1_1}M PhW:_R((7i(rtZ'qs V%wX F H   * _    K  l,^(0,react.useState)(0,react.useCallback)(0,react.useMemo)jsx_runtime.Fragmentapi_client/* api */.FH(0,react.useEffect)(0,navigation.useRouter)(0,navigation.useSearchParams)ErrorBoundarybuffersourcesizemapshashg// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(5155); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(2115); // EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(63); // EXTERNAL MODULE: ./src/lib/api-client.js var api_client = __webpack_require__(6282); ;// ./src/components/ErrorBoundary.jsx /* __next_internal_client_entry_do_not_use__ default auto */ class ErrorBoundary extends react.Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "empty-state", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } ;// ./src/app/dashboard/page.jsx /* __next_internal_client_entry_do_not_use__ default auto */ const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = (0,react.useState)([]); const add = (0,react.useCallback)(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "search-wrap", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ (0,jsx_runtime.jsx)("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = (0,react.useMemo)(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "metric-card", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { children: p.label }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Risk" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Dimension *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Domain", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Probability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Impact", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Detectability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = (0,react.useState)(''); const [sortKey, setSortKey] = (0,react.useState)('normalizedScore'); const [sortDir, setSortDir] = (0,react.useState)('desc'); const [page, setPage] = (0,react.useState)(0); const [selectedRisk, setSelectedRisk] = (0,react.useState)(null); const [showCreate, setShowCreate] = (0,react.useState)(false); const [editing, setEditing] = (0,react.useState)(false); const [editForm, setEditForm] = (0,react.useState)({}); const [updating, setUpdating] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [deleting, setDeleting] = (0,react.useState)(false); const risks = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = (0,react.useMemo)(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api_client/* api */.FH.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api_client/* api */.FH.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: risk.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Dimension", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Domain", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Probability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Impact", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Detectability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Score" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Description" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.description ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api_client/* api */.FH.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Mitigation" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Risk *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Progress %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Due Date", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = (0,react.useState)(''); const [sortKey, setSortKey] = (0,react.useState)('progressPercent'); const [sortDir, setSortDir] = (0,react.useState)('asc'); const [showCreate, setShowCreate] = (0,react.useState)(false); const [selectedMitigation, setSelectedMitigation] = (0,react.useState)(null); const [editing, setEditing] = (0,react.useState)(false); const [editForm, setEditForm] = (0,react.useState)({}); const [updating, setUpdating] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [deleting, setDeleting] = (0,react.useState)(false); const mitigations = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = (0,react.useMemo)(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api_client/* api */.FH.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: m.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Progress %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Due Date", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = (0,react.useState)(false); const [showDecision, setShowDecision] = (0,react.useState)(false); const [decisionForm, setDecisionForm] = (0,react.useState)({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = (0,react.useState)(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api_client/* api */.FH.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api_client/* api */.FH.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Deployment Gate" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Criterion" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Required" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actual" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: c.name }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: c.required }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: c.actual }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Gate Decision" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Decision", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Reason", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Integration" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Provider", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Base URL", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Auth Mode", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = (0,react.useState)(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Integrations" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = (0,react.useState)([]); const [loading, setLoading] = (0,react.useState)(true); const [error, setError] = (0,react.useState)(null); const load = (0,react.useCallback)(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api_client/* api */.FH.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); (0,react.useEffect)(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Audit Log" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Date" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Action" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Entity" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actor" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Details" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [showNew, setShowNew] = (0,react.useState)(false); const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "All Projects" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Name" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Type" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Created" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Project Settings" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Subtitle", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Project" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Project Type", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [showNew, setShowNew] = (0,react.useState)(false); const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Name" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Type" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Created" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", {}) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No projects yet" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } function DashboardPage() { const router = (0,navigation.useRouter)(); const searchParams = (0,navigation.useSearchParams)(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = (0,react.useState)(null); const [projects, setProjects] = (0,react.useState)([]); const [selectedProjectId, setSelectedProjectId] = (0,react.useState)(searchParams.get('projectId') || null); const [dashboard, setDashboard] = (0,react.useState)(null); const [loading, setLoading] = (0,react.useState)(true); const [error, setError] = (0,react.useState)(null); const [retryCount, setRetryCount] = (0,react.useState)(0); const [showProjectSettings, setShowProjectSettings] = (0,react.useState)(false); const [showProjectManager, setShowProjectManager] = (0,react.useState)(false); const [workspaceId, setWorkspaceId] = (0,react.useState)(null); const { toasts, add } = useToast(); const onRefresh = (0,react.useCallback)(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = (0,react.useCallback)(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api_client/* api */.FH.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api_client/* api */.FH.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api_client/* api */.FH.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api_client/* api */.FH.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); (0,react.useEffect)(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = (0,react.useState)(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shell-loading", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "empty-state", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: error }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ (0,jsx_runtime.jsx)(ToastContainer, { toasts: toasts }) ] }); } {"finalSource":true}mapbufferedMap ` ConcatSourceRawSourcez// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(5155); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(2115); // EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(63); // EXTERNAL MODULE: ./src/lib/api-client.js var api_client = __webpack_require__(6282); ;// ./src/components/ErrorBoundary.jsx  ReplaceSourceReplaceSourceRawSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Component } from 'react'; class ErrorBoundary extends Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsxs("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } export { ErrorBoundary as default }; Y61123undefined125158undefined188196__WEBPACK_MODULE_REFERENCE__1_5b22436f6d706f6e656e74225d_directImport_asiSafe1__._undefined527531__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined646649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined805809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10891092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14051408__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22802315undefined91172react.Componentundefined503579(0,jsx_runtime.jsxs)undefined694768(0,jsx_runtime.jsx)undefined9241000(0,jsx_runtime.jsxs)undefined12801354(0,jsx_runtime.jsx)undefined16671741(0,jsx_runtime.jsx)undefinedRawSource" ;// ./src/app/dashboard/page.jsx vn/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback, useMemo } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { api } from '../../lib/api-client'; import ErrorBoundary from '../../components/ErrorBoundary'; const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = useState([]); const add = useCallback(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ _jsx("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ _jsx("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ _jsxs("div", { className: "search-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ _jsx("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ _jsx("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ _jsxs("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ _jsx("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ _jsx("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ _jsxs("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ _jsx("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ _jsx("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = useMemo(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ _jsxs("div", { className: "metric-card", children: [ /*#__PURE__*/ _jsx("h3", { children: p.label }), /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ _jsx("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ _jsx("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ _jsxs("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Risk" }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('normalizedScore'); const [sortDir, setSortDir] = useState('desc'); const [page, setPage] = useState(0); const [selectedRisk, setSelectedRisk] = useState(null); const [showCreate, setShowCreate] = useState(false); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = useMemo(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ _jsx("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ _jsx("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ _jsxs("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ _jsx(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Score" }), /*#__PURE__*/ _jsx("br", {}), /*#__PURE__*/ _jsx("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Description" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.description ] }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ _jsx("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Mitigation" }), /*#__PURE__*/ _jsx(FormField, { label: "Risk *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('progressPercent'); const [sortDir, setSortDir] = useState('asc'); const [showCreate, setShowCreate] = useState(false); const [selectedMitigation, setSelectedMitigation] = useState(null); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const mitigations = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = useMemo(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: m.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ _jsx("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ _jsxs("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ _jsx(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = useState(false); const [showDecision, setShowDecision] = useState(false); const [decisionForm, setDecisionForm] = useState({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = useState(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Deployment Gate" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Criterion" }), /*#__PURE__*/ _jsx("th", { children: "Required" }), /*#__PURE__*/ _jsx("th", { children: "Actual" }), /*#__PURE__*/ _jsx("th", { children: "Status" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: c.name }) }), /*#__PURE__*/ _jsx("td", { children: c.required }), /*#__PURE__*/ _jsx("td", { children: c.actual }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Gate Decision" }), /*#__PURE__*/ _jsx(FormField, { label: "Decision", children: /*#__PURE__*/ _jsx(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reason", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Integration" }), /*#__PURE__*/ _jsx(FormField, { label: "Provider", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Base URL", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Auth Mode", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = useState(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ _jsxs("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ _jsx("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ _jsx("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ _jsx(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ _jsx("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ _jsx("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const load = useCallback(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); useEffect(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Audit Log" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Date" }), /*#__PURE__*/ _jsx("th", { children: "Action" }), /*#__PURE__*/ _jsx("th", { children: "Entity" }), /*#__PURE__*/ _jsx("th", { children: "Actor" }), /*#__PURE__*/ _jsx("th", { children: "Details" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ _jsxs("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ _jsxs("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "All Projects" }), /*#__PURE__*/ _jsxs("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ _jsx("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Project Settings" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Subtitle", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Project" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Project Type", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", {}) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet" }) }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } export default function DashboardPage() { const router = useRouter(); const searchParams = useSearchParams(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = useState(null); const [projects, setProjects] = useState([]); const [selectedProjectId, setSelectedProjectId] = useState(searchParams.get('projectId') || null); const [dashboard, setDashboard] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [retryCount, setRetryCount] = useState(0); const [showProjectSettings, setShowProjectSettings] = useState(false); const [showProjectManager, setShowProjectManager] = useState(false); const [workspaceId, setWorkspaceId] = useState(null); const { toasts, add } = useToast(); const onRefresh = useCallback(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = useCallback(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = useState(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ _jsx("div", { className: "shell-loading", children: /*#__PURE__*/ _jsx("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsx("p", { children: error }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ _jsx("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ _jsxs("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "dash-actions", children: [ /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ _jsx("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ _jsx(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ _jsx(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ _jsx(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ _jsx(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ _jsx(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ _jsx(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ _jsx(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ _jsx(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ _jsx(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ _jsx(ToastContainer, { toasts: toasts }) ] }); } 61146undefined148213undefined215275undefined277319undefined321379undefined970977__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10001010__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined16221625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17221725__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19611965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined20562059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21852188__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined28972900__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30923096__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined32103213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36463649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40424046__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42594262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined45544557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48124815__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49214925__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined51355139__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53475350__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56005604__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57335736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59755978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65846590__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined1054110544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1062110624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1072710731__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1073310741__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1079210795__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102111025__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1116411167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1130111304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1151311516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176411768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1200612010__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1214312146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1232512329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1258312587__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1302613029__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1341113414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1388013883__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1402914032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1473014734__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1486714870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1504915053__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1530715311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1575015753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1613716141__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1686016863__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1700917012__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1788517892__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1793017937__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1862018622__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined1892818931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1903619040__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1925019253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1935419357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1945419457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1963719640__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1974119744__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2018320187__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2044820451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2056820571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2085320856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2096820971__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2122621229__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2133421337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2158721591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2185621859__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2197621979__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2234122344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2245622459__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2281122814__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2293322936__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2333523338__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2343323436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2363823642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2377123774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2401224015__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2447424481__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2452224529__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2458524592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2463124638__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2468824695__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2474424751__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2479524802__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2484824855__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2489824905__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2496024967__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2501225019__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2504725053__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2531425320__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2689626898__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2744927451__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2785827860__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2823828241__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2831828321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2840928413__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2841528423__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2847428478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2869728700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2894128944__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2919729200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2929229296__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2941929422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2948729490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3113431138__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3173031733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3193431938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3211732120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3260132604__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3268232685__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3291332916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3299432997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3340133404__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3374733750__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3382833831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3406934072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3415034153__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3465834661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3473934742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515235155__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3523335236__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3575135754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592435928__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3632136324__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3641736420__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3656336566__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3690036903__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3705037054__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3732037324__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3765637659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795037953__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3832438328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3833038338__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3842938433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3868438687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3883238835__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3934639349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3949839501__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4040740411__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4084040843__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4100641009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4167041673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4183341836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4249442497__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4265042653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4325843262__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4369543698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4386343866__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4466344666__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4482644829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4561645619__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4578645789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4667146674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4681746820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4741847422__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4759947602__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4793847941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4836748370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4910349107__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4910949117__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4920849212__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4969549699__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4982849831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5010350106__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5033450338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5046750470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5073850741__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5097450978__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5110751110__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5138451387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5161751621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5175051753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5202252025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5225052254__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5238352386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5266252665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5289752901__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5303053033__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5330153304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5337953382__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368253686__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5381553818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5408954092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5432454328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5445754460__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5472854731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5506655070__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5537555378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5562055623__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5582155825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5607656079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5648556488__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5693856941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5756657569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5770457707__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5816358166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5851758524__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5856258569__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5956159563__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined5988559888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5999359997__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6020760210__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6031760320__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6041660419__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6078660789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6088660889__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6106961072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6117361176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6161561618__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6171461717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6195461958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6221962222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6233862341__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6271162714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6283562838__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6325163254__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6335263355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6357763580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6367563678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6388063884__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6401364016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6425464257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6472864735__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6477664783__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6483964846__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6489664903__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6496964976__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6501965026__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6507265079__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6512265129__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6518465191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6523665243__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6527765283__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6554765553__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6575265758__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6754767549__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6797667978__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6837468377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6845468457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6854568549__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6855168559__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6861068614__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6883368836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6905669059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6931869321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6941369417__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6954069543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6960869611__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7089170895__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7148771490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7167471678__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7199671999__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7207772080__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7230572308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7238672389__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7268472687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7276572768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7316373166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7324473248__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7369573698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7413474137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7510775111__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7545075453__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7553175534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7602976032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7612576128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7626576268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7664476647__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7680076804__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7707077073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7735277356__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7756777570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7769977702__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7814978152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7828578288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7908279085__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7921379216__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7973679740__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8011380116__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8026480267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8098480987__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8114081143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8193581938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8206882071__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8257682579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8270682709__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8322783231__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8338483387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8368983692__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8407084073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8475184754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8516785174__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8522885235__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8528985296__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8543185438__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8623786239__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8677486776__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8715987162__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8723987242__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8733087334__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8733687344__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined8739587399__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8751487518__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8760787610__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8775487757__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8802188024__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8813488137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8849288495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8858788591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8871488717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8878288786__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8889088893__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8905589058__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8921989222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8938189384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8962389626__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8979789801__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8991389916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8999489997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9022190224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9039790400__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9057190574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9065290655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9121791220__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9131391316__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9144991453__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9170791710__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9201992022__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9226492267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9266292665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9281392817__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9308393086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9321693219__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9333393336__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9400894011__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9413294135__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9454094543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9465594658__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9533895342__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9549595498__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9579595798__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9642296429__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9646796474__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9720697208__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined9753197534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9763997643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9785397856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9796497967__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9806598068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9847698479__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9858598588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9878498787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9888598888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9907299075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9917499177__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9953899542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9967199674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9991299915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100396100403__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined100549100553__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100555100563__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined100614100618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100733100737__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100826100829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100970100973__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101243101246__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101356101359__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101658101661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102149102153__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined102394102397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102793102796__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103079103082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103493103496__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103808103811__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104137104140__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104556104559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104928104931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105060105063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105432105439__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105480105487__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105526105533__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105559105569__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined105708105710__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined105993106001__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined106093106096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106173106176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106285106288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106365106368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106469106472__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106549106552__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106658106662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106664106672__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined106723106727__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106842106846__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106935106938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107076107079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107324107327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107437107440__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107720107723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107815107819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined107942107945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108010108014__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined108118108121__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108278108281__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108440108443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108602108605__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108763108766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109006109009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109191109195__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined109307109310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109742109745__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109823109826__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined110221110225__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined110629110633__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined111305111308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined111657111660__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined112563112570__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112625112632__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112675112682__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112788112790__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined113165113169__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113171113179__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined113230113234__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113349113353__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113442113445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined113586113590__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113960113963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114073114076__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114368114371__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114463114467__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114590114593__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114658114662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114766114769__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114926114929__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115088115091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115248115251__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115411115414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115654115657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115955115959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116261116265__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116393116396__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined116621116624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117173117176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117720117723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117801117804__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118178118181__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118518118521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118887118891__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined119285119288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined119842119845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120828120831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120924120927__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121084121087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121408121411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121559121563__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined121829121833__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122112122115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122477122481__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122634122637__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122934122937__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined123719123726__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined123764123771__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined124373124375__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined124678124681__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined124786124790__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined125000125003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125112125115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125211125214__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125523125526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125624125627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125944125947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126048126051__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126613126616__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126712126715__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127207127211__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined127340127343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127581127584__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128051128058__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128096128103__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128407128409__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined128727128730__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128835128839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined129049129052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129156129159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129255129258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129567129570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129671129674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130236130239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130341130344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130901130905__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined131034131037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131275131278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131793131800__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131855131862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131905131912__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined132018132020__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined132393132397__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132516132520__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132835132839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined133143133146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133409133412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133721133725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134141134144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134354134358__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134505134508__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134581134585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134705134708__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134889134892__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135075135078__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135259135262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135446135449__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135624135627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135965135969__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136311136315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136459136462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined136711136714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137408137411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137497137500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137914137917__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138302138305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138719138723__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined139165139168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined139990139993__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141123141126__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141235141238__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141388141391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141502141505__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141803141806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141954141958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142224142228__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142507142510__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined142872142876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined143029143032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined143329143332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144007144010__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144305144319undefined144366144374__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined144404144418__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined144552144559__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144604144611__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144672144679__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144759144766__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144809144816__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144855144862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144911144918__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144982144989__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145055145062__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145114145121__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145192145202__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145266145276__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145463145465__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146125146127__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146602146604__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147406147408__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147747147755__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined148101148108__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined148182148185__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148264148267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148392148396__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148487148490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148614148617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148700148704__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148966148969__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149261149264__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149566149569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149961149965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined149967149975__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined150026150030__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150145150148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined150398150402__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150499150503__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150866150869__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined151802151806__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined152395152398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153036153039__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153448153451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153996154000__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined154140154143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined154548154551__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155022155025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155125155128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155481155484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155486155498__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155577155580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155771155774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155776155788__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155867155870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156331156334__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156336156348__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156424156427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156737156740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156742156754__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156836156839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157154157157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157159157171__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157246157249__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157558157561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157563157575__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157658157661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157979157982__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157984157996__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined158072158075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158299158302__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158687158690__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined159231159234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefinedc\655739(0,react.useState)undefined762852(0,react.useCallback)undefined14641538(0,jsx_runtime.jsx)undefined16351709(0,jsx_runtime.jsx)undefined19452021(0,jsx_runtime.jsxs)undefined21122186(0,jsx_runtime.jsx)undefined23122386(0,jsx_runtime.jsx)undefined30953169(0,jsx_runtime.jsx)undefined33613437(0,jsx_runtime.jsxs)undefined35513625(0,jsx_runtime.jsx)undefined40584132(0,jsx_runtime.jsx)undefined45254601(0,jsx_runtime.jsxs)undefined48144888(0,jsx_runtime.jsx)undefined51805254(0,jsx_runtime.jsx)undefined55095583(0,jsx_runtime.jsx)undefined56895765(0,jsx_runtime.jsxs)undefined59756051(0,jsx_runtime.jsxs)undefined62596333(0,jsx_runtime.jsx)undefined65836659(0,jsx_runtime.jsxs)undefined67886862(0,jsx_runtime.jsx)undefined71017175(0,jsx_runtime.jsx)undefined77817863(0,react.useMemo)undefined1181411888(0,jsx_runtime.jsx)undefined1196512039(0,jsx_runtime.jsx)undefined1214212218(0,jsx_runtime.jsxs)undefined1222012299jsx_runtime.Fragmentundefined1235012424(0,jsx_runtime.jsx)undefined1265012726(0,jsx_runtime.jsxs)undefined1286512939(0,jsx_runtime.jsx)undefined1307313147(0,jsx_runtime.jsx)undefined1335613430(0,jsx_runtime.jsx)undefined1367813754(0,jsx_runtime.jsxs)undefined1399214068(0,jsx_runtime.jsxs)undefined1420114275(0,jsx_runtime.jsx)undefined1445414530(0,jsx_runtime.jsxs)undefined1478414860(0,jsx_runtime.jsxs)undefined1529915373(0,jsx_runtime.jsx)undefined1575515829(0,jsx_runtime.jsx)undefined1629516369(0,jsx_runtime.jsx)undefined1651516589(0,jsx_runtime.jsx)undefined1728717363(0,jsx_runtime.jsxs)undefined1749617570(0,jsx_runtime.jsx)undefined1774917825(0,jsx_runtime.jsxs)undefined1807918155(0,jsx_runtime.jsxs)undefined1859418668(0,jsx_runtime.jsx)undefined1905219128(0,jsx_runtime.jsxs)undefined1984719921(0,jsx_runtime.jsx)undefined2006720141(0,jsx_runtime.jsx)undefined2101421098(0,react.useState)undefined2113621220(0,react.useState)undefined2190321964api_client/* api */.FHundefined2227022344(0,jsx_runtime.jsx)undefined2244922525(0,jsx_runtime.jsxs)undefined2273522809(0,jsx_runtime.jsx)undefined2291022984(0,jsx_runtime.jsx)undefined2308123155(0,jsx_runtime.jsx)undefined2333523409(0,jsx_runtime.jsx)undefined2351023584(0,jsx_runtime.jsx)undefined2402324099(0,jsx_runtime.jsxs)undefined2436024434(0,jsx_runtime.jsx)undefined2455124625(0,jsx_runtime.jsx)undefined2490724981(0,jsx_runtime.jsx)undefined2509325167(0,jsx_runtime.jsx)undefined2542225496(0,jsx_runtime.jsx)undefined2560125675(0,jsx_runtime.jsx)undefined2592526001(0,jsx_runtime.jsxs)undefined2626626340(0,jsx_runtime.jsx)undefined2645726531(0,jsx_runtime.jsx)undefined2689326967(0,jsx_runtime.jsx)undefined2707927153(0,jsx_runtime.jsx)undefined2750527579(0,jsx_runtime.jsx)undefined2769827772(0,jsx_runtime.jsx)undefined2817128245(0,jsx_runtime.jsx)undefined2834028414(0,jsx_runtime.jsx)undefined2861628692(0,jsx_runtime.jsxs)undefined2882128895(0,jsx_runtime.jsx)undefined2913329207(0,jsx_runtime.jsx)undefined2966629750(0,react.useState)undefined2979129875(0,react.useState)undefined2993130015(0,react.useState)undefined3005430138(0,react.useState)undefined3018830272(0,react.useState)undefined3032130405(0,react.useState)undefined3044930533(0,react.useState)undefined3057930663(0,react.useState)undefined3070630790(0,react.useState)undefined3084530929(0,react.useState)undefined3097431058(0,react.useState)undefined3108631168(0,react.useMemo)undefined3142931511(0,react.useMemo)undefined3308733148api_client/* api */.FHundefined3369933760api_client/* api */.FHundefined3416734228api_client/* api */.FHundefined3460634680(0,jsx_runtime.jsx)undefined3475734831(0,jsx_runtime.jsx)undefined3491934995(0,jsx_runtime.jsxs)undefined3499735076jsx_runtime.Fragmentundefined3512735203(0,jsx_runtime.jsxs)undefined3542235496(0,jsx_runtime.jsx)undefined3573735811(0,jsx_runtime.jsx)undefined3606436138(0,jsx_runtime.jsx)undefined3623036306(0,jsx_runtime.jsxs)undefined3642936503(0,jsx_runtime.jsx)undefined3656836642(0,jsx_runtime.jsx)undefined3828638362(0,jsx_runtime.jsxs)undefined3895439028(0,jsx_runtime.jsx)undefined3922939305(0,jsx_runtime.jsxs)undefined3948439558(0,jsx_runtime.jsx)undefined4003940113(0,jsx_runtime.jsx)undefined4019140265(0,jsx_runtime.jsx)undefined4049340567(0,jsx_runtime.jsx)undefined4064540719(0,jsx_runtime.jsx)undefined4112341197(0,jsx_runtime.jsx)undefined4154041614(0,jsx_runtime.jsx)undefined4169241766(0,jsx_runtime.jsx)undefined4200442078(0,jsx_runtime.jsx)undefined4215642230(0,jsx_runtime.jsx)undefined4273542809(0,jsx_runtime.jsx)undefined4288742961(0,jsx_runtime.jsx)undefined4337143445(0,jsx_runtime.jsx)undefined4352343597(0,jsx_runtime.jsx)undefined4411244186(0,jsx_runtime.jsx)undefined4435644432(0,jsx_runtime.jsxs)undefined4482544899(0,jsx_runtime.jsx)undefined4499245066(0,jsx_runtime.jsx)undefined4520945283(0,jsx_runtime.jsx)undefined4561745691(0,jsx_runtime.jsx)undefined4583845914(0,jsx_runtime.jsxs)undefined4618046256(0,jsx_runtime.jsxs)undefined4658846662(0,jsx_runtime.jsx)undefined4695347027(0,jsx_runtime.jsx)undefined4739847474(0,jsx_runtime.jsxs)undefined4747647555jsx_runtime.Fragmentundefined4764647722(0,jsx_runtime.jsxs)undefined4797348047(0,jsx_runtime.jsx)undefined4819248266(0,jsx_runtime.jsx)undefined4877748851(0,jsx_runtime.jsx)undefined4900049074(0,jsx_runtime.jsx)undefined4998050056(0,jsx_runtime.jsxs)undefined5048550559(0,jsx_runtime.jsx)undefined5072250796(0,jsx_runtime.jsx)undefined5145751531(0,jsx_runtime.jsx)undefined5169151765(0,jsx_runtime.jsx)undefined5242352497(0,jsx_runtime.jsx)undefined5265052724(0,jsx_runtime.jsx)undefined5332953405(0,jsx_runtime.jsxs)undefined5383853912(0,jsx_runtime.jsx)undefined5407754151(0,jsx_runtime.jsx)undefined5494855022(0,jsx_runtime.jsx)undefined5518255256(0,jsx_runtime.jsx)undefined5604356117(0,jsx_runtime.jsx)undefined5628456358(0,jsx_runtime.jsx)undefined5724057314(0,jsx_runtime.jsx)undefined5745757531(0,jsx_runtime.jsx)undefined5812958205(0,jsx_runtime.jsxs)undefined5838258456(0,jsx_runtime.jsx)undefined5879258866(0,jsx_runtime.jsx)undefined5929259366(0,jsx_runtime.jsx)undefined6009960175(0,jsx_runtime.jsxs)undefined6017760256jsx_runtime.Fragmentundefined6034760423(0,jsx_runtime.jsxs)undefined6090660982(0,jsx_runtime.jsxs)undefined6111161185(0,jsx_runtime.jsx)undefined6145761531(0,jsx_runtime.jsx)undefined6175961835(0,jsx_runtime.jsxs)undefined6196462038(0,jsx_runtime.jsx)undefined6230662380(0,jsx_runtime.jsx)undefined6261362689(0,jsx_runtime.jsxs)undefined6281862892(0,jsx_runtime.jsx)undefined6316663240(0,jsx_runtime.jsx)undefined6347063546(0,jsx_runtime.jsxs)undefined6367563749(0,jsx_runtime.jsx)undefined6401864092(0,jsx_runtime.jsx)undefined6431764393(0,jsx_runtime.jsxs)undefined6452264596(0,jsx_runtime.jsx)undefined6487264946(0,jsx_runtime.jsx)undefined6517865254(0,jsx_runtime.jsxs)undefined6538365457(0,jsx_runtime.jsx)undefined6572565799(0,jsx_runtime.jsx)undefined6587465948(0,jsx_runtime.jsx)undefined6624866324(0,jsx_runtime.jsxs)undefined6645366527(0,jsx_runtime.jsx)undefined6679866872(0,jsx_runtime.jsx)undefined6710467180(0,jsx_runtime.jsxs)undefined6730967383(0,jsx_runtime.jsx)undefined6765167725(0,jsx_runtime.jsx)undefined6806068136(0,jsx_runtime.jsxs)undefined6844168515(0,jsx_runtime.jsx)undefined6875768831(0,jsx_runtime.jsx)undefined6902969105(0,jsx_runtime.jsxs)undefined6935669430(0,jsx_runtime.jsx)undefined6983669910(0,jsx_runtime.jsx)undefined7036070434(0,jsx_runtime.jsx)undefined7105971133(0,jsx_runtime.jsx)undefined7126871342(0,jsx_runtime.jsx)undefined7179871872(0,jsx_runtime.jsx)undefined7222372307(0,react.useState)undefined7234572429(0,react.useState)undefined7342173482api_client/* api */.FHundefined7380473878(0,jsx_runtime.jsx)undefined7398374059(0,jsx_runtime.jsxs)undefined7426974343(0,jsx_runtime.jsx)undefined7445074524(0,jsx_runtime.jsx)undefined7462074694(0,jsx_runtime.jsx)undefined7506175135(0,jsx_runtime.jsx)undefined7523275306(0,jsx_runtime.jsx)undefined7548675560(0,jsx_runtime.jsx)undefined7566175735(0,jsx_runtime.jsx)undefined7617476248(0,jsx_runtime.jsx)undefined7634476418(0,jsx_runtime.jsx)undefined7665576731(0,jsx_runtime.jsxs)undefined7699277066(0,jsx_runtime.jsx)undefined7718277256(0,jsx_runtime.jsx)undefined7762677700(0,jsx_runtime.jsx)undefined7782177895(0,jsx_runtime.jsx)undefined7830878382(0,jsx_runtime.jsx)undefined7848078554(0,jsx_runtime.jsx)undefined7877678850(0,jsx_runtime.jsx)undefined7894579019(0,jsx_runtime.jsx)undefined7922179297(0,jsx_runtime.jsxs)undefined7942679500(0,jsx_runtime.jsx)undefined7973879812(0,jsx_runtime.jsx)undefined8028380367(0,react.useState)undefined8040880492(0,react.useState)undefined8054880632(0,react.useState)undefined8068280766(0,react.useState)undefined8083280916(0,react.useState)undefined8095981043(0,react.useState)undefined8108981173(0,react.useState)undefined8121681300(0,react.useState)undefined8135581439(0,react.useState)undefined8148481568(0,react.useState)undefined8160281684(0,react.useMemo)undefined8194882030(0,react.useMemo)undefined8222982311(0,react.useMemo)undefined8410084161api_client/* api */.FHundefined8458884649api_client/* api */.FHundefined8504585119(0,jsx_runtime.jsx)undefined8519685270(0,jsx_runtime.jsx)undefined8535885434(0,jsx_runtime.jsxs)undefined8543685515jsx_runtime.Fragmentundefined8556685642(0,jsx_runtime.jsxs)undefined8586185935(0,jsx_runtime.jsx)undefined8615586229(0,jsx_runtime.jsx)undefined8648886562(0,jsx_runtime.jsx)undefined8665486730(0,jsx_runtime.jsxs)undefined8685386927(0,jsx_runtime.jsx)undefined8699287066(0,jsx_runtime.jsx)undefined8834688422(0,jsx_runtime.jsxs)undefined8901489088(0,jsx_runtime.jsx)undefined8927289348(0,jsx_runtime.jsxs)undefined8966689740(0,jsx_runtime.jsx)undefined8981889892(0,jsx_runtime.jsx)undefined9011790191(0,jsx_runtime.jsx)undefined9026990343(0,jsx_runtime.jsx)undefined9063890712(0,jsx_runtime.jsx)undefined9079090864(0,jsx_runtime.jsx)undefined9125991333(0,jsx_runtime.jsx)undefined9141191487(0,jsx_runtime.jsxs)undefined9193492008(0,jsx_runtime.jsx)undefined9244492518(0,jsx_runtime.jsx)undefined9348893564(0,jsx_runtime.jsxs)undefined9390393977(0,jsx_runtime.jsx)undefined9405594129(0,jsx_runtime.jsx)undefined9462494698(0,jsx_runtime.jsx)undefined9479194865(0,jsx_runtime.jsx)undefined9500295076(0,jsx_runtime.jsx)undefined9545295526(0,jsx_runtime.jsx)undefined9567995755(0,jsx_runtime.jsxs)undefined9602196095(0,jsx_runtime.jsx)undefined9637496450(0,jsx_runtime.jsxs)undefined9666196735(0,jsx_runtime.jsx)undefined9686496938(0,jsx_runtime.jsx)undefined9738597459(0,jsx_runtime.jsx)undefined9759297666(0,jsx_runtime.jsx)undefined9846098534(0,jsx_runtime.jsx)undefined9866298736(0,jsx_runtime.jsx)undefined9925699332(0,jsx_runtime.jsxs)undefined9970599779(0,jsx_runtime.jsx)undefined99927100001(0,jsx_runtime.jsx)undefined100718100792(0,jsx_runtime.jsx)undefined100945101019(0,jsx_runtime.jsx)undefined101811101885(0,jsx_runtime.jsx)undefined102015102089(0,jsx_runtime.jsx)undefined102594102668(0,jsx_runtime.jsx)undefined102795102869(0,jsx_runtime.jsx)undefined103387103463(0,jsx_runtime.jsxs)undefined103616103690(0,jsx_runtime.jsx)undefined103992104066(0,jsx_runtime.jsx)undefined104444104518(0,jsx_runtime.jsx)undefined105196105270(0,jsx_runtime.jsx)undefined105683105767(0,react.useState)undefined105821105905(0,react.useState)undefined105959106043(0,react.useState)undefined106178106262(0,react.useState)undefined107061107122api_client/* api */.FHundefined107657107718api_client/* api */.FHundefined108101108175(0,jsx_runtime.jsx)undefined108252108326(0,jsx_runtime.jsx)undefined108414108490(0,jsx_runtime.jsxs)undefined108492108571jsx_runtime.Fragmentundefined108622108698(0,jsx_runtime.jsxs)undefined108813108889(0,jsx_runtime.jsxs)undefined108978109052(0,jsx_runtime.jsx)undefined109196109270(0,jsx_runtime.jsx)undefined109534109608(0,jsx_runtime.jsx)undefined109718109792(0,jsx_runtime.jsx)undefined110147110221(0,jsx_runtime.jsx)undefined110313110389(0,jsx_runtime.jsxs)undefined110512110586(0,jsx_runtime.jsx)undefined110651110727(0,jsx_runtime.jsxs)undefined110831110905(0,jsx_runtime.jsx)undefined111067111141(0,jsx_runtime.jsx)undefined111302111376(0,jsx_runtime.jsx)undefined111535111609(0,jsx_runtime.jsx)undefined111848111922(0,jsx_runtime.jsx)undefined112093112169(0,jsx_runtime.jsxs)undefined112281112355(0,jsx_runtime.jsx)undefined112433112507(0,jsx_runtime.jsx)undefined112731112805(0,jsx_runtime.jsx)undefined112978113052(0,jsx_runtime.jsx)undefined113223113297(0,jsx_runtime.jsx)undefined113375113449(0,jsx_runtime.jsx)undefined114011114085(0,jsx_runtime.jsx)undefined114178114252(0,jsx_runtime.jsx)undefined114385114461(0,jsx_runtime.jsxs)undefined114715114789(0,jsx_runtime.jsx)undefined115098115172(0,jsx_runtime.jsx)undefined115414115488(0,jsx_runtime.jsx)undefined115883115957(0,jsx_runtime.jsx)undefined116105116181(0,jsx_runtime.jsxs)undefined116447116521(0,jsx_runtime.jsx)undefined116651116725(0,jsx_runtime.jsx)undefined116839116913(0,jsx_runtime.jsx)undefined117585117659(0,jsx_runtime.jsx)undefined117780117854(0,jsx_runtime.jsx)undefined118259118333(0,jsx_runtime.jsx)undefined118445118519(0,jsx_runtime.jsx)undefined119199119275(0,jsx_runtime.jsxs)undefined119428119502(0,jsx_runtime.jsx)undefined119799119873(0,jsx_runtime.jsx)undefined120497120581(0,react.useState)undefined120619120703(0,react.useState)undefined121435121496api_client/* api */.FHundefined121819121893(0,jsx_runtime.jsx)undefined121998122074(0,jsx_runtime.jsxs)undefined122284122358(0,jsx_runtime.jsx)undefined122466122540(0,jsx_runtime.jsx)undefined122638122712(0,jsx_runtime.jsx)undefined123120123194(0,jsx_runtime.jsx)undefined123300123374(0,jsx_runtime.jsx)undefined123570123644(0,jsx_runtime.jsx)undefined123742123816(0,jsx_runtime.jsx)undefined124000124074(0,jsx_runtime.jsx)undefined124173124247(0,jsx_runtime.jsx)undefined124608124684(0,jsx_runtime.jsxs)undefined124813124887(0,jsx_runtime.jsx)undefined125125125199(0,jsx_runtime.jsx)undefined125680125764(0,react.useState)undefined125910125986(0,jsx_runtime.jsxs)undefined125988126067jsx_runtime.Fragmentundefined126118126194(0,jsx_runtime.jsxs)undefined126309126385(0,jsx_runtime.jsxs)undefined126474126548(0,jsx_runtime.jsx)undefined126689126763(0,jsx_runtime.jsx)undefined127033127107(0,jsx_runtime.jsx)undefined127217127291(0,jsx_runtime.jsx)undefined127590127664(0,jsx_runtime.jsx)undefined128152128228(0,jsx_runtime.jsxs)undefined128469128543(0,jsx_runtime.jsx)undefined128939129013(0,jsx_runtime.jsx)undefined129296129370(0,jsx_runtime.jsx)undefined129781129855(0,jsx_runtime.jsx)undefined130167130241(0,jsx_runtime.jsx)undefined130567130641(0,jsx_runtime.jsx)undefined131057131131(0,jsx_runtime.jsx)undefined131500131574(0,jsx_runtime.jsx)undefined131703131777(0,jsx_runtime.jsx)undefined132146132230(0,react.useState)undefined132271132355(0,react.useState)undefined132394132478(0,react.useState)undefined132504132594(0,react.useCallback)undefined132733132794api_client/* api */.FHundefined133077133163(0,react.useEffect)undefined133255133329(0,jsx_runtime.jsx)undefined133406133480(0,jsx_runtime.jsx)undefined133589133663(0,jsx_runtime.jsx)undefined133740133814(0,jsx_runtime.jsx)undefined133915133989(0,jsx_runtime.jsx)undefined134066134140(0,jsx_runtime.jsx)undefined134246134322(0,jsx_runtime.jsxs)undefined134324134403jsx_runtime.Fragmentundefined134454134530(0,jsx_runtime.jsxs)undefined134645134721(0,jsx_runtime.jsxs)undefined134810134884(0,jsx_runtime.jsx)undefined135022135096(0,jsx_runtime.jsx)undefined135341135415(0,jsx_runtime.jsx)undefined135525135599(0,jsx_runtime.jsx)undefined135879135953(0,jsx_runtime.jsx)undefined136045136121(0,jsx_runtime.jsxs)undefined136244136318(0,jsx_runtime.jsx)undefined136383136459(0,jsx_runtime.jsxs)undefined136563136637(0,jsx_runtime.jsx)undefined136794136868(0,jsx_runtime.jsx)undefined137027137101(0,jsx_runtime.jsx)undefined137260137334(0,jsx_runtime.jsx)undefined137492137566(0,jsx_runtime.jsx)undefined137806137880(0,jsx_runtime.jsx)undefined138062138138(0,jsx_runtime.jsxs)undefined138250138324(0,jsx_runtime.jsx)undefined138756138830(0,jsx_runtime.jsx)undefined138908138982(0,jsx_runtime.jsx)undefined139377139453(0,jsx_runtime.jsxs)undefined139857139933(0,jsx_runtime.jsxs)undefined140605140679(0,jsx_runtime.jsx)undefined141028141102(0,jsx_runtime.jsx)undefined142005142089(0,react.useState)undefined142144142228(0,react.useState)undefined142271142355(0,react.useState)undefined142461142522api_client/* api */.FHundefined142897142973(0,jsx_runtime.jsxs)undefined142975143054jsx_runtime.Fragmentundefined143105143181(0,jsx_runtime.jsxs)undefined143296143372(0,jsx_runtime.jsxs)undefined143461143535(0,jsx_runtime.jsx)undefined143676143752(0,jsx_runtime.jsxs)undefined144122144196(0,jsx_runtime.jsx)undefined144306144380(0,jsx_runtime.jsx)undefined144672144746(0,jsx_runtime.jsx)undefined144838144914(0,jsx_runtime.jsxs)undefined145037145111(0,jsx_runtime.jsx)undefined145176145252(0,jsx_runtime.jsxs)undefined145356145430(0,jsx_runtime.jsx)undefined145587145661(0,jsx_runtime.jsx)undefined145820145894(0,jsx_runtime.jsx)undefined146051146125(0,jsx_runtime.jsx)undefined146285146359(0,jsx_runtime.jsx)undefined146599146673(0,jsx_runtime.jsx)undefined146971147047(0,jsx_runtime.jsxs)undefined147349147425(0,jsx_runtime.jsxs)undefined147553147627(0,jsx_runtime.jsx)undefined147852147926(0,jsx_runtime.jsx)undefined148475148549(0,jsx_runtime.jsx)undefined149093149167(0,jsx_runtime.jsx)undefined149245149319(0,jsx_runtime.jsx)undefined149693149767(0,jsx_runtime.jsx)undefined150104150178(0,jsx_runtime.jsx)undefined150544150620(0,jsx_runtime.jsxs)undefined151014151088(0,jsx_runtime.jsx)undefined151642151716(0,jsx_runtime.jsx)undefined152699152773(0,jsx_runtime.jsx)undefined152866152940(0,jsx_runtime.jsx)undefined153097153171(0,jsx_runtime.jsx)undefined153492153566(0,jsx_runtime.jsx)undefined153714153790(0,jsx_runtime.jsxs)undefined154056154132(0,jsx_runtime.jsxs)undefined154411154485(0,jsx_runtime.jsx)undefined154847154923(0,jsx_runtime.jsxs)undefined155076155150(0,jsx_runtime.jsx)undefined155447155521(0,jsx_runtime.jsx)undefined156303156387(0,react.useState)undefined156425156509(0,react.useState)undefined157111157172api_client/* api */.FHundefined157475157549(0,jsx_runtime.jsx)undefined157654157730(0,jsx_runtime.jsxs)undefined157940158014(0,jsx_runtime.jsx)undefined158123158197(0,jsx_runtime.jsx)undefined158293158367(0,jsx_runtime.jsx)undefined158676158750(0,jsx_runtime.jsx)undefined158848158922(0,jsx_runtime.jsx)undefined159239159313(0,jsx_runtime.jsx)undefined159414159488(0,jsx_runtime.jsx)undefined160050160124(0,jsx_runtime.jsx)undefined160220160294(0,jsx_runtime.jsx)undefined160786160862(0,jsx_runtime.jsxs)undefined160991161065(0,jsx_runtime.jsx)undefined161303161377(0,jsx_runtime.jsx)undefined161844161928(0,react.useState)undefined161966162050(0,react.useState)undefined162354162415api_client/* api */.FHundefined162733162807(0,jsx_runtime.jsx)undefined162912162988(0,jsx_runtime.jsxs)undefined163198163272(0,jsx_runtime.jsx)undefined163376163450(0,jsx_runtime.jsx)undefined163546163620(0,jsx_runtime.jsx)undefined163929164003(0,jsx_runtime.jsx)undefined164104164178(0,jsx_runtime.jsx)undefined164740164814(0,jsx_runtime.jsx)undefined164916164990(0,jsx_runtime.jsx)undefined165547165623(0,jsx_runtime.jsxs)undefined165752165826(0,jsx_runtime.jsx)undefined166064166138(0,jsx_runtime.jsx)undefined166653166737(0,react.useState)undefined166792166876(0,react.useState)undefined166919167003(0,react.useState)undefined167109167170api_client/* api */.FHundefined167543167619(0,jsx_runtime.jsxs)undefined167738167814(0,jsx_runtime.jsxs)undefined168129168205(0,jsx_runtime.jsxs)undefined168509168583(0,jsx_runtime.jsx)undefined168846168920(0,jsx_runtime.jsx)undefined169229169305(0,jsx_runtime.jsxs)undefined169721169795(0,jsx_runtime.jsx)undefined170005170081(0,jsx_runtime.jsxs)undefined170228170302(0,jsx_runtime.jsx)undefined170375170451(0,jsx_runtime.jsxs)undefined170571170645(0,jsx_runtime.jsx)undefined170826170900(0,jsx_runtime.jsx)undefined171083171157(0,jsx_runtime.jsx)undefined171338171412(0,jsx_runtime.jsx)undefined171596171670(0,jsx_runtime.jsx)undefined171845171919(0,jsx_runtime.jsx)undefined172257172333(0,jsx_runtime.jsxs)undefined172675172751(0,jsx_runtime.jsxs)undefined172895172969(0,jsx_runtime.jsx)undefined173218173292(0,jsx_runtime.jsx)undefined173986174060(0,jsx_runtime.jsx)undefined174146174220(0,jsx_runtime.jsx)undefined174634174708(0,jsx_runtime.jsx)undefined175093175167(0,jsx_runtime.jsx)undefined175581175657(0,jsx_runtime.jsxs)undefined176099176173(0,jsx_runtime.jsx)undefined176995177069(0,jsx_runtime.jsx)undefined178199178273(0,jsx_runtime.jsx)undefined178382178456(0,jsx_runtime.jsx)undefined178606178680(0,jsx_runtime.jsx)undefined178791178865(0,jsx_runtime.jsx)undefined179163179237(0,jsx_runtime.jsx)undefined179385179461(0,jsx_runtime.jsxs)undefined179727179803(0,jsx_runtime.jsxs)undefined180082180156(0,jsx_runtime.jsx)undefined180518180594(0,jsx_runtime.jsxs)undefined180747180821(0,jsx_runtime.jsx)undefined181118181192(0,jsx_runtime.jsx)undefined181867181941(0,jsx_runtime.jsx)undefined182282182368(0,navigation.useRouter)undefined182398182496(0,navigation.useSearchParams)undefined182630182714(0,react.useState)undefined182759182843(0,react.useState)undefined182904182988(0,react.useState)undefined183068183152(0,react.useState)undefined183195183279(0,react.useState)undefined183318183402(0,react.useState)undefined183451183535(0,react.useState)undefined183599183683(0,react.useState)undefined183749183833(0,react.useState)undefined183885183969(0,react.useState)undefined184040184130(0,react.useCallback)undefined184194184284(0,react.useCallback)undefined184471184532api_client/* api */.FHundefined185192185253api_client/* api */.FHundefined185728185789api_client/* api */.FHundefined186591186652api_client/* api */.FHundefined186991187077(0,react.useEffect)undefined187423187507(0,react.useState)undefined187581187655(0,jsx_runtime.jsx)undefined187734187808(0,jsx_runtime.jsx)undefined187933188009(0,jsx_runtime.jsxs)undefined188100188174(0,jsx_runtime.jsx)undefined188298188372(0,jsx_runtime.jsx)undefined188455188531(0,jsx_runtime.jsxs)undefined188793188867(0,jsx_runtime.jsx)undefined189159189233(0,jsx_runtime.jsx)undefined189535189609(0,jsx_runtime.jsx)undefined190001190077(0,jsx_runtime.jsxs)undefined190079190158jsx_runtime.Fragmentundefined190209190285(0,jsx_runtime.jsxs)undefined190400190474(0,jsx_runtime.jsx)undefined190724190800(0,jsx_runtime.jsxs)undefined190897190973(0,jsx_runtime.jsxs)undefined191336191410(0,jsx_runtime.jsx)undefined192343192419(0,jsx_runtime.jsxs)undefined193008193082(0,jsx_runtime.jsx)undefined193720193794(0,jsx_runtime.jsx)undefined194203194277(0,jsx_runtime.jsx)undefined194822194898(0,jsx_runtime.jsxs)undefined195038195112(0,jsx_runtime.jsx)undefined195517195591(0,jsx_runtime.jsx)undefined196062196136(0,jsx_runtime.jsx)undefined196236196310(0,jsx_runtime.jsx)undefined196663196737(0,jsx_runtime.jsx)undefined196739196816ErrorBoundaryundefined196895196969(0,jsx_runtime.jsx)undefined197160197234(0,jsx_runtime.jsx)undefined197236197313ErrorBoundaryundefined197392197466(0,jsx_runtime.jsx)undefined197927198001(0,jsx_runtime.jsx)undefined198003198080ErrorBoundaryundefined198156198230(0,jsx_runtime.jsx)undefined198540198614(0,jsx_runtime.jsx)undefined198616198693ErrorBoundaryundefined198775198849(0,jsx_runtime.jsx)undefined199164199238(0,jsx_runtime.jsx)undefined199240199317ErrorBoundaryundefined199392199466(0,jsx_runtime.jsx)undefined199775199849(0,jsx_runtime.jsx)undefined199851199928ErrorBoundaryundefined200011200085(0,jsx_runtime.jsx)undefined200403200477(0,jsx_runtime.jsx)undefined200479200556ErrorBoundaryundefined200632200706(0,jsx_runtime.jsx)undefined200930201004(0,jsx_runtime.jsx)undefined201389201463(0,jsx_runtime.jsx)undefined202004202078(0,jsx_runtime.jsx)undefined /***/ }) К/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(5155); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(2115); // EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(63); // EXTERNAL MODULE: ./src/lib/api-client.js var api_client = __webpack_require__(6282); ;// ./src/components/ErrorBoundary.jsx /* __next_internal_client_entry_do_not_use__ default auto */ class ErrorBoundary extends react.Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "empty-state", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } ;// ./src/app/dashboard/page.jsx /* __next_internal_client_entry_do_not_use__ default auto */ const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = (0,react.useState)([]); const add = (0,react.useCallback)(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "search-wrap", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ (0,jsx_runtime.jsx)("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = (0,react.useMemo)(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "metric-card", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { children: p.label }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Risk" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Dimension *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Domain", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Probability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Impact", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Detectability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = (0,react.useState)(''); const [sortKey, setSortKey] = (0,react.useState)('normalizedScore'); const [sortDir, setSortDir] = (0,react.useState)('desc'); const [page, setPage] = (0,react.useState)(0); const [selectedRisk, setSelectedRisk] = (0,react.useState)(null); const [showCreate, setShowCreate] = (0,react.useState)(false); const [editing, setEditing] = (0,react.useState)(false); const [editForm, setEditForm] = (0,react.useState)({}); const [updating, setUpdating] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [deleting, setDeleting] = (0,react.useState)(false); const risks = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = (0,react.useMemo)(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api_client/* api */.FH.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api_client/* api */.FH.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: risk.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Dimension", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Domain", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Probability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Impact", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Detectability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Score" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Description" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.description ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api_client/* api */.FH.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Mitigation" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Risk *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Progress %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Due Date", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = (0,react.useState)(''); const [sortKey, setSortKey] = (0,react.useState)('progressPercent'); const [sortDir, setSortDir] = (0,react.useState)('asc'); const [showCreate, setShowCreate] = (0,react.useState)(false); const [selectedMitigation, setSelectedMitigation] = (0,react.useState)(null); const [editing, setEditing] = (0,react.useState)(false); const [editForm, setEditForm] = (0,react.useState)({}); const [updating, setUpdating] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [deleting, setDeleting] = (0,react.useState)(false); const mitigations = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = (0,react.useMemo)(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api_client/* api */.FH.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: m.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Progress %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Due Date", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = (0,react.useState)(false); const [showDecision, setShowDecision] = (0,react.useState)(false); const [decisionForm, setDecisionForm] = (0,react.useState)({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = (0,react.useState)(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api_client/* api */.FH.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api_client/* api */.FH.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Deployment Gate" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Criterion" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Required" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actual" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: c.name }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: c.required }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: c.actual }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Gate Decision" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Decision", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Reason", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Integration" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Provider", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Base URL", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Auth Mode", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = (0,react.useState)(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Integrations" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = (0,react.useState)([]); const [loading, setLoading] = (0,react.useState)(true); const [error, setError] = (0,react.useState)(null); const load = (0,react.useCallback)(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api_client/* api */.FH.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); (0,react.useEffect)(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Audit Log" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Date" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Action" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Entity" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actor" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Details" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [showNew, setShowNew] = (0,react.useState)(false); const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "All Projects" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Name" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Type" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Created" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Project Settings" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Subtitle", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Project" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Project Type", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [showNew, setShowNew] = (0,react.useState)(false); const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Name" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Type" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Created" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", {}) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No projects yet" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } function DashboardPage() { const router = (0,navigation.useRouter)(); const searchParams = (0,navigation.useSearchParams)(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = (0,react.useState)(null); const [projects, setProjects] = (0,react.useState)([]); const [selectedProjectId, setSelectedProjectId] = (0,react.useState)(searchParams.get('projectId') || null); const [dashboard, setDashboard] = (0,react.useState)(null); const [loading, setLoading] = (0,react.useState)(true); const [error, setError] = (0,react.useState)(null); const [retryCount, setRetryCount] = (0,react.useState)(0); const [showProjectSettings, setShowProjectSettings] = (0,react.useState)(false); const [showProjectManager, setShowProjectManager] = (0,react.useState)(false); const [workspaceId, setWorkspaceId] = (0,react.useState)(null); const { toasts, add } = useToast(); const onRefresh = (0,react.useCallback)(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = (0,react.useCallback)(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api_client/* api */.FH.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api_client/* api */.FH.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api_client/* api */.FH.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api_client/* api */.FH.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); (0,react.useEffect)(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = (0,react.useState)(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shell-loading", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "empty-state", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: error }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ (0,jsx_runtime.jsx)(ToastContainer, { toasts: toasts }) ] }); } /***/ })  `z// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(5155); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(2115); // EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(63); // EXTERNAL MODULE: ./src/lib/api-client.js var api_client = __webpack_require__(6282); ;// ./src/components/ErrorBoundary.jsx  ReplaceSource /* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Component } from 'react'; class ErrorBoundary extends Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsxs("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } export { ErrorBoundary as default }; Y61123undefined125158undefined188196__WEBPACK_MODULE_REFERENCE__1_5b22436f6d706f6e656e74225d_directImport_asiSafe1__._undefined527531__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined646649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined805809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10891092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined14051408__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22802315undefined91172react.Componentundefined503579(0,jsx_runtime.jsxs)undefined694768(0,jsx_runtime.jsx)undefined9241000(0,jsx_runtime.jsxs)undefined12801354(0,jsx_runtime.jsx)undefined16671741(0,jsx_runtime.jsx)undefinedRawSource" ;// ./src/app/dashboard/page.jsx vn/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback, useMemo } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { api } from '../../lib/api-client'; import ErrorBoundary from '../../components/ErrorBoundary'; const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = useState([]); const add = useCallback(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ _jsx("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ _jsx("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ _jsxs("div", { className: "search-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ _jsx("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ _jsx("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ _jsxs("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ _jsx("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ _jsx("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ _jsxs("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ _jsx("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ _jsx("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = useMemo(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ _jsxs("div", { className: "metric-card", children: [ /*#__PURE__*/ _jsx("h3", { children: p.label }), /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ _jsx("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ _jsx("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ _jsxs("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Risk" }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('normalizedScore'); const [sortDir, setSortDir] = useState('desc'); const [page, setPage] = useState(0); const [selectedRisk, setSelectedRisk] = useState(null); const [showCreate, setShowCreate] = useState(false); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = useMemo(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ _jsx("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ _jsx("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ _jsxs("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ _jsx(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Score" }), /*#__PURE__*/ _jsx("br", {}), /*#__PURE__*/ _jsx("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Description" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.description ] }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ _jsx("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Mitigation" }), /*#__PURE__*/ _jsx(FormField, { label: "Risk *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('progressPercent'); const [sortDir, setSortDir] = useState('asc'); const [showCreate, setShowCreate] = useState(false); const [selectedMitigation, setSelectedMitigation] = useState(null); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const mitigations = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = useMemo(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = useMemo(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: m.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ _jsx("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ _jsxs("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ _jsx(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = useState(false); const [showDecision, setShowDecision] = useState(false); const [decisionForm, setDecisionForm] = useState({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = useState(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Deployment Gate" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Criterion" }), /*#__PURE__*/ _jsx("th", { children: "Required" }), /*#__PURE__*/ _jsx("th", { children: "Actual" }), /*#__PURE__*/ _jsx("th", { children: "Status" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: c.name }) }), /*#__PURE__*/ _jsx("td", { children: c.required }), /*#__PURE__*/ _jsx("td", { children: c.actual }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Gate Decision" }), /*#__PURE__*/ _jsx(FormField, { label: "Decision", children: /*#__PURE__*/ _jsx(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reason", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Integration" }), /*#__PURE__*/ _jsx(FormField, { label: "Provider", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Base URL", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Auth Mode", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = useState(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ _jsxs("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ _jsx("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ _jsx("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ _jsx(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ _jsx("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ _jsx("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const load = useCallback(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); useEffect(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Audit Log" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Date" }), /*#__PURE__*/ _jsx("th", { children: "Action" }), /*#__PURE__*/ _jsx("th", { children: "Entity" }), /*#__PURE__*/ _jsx("th", { children: "Actor" }), /*#__PURE__*/ _jsx("th", { children: "Details" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ _jsxs("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ _jsxs("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "All Projects" }), /*#__PURE__*/ _jsxs("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ _jsx("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Project Settings" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Subtitle", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Project" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Project Type", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", {}) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet" }) }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } export default function DashboardPage() { const router = useRouter(); const searchParams = useSearchParams(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = useState(null); const [projects, setProjects] = useState([]); const [selectedProjectId, setSelectedProjectId] = useState(searchParams.get('projectId') || null); const [dashboard, setDashboard] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [retryCount, setRetryCount] = useState(0); const [showProjectSettings, setShowProjectSettings] = useState(false); const [showProjectManager, setShowProjectManager] = useState(false); const [workspaceId, setWorkspaceId] = useState(null); const { toasts, add } = useToast(); const onRefresh = useCallback(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = useCallback(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = useState(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ _jsx("div", { className: "shell-loading", children: /*#__PURE__*/ _jsx("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsx("p", { children: error }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ _jsx("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ _jsxs("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "dash-actions", children: [ /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ _jsx("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ _jsx("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ _jsx(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ _jsx(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ _jsx(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ _jsx(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ _jsx(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ _jsx(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ _jsx(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ _jsx(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ _jsx(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ _jsx(ToastContainer, { toasts: toasts }) ] }); } 61146undefined148213undefined215275undefined277319undefined321379undefined970977__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10001010__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined16221625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17221725__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19611965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined20562059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21852188__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined28972900__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30923096__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined32103213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36463649__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40424046__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined42594262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined45544557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48124815__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined49214925__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined51355139__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53475350__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56005604__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57335736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined59755978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65846590__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined1054110544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1062110624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1072710731__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1073310741__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1079210795__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1102111025__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1116411167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1130111304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1151311516__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1176411768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1200612010__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1214312146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1232512329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1258312587__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1302613029__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1341113414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1388013883__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1402914032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1473014734__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1486714870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1504915053__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1530715311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1575015753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1613716141__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1686016863__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1700917012__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1788517892__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1793017937__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined1862018622__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined1892818931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1903619040__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1925019253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1935419357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1945419457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1963719640__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1974119744__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2018320187__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2044820451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2056820571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2085320856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2096820971__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2122621229__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2133421337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2158721591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2185621859__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2197621979__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2234122344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2245622459__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2281122814__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2293322936__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2333523338__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2343323436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2363823642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2377123774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2401224015__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2447424481__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2452224529__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2458524592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2463124638__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2468824695__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2474424751__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2479524802__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2484824855__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2489824905__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2496024967__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2501225019__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined2504725053__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2531425320__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined2689626898__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2744927451__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2785827860__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined2823828241__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2831828321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2840928413__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2841528423__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2847428478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2869728700__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2894128944__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2919729200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2929229296__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2941929422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2948729490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3113431138__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3173031733__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3193431938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3211732120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3260132604__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3268232685__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3291332916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3299432997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3340133404__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3374733750__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3382833831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3406934072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3415034153__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3465834661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3473934742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515235155__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3523335236__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3575135754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592435928__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3632136324__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3641736420__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3656336566__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3690036903__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3705037054__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3732037324__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3765637659__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795037953__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3832438328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3833038338__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3842938433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3868438687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3883238835__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3934639349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3949839501__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4040740411__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4084040843__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4100641009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4167041673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4183341836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4249442497__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4265042653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4325843262__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4369543698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4386343866__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4466344666__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4482644829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4561645619__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4578645789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4667146674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4681746820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4741847422__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4759947602__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4793847941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4836748370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4910349107__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4910949117__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4920849212__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4969549699__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4982849831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5010350106__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5033450338__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5046750470__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5073850741__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5097450978__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5110751110__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5138451387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5161751621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5175051753__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5202252025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5225052254__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5238352386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5266252665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5289752901__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5303053033__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5330153304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5337953382__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368253686__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5381553818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5408954092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5432454328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5445754460__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5472854731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5506655070__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5537555378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5562055623__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5582155825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5607656079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5648556488__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5693856941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5756657569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5770457707__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5816358166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5851758524__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5856258569__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5956159563__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined5988559888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5999359997__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6020760210__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6031760320__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6041660419__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6078660789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6088660889__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6106961072__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6117361176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6161561618__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6171461717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6195461958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6221962222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6233862341__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6271162714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6283562838__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6325163254__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6335263355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6357763580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6367563678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6388063884__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6401364016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6425464257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6472864735__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6477664783__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6483964846__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6489664903__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6496964976__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6501965026__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6507265079__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6512265129__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6518465191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6523665243__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined6527765283__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6554765553__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6575265758__WEBPACK_MODULE_REFERENCE__1_5b227573654d656d6f225d_call_directImport_asiSafe1__._undefined6754767549__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6797667978__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined6837468377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6845468457__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6854568549__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6855168559__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6861068614__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6883368836__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6905669059__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6931869321__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6941369417__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6954069543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6960869611__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7089170895__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7148771490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7167471678__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7199671999__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7207772080__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7230572308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7238672389__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7268472687__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7276572768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7316373166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7324473248__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7369573698__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7413474137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7510775111__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7545075453__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7553175534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7602976032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7612576128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7626576268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7664476647__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7680076804__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7707077073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7735277356__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7756777570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7769977702__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7814978152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7828578288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7908279085__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7921379216__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7973679740__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8011380116__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8026480267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8098480987__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8114081143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8193581938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8206882071__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8257682579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8270682709__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8322783231__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8338483387__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8368983692__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8407084073__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8475184754__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8516785174__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8522885235__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8528985296__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8543185438__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined8623786239__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8677486776__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined8715987162__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8723987242__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8733087334__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8733687344__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined8739587399__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8751487518__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8760787610__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8775487757__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8802188024__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8813488137__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8849288495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8858788591__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8871488717__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8878288786__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8889088893__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8905589058__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8921989222__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8938189384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8962389626__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8979789801__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined8991389916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined8999489997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9022190224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9039790400__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9057190574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9065290655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9121791220__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9131391316__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9144991453__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9170791710__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9201992022__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9226492267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9266292665__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9281392817__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9308393086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9321693219__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9333393336__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9400894011__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9413294135__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9454094543__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9465594658__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9533895342__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9549595498__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9579595798__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9642296429__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9646796474__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined9720697208__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined9753197534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9763997643__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9785397856__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9796497967__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9806598068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9847698479__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9858598588__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9878498787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9888598888__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9907299075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9917499177__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9953899542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined9967199674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined9991299915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100396100403__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined100549100553__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100555100563__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined100614100618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100733100737__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined100826100829__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined100970100973__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101243101246__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101356101359__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined101658101661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102149102153__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined102394102397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined102793102796__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103079103082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103493103496__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined103808103811__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104137104140__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104556104559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined104928104931__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105060105063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined105432105439__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105480105487__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105526105533__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined105559105569__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined105708105710__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined105993106001__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined106093106096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106173106176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106285106288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106365106368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106469106472__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106549106552__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined106658106662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106664106672__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined106723106727__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106842106846__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined106935106938__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107076107079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107324107327__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107437107440__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107720107723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined107815107819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined107942107945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108010108014__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined108118108121__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108278108281__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108440108443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108602108605__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined108763108766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109006109009__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109191109195__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined109307109310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109742109745__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined109823109826__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined110221110225__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined110629110633__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined111305111308__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined111657111660__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined112563112570__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112625112632__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112675112682__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined112788112790__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined113165113169__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113171113179__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined113230113234__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113349113353__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113442113445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined113586113590__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined113960113963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114073114076__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114368114371__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114463114467__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114590114593__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114658114662__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined114766114769__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined114926114929__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115088115091__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115248115251__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115411115414__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115654115657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined115955115959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116261116265__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined116393116396__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined116621116624__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117173117176__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117720117723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined117801117804__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118178118181__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118518118521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined118887118891__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined119285119288__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined119842119845__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120828120831__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined120924120927__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121084121087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121408121411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined121559121563__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined121829121833__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122112122115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122477122481__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined122634122637__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined122934122937__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined123719123726__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined123764123771__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined124373124375__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined124678124681__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined124786124790__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined125000125003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125112125115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125211125214__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125523125526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125624125627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined125944125947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126048126051__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126613126616__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined126712126715__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127207127211__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined127340127343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined127581127584__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128051128058__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128096128103__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined128407128409__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined128727128730__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined128835128839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined129049129052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129156129159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129255129258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129567129570__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined129671129674__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130236130239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130341130344__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined130901130905__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined131034131037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131275131278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined131793131800__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131855131862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined131905131912__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined132018132020__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined132393132397__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132516132520__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined132835132839__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined133143133146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133409133412__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined133721133725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134141134144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134354134358__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134505134508__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134581134585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined134705134708__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined134889134892__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135075135078__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135259135262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135446135449__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135624135627__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined135965135969__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136311136315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined136459136462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined136711136714__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137408137411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137497137500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined137914137917__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138302138305__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined138719138723__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined139165139168__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined139990139993__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141123141126__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141235141238__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141388141391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141502141505__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141803141806__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined141954141958__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142224142228__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined142507142510__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined142872142876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined143029143032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined143329143332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144007144010__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined144305144319undefined144366144374__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined144404144418__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined144552144559__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144604144611__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144672144679__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144759144766__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144809144816__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144855144862__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144911144918__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined144982144989__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145055145062__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145114145121__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined145192145202__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145266145276__WEBPACK_MODULE_REFERENCE__1_5b2275736543616c6c6261636b225d_call_directImport_asiSafe1__._undefined145463145465__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146125146127__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined146602146604__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147406147408__WEBPACK_MODULE_REFERENCE__3_5b22617069225d_call_asiSafe1__._undefined147747147755__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined148101148108__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined148182148185__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148264148267__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148392148396__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148487148490__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148614148617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined148700148704__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined148966148969__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149261149264__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149566149569__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined149961149965__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined149967149975__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined150026150030__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150145150148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined150398150402__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150499150503__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined150866150869__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined151802151806__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined152395152398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153036153039__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153448153451__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined153996154000__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined154140154143__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined154548154551__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155022155025__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155125155128__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155481155484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155486155498__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155577155580__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155771155774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined155776155788__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined155867155870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156331156334__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156336156348__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156424156427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156737156740__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined156742156754__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined156836156839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157154157157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157159157171__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157246157249__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157558157561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157563157575__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined157658157661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157979157982__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined157984157996__WEBPACK_MODULE_REFERENCE__4_5b2264656661756c74225d_directImport_asiSafe1__._undefined158072158075__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158299158302__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined158687158690__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined159231159234__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefinedc\655739(0,react.useState)undefined762852(0,react.useCallback)undefined14641538(0,jsx_runtime.jsx)undefined16351709(0,jsx_runtime.jsx)undefined19452021(0,jsx_runtime.jsxs)undefined21122186(0,jsx_runtime.jsx)undefined23122386(0,jsx_runtime.jsx)undefined30953169(0,jsx_runtime.jsx)undefined33613437(0,jsx_runtime.jsxs)undefined35513625(0,jsx_runtime.jsx)undefined40584132(0,jsx_runtime.jsx)undefined45254601(0,jsx_runtime.jsxs)undefined48144888(0,jsx_runtime.jsx)undefined51805254(0,jsx_runtime.jsx)undefined55095583(0,jsx_runtime.jsx)undefined56895765(0,jsx_runtime.jsxs)undefined59756051(0,jsx_runtime.jsxs)undefined62596333(0,jsx_runtime.jsx)undefined65836659(0,jsx_runtime.jsxs)undefined67886862(0,jsx_runtime.jsx)undefined71017175(0,jsx_runtime.jsx)undefined77817863(0,react.useMemo)undefined1181411888(0,jsx_runtime.jsx)undefined1196512039(0,jsx_runtime.jsx)undefined1214212218(0,jsx_runtime.jsxs)undefined1222012299jsx_runtime.Fragmentundefined1235012424(0,jsx_runtime.jsx)undefined1265012726(0,jsx_runtime.jsxs)undefined1286512939(0,jsx_runtime.jsx)undefined1307313147(0,jsx_runtime.jsx)undefined1335613430(0,jsx_runtime.jsx)undefined1367813754(0,jsx_runtime.jsxs)undefined1399214068(0,jsx_runtime.jsxs)undefined1420114275(0,jsx_runtime.jsx)undefined1445414530(0,jsx_runtime.jsxs)undefined1478414860(0,jsx_runtime.jsxs)undefined1529915373(0,jsx_runtime.jsx)undefined1575515829(0,jsx_runtime.jsx)undefined1629516369(0,jsx_runtime.jsx)undefined1651516589(0,jsx_runtime.jsx)undefined1728717363(0,jsx_runtime.jsxs)undefined1749617570(0,jsx_runtime.jsx)undefined1774917825(0,jsx_runtime.jsxs)undefined1807918155(0,jsx_runtime.jsxs)undefined1859418668(0,jsx_runtime.jsx)undefined1905219128(0,jsx_runtime.jsxs)undefined1984719921(0,jsx_runtime.jsx)undefined2006720141(0,jsx_runtime.jsx)undefined2101421098(0,react.useState)undefined2113621220(0,react.useState)undefined2190321964api_client/* api */.FHundefined2227022344(0,jsx_runtime.jsx)undefined2244922525(0,jsx_runtime.jsxs)undefined2273522809(0,jsx_runtime.jsx)undefined2291022984(0,jsx_runtime.jsx)undefined2308123155(0,jsx_runtime.jsx)undefined2333523409(0,jsx_runtime.jsx)undefined2351023584(0,jsx_runtime.jsx)undefined2402324099(0,jsx_runtime.jsxs)undefined2436024434(0,jsx_runtime.jsx)undefined2455124625(0,jsx_runtime.jsx)undefined2490724981(0,jsx_runtime.jsx)undefined2509325167(0,jsx_runtime.jsx)undefined2542225496(0,jsx_runtime.jsx)undefined2560125675(0,jsx_runtime.jsx)undefined2592526001(0,jsx_runtime.jsxs)undefined2626626340(0,jsx_runtime.jsx)undefined2645726531(0,jsx_runtime.jsx)undefined2689326967(0,jsx_runtime.jsx)undefined2707927153(0,jsx_runtime.jsx)undefined2750527579(0,jsx_runtime.jsx)undefined2769827772(0,jsx_runtime.jsx)undefined2817128245(0,jsx_runtime.jsx)undefined2834028414(0,jsx_runtime.jsx)undefined2861628692(0,jsx_runtime.jsxs)undefined2882128895(0,jsx_runtime.jsx)undefined2913329207(0,jsx_runtime.jsx)undefined2966629750(0,react.useState)undefined2979129875(0,react.useState)undefined2993130015(0,react.useState)undefined3005430138(0,react.useState)undefined3018830272(0,react.useState)undefined3032130405(0,react.useState)undefined3044930533(0,react.useState)undefined3057930663(0,react.useState)undefined3070630790(0,react.useState)undefined3084530929(0,react.useState)undefined3097431058(0,react.useState)undefined3108631168(0,react.useMemo)undefined3142931511(0,react.useMemo)undefined3308733148api_client/* api */.FHundefined3369933760api_client/* api */.FHundefined3416734228api_client/* api */.FHundefined3460634680(0,jsx_runtime.jsx)undefined3475734831(0,jsx_runtime.jsx)undefined3491934995(0,jsx_runtime.jsxs)undefined3499735076jsx_runtime.Fragmentundefined3512735203(0,jsx_runtime.jsxs)undefined3542235496(0,jsx_runtime.jsx)undefined3573735811(0,jsx_runtime.jsx)undefined3606436138(0,jsx_runtime.jsx)undefined3623036306(0,jsx_runtime.jsxs)undefined3642936503(0,jsx_runtime.jsx)undefined3656836642(0,jsx_runtime.jsx)undefined3828638362(0,jsx_runtime.jsxs)undefined3895439028(0,jsx_runtime.jsx)undefined3922939305(0,jsx_runtime.jsxs)undefined3948439558(0,jsx_runtime.jsx)undefined4003940113(0,jsx_runtime.jsx)undefined4019140265(0,jsx_runtime.jsx)undefined4049340567(0,jsx_runtime.jsx)undefined4064540719(0,jsx_runtime.jsx)undefined4112341197(0,jsx_runtime.jsx)undefined4154041614(0,jsx_runtime.jsx)undefined4169241766(0,jsx_runtime.jsx)undefined4200442078(0,jsx_runtime.jsx)undefined4215642230(0,jsx_runtime.jsx)undefined4273542809(0,jsx_runtime.jsx)undefined4288742961(0,jsx_runtime.jsx)undefined4337143445(0,jsx_runtime.jsx)undefined4352343597(0,jsx_runtime.jsx)undefined4411244186(0,jsx_runtime.jsx)undefined4435644432(0,jsx_runtime.jsxs)undefined4482544899(0,jsx_runtime.jsx)undefined4499245066(0,jsx_runtime.jsx)undefined4520945283(0,jsx_runtime.jsx)undefined4561745691(0,jsx_runtime.jsx)undefined4583845914(0,jsx_runtime.jsxs)undefined4618046256(0,jsx_runtime.jsxs)undefined4658846662(0,jsx_runtime.jsx)undefined4695347027(0,jsx_runtime.jsx)undefined4739847474(0,jsx_runtime.jsxs)undefined4747647555jsx_runtime.Fragmentundefined4764647722(0,jsx_runtime.jsxs)undefined4797348047(0,jsx_runtime.jsx)undefined4819248266(0,jsx_runtime.jsx)undefined4877748851(0,jsx_runtime.jsx)undefined4900049074(0,jsx_runtime.jsx)undefined4998050056(0,jsx_runtime.jsxs)undefined5048550559(0,jsx_runtime.jsx)undefined5072250796(0,jsx_runtime.jsx)undefined5145751531(0,jsx_runtime.jsx)undefined5169151765(0,jsx_runtime.jsx)undefined5242352497(0,jsx_runtime.jsx)undefined5265052724(0,jsx_runtime.jsx)undefined5332953405(0,jsx_runtime.jsxs)undefined5383853912(0,jsx_runtime.jsx)undefined5407754151(0,jsx_runtime.jsx)undefined5494855022(0,jsx_runtime.jsx)undefined5518255256(0,jsx_runtime.jsx)undefined5604356117(0,jsx_runtime.jsx)undefined5628456358(0,jsx_runtime.jsx)undefined5724057314(0,jsx_runtime.jsx)undefined5745757531(0,jsx_runtime.jsx)undefined5812958205(0,jsx_runtime.jsxs)undefined5838258456(0,jsx_runtime.jsx)undefined5879258866(0,jsx_runtime.jsx)undefined5929259366(0,jsx_runtime.jsx)undefined6009960175(0,jsx_runtime.jsxs)undefined6017760256jsx_runtime.Fragmentundefined6034760423(0,jsx_runtime.jsxs)undefined6090660982(0,jsx_runtime.jsxs)undefined6111161185(0,jsx_runtime.jsx)undefined6145761531(0,jsx_runtime.jsx)undefined6175961835(0,jsx_runtime.jsxs)undefined6196462038(0,jsx_runtime.jsx)undefined6230662380(0,jsx_runtime.jsx)undefined6261362689(0,jsx_runtime.jsxs)undefined6281862892(0,jsx_runtime.jsx)undefined6316663240(0,jsx_runtime.jsx)undefined6347063546(0,jsx_runtime.jsxs)undefined6367563749(0,jsx_runtime.jsx)undefined6401864092(0,jsx_runtime.jsx)undefined6431764393(0,jsx_runtime.jsxs)undefined6452264596(0,jsx_runtime.jsx)undefined6487264946(0,jsx_runtime.jsx)undefined6517865254(0,jsx_runtime.jsxs)undefined6538365457(0,jsx_runtime.jsx)undefined6572565799(0,jsx_runtime.jsx)undefined6587465948(0,jsx_runtime.jsx)undefined6624866324(0,jsx_runtime.jsxs)undefined6645366527(0,jsx_runtime.jsx)undefined6679866872(0,jsx_runtime.jsx)undefined6710467180(0,jsx_runtime.jsxs)undefined6730967383(0,jsx_runtime.jsx)undefined6765167725(0,jsx_runtime.jsx)undefined6806068136(0,jsx_runtime.jsxs)undefined6844168515(0,jsx_runtime.jsx)undefined6875768831(0,jsx_runtime.jsx)undefined6902969105(0,jsx_runtime.jsxs)undefined6935669430(0,jsx_runtime.jsx)undefined6983669910(0,jsx_runtime.jsx)undefined7036070434(0,jsx_runtime.jsx)undefined7105971133(0,jsx_runtime.jsx)undefined7126871342(0,jsx_runtime.jsx)undefined7179871872(0,jsx_runtime.jsx)undefined7222372307(0,react.useState)undefined7234572429(0,react.useState)undefined7342173482api_client/* api */.FHundefined7380473878(0,jsx_runtime.jsx)undefined7398374059(0,jsx_runtime.jsxs)undefined7426974343(0,jsx_runtime.jsx)undefined7445074524(0,jsx_runtime.jsx)undefined7462074694(0,jsx_runtime.jsx)undefined7506175135(0,jsx_runtime.jsx)undefined7523275306(0,jsx_runtime.jsx)undefined7548675560(0,jsx_runtime.jsx)undefined7566175735(0,jsx_runtime.jsx)undefined7617476248(0,jsx_runtime.jsx)undefined7634476418(0,jsx_runtime.jsx)undefined7665576731(0,jsx_runtime.jsxs)undefined7699277066(0,jsx_runtime.jsx)undefined7718277256(0,jsx_runtime.jsx)undefined7762677700(0,jsx_runtime.jsx)undefined7782177895(0,jsx_runtime.jsx)undefined7830878382(0,jsx_runtime.jsx)undefined7848078554(0,jsx_runtime.jsx)undefined7877678850(0,jsx_runtime.jsx)undefined7894579019(0,jsx_runtime.jsx)undefined7922179297(0,jsx_runtime.jsxs)undefined7942679500(0,jsx_runtime.jsx)undefined7973879812(0,jsx_runtime.jsx)undefined8028380367(0,react.useState)undefined8040880492(0,react.useState)undefined8054880632(0,react.useState)undefined8068280766(0,react.useState)undefined8083280916(0,react.useState)undefined8095981043(0,react.useState)undefined8108981173(0,react.useState)undefined8121681300(0,react.useState)undefined8135581439(0,react.useState)undefined8148481568(0,react.useState)undefined8160281684(0,react.useMemo)undefined8194882030(0,react.useMemo)undefined8222982311(0,react.useMemo)undefined8410084161api_client/* api */.FHundefined8458884649api_client/* api */.FHundefined8504585119(0,jsx_runtime.jsx)undefined8519685270(0,jsx_runtime.jsx)undefined8535885434(0,jsx_runtime.jsxs)undefined8543685515jsx_runtime.Fragmentundefined8556685642(0,jsx_runtime.jsxs)undefined8586185935(0,jsx_runtime.jsx)undefined8615586229(0,jsx_runtime.jsx)undefined8648886562(0,jsx_runtime.jsx)undefined8665486730(0,jsx_runtime.jsxs)undefined8685386927(0,jsx_runtime.jsx)undefined8699287066(0,jsx_runtime.jsx)undefined8834688422(0,jsx_runtime.jsxs)undefined8901489088(0,jsx_runtime.jsx)undefined8927289348(0,jsx_runtime.jsxs)undefined8966689740(0,jsx_runtime.jsx)undefined8981889892(0,jsx_runtime.jsx)undefined9011790191(0,jsx_runtime.jsx)undefined9026990343(0,jsx_runtime.jsx)undefined9063890712(0,jsx_runtime.jsx)undefined9079090864(0,jsx_runtime.jsx)undefined9125991333(0,jsx_runtime.jsx)undefined9141191487(0,jsx_runtime.jsxs)undefined9193492008(0,jsx_runtime.jsx)undefined9244492518(0,jsx_runtime.jsx)undefined9348893564(0,jsx_runtime.jsxs)undefined9390393977(0,jsx_runtime.jsx)undefined9405594129(0,jsx_runtime.jsx)undefined9462494698(0,jsx_runtime.jsx)undefined9479194865(0,jsx_runtime.jsx)undefined9500295076(0,jsx_runtime.jsx)undefined9545295526(0,jsx_runtime.jsx)undefined9567995755(0,jsx_runtime.jsxs)undefined9602196095(0,jsx_runtime.jsx)undefined9637496450(0,jsx_runtime.jsxs)undefined9666196735(0,jsx_runtime.jsx)undefined9686496938(0,jsx_runtime.jsx)undefined9738597459(0,jsx_runtime.jsx)undefined9759297666(0,jsx_runtime.jsx)undefined9846098534(0,jsx_runtime.jsx)undefined9866298736(0,jsx_runtime.jsx)undefined9925699332(0,jsx_runtime.jsxs)undefined9970599779(0,jsx_runtime.jsx)undefined99927100001(0,jsx_runtime.jsx)undefined100718100792(0,jsx_runtime.jsx)undefined100945101019(0,jsx_runtime.jsx)undefined101811101885(0,jsx_runtime.jsx)undefined102015102089(0,jsx_runtime.jsx)undefined102594102668(0,jsx_runtime.jsx)undefined102795102869(0,jsx_runtime.jsx)undefined103387103463(0,jsx_runtime.jsxs)undefined103616103690(0,jsx_runtime.jsx)undefined103992104066(0,jsx_runtime.jsx)undefined104444104518(0,jsx_runtime.jsx)undefined105196105270(0,jsx_runtime.jsx)undefined105683105767(0,react.useState)undefined105821105905(0,react.useState)undefined105959106043(0,react.useState)undefined106178106262(0,react.useState)undefined107061107122api_client/* api */.FHundefined107657107718api_client/* api */.FHundefined108101108175(0,jsx_runtime.jsx)undefined108252108326(0,jsx_runtime.jsx)undefined108414108490(0,jsx_runtime.jsxs)undefined108492108571jsx_runtime.Fragmentundefined108622108698(0,jsx_runtime.jsxs)undefined108813108889(0,jsx_runtime.jsxs)undefined108978109052(0,jsx_runtime.jsx)undefined109196109270(0,jsx_runtime.jsx)undefined109534109608(0,jsx_runtime.jsx)undefined109718109792(0,jsx_runtime.jsx)undefined110147110221(0,jsx_runtime.jsx)undefined110313110389(0,jsx_runtime.jsxs)undefined110512110586(0,jsx_runtime.jsx)undefined110651110727(0,jsx_runtime.jsxs)undefined110831110905(0,jsx_runtime.jsx)undefined111067111141(0,jsx_runtime.jsx)undefined111302111376(0,jsx_runtime.jsx)undefined111535111609(0,jsx_runtime.jsx)undefined111848111922(0,jsx_runtime.jsx)undefined112093112169(0,jsx_runtime.jsxs)undefined112281112355(0,jsx_runtime.jsx)undefined112433112507(0,jsx_runtime.jsx)undefined112731112805(0,jsx_runtime.jsx)undefined112978113052(0,jsx_runtime.jsx)undefined113223113297(0,jsx_runtime.jsx)undefined113375113449(0,jsx_runtime.jsx)undefined114011114085(0,jsx_runtime.jsx)undefined114178114252(0,jsx_runtime.jsx)undefined114385114461(0,jsx_runtime.jsxs)undefined114715114789(0,jsx_runtime.jsx)undefined115098115172(0,jsx_runtime.jsx)undefined115414115488(0,jsx_runtime.jsx)undefined115883115957(0,jsx_runtime.jsx)undefined116105116181(0,jsx_runtime.jsxs)undefined116447116521(0,jsx_runtime.jsx)undefined116651116725(0,jsx_runtime.jsx)undefined116839116913(0,jsx_runtime.jsx)undefined117585117659(0,jsx_runtime.jsx)undefined117780117854(0,jsx_runtime.jsx)undefined118259118333(0,jsx_runtime.jsx)undefined118445118519(0,jsx_runtime.jsx)undefined119199119275(0,jsx_runtime.jsxs)undefined119428119502(0,jsx_runtime.jsx)undefined119799119873(0,jsx_runtime.jsx)undefined120497120581(0,react.useState)undefined120619120703(0,react.useState)undefined121435121496api_client/* api */.FHundefined121819121893(0,jsx_runtime.jsx)undefined121998122074(0,jsx_runtime.jsxs)undefined122284122358(0,jsx_runtime.jsx)undefined122466122540(0,jsx_runtime.jsx)undefined122638122712(0,jsx_runtime.jsx)undefined123120123194(0,jsx_runtime.jsx)undefined123300123374(0,jsx_runtime.jsx)undefined123570123644(0,jsx_runtime.jsx)undefined123742123816(0,jsx_runtime.jsx)undefined124000124074(0,jsx_runtime.jsx)undefined124173124247(0,jsx_runtime.jsx)undefined124608124684(0,jsx_runtime.jsxs)undefined124813124887(0,jsx_runtime.jsx)undefined125125125199(0,jsx_runtime.jsx)undefined125680125764(0,react.useState)undefined125910125986(0,jsx_runtime.jsxs)undefined125988126067jsx_runtime.Fragmentundefined126118126194(0,jsx_runtime.jsxs)undefined126309126385(0,jsx_runtime.jsxs)undefined126474126548(0,jsx_runtime.jsx)undefined126689126763(0,jsx_runtime.jsx)undefined127033127107(0,jsx_runtime.jsx)undefined127217127291(0,jsx_runtime.jsx)undefined127590127664(0,jsx_runtime.jsx)undefined128152128228(0,jsx_runtime.jsxs)undefined128469128543(0,jsx_runtime.jsx)undefined128939129013(0,jsx_runtime.jsx)undefined129296129370(0,jsx_runtime.jsx)undefined129781129855(0,jsx_runtime.jsx)undefined130167130241(0,jsx_runtime.jsx)undefined130567130641(0,jsx_runtime.jsx)undefined131057131131(0,jsx_runtime.jsx)undefined131500131574(0,jsx_runtime.jsx)undefined131703131777(0,jsx_runtime.jsx)undefined132146132230(0,react.useState)undefined132271132355(0,react.useState)undefined132394132478(0,react.useState)undefined132504132594(0,react.useCallback)undefined132733132794api_client/* api */.FHundefined133077133163(0,react.useEffect)undefined133255133329(0,jsx_runtime.jsx)undefined133406133480(0,jsx_runtime.jsx)undefined133589133663(0,jsx_runtime.jsx)undefined133740133814(0,jsx_runtime.jsx)undefined133915133989(0,jsx_runtime.jsx)undefined134066134140(0,jsx_runtime.jsx)undefined134246134322(0,jsx_runtime.jsxs)undefined134324134403jsx_runtime.Fragmentundefined134454134530(0,jsx_runtime.jsxs)undefined134645134721(0,jsx_runtime.jsxs)undefined134810134884(0,jsx_runtime.jsx)undefined135022135096(0,jsx_runtime.jsx)undefined135341135415(0,jsx_runtime.jsx)undefined135525135599(0,jsx_runtime.jsx)undefined135879135953(0,jsx_runtime.jsx)undefined136045136121(0,jsx_runtime.jsxs)undefined136244136318(0,jsx_runtime.jsx)undefined136383136459(0,jsx_runtime.jsxs)undefined136563136637(0,jsx_runtime.jsx)undefined136794136868(0,jsx_runtime.jsx)undefined137027137101(0,jsx_runtime.jsx)undefined137260137334(0,jsx_runtime.jsx)undefined137492137566(0,jsx_runtime.jsx)undefined137806137880(0,jsx_runtime.jsx)undefined138062138138(0,jsx_runtime.jsxs)undefined138250138324(0,jsx_runtime.jsx)undefined138756138830(0,jsx_runtime.jsx)undefined138908138982(0,jsx_runtime.jsx)undefined139377139453(0,jsx_runtime.jsxs)undefined139857139933(0,jsx_runtime.jsxs)undefined140605140679(0,jsx_runtime.jsx)undefined141028141102(0,jsx_runtime.jsx)undefined142005142089(0,react.useState)undefined142144142228(0,react.useState)undefined142271142355(0,react.useState)undefined142461142522api_client/* api */.FHundefined142897142973(0,jsx_runtime.jsxs)undefined142975143054jsx_runtime.Fragmentundefined143105143181(0,jsx_runtime.jsxs)undefined143296143372(0,jsx_runtime.jsxs)undefined143461143535(0,jsx_runtime.jsx)undefined143676143752(0,jsx_runtime.jsxs)undefined144122144196(0,jsx_runtime.jsx)undefined144306144380(0,jsx_runtime.jsx)undefined144672144746(0,jsx_runtime.jsx)undefined144838144914(0,jsx_runtime.jsxs)undefined145037145111(0,jsx_runtime.jsx)undefined145176145252(0,jsx_runtime.jsxs)undefined145356145430(0,jsx_runtime.jsx)undefined145587145661(0,jsx_runtime.jsx)undefined145820145894(0,jsx_runtime.jsx)undefined146051146125(0,jsx_runtime.jsx)undefined146285146359(0,jsx_runtime.jsx)undefined146599146673(0,jsx_runtime.jsx)undefined146971147047(0,jsx_runtime.jsxs)undefined147349147425(0,jsx_runtime.jsxs)undefined147553147627(0,jsx_runtime.jsx)undefined147852147926(0,jsx_runtime.jsx)undefined148475148549(0,jsx_runtime.jsx)undefined149093149167(0,jsx_runtime.jsx)undefined149245149319(0,jsx_runtime.jsx)undefined149693149767(0,jsx_runtime.jsx)undefined150104150178(0,jsx_runtime.jsx)undefined150544150620(0,jsx_runtime.jsxs)undefined151014151088(0,jsx_runtime.jsx)undefined151642151716(0,jsx_runtime.jsx)undefined152699152773(0,jsx_runtime.jsx)undefined152866152940(0,jsx_runtime.jsx)undefined153097153171(0,jsx_runtime.jsx)undefined153492153566(0,jsx_runtime.jsx)undefined153714153790(0,jsx_runtime.jsxs)undefined154056154132(0,jsx_runtime.jsxs)undefined154411154485(0,jsx_runtime.jsx)undefined154847154923(0,jsx_runtime.jsxs)undefined155076155150(0,jsx_runtime.jsx)undefined155447155521(0,jsx_runtime.jsx)undefined156303156387(0,react.useState)undefined156425156509(0,react.useState)undefined157111157172api_client/* api */.FHundefined157475157549(0,jsx_runtime.jsx)undefined157654157730(0,jsx_runtime.jsxs)undefined157940158014(0,jsx_runtime.jsx)undefined158123158197(0,jsx_runtime.jsx)undefined158293158367(0,jsx_runtime.jsx)undefined158676158750(0,jsx_runtime.jsx)undefined158848158922(0,jsx_runtime.jsx)undefined159239159313(0,jsx_runtime.jsx)undefined159414159488(0,jsx_runtime.jsx)undefined160050160124(0,jsx_runtime.jsx)undefined160220160294(0,jsx_runtime.jsx)undefined160786160862(0,jsx_runtime.jsxs)undefined160991161065(0,jsx_runtime.jsx)undefined161303161377(0,jsx_runtime.jsx)undefined161844161928(0,react.useState)undefined161966162050(0,react.useState)undefined162354162415api_client/* api */.FHundefined162733162807(0,jsx_runtime.jsx)undefined162912162988(0,jsx_runtime.jsxs)undefined163198163272(0,jsx_runtime.jsx)undefined163376163450(0,jsx_runtime.jsx)undefined163546163620(0,jsx_runtime.jsx)undefined163929164003(0,jsx_runtime.jsx)undefined164104164178(0,jsx_runtime.jsx)undefined164740164814(0,jsx_runtime.jsx)undefined164916164990(0,jsx_runtime.jsx)undefined165547165623(0,jsx_runtime.jsxs)undefined165752165826(0,jsx_runtime.jsx)undefined166064166138(0,jsx_runtime.jsx)undefined166653166737(0,react.useState)undefined166792166876(0,react.useState)undefined166919167003(0,react.useState)undefined167109167170api_client/* api */.FHundefined167543167619(0,jsx_runtime.jsxs)undefined167738167814(0,jsx_runtime.jsxs)undefined168129168205(0,jsx_runtime.jsxs)undefined168509168583(0,jsx_runtime.jsx)undefined168846168920(0,jsx_runtime.jsx)undefined169229169305(0,jsx_runtime.jsxs)undefined169721169795(0,jsx_runtime.jsx)undefined170005170081(0,jsx_runtime.jsxs)undefined170228170302(0,jsx_runtime.jsx)undefined170375170451(0,jsx_runtime.jsxs)undefined170571170645(0,jsx_runtime.jsx)undefined170826170900(0,jsx_runtime.jsx)undefined171083171157(0,jsx_runtime.jsx)undefined171338171412(0,jsx_runtime.jsx)undefined171596171670(0,jsx_runtime.jsx)undefined171845171919(0,jsx_runtime.jsx)undefined172257172333(0,jsx_runtime.jsxs)undefined172675172751(0,jsx_runtime.jsxs)undefined172895172969(0,jsx_runtime.jsx)undefined173218173292(0,jsx_runtime.jsx)undefined173986174060(0,jsx_runtime.jsx)undefined174146174220(0,jsx_runtime.jsx)undefined174634174708(0,jsx_runtime.jsx)undefined175093175167(0,jsx_runtime.jsx)undefined175581175657(0,jsx_runtime.jsxs)undefined176099176173(0,jsx_runtime.jsx)undefined176995177069(0,jsx_runtime.jsx)undefined178199178273(0,jsx_runtime.jsx)undefined178382178456(0,jsx_runtime.jsx)undefined178606178680(0,jsx_runtime.jsx)undefined178791178865(0,jsx_runtime.jsx)undefined179163179237(0,jsx_runtime.jsx)undefined179385179461(0,jsx_runtime.jsxs)undefined179727179803(0,jsx_runtime.jsxs)undefined180082180156(0,jsx_runtime.jsx)undefined180518180594(0,jsx_runtime.jsxs)undefined180747180821(0,jsx_runtime.jsx)undefined181118181192(0,jsx_runtime.jsx)undefined181867181941(0,jsx_runtime.jsx)undefined182282182368(0,navigation.useRouter)undefined182398182496(0,navigation.useSearchParams)undefined182630182714(0,react.useState)undefined182759182843(0,react.useState)undefined182904182988(0,react.useState)undefined183068183152(0,react.useState)undefined183195183279(0,react.useState)undefined183318183402(0,react.useState)undefined183451183535(0,react.useState)undefined183599183683(0,react.useState)undefined183749183833(0,react.useState)undefined183885183969(0,react.useState)undefined184040184130(0,react.useCallback)undefined184194184284(0,react.useCallback)undefined184471184532api_client/* api */.FHundefined185192185253api_client/* api */.FHundefined185728185789api_client/* api */.FHundefined186591186652api_client/* api */.FHundefined186991187077(0,react.useEffect)undefined187423187507(0,react.useState)undefined187581187655(0,jsx_runtime.jsx)undefined187734187808(0,jsx_runtime.jsx)undefined187933188009(0,jsx_runtime.jsxs)undefined188100188174(0,jsx_runtime.jsx)undefined188298188372(0,jsx_runtime.jsx)undefined188455188531(0,jsx_runtime.jsxs)undefined188793188867(0,jsx_runtime.jsx)undefined189159189233(0,jsx_runtime.jsx)undefined189535189609(0,jsx_runtime.jsx)undefined190001190077(0,jsx_runtime.jsxs)undefined190079190158jsx_runtime.Fragmentundefined190209190285(0,jsx_runtime.jsxs)undefined190400190474(0,jsx_runtime.jsx)undefined190724190800(0,jsx_runtime.jsxs)undefined190897190973(0,jsx_runtime.jsxs)undefined191336191410(0,jsx_runtime.jsx)undefined192343192419(0,jsx_runtime.jsxs)undefined193008193082(0,jsx_runtime.jsx)undefined193720193794(0,jsx_runtime.jsx)undefined194203194277(0,jsx_runtime.jsx)undefined194822194898(0,jsx_runtime.jsxs)undefined195038195112(0,jsx_runtime.jsx)undefined195517195591(0,jsx_runtime.jsx)undefined196062196136(0,jsx_runtime.jsx)undefined196236196310(0,jsx_runtime.jsx)undefined196663196737(0,jsx_runtime.jsx)undefined196739196816ErrorBoundaryundefined196895196969(0,jsx_runtime.jsx)undefined197160197234(0,jsx_runtime.jsx)undefined197236197313ErrorBoundaryundefined197392197466(0,jsx_runtime.jsx)undefined197927198001(0,jsx_runtime.jsx)undefined198003198080ErrorBoundaryundefined198156198230(0,jsx_runtime.jsx)undefined198540198614(0,jsx_runtime.jsx)undefined198616198693ErrorBoundaryundefined198775198849(0,jsx_runtime.jsx)undefined199164199238(0,jsx_runtime.jsx)undefined199240199317ErrorBoundaryundefined199392199466(0,jsx_runtime.jsx)undefined199775199849(0,jsx_runtime.jsx)undefined199851199928ErrorBoundaryundefined200011200085(0,jsx_runtime.jsx)undefined200403200477(0,jsx_runtime.jsx)undefined200479200556ErrorBoundaryundefined200632200706(0,jsx_runtime.jsx)undefined200930201004(0,jsx_runtime.jsx)undefined201389201463(0,jsx_runtime.jsx)undefined202004202078(0,jsx_runtime.jsx)undefined, /***/ 6282:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource >webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FH: () => (/* binding */ api), /* harmony export */ Ht: () => (/* binding */ getSession), /* harmony export */ ri: () => (/* binding */ logout) /* harmony export */ }); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource#const BASE = ''; async function request(method, path, body) { var _res_headers_get; const opts = { method, headers: { 'Content-Type': 'application/json' } }; if (body) opts.body = JSON.stringify(body); const res = await fetch("".concat(BASE).concat(path), opts); const data = ((_res_headers_get = res.headers.get('content-type')) === null || _res_headers_get === void 0 ? void 0 : _res_headers_get.includes('application/json')) ? await res.json() : await res.text(); if (!res.ok) throw new Error((data === null || data === void 0 ? void 0 : data.error) || (data === null || data === void 0 ? void 0 : data.message) || "Request failed (".concat(res.status, ")")); return data; } export const api = { get: (path)=>request('GET', path), post: (path, body)=>request('POST', path, body), put: (path, body)=>request('PUT', path, body), patch: (path, body)=>request('PATCH', path, body), del: (path)=>request('DELETE', path) }; export async function getSession() { try { const data = await api.get('/api/auth/session'); return data.user || data.actor || null; } catch (e) { return null; } } export async function logout() { await api.post('/api/auth/logout'); window.location.href = '/'; } Ebuffersourcesizemapshash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FH: () => (/* binding */ api), /* harmony export */ Ht: () => (/* binding */ getSession), /* harmony export */ ri: () => (/* binding */ logout) /* harmony export */ }); const BASE = ''; async function request(method, path, body) { var _res_headers_get; const opts = { method, headers: { 'Content-Type': 'application/json' } }; if (body) opts.body = JSON.stringify(body); const res = await fetch("".concat(BASE).concat(path), opts); const data = ((_res_headers_get = res.headers.get('content-type')) === null || _res_headers_get === void 0 ? void 0 : _res_headers_get.includes('application/json')) ? await res.json() : await res.text(); if (!res.ok) throw new Error((data === null || data === void 0 ? void 0 : data.error) || (data === null || data === void 0 ? void 0 : data.message) || "Request failed (".concat(res.status, ")")); return data; } const api = { get: (path)=>request('GET', path), post: (path, body)=>request('POST', path, body), put: (path, body)=>request('PUT', path, body), patch: (path, body)=>request('PATCH', path, body), del: (path)=>request('DELETE', path) }; async function getSession() { try { const data = await api.get('/api/auth/session'); return data.user || data.actor || null; } catch (e) { return null; } } async function logout() { await api.post('/api/auth/logout'); window.location.href = '/'; } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FH: () => (/* binding */ api), /* harmony export */ Ht: () => (/* binding */ getSession), /* harmony export */ ri: () => (/* binding */ logout) /* harmony export */ }); ReplaceSourceRawSource#const BASE = ''; async function request(method, path, body) { var _res_headers_get; const opts = { method, headers: { 'Content-Type': 'application/json' } }; if (body) opts.body = JSON.stringify(body); const res = await fetch("".concat(BASE).concat(path), opts); const data = ((_res_headers_get = res.headers.get('content-type')) === null || _res_headers_get === void 0 ? void 0 : _res_headers_get.includes('application/json')) ? await res.json() : await res.text(); if (!res.ok) throw new Error((data === null || data === void 0 ? void 0 : data.error) || (data === null || data === void 0 ? void 0 : data.message) || "Request failed (".concat(res.status, ")")); return data; } export const api = { get: (path)=>request('GET', path), post: (path, body)=>request('POST', path, body), put: (path, body)=>request('PUT', path, body), patch: (path, body)=>request('PATCH', path, body), del: (path)=>request('DELETE', path) }; export async function getSession() { try { const data = await api.get('/api/auth/session'); return data.user || data.actor || null; } catch (e) { return null; } } export async function logout() { await api.post('/api/auth/logout'); window.location.href = '/'; } 1746752undefined10091015undefined12081214undefined /***/ }) }/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FH: () => (/* binding */ api), /* harmony export */ Ht: () => (/* binding */ getSession), /* harmony export */ ri: () => (/* binding */ logout) /* harmony export */ }); const BASE = ''; async function request(method, path, body) { var _res_headers_get; const opts = { method, headers: { 'Content-Type': 'application/json' } }; if (body) opts.body = JSON.stringify(body); const res = await fetch("".concat(BASE).concat(path), opts); const data = ((_res_headers_get = res.headers.get('content-type')) === null || _res_headers_get === void 0 ? void 0 : _res_headers_get.includes('application/json')) ? await res.json() : await res.text(); if (!res.ok) throw new Error((data === null || data === void 0 ? void 0 : data.error) || (data === null || data === void 0 ? void 0 : data.message) || "Request failed (".concat(res.status, ")")); return data; } const api = { get: (path)=>request('GET', path), post: (path, body)=>request('POST', path, body), put: (path, body)=>request('PUT', path, body), patch: (path, body)=>request('PATCH', path, body), del: (path)=>request('DELETE', path) }; async function getSession() { try { const data = await api.get('/api/auth/session'); return data.user || data.actor || null; } catch (e) { return null; } } async function logout() { await api.post('/api/auth/logout'); window.location.href = '/'; } /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FH: () => (/* binding */ api), /* harmony export */ Ht: () => (/* binding */ getSession), /* harmony export */ ri: () => (/* binding */ logout) /* harmony export */ }); #const BASE = ''; async function request(method, path, body) { var _res_headers_get; const opts = { method, headers: { 'Content-Type': 'application/json' } }; if (body) opts.body = JSON.stringify(body); const res = await fetch("".concat(BASE).concat(path), opts); const data = ((_res_headers_get = res.headers.get('content-type')) === null || _res_headers_get === void 0 ? void 0 : _res_headers_get.includes('application/json')) ? await res.json() : await res.text(); if (!res.ok) throw new Error((data === null || data === void 0 ? void 0 : data.error) || (data === null || data === void 0 ? void 0 : data.message) || "Request failed (".concat(res.status, ")")); return data; } export const api = { get: (path)=>request('GET', path), post: (path, body)=>request('POST', path, body), put: (path, body)=>request('PUT', path, body), patch: (path, body)=>request('PATCH', path, body), del: (path)=>request('DELETE', path) }; export async function getSession() { try { const data = await api.get('/api/auth/session'); return data.user || data.actor || null; } catch (e) { return null; } } export async function logout() { await api.post('/api/auth/logout'); window.location.href = '/'; } 1746752undefined10091015undefined12081214undefined }, webpack/lib/util/registerExternalSerializerwebpack-sources/PrefixSource/******/ 2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [8441,1255,7358], () => (__webpack_exec__(646))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5105],{ /***/ 63: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7260); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); //# sourceMappingURL=navigation.js.map /***/ }), /***/ 646: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3399)); /***/ }), /***/ 3399: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(5155); // EXTERNAL MODULE: ./node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(2115); // EXTERNAL MODULE: ./node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(63); // EXTERNAL MODULE: ./src/lib/api-client.js var api_client = __webpack_require__(6282); ;// ./src/components/ErrorBoundary.jsx /* __next_internal_client_entry_do_not_use__ default auto */ class ErrorBoundary extends react.Component { static getDerivedStateFromError(error) { return { error }; } render() { if (this.state.error) { const { fallback } = this.props; if (fallback) return typeof fallback === 'function' ? fallback(this.state.error) : fallback; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "empty-state", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { children: [ "Something went wrong in ", this.props.name || 'this section', "." ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: this.state.error.message }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginTop: 12 }, onClick: ()=>{ var _this_props_onRetry, _this_props; this.setState({ error: null }); (_this_props_onRetry = (_this_props = this.props).onRetry) === null || _this_props_onRetry === void 0 ? void 0 : _this_props_onRetry.call(_this_props); }, children: "Retry" }) ] }); } return this.props.children; } constructor(props){ super(props); this.state = { error: null }; } } ;// ./src/app/dashboard/page.jsx /* __next_internal_client_entry_do_not_use__ default auto */ const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = (0,react.useState)([]); const add = (0,react.useCallback)(function(message) { let type = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'success'; const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer(param) { let { toasts } = param; if (!toasts.length) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "toast ".concat(t.type), children: t.message }, t.id)) }); } function SearchInput(param) { let { value, onChange, placeholder } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "search-wrap", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge(param) { let { children, className } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "badge ".concat(className || ''), children: children }); } function FormField(param) { let { label, children } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput(param) { let { value, onChange, type = 'text', min, max, style: extraStyle } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect(param) { let { value, onChange, options } = param; const items = options || []; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ (0,jsx_runtime.jsx)("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete(param) { let { label, onConfirm, onCancel, deleting } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab(param) { let { project, dashboard } = param; const panels = (0,react.useMemo)(()=>{ var _dashboard_summary, _dashboard_summary1, _dashboard_summary2, _dashboard_summary3, _dashboard_summary4, _dashboard_summary5, _dashboard_summary6, _dashboard_gate, _dashboard_summary7, _dashboard_summary8, _dashboard_summary9, _dashboard_summary10, _dashboard_summary11, _dashboard_summary12, _dashboard_summary13; if (!dashboard) return []; var _dashboard_summary_overallScore, _dashboard_summary_gateStatus, _dashboard_summary_openRisks, _dashboard_summary_mitigationCompletion; return [ { label: 'Overall Score', value: (_dashboard_summary_overallScore = (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.overallScore) !== null && _dashboard_summary_overallScore !== void 0 ? _dashboard_summary_overallScore : '-', cls: ((_dashboard_summary1 = dashboard.summary) === null || _dashboard_summary1 === void 0 ? void 0 : _dashboard_summary1.overallScore) >= 75 ? 'bad' : ((_dashboard_summary2 = dashboard.summary) === null || _dashboard_summary2 === void 0 ? void 0 : _dashboard_summary2.overallScore) >= 50 ? 'warn' : 'good', sub: "Risk level: ".concat(((_dashboard_summary3 = dashboard.summary) === null || _dashboard_summary3 === void 0 ? void 0 : _dashboard_summary3.riskLevel) || '-') }, { label: 'Deployment Gate', value: (_dashboard_summary_gateStatus = (_dashboard_summary4 = dashboard.summary) === null || _dashboard_summary4 === void 0 ? void 0 : _dashboard_summary4.gateStatus) !== null && _dashboard_summary_gateStatus !== void 0 ? _dashboard_summary_gateStatus : '-', cls: ((_dashboard_summary5 = dashboard.summary) === null || _dashboard_summary5 === void 0 ? void 0 : _dashboard_summary5.gateStatus) === 'Ready' ? 'good' : ((_dashboard_summary6 = dashboard.summary) === null || _dashboard_summary6 === void 0 ? void 0 : _dashboard_summary6.gateStatus) === 'Warning' ? 'warn' : 'bad', sub: ((_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.message) || '' }, { label: 'Open Risks', value: (_dashboard_summary_openRisks = (_dashboard_summary7 = dashboard.summary) === null || _dashboard_summary7 === void 0 ? void 0 : _dashboard_summary7.openRisks) !== null && _dashboard_summary_openRisks !== void 0 ? _dashboard_summary_openRisks : 0, cls: (((_dashboard_summary8 = dashboard.summary) === null || _dashboard_summary8 === void 0 ? void 0 : _dashboard_summary8.openRisks) || 0) > 5 ? 'bad' : (((_dashboard_summary9 = dashboard.summary) === null || _dashboard_summary9 === void 0 ? void 0 : _dashboard_summary9.openRisks) || 0) > 2 ? 'warn' : 'good', sub: "".concat(((_dashboard_summary10 = dashboard.summary) === null || _dashboard_summary10 === void 0 ? void 0 : _dashboard_summary10.totalRisks) || 0, " total risks") }, { label: 'Mitigation', value: "".concat((_dashboard_summary_mitigationCompletion = (_dashboard_summary11 = dashboard.summary) === null || _dashboard_summary11 === void 0 ? void 0 : _dashboard_summary11.mitigationCompletion) !== null && _dashboard_summary_mitigationCompletion !== void 0 ? _dashboard_summary_mitigationCompletion : 0, "%"), cls: (((_dashboard_summary12 = dashboard.summary) === null || _dashboard_summary12 === void 0 ? void 0 : _dashboard_summary12.mitigationCompletion) || 0) < 40 ? 'bad' : (((_dashboard_summary13 = dashboard.summary) === null || _dashboard_summary13 === void 0 ? void 0 : _dashboard_summary13.mitigationCompletion) || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "metric-card", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { children: p.label }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-value ".concat(p.cls), children: p.value }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(Math.min(dim.score, 100), "%"), background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(Math.min(phase.riskScore || 0, 100), "%"), background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/projects/".concat(project.id, "/risks"), form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Risk" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Dimension *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Domain", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Probability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Impact", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Detectability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = (0,react.useState)(''); const [sortKey, setSortKey] = (0,react.useState)('normalizedScore'); const [sortDir, setSortDir] = (0,react.useState)('desc'); const [page, setPage] = (0,react.useState)(0); const [selectedRisk, setSelectedRisk] = (0,react.useState)(null); const [showCreate, setShowCreate] = (0,react.useState)(false); const [editing, setEditing] = (0,react.useState)(false); const [editForm, setEditForm] = (0,react.useState)({}); const [updating, setUpdating] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [deleting, setDeleting] = (0,react.useState)(false); const risks = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = (0,react.useMemo)(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); var _risk_probability, _risk_impact, _risk_detectability; setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: (_risk_probability = risk.probability) !== null && _risk_probability !== void 0 ? _risk_probability : 50, impact: (_risk_impact = risk.impact) !== null && _risk_impact !== void 0 ? _risk_impact : 50, detectability: (_risk_detectability = risk.detectability) !== null && _risk_detectability !== void 0 ? _risk_detectability : 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api_client/* api */.FH.patch("/api/risks/".concat(riskId), { status }); toast.add("Risk status updated to ".concat(status)); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api_client/* api */.FH.patch("/api/risks/".concat(selectedRisk.id), editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/risks/".concat(confirmDelete.id)); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: paged.map((risk)=>{ var _risk_id, _risk_dimension, _risk_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: (_risk_id = risk.id) === null || _risk_id === void 0 ? void 0 : _risk_id.slice(0, 8) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: risk.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_risk_dimension = risk.dimension) === null || _risk_dimension === void 0 ? void 0 : _risk_dimension.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_risk_status = risk.status) === null || _risk_status === void 0 ? void 0 : _risk_status.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id); }) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Dimension", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Domain", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Probability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Impact", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Detectability", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Score" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: "Description" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("br", {}), selectedRisk.description ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small ".concat(s === 'OPEN' ? 'secondary' : ''), onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal(param) { let { project, risks, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api_client/* api */.FH.post("/api/risks/".concat(form.riskId, "/mitigations"), body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Mitigation" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Risk *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Progress %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Due Date", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [search, setSearch] = (0,react.useState)(''); const [sortKey, setSortKey] = (0,react.useState)('progressPercent'); const [sortDir, setSortDir] = (0,react.useState)('asc'); const [showCreate, setShowCreate] = (0,react.useState)(false); const [selectedMitigation, setSelectedMitigation] = (0,react.useState)(null); const [editing, setEditing] = (0,react.useState)(false); const [editForm, setEditForm] = (0,react.useState)({}); const [updating, setUpdating] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [deleting, setDeleting] = (0,react.useState)(false); const mitigations = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.mitigations)) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = (0,react.useMemo)(()=>{ if (!(dashboard === null || dashboard === void 0 ? void 0 : dashboard.topRisks)) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = (0,react.useMemo)(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); var _m_progressPercent, _m_effectivenessPercent; setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: (_m_progressPercent = m.progressPercent) !== null && _m_progressPercent !== void 0 ? _m_progressPercent : 0, effectivenessPercent: (_m_effectivenessPercent = m.effectivenessPercent) !== null && _m_effectivenessPercent !== void 0 ? _m_effectivenessPercent : 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api_client/* api */.FH.patch("/api/mitigations/".concat(selectedMitigation.id), body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/mitigations/".concat(confirmDelete.id)); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: filtered.slice(0, 50).map((m)=>{ var _m_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: m.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_m_status = m.status) === null || _m_status === void 0 ? void 0 : _m_status.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bar-fill", style: { width: "".concat(m.progressPercent || 0, "%"), background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id); }) }) ] }) }), !filtered.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Title *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Progress %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Due Date", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Owner", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab(param) { let { project, dashboard, toast, onRefresh } = param; var _dashboard_gate, _dashboard_summary, _dashboard_gate1; const [evaluating, setEvaluating] = (0,react.useState)(false); const [showDecision, setShowDecision] = (0,react.useState)(false); const [decisionForm, setDecisionForm] = (0,react.useState)({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = (0,react.useState)(false); const criteria = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.criteria) || []; const gateStatus = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_summary = dashboard.summary) === null || _dashboard_summary === void 0 ? void 0 : _dashboard_summary.gateStatus) || 'Unknown'; const gateId = dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate1 = dashboard.gate) === null || _dashboard_gate1 === void 0 ? void 0 : _dashboard_gate1.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api_client/* api */.FH.post("/api/projects/".concat(project.id, "/gate/evaluate"), {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api_client/* api */.FH.post("/api/gates/".concat(gateId, "/decisions"), decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading..." }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Deployment Gate" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "metric-value ".concat(gateCls), style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Criterion" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Required" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actual" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: criteria.map((c)=>{ var _c_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: c.name }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: c.required }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: c.actual }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_c_status = c.status) === null || _c_status === void 0 ? void 0 : _c_status.toLowerCase(), children: c.status }) }) ] }, c.name); }) }) ] }) }), !criteria.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/gate/history"), className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Gate Decision" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Decision", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Reason", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal(param) { let { project, dashboard, onClose, onSaved, toast } = param; var _dashboard_gate; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = (dashboard === null || dashboard === void 0 ? void 0 : (_dashboard_gate = dashboard.gate) === null || _dashboard_gate === void 0 ? void 0 : _dashboard_gate.workspaceId) || (project === null || project === void 0 ? void 0 : project.workspaceId); const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/workspaces/".concat(wsId, "/integrations"), form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Integration" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Provider", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Base URL", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Auth Mode", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab(param) { let { project, dashboard, toast, onRefresh } = param; const [showCreate, setShowCreate] = (0,react.useState)(false); const integrations = (dashboard === null || dashboard === void 0 ? void 0 : dashboard.integrations) || []; return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Integrations" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/integrations/".concat(existing.id), className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ (0,jsx_runtime.jsx)(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab(param) { let { project, toast } = param; const [events, setEvents] = (0,react.useState)([]); const [loading, setLoading] = (0,react.useState)(true); const [error, setError] = (0,react.useState)(null); const load = (0,react.useCallback)(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api_client/* api */.FH.get("/api/projects/".concat(project.id, "/audit")); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); (0,react.useEffect)(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "Audit Log" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Date" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Action" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Entity" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actor" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Details" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: events.map((e)=>{ var _e_action, _e_entityId; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_e_action = e.action) === null || _e_action === void 0 ? void 0 : _e_action.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "muted", children: [ "(", (_e_entityId = e.entityId) === null || _e_entityId === void 0 ? void 0 : _e_entityId.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id); }) }) ] }) }) ] }); } function ProjectsTab(param) { let { projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast } = param; const [deleting, setDeleting] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [showNew, setShowNew] = (0,react.useState)(false); const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { children: "All Projects" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "dash-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Name" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Type" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Created" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal(param) { let { project, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ name: (project === null || project === void 0 ? void 0 : project.name) || '', description: (project === null || project === void 0 ? void 0 : project.description) || '', subtitle: (project === null || project === void 0 ? void 0 : project.subtitle) || '', status: (project === null || project === void 0 ? void 0 : project.status) || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.patch("/api/projects/".concat(project.id), form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "Project Settings" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Subtitle", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Status", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal(param) { let { workspaceId, onClose, onSaved, toast } = param; const [saving, setSaving] = (0,react.useState)(false); const [form, setForm] = (0,react.useState)({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api_client/* api */.FH.post("/api/workspaces/".concat(workspaceId, "/projects"), form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { children: "New Project" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Name *", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Description", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)(FormField, { label: "Project Type", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal(param) { let { projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast } = param; const [deleting, setDeleting] = (0,react.useState)(null); const [confirmDelete, setConfirmDelete] = (0,react.useState)(null); const [showNew, setShowNew] = (0,react.useState)(false); const handleDelete = async ()=>{ setDeleting(true); try { await api_client/* api */.FH.del("/api/projects/".concat(confirmDelete.id)); toast.add('Project "'.concat(confirmDelete.name, '" deleted')); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("table", { className: "table", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("thead", { children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Name" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Status" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Type" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", { children: "Created" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("th", {}) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>{ var _p_status; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)(Badge, { className: (_p_status = p.status) === null || _p_status === void 0 ? void 0 : _p_status.toLowerCase(), children: p.status }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ (0,jsx_runtime.jsx)("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id); }) }) ] }) }), !projects.length && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-state", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: "No projects yet" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-actions", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "modal-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } function DashboardPage() { const router = (0,navigation.useRouter)(); const searchParams = (0,navigation.useSearchParams)(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = (0,react.useState)(null); const [projects, setProjects] = (0,react.useState)([]); const [selectedProjectId, setSelectedProjectId] = (0,react.useState)(searchParams.get('projectId') || null); const [dashboard, setDashboard] = (0,react.useState)(null); const [loading, setLoading] = (0,react.useState)(true); const [error, setError] = (0,react.useState)(null); const [retryCount, setRetryCount] = (0,react.useState)(0); const [showProjectSettings, setShowProjectSettings] = (0,react.useState)(false); const [showProjectManager, setShowProjectManager] = (0,react.useState)(false); const [workspaceId, setWorkspaceId] = (0,react.useState)(null); const { toasts, add } = useToast(); const onRefresh = (0,react.useCallback)(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = (0,react.useCallback)(async (projectId)=>{ setLoading(true); setError(null); try { var _session_memberships, _workspacesResp_workspaces; const session = await api_client/* api */.FH.get('/api/auth/session'); if (!(session === null || session === void 0 ? void 0 : session.authenticated)) { setError('Not authenticated.'); setLoading(false); return; } const membership = (_session_memberships = session.memberships) === null || _session_memberships === void 0 ? void 0 : _session_memberships[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api_client/* api */.FH.get("/api/workspaces?organizationId=".concat(orgId)); const ws = (_workspacesResp_workspaces = workspacesResp.workspaces) === null || _workspacesResp_workspaces === void 0 ? void 0 : _workspacesResp_workspaces[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api_client/* api */.FH.get("/api/workspaces/".concat(ws.id, "/projects")); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace("/dashboard?tab=".concat(currentTab, "&projectId=").concat(proj.id)); } setProject(proj); const dashResp = await api_client/* api */.FH.get("/api/projects/".concat(proj.id, "/dashboard")); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); (0,react.useEffect)(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push("/dashboard?tab=".concat(tab, "&projectId=").concat(pid)); }; const [showCreateOnError, setShowCreateOnError] = (0,react.useState)(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shell-loading", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "empty-state", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: error }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ (0,jsx_runtime.jsx)(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-header", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("select", { className: "input", value: (project === null || project === void 0 ? void 0 : project.id) || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? "(".concat(p.status, ")") : '' ] }, p.id)) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "muted", style: { margin: 0 }, children: (project === null || project === void 0 ? void 0 : project.subtitle) || (project === null || project === void 0 ? void 0 : project.description) || '' }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "dash-actions", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/executive.html"), className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "/api/projects/".concat(project === null || project === void 0 ? void 0 : project.id, "/reports/risk-register.csv"), className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "tab ".concat(tab === t ? 'active' : ''), onClick: ()=>router.push("/dashboard?tab=".concat(t).concat(project ? "&projectId=".concat(project.id) : '')), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ (0,jsx_runtime.jsx)(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ (0,jsx_runtime.jsx)(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project === null || project === void 0 ? void 0 : project.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ (0,jsx_runtime.jsx)(ToastContainer, { toasts: toasts }) ] }); } /***/ }), /***/ 6282: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FH: () => (/* binding */ api), /* harmony export */ Ht: () => (/* binding */ getSession), /* harmony export */ ri: () => (/* binding */ logout) /* harmony export */ }); const BASE = ''; async function request(method, path, body) { var _res_headers_get; const opts = { method, headers: { 'Content-Type': 'application/json' } }; if (body) opts.body = JSON.stringify(body); const res = await fetch("".concat(BASE).concat(path), opts); const data = ((_res_headers_get = res.headers.get('content-type')) === null || _res_headers_get === void 0 ? void 0 : _res_headers_get.includes('application/json')) ? await res.json() : await res.text(); if (!res.ok) throw new Error((data === null || data === void 0 ? void 0 : data.error) || (data === null || data === void 0 ? void 0 : data.message) || "Request failed (".concat(res.status, ")")); return data; } const api = { get: (path)=>request('GET', path), post: (path, body)=>request('POST', path, body), put: (path, body)=>request('PUT', path, body), patch: (path, body)=>request('PATCH', path, body), del: (path)=>request('DELETE', path) }; async function getSession() { try { const data = await api.get('/api/auth/session'); return data.user || data.actor || null; } catch (e) { return null; } } async function logout() { await api.post('/api/auth/logout'); window.location.href = '/'; } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [8441,1255,7358], () => (__webpack_exec__(646))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); {}  `<V(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5105],{ /***/ 63: _/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; y/* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7260); /* harmony import */ var _client_components_navigation__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useRouter")) __webpack_require__.d(__webpack_exports__, { useRouter: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useRouter; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_client_components_navigation__WEBPACK_IMPORTED_MODULE_0__, "useSearchParams")) __webpack_require__.d(__webpack_exports__, { useSearchParams: function() { return _client_components_navigation__WEBPACK_IMPORTED_MODULE_0__.useSearchParams; } }); Xexport * from '../client/components/navigation'; //# sourceMappingURL=navigation.js.map 047undefined RawSource /***/ }), /***/ 646: V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { import(/* webpackMode: "eager" */ "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\dashboard\\page.jsx"); l0220Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3399))undefined, /***/ 3399: ", /***/ 6282: /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FH: () => (/* binding */ api), /* harmony export */ Ht: () => (/* binding */ getSession), /* harmony export */ ri: () => (/* binding */ logout) /* harmony export */ }); #const BASE = ''; async function request(method, path, body) { var _res_headers_get; const opts = { method, headers: { 'Content-Type': 'application/json' } }; if (body) opts.body = JSON.stringify(body); const res = await fetch("".concat(BASE).concat(path), opts); const data = ((_res_headers_get = res.headers.get('content-type')) === null || _res_headers_get === void 0 ? void 0 : _res_headers_get.includes('application/json')) ? await res.json() : await res.text(); if (!res.ok) throw new Error((data === null || data === void 0 ? void 0 : data.error) || (data === null || data === void 0 ? void 0 : data.message) || "Request failed (".concat(res.status, ")")); return data; } export const api = { get: (path)=>request('GET', path), post: (path, body)=>request('POST', path, body), put: (path, body)=>request('PUT', path, body), patch: (path, body)=>request('PATCH', path, body), del: (path)=>request('DELETE', path) }; export async function getSession() { try { const data = await api.get('/api/auth/session'); return data.user || data.actor || null; } catch (e) { return null; } } export async function logout() { await api.post('/api/auth/logout'); window.location.href = '/'; } 1746752undefined10091015undefined12081214undefined }, !PrefixSourceConcatSourceRawSource2__webpack_require__ => { // webpackRuntimeModules var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [8441,1255,7358], () => (__webpack_exec__(646))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } /******/ RawSource]);(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{63:(e,s,a)=>{"use strict";var t=a(7260);a.o(t,"useRouter")&&a.d(s,{useRouter:function(){return t.useRouter}}),a.o(t,"useSearchParams")&&a.d(s,{useSearchParams:function(){return t.useSearchParams}})},646:(e,s,a)=>{Promise.resolve().then(a.bind(a,3399))},3399:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>F});var t=a(5155),l=a(2115),n=a(63),i=a(6282);class r extends l.Component{static getDerivedStateFromError(e){return{error:e}}render(){if(this.state.error){let{fallback:e}=this.props;return e?"function"==typeof e?e(this.state.error):e:(0,t.jsxs)("div",{className:"empty-state",children:[(0,t.jsx)("div",{className:"empty-icon",children:"!"}),(0,t.jsxs)("p",{children:["Something went wrong in ",this.props.name||"this section","."]}),(0,t.jsx)("p",{className:"muted",style:{fontSize:12,marginTop:4},children:this.state.error.message}),(0,t.jsx)("button",{className:"button secondary small",style:{marginTop:12},onClick:()=>{var e,s;this.setState({error:null}),null==(e=(s=this.props).onRetry)||e.call(s)},children:"Retry"})]})}return this.props.children}constructor(e){super(e),this.state={error:null}}}let c=["Overview","Projects","Risks","Mitigations","Gate","Integrations","Audit"],d=["Technical","Governance","Legal","Ethical","Operational"],o=["Design","Development","Testing","Deployment"],u=["OPEN","IN_MITIGATION","ACCEPTED","CLOSED"],m=["NOT_STARTED","IN_PROGRESS","DONE","REJECTED"];function h(e){let{toasts:s}=e;return s.length?(0,t.jsx)("div",{className:"toast-container",children:s.map(e=>(0,t.jsx)("div",{className:"toast ".concat(e.type),children:e.message},e.id))}):null}function j(e){let{value:s,onChange:a,placeholder:l}=e;return(0,t.jsxs)("div",{className:"search-wrap",children:[(0,t.jsx)("span",{className:"search-icon",children:"⌕"}),(0,t.jsx)("input",{className:"input",value:s,onChange:e=>a(e.target.value),placeholder:l||"Search..."})]})}function x(e,s,a){return s?[...e].sort((e,t)=>{let l=e[s],n=t[s];if(null==l)return 1;if(null==n)return -1;let i="number"==typeof l?l-n:String(l).localeCompare(String(n));return"asc"===a?i:-i}):e}function p(e){let{children:s,className:a}=e;return(0,t.jsx)("span",{className:"badge ".concat(a||""),children:s})}function v(e){let{label:s,children:a}=e;return(0,t.jsxs)("div",{style:{marginBottom:10},children:[(0,t.jsx)("label",{style:{display:"block",fontSize:12,color:"var(--muted)",marginBottom:3},children:s}),a]})}function g(e){let{value:s,onChange:a,type:l="text",min:n,max:i,style:r}=e;return(0,t.jsx)("input",{className:"input",type:l,value:s,onChange:e=>a(e.target.value),min:n,max:i,style:{width:"100%",...r}})}function y(e){let{value:s,onChange:a,options:l}=e;return(0,t.jsxs)("select",{className:"input",value:s,onChange:e=>a(e.target.value),style:{width:"100%"},children:[(0,t.jsx)("option",{value:"",children:"— Select —"}),(l||[]).map(e=>{let s="object"==typeof e?e.value:e,a="object"==typeof e?e.label:e;return(0,t.jsx)("option",{value:s,children:a},s)})]})}function b(e){let{label:s,onConfirm:a,onCancel:l,deleting:n}=e;return(0,t.jsx)("div",{className:"modal-overlay",onClick:l,children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:380},children:[(0,t.jsxs)("h3",{children:["Delete ",s,"?"]}),(0,t.jsx)("p",{style:{fontSize:13,color:"var(--muted)"},children:"This cannot be undone."}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:l,children:"Cancel"}),(0,t.jsx)("button",{className:"button small",style:{background:"var(--danger)",color:"#fff"},onClick:a,disabled:n,children:n?"Deleting...":"Delete"})]})]})})}function N(e){let{project:s,dashboard:a}=e,n=(0,l.useMemo)(()=>{var e,s,t,l,n,i,r,c,d,o,u,m,h,j,x,p,v,g,y;return a?[{label:"Overall Score",value:null!=(p=null==(e=a.summary)?void 0:e.overallScore)?p:"-",cls:(null==(s=a.summary)?void 0:s.overallScore)>=75?"bad":(null==(t=a.summary)?void 0:t.overallScore)>=50?"warn":"good",sub:"Risk level: ".concat((null==(l=a.summary)?void 0:l.riskLevel)||"-")},{label:"Deployment Gate",value:null!=(v=null==(n=a.summary)?void 0:n.gateStatus)?v:"-",cls:(null==(i=a.summary)?void 0:i.gateStatus)==="Ready"?"good":(null==(r=a.summary)?void 0:r.gateStatus)==="Warning"?"warn":"bad",sub:(null==(c=a.gate)?void 0:c.message)||""},{label:"Open Risks",value:null!=(g=null==(d=a.summary)?void 0:d.openRisks)?g:0,cls:((null==(o=a.summary)?void 0:o.openRisks)||0)>5?"bad":((null==(u=a.summary)?void 0:u.openRisks)||0)>2?"warn":"good",sub:"".concat((null==(m=a.summary)?void 0:m.totalRisks)||0," total risks")},{label:"Mitigation",value:"".concat(null!=(y=null==(h=a.summary)?void 0:h.mitigationCompletion)?y:0,"%"),cls:40>((null==(j=a.summary)?void 0:j.mitigationCompletion)||0)?"bad":70>((null==(x=a.summary)?void 0:x.mitigationCompletion)||0)?"warn":"good",sub:"Average active-risk completion"}]:[]},[a]);return a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"grid",style:{gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))"},children:n.map(e=>(0,t.jsxs)("div",{className:"metric-card",children:[(0,t.jsx)("h3",{children:e.label}),(0,t.jsx)("div",{className:"metric-value ".concat(e.cls),children:e.value}),(0,t.jsx)("div",{className:"metric-sub",children:e.sub})]},e.label))}),(0,t.jsxs)("div",{className:"grid",style:{gridTemplateColumns:"1fr 1fr",marginTop:18},children:[(0,t.jsxs)("div",{className:"panel",children:[(0,t.jsx)("h2",{children:"Dimensions"}),(a.dimensions||[]).map(e=>(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:4},children:[(0,t.jsx)("span",{style:{fontSize:13},children:e.name}),(0,t.jsx)("strong",{style:{fontSize:13},children:e.score})]}),(0,t.jsx)("div",{className:"bar-wrap",children:(0,t.jsx)("div",{className:"bar-fill",style:{width:"".concat(Math.min(e.score,100),"%"),background:e.score>=50?"var(--danger)":e.score>=25?"var(--warn)":"var(--accent)"}})})]},e.name))]}),(0,t.jsxs)("div",{className:"panel",children:[(0,t.jsx)("h2",{children:"Lifecycle"}),(a.lifecycle||[]).map(e=>(0,t.jsxs)("div",{style:{marginBottom:12},children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:4},children:[(0,t.jsx)("span",{style:{fontSize:13},children:e.name}),(0,t.jsxs)("span",{className:"muted",style:{fontSize:12},children:[e.openRisks," open"]})]}),(0,t.jsx)("div",{className:"bar-wrap",children:(0,t.jsx)("div",{className:"bar-fill",style:{width:"".concat(Math.min(e.riskScore||0,100),"%"),background:(e.riskScore||0)>=50?"var(--danger)":(e.riskScore||0)>=25?"var(--warn)":"var(--accent)"}})})]},e.name))]})]})]}):(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"Loading dashboard data..."})})}function f(e){let{project:s,onClose:a,onSaved:n,toast:r}=e,[c,u]=(0,l.useState)(!1),[m,h]=(0,l.useState)({title:"",description:"",dimension:"",domain:"",lifecyclePhase:"",probability:50,impact:50,detectability:50,ownerDisplayName:""}),j=e=>s=>h(a=>({...a,[e]:s})),x=async()=>{if(!m.title.trim())return void r.add("Title is required","error");if(!m.dimension)return void r.add("Dimension is required","error");u(!0);try{await i.FH.post("/api/projects/".concat(s.id,"/risks"),m),r.add("Risk created"),n()}catch(e){r.add(e.message||"Failed to create risk","error")}finally{u(!1)}};return(0,t.jsx)("div",{className:"modal-overlay",onClick:a,children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:500},children:[(0,t.jsx)("h2",{children:"New Risk"}),(0,t.jsx)(v,{label:"Title *",children:(0,t.jsx)(g,{value:m.title,onChange:j("title")})}),(0,t.jsx)(v,{label:"Description",children:(0,t.jsx)("textarea",{className:"input",value:m.description,onChange:e=>j("description")(e.target.value),rows:3,style:{width:"100%",resize:"vertical"}})}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[(0,t.jsx)(v,{label:"Dimension *",children:(0,t.jsx)(y,{value:m.dimension,onChange:j("dimension"),options:d})}),(0,t.jsx)(v,{label:"Domain",children:(0,t.jsx)(g,{value:m.domain,onChange:j("domain")})})]}),(0,t.jsx)(v,{label:"Lifecycle Phase",children:(0,t.jsx)(y,{value:m.lifecyclePhase,onChange:j("lifecyclePhase"),options:o})}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:8},children:[(0,t.jsx)(v,{label:"Probability",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:m.probability,onChange:j("probability")})}),(0,t.jsx)(v,{label:"Impact",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:m.impact,onChange:j("impact")})}),(0,t.jsx)(v,{label:"Detectability",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:m.detectability,onChange:j("detectability")})})]}),(0,t.jsx)(v,{label:"Owner",children:(0,t.jsx)(g,{value:m.ownerDisplayName,onChange:j("ownerDisplayName")})}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:a,children:"Cancel"}),(0,t.jsx)("button",{className:"button small",onClick:x,disabled:c,children:c?"Saving...":"Create Risk"})]})]})})}function C(e){let{project:s,dashboard:a,toast:n,onRefresh:r}=e,[c,m]=(0,l.useState)(""),[h,N]=(0,l.useState)("normalizedScore"),[C,k]=(0,l.useState)("desc"),[S,w]=(0,l.useState)(0),[P,D]=(0,l.useState)(null),[T,R]=(0,l.useState)(!1),[A,I]=(0,l.useState)(!1),[E,F]=(0,l.useState)({}),[L,O]=(0,l.useState)(null),[z,M]=(0,l.useState)(null),[H,_]=(0,l.useState)(!1),W=(0,l.useMemo)(()=>(null==a?void 0:a.topRisks)?x(a.topRisks,h,C):[],[a,h,C]),G=(0,l.useMemo)(()=>{if(!c)return W;let e=c.toLowerCase();return W.filter(s=>(s.title||"").toLowerCase().includes(e)||(s.dimension||"").toLowerCase().includes(e)||(s.ownerDisplayName||"").toLowerCase().includes(e))},[W,c]),q=G.slice(0,(S+1)*20),B=async(e,s)=>{O(e);try{await i.FH.patch("/api/risks/".concat(e),{status:s}),n.add("Risk status updated to ".concat(s)),D(null),r()}catch(e){n.add(e.message,"error")}finally{O(null)}},J=async()=>{if(!E.title.trim())return void n.add("Title is required","error");O("edit");try{await i.FH.patch("/api/risks/".concat(P.id),E),n.add("Risk updated"),D(null),r()}catch(e){n.add(e.message||"Failed to update","error")}finally{O(null)}},U=async()=>{_(!0);try{await i.FH.del("/api/risks/".concat(z.id)),n.add("Risk deleted"),M(null),D(null),r()}catch(e){n.add(e.message||"Failed to delete","error")}finally{_(!1)}};return a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:8,marginBottom:12},children:[(0,t.jsx)(j,{value:c,onChange:m,placeholder:"Search risks by title, dimension, owner..."}),(0,t.jsx)("button",{className:"button small",onClick:()=>R(!0),children:"+ New Risk"})]}),(0,t.jsx)("div",{className:"table-wrap",children:(0,t.jsxs)("table",{className:"table",children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:[{key:"id",label:"ID"},{key:"title",label:"Risk"},{key:"dimension",label:"Dimension"},{key:"lifecyclePhase",label:"Phase"},{key:"normalizedScore",label:"Score"},{key:"residualScore",label:"Residual"},{key:"status",label:"Status"},{key:"ownerDisplayName",label:"Owner"}].map(e=>(0,t.jsxs)("th",{className:"sortable",onClick:()=>{var s;h===(s=e.key)?k(e=>"asc"===e?"desc":"asc"):(N(s),k("asc"))},children:[e.label," ",h===e.key?"asc"===C?"▲":"▼":""]},e.key))})}),(0,t.jsx)("tbody",{children:q.map(e=>{var s,a,l;return(0,t.jsxs)("tr",{onClick:()=>{var s,a,t;D(e),F({title:e.title||"",description:e.description||"",dimension:e.dimension||"",domain:e.domain||"",lifecyclePhase:e.lifecyclePhase||"",probability:null!=(s=e.probability)?s:50,impact:null!=(a=e.impact)?a:50,detectability:null!=(t=e.detectability)?t:50,ownerDisplayName:e.ownerDisplayName||""}),I(!1),M(null)},children:[(0,t.jsx)("td",{style:{fontFamily:"monospace",fontSize:12},children:null==(s=e.id)?void 0:s.slice(0,8)}),(0,t.jsx)("td",{children:(0,t.jsx)("strong",{children:e.title})}),(0,t.jsx)("td",{children:(0,t.jsx)(p,{className:null==(a=e.dimension)?void 0:a.toLowerCase(),children:e.dimension})}),(0,t.jsx)("td",{style:{fontSize:12},children:e.lifecyclePhase}),(0,t.jsx)("td",{children:(0,t.jsx)("strong",{children:e.normalizedScore})}),(0,t.jsx)("td",{children:(0,t.jsx)("span",{style:{color:e.residualScore>=50?"var(--danger)":e.residualScore>=25?"var(--warn)":"var(--accent)"},children:e.residualScore})}),(0,t.jsx)("td",{children:(0,t.jsx)(p,{className:null==(l=e.status)?void 0:l.toLowerCase().replace(/\s+/g,"-"),children:e.status})}),(0,t.jsx)("td",{children:(0,t.jsx)("span",{className:"muted",children:e.ownerDisplayName||"-"})})]},e.id)})})]})}),G.length>q.length&&(0,t.jsx)("div",{style:{textAlign:"center",marginTop:12},children:(0,t.jsxs)("button",{className:"button secondary small",onClick:()=>w(e=>e+1),children:["Show more (",G.length-q.length," remaining)"]})}),!G.length&&(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"No risks match your search"})}),T&&(0,t.jsx)(f,{project:s,onClose:()=>R(!1),onSaved:()=>{R(!1),r()},toast:n}),P&&!z&&(0,t.jsx)("div",{className:"modal-overlay",onClick:()=>D(null),children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:520},children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)("h2",{style:{margin:0},children:P.title}),(0,t.jsx)("button",{className:"button secondary small",onClick:()=>I(!A),children:A?"View":"Edit"})]}),A?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{marginTop:12},children:[(0,t.jsx)(v,{label:"Title *",children:(0,t.jsx)(g,{value:E.title,onChange:e=>F(s=>({...s,title:e}))})}),(0,t.jsx)(v,{label:"Description",children:(0,t.jsx)("textarea",{className:"input",value:E.description,onChange:e=>F(s=>({...s,description:e.target.value})),rows:2,style:{width:"100%",resize:"vertical"}})}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[(0,t.jsx)(v,{label:"Dimension",children:(0,t.jsx)(y,{value:E.dimension,onChange:e=>F(s=>({...s,dimension:e})),options:d})}),(0,t.jsx)(v,{label:"Domain",children:(0,t.jsx)(g,{value:E.domain,onChange:e=>F(s=>({...s,domain:e}))})})]}),(0,t.jsx)(v,{label:"Lifecycle Phase",children:(0,t.jsx)(y,{value:E.lifecyclePhase,onChange:e=>F(s=>({...s,lifecyclePhase:e})),options:o})}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:8},children:[(0,t.jsx)(v,{label:"Probability",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:E.probability,onChange:e=>F(s=>({...s,probability:Number(e)}))})}),(0,t.jsx)(v,{label:"Impact",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:E.impact,onChange:e=>F(s=>({...s,impact:Number(e)}))})}),(0,t.jsx)(v,{label:"Detectability",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:E.detectability,onChange:e=>F(s=>({...s,detectability:Number(e)}))})})]}),(0,t.jsx)(v,{label:"Owner",children:(0,t.jsx)(g,{value:E.ownerDisplayName,onChange:e=>F(s=>({...s,ownerDisplayName:e}))})})]}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:()=>D(null),children:"Cancel"}),(0,t.jsx)("button",{className:"button small",onClick:J,disabled:"edit"===L,children:"edit"===L?"Saving...":"Save Changes"}),(0,t.jsx)("button",{className:"button small",style:{background:"var(--danger)",color:"#fff",marginLeft:"auto"},onClick:()=>M(P),children:"Delete"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12,fontSize:13,marginTop:12},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"muted",children:"Dimension"}),(0,t.jsx)("br",{}),P.dimension]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"muted",children:"Phase"}),(0,t.jsx)("br",{}),P.lifecyclePhase]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"muted",children:"Probability"}),(0,t.jsx)("br",{}),P.probability]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"muted",children:"Impact"}),(0,t.jsx)("br",{}),P.impact]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"muted",children:"Detectability"}),(0,t.jsx)("br",{}),P.detectability]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"muted",children:"Score"}),(0,t.jsx)("br",{}),(0,t.jsx)("strong",{children:P.normalizedScore})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"muted",children:"Residual"}),(0,t.jsx)("br",{}),P.residualScore]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"muted",children:"Owner"}),(0,t.jsx)("br",{}),P.ownerDisplayName||"-"]})]}),P.description&&(0,t.jsxs)("div",{style:{marginTop:12,fontSize:13},children:[(0,t.jsx)("span",{className:"muted",children:"Description"}),(0,t.jsx)("br",{}),P.description]}),(0,t.jsxs)("div",{style:{marginTop:16},children:[(0,t.jsx)("span",{className:"muted",style:{fontSize:12},children:"Update status:"}),(0,t.jsx)("div",{style:{display:"flex",gap:6,marginTop:6,flexWrap:"wrap"},children:u.map(e=>(0,t.jsx)("button",{className:"button small ".concat("OPEN"===e?"secondary":""),onClick:()=>B(P.id,e),disabled:L===P.id,children:e.replace("_"," ")},e))})]}),(0,t.jsx)("div",{className:"modal-actions",children:(0,t.jsx)("button",{className:"button secondary small",onClick:()=>D(null),children:"Close"})})]})]})}),z&&(0,t.jsx)(b,{label:"this risk",onConfirm:U,onCancel:()=>M(null),deleting:H})]}):(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"Loading..."})})}function k(e){let{project:s,risks:a,onClose:n,onSaved:r,toast:c}=e,[d,o]=(0,l.useState)(!1),[u,h]=(0,l.useState)({riskId:"",title:"",description:"",status:"NOT_STARTED",progressPercent:0,effectivenessPercent:0,dueDate:"",ownerDisplayName:""}),j=e=>s=>h(a=>({...a,[e]:s})),x=async()=>{if(!u.title.trim())return void c.add("Title is required","error");if(!u.riskId)return void c.add("Please select a risk","error");o(!0);try{let e={...u,progressPercent:Number(u.progressPercent),effectivenessPercent:Number(u.effectivenessPercent)};e.dueDate?e.dueDate=new Date(e.dueDate).toISOString():delete e.dueDate,await i.FH.post("/api/risks/".concat(u.riskId,"/mitigations"),e),c.add("Mitigation created"),r()}catch(e){c.add(e.message||"Failed to create mitigation","error")}finally{o(!1)}};return(0,t.jsx)("div",{className:"modal-overlay",onClick:n,children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:500},children:[(0,t.jsx)("h2",{children:"New Mitigation"}),(0,t.jsx)(v,{label:"Risk *",children:(0,t.jsx)(y,{value:u.riskId,onChange:j("riskId"),options:(a||[]).map(e=>({value:e.id,label:e.title}))})}),(0,t.jsx)(v,{label:"Title *",children:(0,t.jsx)(g,{value:u.title,onChange:j("title")})}),(0,t.jsx)(v,{label:"Description",children:(0,t.jsx)("textarea",{className:"input",value:u.description,onChange:e=>j("description")(e.target.value),rows:2,style:{width:"100%",resize:"vertical"}})}),(0,t.jsx)(v,{label:"Status",children:(0,t.jsx)(y,{value:u.status,onChange:j("status"),options:m})}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[(0,t.jsx)(v,{label:"Progress %",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:u.progressPercent,onChange:j("progressPercent")})}),(0,t.jsx)(v,{label:"Effectiveness %",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:u.effectivenessPercent,onChange:j("effectivenessPercent")})})]}),(0,t.jsx)(v,{label:"Due Date",children:(0,t.jsx)(g,{type:"date",value:u.dueDate,onChange:j("dueDate")})}),(0,t.jsx)(v,{label:"Owner",children:(0,t.jsx)(g,{value:u.ownerDisplayName,onChange:j("ownerDisplayName")})}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:n,children:"Cancel"}),(0,t.jsx)("button",{className:"button small",onClick:x,disabled:d,children:d?"Saving...":"Create Mitigation"})]})]})})}function S(e){let{project:s,dashboard:a,toast:n,onRefresh:r}=e,[c,d]=(0,l.useState)(""),[o,u]=(0,l.useState)("progressPercent"),[h,N]=(0,l.useState)("asc"),[f,C]=(0,l.useState)(!1),[S,w]=(0,l.useState)(null),[P,D]=(0,l.useState)(!1),[T,R]=(0,l.useState)({}),[A,I]=(0,l.useState)(null),[E,F]=(0,l.useState)(null),[L,O]=(0,l.useState)(!1),z=(0,l.useMemo)(()=>(null==a?void 0:a.mitigations)?x(a.mitigations,o,h):[],[a,o,h]),M=(0,l.useMemo)(()=>(null==a?void 0:a.topRisks)?a.topRisks:[],[a]),H=(0,l.useMemo)(()=>{if(!c)return z;let e=c.toLowerCase();return z.filter(s=>(s.title||"").toLowerCase().includes(e)||(s.riskTitle||"").toLowerCase().includes(e))},[z,c]),_=async()=>{if(!T.title.trim())return void n.add("Title is required","error");I("edit");try{let e={...T,progressPercent:Number(T.progressPercent),effectivenessPercent:Number(T.effectivenessPercent)};e.dueDate?e.dueDate=new Date(e.dueDate).toISOString():e.dueDate=null,await i.FH.patch("/api/mitigations/".concat(S.id),e),n.add("Mitigation updated"),w(null),r()}catch(e){n.add(e.message||"Failed to update","error")}finally{I(null)}},W=async()=>{O(!0);try{await i.FH.del("/api/mitigations/".concat(E.id)),n.add("Mitigation deleted"),F(null),w(null),r()}catch(e){n.add(e.message||"Failed to delete","error")}finally{O(!1)}};return a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:8,marginBottom:12},children:[(0,t.jsx)(j,{value:c,onChange:d,placeholder:"Search mitigations..."}),(0,t.jsx)("button",{className:"button small",onClick:()=>C(!0),children:"+ New Mitigation"})]}),(0,t.jsx)("div",{className:"table-wrap",children:(0,t.jsxs)("table",{className:"table",children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:[{key:"title",label:"Title"},{key:"riskTitle",label:"Risk"},{key:"status",label:"Status"},{key:"progressPercent",label:"Progress"},{key:"effectivenessPercent",label:"Effectiveness"},{key:"ownerDisplayName",label:"Owner"}].map(e=>(0,t.jsxs)("th",{className:"sortable",onClick:()=>{var s;o===(s=e.key)?N(e=>"asc"===e?"desc":"asc"):(u(s),N("asc"))},children:[e.label," ",o===e.key?"asc"===h?"▲":"▼":""]},e.key))})}),(0,t.jsx)("tbody",{children:H.slice(0,50).map(e=>{var s;return(0,t.jsxs)("tr",{onClick:()=>{var s,a;w(e),R({title:e.title||"",description:e.description||"",status:e.status||"NOT_STARTED",progressPercent:null!=(s=e.progressPercent)?s:0,effectivenessPercent:null!=(a=e.effectivenessPercent)?a:0,dueDate:e.dueDate?e.dueDate.slice(0,10):"",ownerDisplayName:e.ownerDisplayName||""}),D(!0),F(null)},style:{cursor:"pointer"},children:[(0,t.jsx)("td",{children:(0,t.jsx)("strong",{children:e.title})}),(0,t.jsx)("td",{children:(0,t.jsx)("span",{className:"muted",children:e.riskTitle})}),(0,t.jsx)("td",{children:(0,t.jsx)(p,{className:null==(s=e.status)?void 0:s.toLowerCase().replace(/\s+/g,"-"),children:e.status})}),(0,t.jsx)("td",{children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,t.jsx)("div",{className:"bar-wrap",style:{flex:1,maxWidth:80},children:(0,t.jsx)("div",{className:"bar-fill",style:{width:"".concat(e.progressPercent||0,"%"),background:(e.progressPercent||0)>=80?"var(--accent)":(e.progressPercent||0)>=30?"var(--warn)":"var(--danger)"}})}),e.progressPercent||0,"%"]})}),(0,t.jsxs)("td",{children:[e.effectivenessPercent||0,"%"]}),(0,t.jsx)("td",{children:(0,t.jsx)("span",{className:"muted",children:e.ownerDisplayName||"-"})})]},e.id)})})]})}),!H.length&&(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"No mitigations found"})}),f&&(0,t.jsx)(k,{project:s,risks:M,onClose:()=>C(!1),onSaved:()=>{C(!1),r()},toast:n}),S&&!E&&(0,t.jsx)("div",{className:"modal-overlay",onClick:()=>w(null),children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:500},children:[(0,t.jsx)("h2",{style:{margin:0},children:P?"Edit Mitigation":S.title}),(0,t.jsxs)("div",{style:{marginTop:12},children:[(0,t.jsx)(v,{label:"Title *",children:(0,t.jsx)(g,{value:T.title,onChange:e=>R(s=>({...s,title:e}))})}),(0,t.jsx)(v,{label:"Description",children:(0,t.jsx)("textarea",{className:"input",value:T.description,onChange:e=>R(s=>({...s,description:e.target.value})),rows:2,style:{width:"100%",resize:"vertical"}})}),(0,t.jsx)(v,{label:"Status",children:(0,t.jsx)(y,{value:T.status,onChange:e=>R(s=>({...s,status:e})),options:m})}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[(0,t.jsx)(v,{label:"Progress %",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:T.progressPercent,onChange:e=>R(s=>({...s,progressPercent:Number(e)}))})}),(0,t.jsx)(v,{label:"Effectiveness %",children:(0,t.jsx)(g,{type:"number",min:0,max:100,value:T.effectivenessPercent,onChange:e=>R(s=>({...s,effectivenessPercent:Number(e)}))})})]}),(0,t.jsx)(v,{label:"Due Date",children:(0,t.jsx)(g,{type:"date",value:T.dueDate,onChange:e=>R(s=>({...s,dueDate:e}))})}),(0,t.jsx)(v,{label:"Owner",children:(0,t.jsx)(g,{value:T.ownerDisplayName,onChange:e=>R(s=>({...s,ownerDisplayName:e}))})})]}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:()=>w(null),children:"Cancel"}),(0,t.jsx)("button",{className:"button small",onClick:_,disabled:"edit"===A,children:"edit"===A?"Saving...":"Save Changes"}),(0,t.jsx)("button",{className:"button small",style:{background:"var(--danger)",color:"#fff",marginLeft:"auto"},onClick:()=>F(S),children:"Delete"})]})]})}),E&&(0,t.jsx)(b,{label:"this mitigation",onConfirm:W,onCancel:()=>F(null),deleting:L})]}):(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"Loading..."})})}function w(e){var s,a,n;let{project:r,dashboard:c,toast:d,onRefresh:o}=e,[u,m]=(0,l.useState)(!1),[h,j]=(0,l.useState)(!1),[x,b]=(0,l.useState)({decision:"APPROVED",reviewerName:"",reason:""}),[N,f]=(0,l.useState)(!1),C=(null==c||null==(s=c.gate)?void 0:s.criteria)||[],k=(null==c||null==(a=c.summary)?void 0:a.gateStatus)||"Unknown",S=null==c||null==(n=c.gate)?void 0:n.id,w="Ready"===k?"good":"Warning"===k?"warn":"bad",P=async()=>{m(!0);try{await i.FH.post("/api/projects/".concat(r.id,"/gate/evaluate"),{}),d.add("Gate evaluated"),o()}catch(e){d.add(e.message||"Evaluation failed","error")}finally{m(!1)}},D=async()=>{if(!x.reviewerName.trim())return void d.add("Reviewer name is required","error");f(!0);try{await i.FH.post("/api/gates/".concat(S,"/decisions"),x),d.add("Decision submitted"),j(!1),o()}catch(e){d.add(e.message||"Failed to submit decision","error")}finally{f(!1)}};return c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"dash-header",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{children:"Deployment Gate"}),(0,t.jsx)("p",{className:"muted",children:"Gate evaluation for AI deployment readiness"})]}),(0,t.jsx)("div",{className:"dash-actions",children:(0,t.jsx)("div",{className:"metric-value ".concat(w),style:{fontSize:28},children:k})})]}),(0,t.jsx)("div",{className:"table-wrap",children:(0,t.jsxs)("table",{className:"table",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"Criterion"}),(0,t.jsx)("th",{children:"Required"}),(0,t.jsx)("th",{children:"Actual"}),(0,t.jsx)("th",{children:"Status"})]})}),(0,t.jsx)("tbody",{children:C.map(e=>{var s;return(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:(0,t.jsx)("strong",{children:e.name})}),(0,t.jsx)("td",{children:e.required}),(0,t.jsx)("td",{children:e.actual}),(0,t.jsx)("td",{children:(0,t.jsx)(p,{className:null==(s=e.status)?void 0:s.toLowerCase(),children:e.status})})]},e.name)})})]})}),!C.length&&(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"No gate criteria evaluated yet"})}),(0,t.jsxs)("div",{style:{marginTop:16,display:"flex",gap:8,flexWrap:"wrap"},children:[(0,t.jsx)("button",{className:"button small",onClick:P,disabled:u,children:u?"Evaluating...":"Evaluate Gate"}),S&&(0,t.jsx)("button",{className:"button secondary small",onClick:()=>j(!0),children:"Add Decision"}),(0,t.jsx)("a",{href:"/api/projects/".concat(null==r?void 0:r.id,"/gate/history"),className:"button secondary small",target:"_blank",children:"History (API)"})]}),h&&(0,t.jsx)("div",{className:"modal-overlay",onClick:()=>j(!1),children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:400},children:[(0,t.jsx)("h2",{children:"Gate Decision"}),(0,t.jsx)(v,{label:"Decision",children:(0,t.jsx)(y,{value:x.decision,onChange:e=>b(s=>({...s,decision:e})),options:["APPROVED","REJECTED","ACCEPTED","NEEDS_CHANGES"]})}),(0,t.jsx)(v,{label:"Reviewer Name *",children:(0,t.jsx)(g,{value:x.reviewerName,onChange:e=>b(s=>({...s,reviewerName:e}))})}),(0,t.jsx)(v,{label:"Reason",children:(0,t.jsx)("textarea",{className:"input",value:x.reason,onChange:e=>b(s=>({...s,reason:e.target.value})),rows:3,style:{width:"100%",resize:"vertical"}})}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:()=>j(!1),children:"Cancel"}),(0,t.jsx)("button",{className:"button small",onClick:D,disabled:N,children:N?"Saving...":"Submit Decision"})]})]})})]}):(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"Loading..."})})}function P(e){var s;let{project:a,dashboard:n,onClose:r,onSaved:c,toast:d}=e,[o,u]=(0,l.useState)(!1),[m,h]=(0,l.useState)({provider:"TRELLO",workspaceName:"",baseUrl:"",authMode:"API_KEY"}),j=e=>s=>h(a=>({...a,[e]:s})),x=(null==n||null==(s=n.gate)?void 0:s.workspaceId)||(null==a?void 0:a.workspaceId),p=async()=>{if(!m.workspaceName.trim())return void d.add("Workspace name is required","error");u(!0);try{await i.FH.post("/api/workspaces/".concat(x,"/integrations"),m),d.add("Integration created"),c()}catch(e){d.add(e.message||"Failed to create integration","error")}finally{u(!1)}};return(0,t.jsx)("div",{className:"modal-overlay",onClick:r,children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:450},children:[(0,t.jsx)("h2",{children:"New Integration"}),(0,t.jsx)(v,{label:"Provider",children:(0,t.jsx)(y,{value:m.provider,onChange:j("provider"),options:["TRELLO","JIRA","ASANA","MICROSOFT_PLANNER"]})}),(0,t.jsx)(v,{label:"Workspace Name *",children:(0,t.jsx)(g,{value:m.workspaceName,onChange:j("workspaceName")})}),(0,t.jsx)(v,{label:"Base URL",children:(0,t.jsx)(g,{value:m.baseUrl,onChange:j("baseUrl")})}),(0,t.jsx)(v,{label:"Auth Mode",children:(0,t.jsx)(y,{value:m.authMode,onChange:j("authMode"),options:["API_KEY","OAUTH","BASIC"]})}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:r,children:"Cancel"}),(0,t.jsx)("button",{className:"button small",onClick:p,disabled:o,children:o?"Saving...":"Create Integration"})]})]})})}function D(e){let{project:s,dashboard:a,toast:n,onRefresh:i}=e,[r,c]=(0,l.useState)(!1),d=(null==a?void 0:a.integrations)||[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"dash-header",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{children:"Integrations"}),(0,t.jsx)("p",{className:"muted",children:"Connect Trello, Jira, Asana, or Microsoft Planner"})]}),(0,t.jsx)("div",{className:"dash-actions",children:(0,t.jsx)("button",{className:"button small",onClick:()=>c(!0),children:"+ New Integration"})})]}),(0,t.jsx)("div",{className:"grid",style:{gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))"},children:["TRELLO","JIRA","ASANA","MICROSOFT_PLANNER"].map(e=>{let s=d.find(s=>s.provider===e);return(0,t.jsxs)("div",{className:"panel",style:{textAlign:"center"},children:[(0,t.jsx)("div",{style:{fontSize:32,marginBottom:8},children:"TRELLO"===e?"⊞":"JIRA"===e?"◆":"ASANA"===e?"◇":"▣"}),(0,t.jsx)("h3",{style:{margin:"0 0 4px"},children:e.replace("_"," ")}),(0,t.jsx)("p",{className:"muted",style:{fontSize:12,margin:"0 0 12px"},children:s?s.workspaceName:"Not configured"}),(0,t.jsx)("div",{style:{display:"flex",gap:6,justifyContent:"center"},children:s?(0,t.jsx)("a",{href:"/api/integrations/".concat(s.id),className:"button secondary small",target:"_blank",children:"Manage"}):(0,t.jsx)("button",{className:"button secondary small",onClick:()=>c(!0),children:"Configure"})})]},e)})}),r&&(0,t.jsx)(P,{project:s,dashboard:a,onClose:()=>c(!1),onSaved:()=>{c(!1),i()},toast:n}),!d.length&&(0,t.jsx)("div",{style:{marginTop:12},children:(0,t.jsx)("a",{href:"/api/integration-providers",className:"button secondary small",target:"_blank",children:"Integration providers (API)"})})]})}function T(e){let{project:s,toast:a}=e,[n,r]=(0,l.useState)([]),[c,d]=(0,l.useState)(!0),[o,u]=(0,l.useState)(null),m=(0,l.useCallback)(async()=>{if(s){d(!0),u(null);try{let e=await i.FH.get("/api/projects/".concat(s.id,"/audit"));r(e.auditEvents||[])}catch(e){u(e.message||"Failed to load audit log")}finally{d(!1)}}},[s]);return((0,l.useEffect)(()=>{m()},[m]),c)?(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"Loading audit log..."})}):o?(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:o})}):n.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"dash-header",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{children:"Audit Log"}),(0,t.jsx)("p",{className:"muted",children:"Project activity history"})]}),(0,t.jsx)("div",{className:"dash-actions",children:(0,t.jsx)("button",{className:"button secondary small",onClick:m,children:"Refresh"})})]}),(0,t.jsx)("div",{className:"table-wrap",children:(0,t.jsxs)("table",{className:"table",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"Date"}),(0,t.jsx)("th",{children:"Action"}),(0,t.jsx)("th",{children:"Entity"}),(0,t.jsx)("th",{children:"Actor"}),(0,t.jsx)("th",{children:"Details"})]})}),(0,t.jsx)("tbody",{children:n.map(e=>{var s,a;return(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{style:{fontSize:12,whiteSpace:"nowrap"},children:new Date(e.createdAt).toLocaleString()}),(0,t.jsx)("td",{children:(0,t.jsx)(p,{className:null==(s=e.action)?void 0:s.toLowerCase().replace(/\s+/g,"-"),children:e.action})}),(0,t.jsxs)("td",{style:{fontSize:12},children:[e.entityType," ",(0,t.jsxs)("span",{className:"muted",children:["(",null==(a=e.entityId)?void 0:a.slice(0,8),")"]})]}),(0,t.jsx)("td",{style:{fontSize:12},children:e.actorUserId||"system"}),(0,t.jsx)("td",{style:{fontSize:12,maxWidth:300,overflow:"hidden",textOverflow:"ellipsis"},children:e.afterJson?JSON.stringify(e.afterJson).slice(0,80):"-"})]},e.id)})})]})})]}):(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"No audit events recorded yet"})})}function R(e){let{projects:s,workspaceId:a,currentProjectId:n,onSwitch:r,onRefresh:c,toast:d}=e,[o,u]=(0,l.useState)(null),[m,h]=(0,l.useState)(null),[j,x]=(0,l.useState)(!1),v=async()=>{u(!0);try{await i.FH.del("/api/projects/".concat(m.id)),d.add('Project "'.concat(m.name,'" deleted')),h(null),c()}catch(e){d.add(e.message||"Failed to delete project","error")}finally{u(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"dash-header",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{children:"All Projects"}),(0,t.jsxs)("p",{className:"muted",children:[s.length," project(s) in workspace"]})]}),(0,t.jsx)("div",{className:"dash-actions",children:(0,t.jsx)("button",{className:"button small",onClick:()=>x(!0),children:"+ New Project"})})]}),(0,t.jsx)("div",{className:"table-wrap",children:(0,t.jsxs)("table",{className:"table",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"Name"}),(0,t.jsx)("th",{children:"Status"}),(0,t.jsx)("th",{children:"Type"}),(0,t.jsx)("th",{children:"Created"}),(0,t.jsx)("th",{children:"Actions"})]})}),(0,t.jsx)("tbody",{children:[...s].sort((e,s)=>new Date(s.createdAt)-new Date(e.createdAt)).map(e=>{var s;return(0,t.jsxs)("tr",{style:{background:e.id===n?"var(--surface-alt)":""},children:[(0,t.jsxs)("td",{children:[(0,t.jsx)("strong",{children:e.name}),e.id===n?(0,t.jsx)("span",{className:"muted",style:{fontSize:11,marginLeft:6},children:"(current)"}):"",e.description?(0,t.jsx)("div",{className:"muted",style:{fontSize:11},children:e.description}):""]}),(0,t.jsx)("td",{children:(0,t.jsx)(p,{className:null==(s=e.status)?void 0:s.toLowerCase(),children:e.status})}),(0,t.jsx)("td",{style:{fontSize:12},children:e.projectType}),(0,t.jsx)("td",{style:{fontSize:12},children:new Date(e.createdAt).toLocaleDateString()}),(0,t.jsxs)("td",{style:{textAlign:"right",whiteSpace:"nowrap"},children:[e.id!==n&&(0,t.jsx)("button",{className:"button secondary small",style:{marginRight:6},onClick:()=>r(e.id),children:"Open"}),(0,t.jsx)("button",{className:"button small",style:{background:"var(--danger)",color:"#fff"},onClick:()=>h(e),disabled:o===e.id,children:"Delete"})]})]},e.id)})})]})}),!s.length&&(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"No projects yet. Create one to get started."})}),j&&(0,t.jsx)(I,{workspaceId:a,onClose:()=>x(!1),onSaved:()=>{x(!1),c()},toast:d}),m&&(0,t.jsx)("div",{className:"modal-overlay",onClick:()=>h(null),children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:380},children:[(0,t.jsxs)("h3",{children:['Delete "',m.name,'"?']}),(0,t.jsx)("p",{style:{fontSize:13,color:"var(--muted)"},children:"This permanently deletes the project and all its risks, mitigations, and data."}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:()=>h(null),children:"Cancel"}),(0,t.jsx)("button",{className:"button small",style:{background:"var(--danger)",color:"#fff"},onClick:v,disabled:o,children:o?"Deleting...":"Delete Project"})]})]})})]})}function A(e){let{project:s,onClose:a,onSaved:n,toast:r}=e,[c,d]=(0,l.useState)(!1),[o,u]=(0,l.useState)({name:(null==s?void 0:s.name)||"",description:(null==s?void 0:s.description)||"",subtitle:(null==s?void 0:s.subtitle)||"",status:(null==s?void 0:s.status)||"Active"}),m=async()=>{if(!o.name.trim())return void r.add("Project name is required","error");d(!0);try{await i.FH.patch("/api/projects/".concat(s.id),o),r.add("Project updated"),n()}catch(e){r.add(e.message||"Failed to update project","error")}finally{d(!1)}};return(0,t.jsx)("div",{className:"modal-overlay",onClick:a,children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:450},children:[(0,t.jsx)("h2",{children:"Project Settings"}),(0,t.jsx)(v,{label:"Name *",children:(0,t.jsx)(g,{value:o.name,onChange:e=>u(s=>({...s,name:e}))})}),(0,t.jsx)(v,{label:"Subtitle",children:(0,t.jsx)(g,{value:o.subtitle,onChange:e=>u(s=>({...s,subtitle:e}))})}),(0,t.jsx)(v,{label:"Description",children:(0,t.jsx)("textarea",{className:"input",value:o.description,onChange:e=>u(s=>({...s,description:e.target.value})),rows:3,style:{width:"100%",resize:"vertical"}})}),(0,t.jsx)(v,{label:"Status",children:(0,t.jsx)(y,{value:o.status,onChange:e=>u(s=>({...s,status:e})),options:["Active","Archived","On Hold"]})}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:a,children:"Cancel"}),(0,t.jsx)("button",{className:"button small",onClick:m,disabled:c,children:c?"Saving...":"Save Changes"})]})]})})}function I(e){let{workspaceId:s,onClose:a,onSaved:n,toast:r}=e,[c,d]=(0,l.useState)(!1),[o,u]=(0,l.useState)({name:"",description:"",projectType:"AI-Enabler"}),m=async()=>{if(!o.name.trim())return void r.add("Project name is required","error");d(!0);try{await i.FH.post("/api/workspaces/".concat(s,"/projects"),o),r.add("Project created"),n()}catch(e){r.add(e.message||"Failed to create project","error")}finally{d(!1)}};return(0,t.jsx)("div",{className:"modal-overlay",onClick:a,children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:450},children:[(0,t.jsx)("h2",{children:"New Project"}),(0,t.jsx)(v,{label:"Name *",children:(0,t.jsx)(g,{value:o.name,onChange:e=>u(s=>({...s,name:e}))})}),(0,t.jsx)(v,{label:"Description",children:(0,t.jsx)("textarea",{className:"input",value:o.description,onChange:e=>u(s=>({...s,description:e.target.value})),rows:3,style:{width:"100%",resize:"vertical"}})}),(0,t.jsx)(v,{label:"Project Type",children:(0,t.jsx)(y,{value:o.projectType,onChange:e=>u(s=>({...s,projectType:e})),options:["AI-Enabler","GENERATIVE_AI","ML-Pipeline","Automation"]})}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:a,children:"Cancel"}),(0,t.jsx)("button",{className:"button small",onClick:m,disabled:c,children:c?"Saving...":"Create Project"})]})]})})}function E(e){let{projects:s,workspaceId:a,currentProjectId:n,onClose:r,onSwitch:c,onSaved:d,toast:o}=e,[u,m]=(0,l.useState)(null),[h,j]=(0,l.useState)(null),[x,v]=(0,l.useState)(!1),g=async()=>{m(!0);try{await i.FH.del("/api/projects/".concat(h.id)),o.add('Project "'.concat(h.name,'" deleted')),j(null),d()}catch(e){o.add(e.message||"Failed to delete project","error")}finally{m(!1)}};return(0,t.jsxs)("div",{className:"modal-overlay",onClick:r,children:[(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:700,maxHeight:"80vh",overflow:"auto"},children:[(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)("h2",{style:{margin:0},children:"All Projects"}),(0,t.jsx)("button",{className:"button small",onClick:()=>v(!0),children:"+ New Project"})]}),(0,t.jsxs)("p",{className:"muted",style:{fontSize:12,marginTop:4},children:[s.length," project(s) in workspace"]}),(0,t.jsx)("div",{className:"table-wrap",style:{marginTop:12},children:(0,t.jsxs)("table",{className:"table",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"Name"}),(0,t.jsx)("th",{children:"Status"}),(0,t.jsx)("th",{children:"Type"}),(0,t.jsx)("th",{children:"Created"}),(0,t.jsx)("th",{})]})}),(0,t.jsx)("tbody",{children:[...s].sort((e,s)=>new Date(s.createdAt)-new Date(e.createdAt)).map(e=>{var s;return(0,t.jsxs)("tr",{style:{background:e.id===n?"var(--surface-alt)":""},children:[(0,t.jsxs)("td",{children:[(0,t.jsx)("strong",{children:e.name}),e.id===n?(0,t.jsx)("span",{className:"muted",style:{fontSize:11,marginLeft:6},children:"(current)"}):""]}),(0,t.jsx)("td",{children:(0,t.jsx)(p,{className:null==(s=e.status)?void 0:s.toLowerCase(),children:e.status})}),(0,t.jsx)("td",{style:{fontSize:12},children:e.projectType}),(0,t.jsx)("td",{style:{fontSize:12},children:new Date(e.createdAt).toLocaleDateString()}),(0,t.jsxs)("td",{style:{textAlign:"right",whiteSpace:"nowrap"},children:[e.id!==n&&(0,t.jsx)("button",{className:"button secondary small",style:{marginRight:6},onClick:()=>{c(e.id),r()},children:"Open"}),(0,t.jsx)("button",{className:"button small",style:{background:"var(--danger)",color:"#fff"},onClick:()=>j(e),disabled:u===e.id,children:"✕"})]})]},e.id)})})]})}),!s.length&&(0,t.jsx)("div",{className:"empty-state",children:(0,t.jsx)("p",{children:"No projects yet"})}),(0,t.jsx)("div",{className:"modal-actions",children:(0,t.jsx)("button",{className:"button secondary small",onClick:r,children:"Close"})})]}),h&&(0,t.jsx)("div",{className:"modal-overlay",onClick:()=>j(null),children:(0,t.jsxs)("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:380},children:[(0,t.jsxs)("h3",{children:['Delete "',h.name,'"?']}),(0,t.jsx)("p",{style:{fontSize:13,color:"var(--muted)"},children:"This permanently deletes the project and all its risks, mitigations, and data."}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"button secondary small",onClick:()=>j(null),children:"Cancel"}),(0,t.jsx)("button",{className:"button small",style:{background:"var(--danger)",color:"#fff"},onClick:g,disabled:u,children:u?"Deleting...":"Delete Project"})]})]})}),x&&(0,t.jsx)(I,{workspaceId:a,onClose:()=>v(!1),onSaved:()=>{v(!1),d()},toast:o})]})}function F(){let e=(0,n.useRouter)(),s=(0,n.useSearchParams)(),a=c.includes(s.get("tab"))?s.get("tab"):"Overview",[d,o]=(0,l.useState)(null),[u,m]=(0,l.useState)([]),[j,x]=(0,l.useState)(s.get("projectId")||null),[p,v]=(0,l.useState)(null),[g,y]=(0,l.useState)(!0),[b,f]=(0,l.useState)(null),[k,P]=(0,l.useState)(0),[F,L]=(0,l.useState)(!1),[O,z]=(0,l.useState)(!1),[M,H]=(0,l.useState)(null),{toasts:_,add:W}=function(){let[e,s]=(0,l.useState)([]);return{toasts:e,add:(0,l.useCallback)(function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success",t=Date.now()+Math.random();s(s=>[...s,{id:t,message:e,type:a}]),setTimeout(()=>s(e=>e.filter(e=>e.id!==t)),3e3)},[])}}(),G=(0,l.useCallback)(()=>P(e=>e+1),[]),q=(0,l.useCallback)(async a=>{y(!0),f(null);try{var t,l;let n=await i.FH.get("/api/auth/session");if(!(null==n?void 0:n.authenticated)){f("Not authenticated."),y(!1);return}let r=null==(t=n.memberships)?void 0:t[0];if(!r){f("No organization membership found."),y(!1);return}let c=r.organizationId,d=null==(l=(await i.FH.get("/api/workspaces?organizationId=".concat(c))).workspaces)?void 0:l[0];if(!d){f("No workspace found — create one to get started."),y(!1);return}H(d.id);let u=(await i.FH.get("/api/workspaces/".concat(d.id,"/projects"))).projects||[];if(!u.length){f("No project found — create a project to get started."),y(!1);return}m(u);let h=a?u.find(e=>e.id===a):null;if(h||(h=u[0]),h.id!==(s.get("projectId")||null)){let a=s.get("tab")||"Overview";e.replace("/dashboard?tab=".concat(a,"&projectId=").concat(h.id))}o(h);let j=await i.FH.get("/api/projects/".concat(h.id,"/dashboard"));v(j.dashboard),y(!1)}catch(e){f(e.message||"Failed to load dashboard data"),y(!1)}},[]);(0,l.useEffect)(()=>{q(j)},[q,k,j]);let B=s=>{x(s),e.push("/dashboard?tab=".concat(a,"&projectId=").concat(s))},[J,U]=(0,l.useState)(!1);return g&&"Integrations"!==a?(0,t.jsx)("div",{className:"shell-loading",children:(0,t.jsx)("div",{className:"spinner"})}):b&&"Integrations"!==a?(0,t.jsxs)("div",{className:"empty-state",children:[(0,t.jsx)("div",{className:"empty-icon",children:"!"}),(0,t.jsx)("p",{children:b}),(0,t.jsxs)("div",{style:{marginTop:12,display:"flex",gap:8,justifyContent:"center"},children:[(0,t.jsx)("button",{className:"button secondary small",onClick:()=>P(e=>e+1),children:"Retry"}),b.includes("No project found")&&M&&(0,t.jsx)("button",{className:"button small",onClick:()=>U(!0),children:"+ Create Project"})]}),J&&M&&(0,t.jsx)(I,{workspaceId:M,onClose:()=>U(!1),onSaved:()=>{U(!1),P(e=>e+1)},toast:{add:W}})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"dash-header",children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:10},children:(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)("select",{className:"input",value:(null==d?void 0:d.id)||"",onChange:e=>B(e.target.value),style:{fontSize:16,fontWeight:700,width:"auto",minWidth:200,border:"none",background:"transparent",cursor:"pointer"},children:u.map(e=>(0,t.jsxs)("option",{value:e.id,children:[e.name," ","Active"!==e.status?"(".concat(e.status,")"):""]},e.id))}),(0,t.jsx)("button",{className:"button secondary small",style:{fontSize:14,padding:"2px 8px"},onClick:()=>L(!0),title:"Project settings",children:"⚙"}),(0,t.jsx)("button",{className:"button secondary small",onClick:()=>z(!0),children:"Projects"})]}),(0,t.jsx)("p",{className:"muted",style:{margin:0},children:(null==d?void 0:d.subtitle)||(null==d?void 0:d.description)||""})]})}),(0,t.jsxs)("div",{className:"dash-actions",children:[(0,t.jsx)("a",{href:"/api/projects/".concat(null==d?void 0:d.id,"/reports/executive.html"),className:"button secondary small",target:"_blank",children:"Report"}),(0,t.jsx)("a",{href:"/api/projects/".concat(null==d?void 0:d.id,"/reports/risk-register.csv"),className:"button secondary small",target:"_blank",children:"CSV"})]})]}),(0,t.jsx)("div",{className:"tabs",children:c.map(s=>(0,t.jsx)("button",{className:"tab ".concat(a===s?"active":""),onClick:()=>e.push("/dashboard?tab=".concat(s).concat(d?"&projectId=".concat(d.id):"")),children:s},s))}),"Overview"===a&&(0,t.jsx)(r,{name:"Overview",children:(0,t.jsx)(N,{project:d,dashboard:p})},"overview"),"Projects"===a&&(0,t.jsx)(r,{name:"Projects",children:(0,t.jsx)(R,{projects:u,workspaceId:M,currentProjectId:null==d?void 0:d.id,onSwitch:B,onRefresh:G,toast:{add:W}})},"projects"),"Risks"===a&&(0,t.jsx)(r,{name:"Risks",children:(0,t.jsx)(C,{project:d,dashboard:p,toast:{add:W},onRefresh:G})},"risks"),"Mitigations"===a&&(0,t.jsx)(r,{name:"Mitigations",children:(0,t.jsx)(S,{project:d,dashboard:p,toast:{add:W},onRefresh:G})},"mitigations"),"Gate"===a&&(0,t.jsx)(r,{name:"Gate",children:(0,t.jsx)(w,{project:d,dashboard:p,toast:{add:W},onRefresh:G})},"gate"),"Integrations"===a&&(0,t.jsx)(r,{name:"Integrations",children:(0,t.jsx)(D,{project:d,dashboard:p,toast:{add:W},onRefresh:G})},"integrations"),"Audit"===a&&(0,t.jsx)(r,{name:"Audit",children:(0,t.jsx)(T,{project:d,toast:{add:W}})},"audit"),F&&(0,t.jsx)(A,{project:d,onClose:()=>L(!1),onSaved:()=>{L(!1),G()},toast:{add:W}}),O&&(0,t.jsx)(E,{projects:u,workspaceId:M,currentProjectId:null==d?void 0:d.id,onClose:()=>z(!1),onSwitch:B,onSaved:()=>{z(!1),G()},toast:{add:W}}),(0,t.jsx)(h,{toasts:_})]})}},6282:(e,s,a)=>{"use strict";async function t(e,s,a){var t;let l={method:e,headers:{"Content-Type":"application/json"}};a&&(l.body=JSON.stringify(a));let n=await fetch("".concat("").concat(s),l),i=(null==(t=n.headers.get("content-type"))?void 0:t.includes("application/json"))?await n.json():await n.text();if(!n.ok)throw Error((null==i?void 0:i.error)||(null==i?void 0:i.message)||"Request failed (".concat(n.status,")"));return i}a.d(s,{FH:()=>l,Ht:()=>n,ri:()=>i});let l={get:e=>t("GET",e),post:(e,s)=>t("POST",e,s),put:(e,s)=>t("PUT",e,s),patch:(e,s)=>t("PATCH",e,s),del:e=>t("DELETE",e)};async function n(){try{let e=await l.get("/api/auth/session");return e.user||e.actor||null}catch(e){return null}}async function i(){await l.post("/api/auth/logout"),window.location.href="/"}}},e=>{e.O(0,[8441,1255,7358],()=>e(e.s=646)),_N_E=e.O()}]);