<script>
import { LucidSuggest } from "./en.js";
import ListItem from "./ListItem.svelte";
import IconLoupe from "./IconLoupe.svelte";
import Legend from "./Legend.svelte";
const url =
"https://schema.org/version/latest/schemaorg-current-https.jsonld";
const limit = 15;
const suggest = new LucidSuggest();
suggest.setLimit(limit);
setUp();
async function setUp() {
let data
const start = Date.now();
// fetch the latest schema data
try {
const response = await fetch(url);
const allData = await response.json();
data = allData["@graph"];
} catch (error) {
console.error(error);
}
const rating = 0;
let id = 0;
for (const record of data) {
let title = record["@id"]
.split(":")[1]
// insert a space before capitalized words (but not acronyms)
.replace(/((?<!^)[A-Z](?![A-Z]))(?=\S)/g, " $1")
// uppercase the first character