<% // Do not pre-select options by providing a value to the hidden input field. %>
<% // This causes errors in some situations. Pre-select in the view JS instead. %>
<%= placeholderText %>
<% // If the list of options doesn't have category headings, put it in the %>
<% // same format as options that do have headings. %>
<% if (Array.isArray(options)) { options = { "" : options } } %>
<% for (const [header, values] of Object.entries(options)) { %>
<% if (header) { %>
<%= header %>
<% } %>
<% for (option of values) { %>
<% if (option.icon) { %>
<% } else if (option.image) { %>
<% } %>
<%= option.label %>