<% if (!ob.fetching) { %>
<% if (!ob.emptyData) { %>

<%= ob.name %>

<% if (!ob.isQueryProvider) { %> <% if (!ob.providerLocked) { %> <% } %> <% if (!ob.isDefaultProvider) { %>
<% } %> <% } else { %> <% } %>

<% _.each(ob.options, function(val, key) { %>
<%= val.label %>
<% if (val.type ==='dropdown') { %> <% } else if (val.type ==='radio') { %>
<% // if any options has a checked value, check the first one. Otherwise use the first default. let checkedIndex = val.options.findIndex(opt => opt.checked); checkedIndex = checkedIndex === -1 ? val.options.findIndex(opt => opt.default) : checkedIndex; _.each(val.options, function(option, ind) { %>
<% const checked = checkedIndex === ind ? 'checked' : ''; var parsedLabel = ob.parseEmojis(option.label); print(``); print(``); %>
<% }); %>
<% } else if (val.type ==='checkbox') { %>
<% const anyChecked = val.options.filter(opt => opt.checked); val.options.forEach((option, index) => { let checked = ''; // if none of the checkboxes have a checked value, use the default values if (option.checked || !anyChecked.length && option.default) { checked = 'checked'; } var parsedLabel = ob.parseEmojis(option.label); print(``); print(``); }); %>
<% } %>
<% }); %>
<% if (ob.results) { %> <% if (ob.term) { %> <%= ob.polyT('search.resultsFound', { totalResults: ob.results.total, term: ob.parseEmojis(ob.term), smart_count: ob.results.total, }) %> <% } else { %> <%= ob.polyT('search.resultsTotal', { totalResults: ob.results.total }) %> <% } %> <% } %>
<% if (ob.sortBy) { %>
<%= ob.polyT('search.sortBy') %>
<% } %>
<% // the results are added here %>
<% } else { %>

<%= ob.errTitle %>

<%= ob.errMsg %>

<% if(!ob.providerLocked) { %>
<% } %>
<% } %>
<% } else { %> <% if (!ob.selecting) { %>
<%= ob.spinner({ className: 'spinnerLg' }) %>
<% } %> <% } %>