${
hasChanges
? html`
${
formMode === "raw"
? "Unsaved changes"
: `${diff.length} unsaved change${diff.length !== 1 ? "s" : ""}`
}
`
: html`
No changes
`
}
${
props.onOpenFile
? html`
`
: nothing
}
${
formMode === "form"
? html`
`
: nothing
}
${topTabs.map(
(tab) => html`
`,
)}
${
showModeToggle
? html`
`
: nothing
}
${
validity === "invalid" && !cvs.validityDismissed
? html`
${getSectionIcon(props.activeSection ?? "")}
${activeSectionMeta.label}
${
activeSectionMeta.description
? html`
${activeSectionMeta.description}
`
: nothing
}
${
props.activeSection === "env"
? html`
`
: nothing
}
`
: nothing
}
${
props.activeSection === "__appearance__"
? includeVirtualSections
? renderAppearanceSection(props)
: nothing
: formMode === "form"
? html`
${showAppearanceOnRoot ? renderAppearanceSection(props) : nothing}
${
props.schemaLoading
? html`
`
: renderConfigForm({
schema: analysis.schema,
uiHints: props.uiHints,
value: props.formValue,
disabled: props.loading || !props.formValue,
unsupportedPaths: analysis.unsupportedPaths,
onPatch: props.onFormPatch,
searchQuery: props.searchQuery,
activeSection: props.activeSection,
activeSubsection: effectiveSubsection,
revealSensitive:
props.activeSection === "env" ? envSensitiveVisible : false,
isSensitivePathRevealed,
onToggleSensitivePath: (path) => {
toggleSensitivePathReveal(path);
props.onRawChange(props.raw);
},
})
}
`
: (() => {
const sensitiveCount = countSensitiveConfigValues(
props.formValue,
[],
props.uiHints,
);
const blurred = sensitiveCount > 0 && !cvs.rawRevealed;
return html`
${
formUnsafe
? html`
Your config contains fields the form editor can't safely represent. Use Raw mode to edit those
entries.
`
: nothing
}
`;
})()
}
${
props.issues.length > 0
? html`