(() => {
const key = document.body.dataset.document;
const target = document.getElementById("legal-document");
const escapeHtml = (value) => String(value).replace(/[&<>"']/g, (character) => ({
"&": "&", "<": "<", ">": ">", '"': """, "'": "'"
})[character]);
fetch("/legal/legal_documents.json", { cache: "no-store" })
.then((response) => {
if (!response.ok) throw new Error(`status ${response.status}`);
return response.json();
})
.then((documents) => {
const documentData = documents[key];
if (!documentData) throw new Error("document not found");
document.title = `${documentData.title} | RanaZe`;
const sections = documentData.sections.map((section) => `
${escapeHtml(paragraph)} ${escapeHtml(documentData.summary)}${escapeHtml(section.heading)}
${section.paragraphs.map((paragraph) => `${escapeHtml(documentData.title)}
This document could not be loaded. Contact support@ranaze.com.
'; }); })();