{"id":368,"date":"2025-07-23T20:51:38","date_gmt":"2025-07-23T20:51:38","guid":{"rendered":"https:\/\/tree-of-mylife.com\/?page_id=368"},"modified":"2025-12-09T04:12:35","modified_gmt":"2025-12-09T04:12:35","slug":"family-history","status":"publish","type":"page","link":"https:\/\/tree-of-mylife.com\/es\/family-history\/","title":{"rendered":"FAMILY HISTORY"},"content":{"rendered":"\n<div style=\"padding:60px 20px; font-family: Arial, Helvetica, sans-serif;\">\n  <!-- ===== CARD con \u00e1rbol de fondo ===== -->\n  <div id=\"fh-card\" style=\"\n    max-width:960px; margin:auto; padding:28px; border-radius:14px;\n    box-shadow:0 12px 28px rgba(0,0,0,.25);\n    background:\n      linear-gradient(to bottom right, rgba(0,0,0,0.10), rgba(0,0,0,0.10)),\n      url('https:\/\/tree-of-mylife.com\/wp-content\/uploads\/2025\/08\/family-history.png') center\/cover no-repeat !important;\n    background-color: transparent !important; color:#fff;\">\n\n    <!-- ===== Barra superior: T\u00edtulo + Idioma ===== -->\n    <div style=\"display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px;\">\n      <h2 id=\"title\" style=\"margin:0; font-size:36px; font-weight:800; letter-spacing:.2px; color:#fff;\n                            text-shadow:0 2px 6px rgba(0,0,0,.6);\">\n        Family History\n      <\/h2>\n      <div>\n        <label for=\"langSel\" style=\"font-weight:700; margin-right:8px; text-shadow:0 1px 3px rgba(0,0,0,.6);\">Language<\/label>\n        <select id=\"langSel\" style=\"padding:8px 12px; border-radius:10px; border:1px solid rgba(255,255,255,.6); background:rgba(0,0,0,.25); color:#fff;\">\n          <option value=\"en\">English<\/option>\n          <option value=\"es\">Espa\u00f1ol<\/option>\n        <\/select>\n      <\/div>\n    <\/div>\n\n    <!-- ===== Formulario ===== -->\n    <form id=\"fhForm\" style=\"font-weight:600; text-shadow:0 1px 3px rgba(0,0,0,.55);\">\n      <style>\n        .row{display:flex; gap:14px; flex-wrap:wrap}\n        label{display:block; margin:10px 0 6px; font-size:18px}\n        input, textarea, select{\n          width:100%; padding:12px; border-radius:12px; font-size:16px;\n          border:1px solid rgba(255,255,255,.7); background:rgba(255,255,255,.14);\n          color:#fff; outline:none; backdrop-filter: blur(2px);\n        }\n        textarea{min-height:110px; resize:vertical}\n        .blk{position:relative; margin:0 0 22px; padding:14px; border-radius:12px;\n             background:rgba(0,0,0,.20); border:1px solid rgba(255,255,255,.2)}\n        .btn{border:none; border-radius:12px; padding:12px 16px; cursor:pointer; font-weight:800; color:#fff; text-shadow:none}\n        .btn-primary{background:#0f3a8a}\n        .btn-success{background:#16a34a}\n        .btn-copy{background:#6a1b9a}\n        .btn-wa{background:#25D366}\n        .btn-mail{background:#1E90FF}\n        .btn-pdf{background:#e67e22}\n        .btn-print{background:#8e44ad}\n        .btn-json{background:#0ea5e9}\n        .btn-remove{background:#dc2626; position:absolute; top:-10px; right:-10px; display:none}\n        .chips{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}\n        .chip{display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px;\n              background:rgba(255,255,255,.25); color:#fff; border:1px solid rgba(255,255,255,.5)}\n        .chip > button{border:none; border-radius:999px; width:22px; height:22px; cursor:pointer; color:#fff; background:#0f3a8a}\n        .muted{color:#fff; background:rgba(0,0,0,.28); padding:8px 12px; border-radius:10px; font-size:14px}\n        .att-row{display:flex; align-items:center; gap:10px; background:rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.25); color:#fff; padding:10px; border-radius:12px;}\n        .section-title{font-size:24px; margin:20px 0 10px; font-weight:800; text-shadow:0 2px 6px rgba(0,0,0,.6)}\n      <\/style>\n\n      <div id=\"blocks\">\n        <!-- === BLOQUE INICIAL (un familiar) === -->\n        <div class=\"blk\" data-cloneable=\"1\">\n          <button type=\"button\" class=\"btn btn-remove\" onclick=\"this.closest('.blk').remove()\">\u00d7<\/button>\n\n          <div class=\"row\">\n            <div style=\"flex:1; min-width:200px\">\n              <label data-i18n=\"relationship\">Relationship<\/label>\n              <select name=\"relationship[]\">\n                <option value=\"\" data-i18n=\"select_one\">Select one\u2026<\/option>\n                <option data-i18n=\"mother\">Mother<\/option>\n                <option data-i18n=\"father\">Father<\/option>\n                <option data-i18n=\"sibling\">Sibling<\/option>\n                <option data-i18n=\"spouse\">Spouse<\/option>\n                <option data-i18n=\"child\">Child<\/option>\n                <option data-i18n=\"mgm\">Maternal Grandmother<\/option>\n                <option data-i18n=\"mgf\">Maternal Grandfather<\/option>\n                <option data-i18n=\"pgm\">Paternal Grandmother<\/option>\n                <option data-i18n=\"pgf\">Paternal Grandfather<\/option>\n                <option data-i18n=\"other\">Other<\/option>\n              <\/select>\n            <\/div>\n            <div style=\"flex:2; min-width:260px\">\n              <label data-i18n=\"fullname\">Full Name<\/label>\n              <input name=\"fullname[]\" data-i18n-ph=\"ph_fullname\" placeholder=\"e.g., Jane Doe\">\n            <\/div>\n          <\/div>\n\n          <div class=\"row\">\n            <div style=\"flex:1; min-width:220px\">\n              <label data-i18n=\"dob\">Birth Date<\/label>\n              <input type=\"date\" name=\"birth_date[]\">\n            <\/div>\n            <div style=\"flex:1; min-width:220px\">\n              <label data-i18n=\"birthplace\">Birth Place<\/label>\n              <input name=\"birth_place[]\" data-i18n-ph=\"ph_place\" placeholder=\"City, Country\">\n            <\/div>\n            <div style=\"flex:1; min-width:220px\">\n              <label style=\"display:inline-flex; align-items:center; gap:10px; margin-top:36px;\">\n                <input type=\"checkbox\" class=\"is-deceased\" style=\"transform:scale(1.2)\"> <span data-i18n=\"deceased\">Deceased<\/span>\n              <\/label>\n            <\/div>\n            <div style=\"flex:1; min-width:220px\">\n              <label data-i18n=\"dod\">Death Date<\/label>\n              <input type=\"date\" name=\"death_date[]\" class=\"death-date\">\n            <\/div>\n          <\/div>\n\n          <div class=\"row\">\n            <div style=\"flex:1; min-width:240px\">\n              <label data-i18n=\"occupation\">Occupation<\/label>\n              <input name=\"occupation[]\" data-i18n-ph=\"ph_occupation\" placeholder=\"e.g., Teacher\">\n            <\/div>\n            <div style=\"flex:1; min-width:240px\">\n              <label data-i18n=\"contact\">Contact (email\/phone)<\/label>\n              <input name=\"contact[]\" data-i18n-ph=\"ph_contact\" placeholder=\"email@domain.com \/ +1\u2026\">\n            <\/div>\n          <\/div>\n\n          <label data-i18n=\"notable\" class=\"section-title\" style=\"margin-top:8px\">Notable Facts \/ Biography<\/label>\n          <textarea name=\"notable[]\" data-i18n-ph=\"ph_textarea\" placeholder=\"Key life events, achievements\u2026\"><\/textarea>\n\n          <label data-i18n=\"children\" class=\"section-title\">Children (names)<\/label>\n          <div class=\"chips\"><\/div>\n          <div class=\"row\">\n            <input class=\"child-input\" data-i18n-ph=\"ph_child\" placeholder=\"e.g., Emily Doe\" style=\"flex:1; min-width:260px\">\n            <button type=\"button\" class=\"btn btn-primary\" onclick=\"addChild(this)\" data-i18n=\"add_child\">+ Add child<\/button>\n          <\/div>\n\n          <label data-i18n=\"medical\" class=\"section-title\">Medical \/ Genetic Notes<\/label>\n          <textarea name=\"medical[]\" data-i18n-ph=\"ph_textarea\" placeholder=\"Conditions that may be relevant for family history\"><\/textarea>\n\n          <label data-i18n=\"notes\" class=\"section-title\">Notes<\/label>\n          <textarea name=\"notes[]\" data-i18n-ph=\"ph_textarea\" placeholder=\"Anything else important\"><\/textarea>\n        <\/div>\n      <\/div>\n\n      <div class=\"row\" style=\"margin-top:10px\">\n        <button type=\"button\" class=\"btn btn-primary\" onclick=\"addBlock()\" data-i18n=\"add_block\">+ Add another relative<\/button>\n        <button type=\"submit\" class=\"btn btn-success\" data-i18n=\"submit\">Submit<\/button>\n        <span class=\"muted\" data-i18n=\"hint_add\">You can add as many relatives as needed.<\/span>\n      <\/div>\n    <\/form>\n\n    <!-- ===== Botonera general (abajo) ===== -->\n    <div class=\"row\" style=\"margin-top:16px;\">\n      <button class=\"btn btn-primary\" onclick=\"shareNative()\" data-i18n=\"share_native\">Share\u2026<\/button>\n      <button class=\"btn btn-copy\" onclick=\"copyLink()\" data-i18n=\"share_copy\">Copy link<\/button>\n      <button class=\"btn btn-mail\" onclick=\"shareEmail()\" data-i18n=\"share_email\">Email<\/button>\n      <button class=\"btn btn-wa\" onclick=\"shareWhatsApp()\" data-i18n=\"share_whatsapp\">WhatsApp<\/button>\n      <button class=\"btn btn-print\" onclick=\"printCard()\" data-i18n=\"print\">Print<\/button>\n      <button class=\"btn btn-pdf\" onclick=\"downloadPDF()\" data-i18n=\"dl_pdf\">Download PDF<\/button>\n      <button class=\"btn btn-json\" onclick=\"downloadJSON()\" data-i18n=\"dl_json\">Download JSON<\/button>\n    <\/div>\n\n    <!-- ===== Documents & Certificates (compartir individual) ===== -->\n    <div id=\"fh-docs\" style=\"margin-top:22px;\">\n      <h3 id=\"docs-title\" class=\"section-title\">Documents &#038; Certificates<\/h3>\n      <div id=\"docs-list\" style=\"display:grid; gap:14px;\"><\/div>\n\n      <div style=\"margin-top:14px; background:rgba(0,0,0,.25); border:1px solid rgba(255,255,255,.25); color:#fff; padding:12px; border-radius:12px;\">\n        <div style=\"display:flex; gap:10px; flex-wrap:wrap; align-items:center;\">\n          <input id=\"new-doc-name\" type=\"text\" placeholder=\"Custom document name\"\n                 style=\"flex:1; min-width:240px; padding:12px; border-radius:12px; border:1px solid rgba(255,255,255,.45); background:rgba(255,255,255,.10); color:#fff;\">\n          <button type=\"button\" class=\"btn btn-primary\" onclick=\"Docs_addCustom()\" data-i18n=\"add_doc\">\n            + Add document\n          <\/button>\n        <\/div>\n      <\/div>\n    <\/div>\n\n  <\/div><!-- \/fh-card -->\n<\/div>\n\n<script>\n\/* ===================== i18n EN\/ES ===================== *\/\nconst I18N = {\n  en:{\n    title:\"Family History\",\n    relationship:\"Relationship\",\n    select_one:\"Select one\u2026\",\n    mother:\"Mother\", father:\"Father\", sibling:\"Sibling\", spouse:\"Spouse\", child:\"Child\",\n    mgm:\"Maternal Grandmother\", mgf:\"Maternal Grandfather\", pgm:\"Paternal Grandmother\", pgf:\"Paternal Grandfather\", other:\"Other\",\n    fullname:\"Full Name\",\n    dob:\"Birth Date\",\n    birthplace:\"Birth Place\",\n    deceased:\"Deceased\",\n    dod:\"Death Date\",\n    occupation:\"Occupation\",\n    contact:\"Contact (email\/phone)\",\n    notable:\"Notable Facts \/ Biography\",\n    children:\"Children (names)\",\n    medical:\"Medical \/ Genetic Notes\",\n    notes:\"Notes\",\n    add_child:\"+ Add child\",\n    add_block:\"+ Add another relative\",\n    submit:\"Submit\",\n    hint_add:\"You can add as many relatives as needed.\",\n    \/\/ Share UI\n    share_native:\"Share\u2026\",\n    share_copy:\"Copy link\",\n    share_email:\"Email\",\n    share_whatsapp:\"WhatsApp\",\n    print:\"Print\",\n    dl_pdf:\"Download PDF\",\n    dl_json:\"Download JSON\",\n    \/\/ Placeholders\n    ph_fullname:\"e.g., Jane Doe\",\n    ph_place:\"City, Country\",\n    ph_occupation:\"e.g., Teacher\",\n    ph_contact:\"email@domain.com \/ +1\u2026\",\n    ph_child:\"e.g., Emily Doe\",\n    ph_textarea:\"Add details\u2026\",\n    \/\/ Docs\n    docs_title:\"Documents & Certificates\",\n    pick_files:\"Attach files\",\n    no_files:\"No files yet.\",\n    download:\"Download\",\n    remove:\"Remove\",\n    share_native_file:\"Share\u2026\",\n    share_copy_file:\"Copy link\",\n    share_email_file:\"Email\",\n    share_whatsapp_file:\"WhatsApp\",\n    custom_ph:\"Custom document name\",\n    add_doc:\"+ Add document\",\n    c_birth:\"Birth Certificate\",\n    c_marriage:\"Marriage Certificate\",\n    c_death:\"Death Certificate\",\n    c_adoption:\"Adoption Papers\",\n    c_passport:\"Immigration \/ Passport\",\n    c_medical:\"Other Medical Records\"\n  },\n  es:{\n    title:\"Historia Familiar\",\n    relationship:\"Parentesco\",\n    select_one:\"Selecciona una\u2026\",\n    mother:\"Madre\", father:\"Padre\", sibling:\"Hermano(a)\", spouse:\"C\u00f3nyuge\", child:\"Hijo(a)\",\n    mgm:\"Abuela materna\", mgf:\"Abuelo materno\", pgm:\"Abuela paterna\", pgf:\"Abuelo paterno\", other:\"Otro\",\n    fullname:\"Nombre completo\",\n    dob:\"Fecha de nacimiento\",\n    birthplace:\"Lugar de nacimiento\",\n    deceased:\"Fallecido(a)\",\n    dod:\"Fecha de defunci\u00f3n\",\n    occupation:\"Ocupaci\u00f3n\",\n    contact:\"Contacto (email\/tel\u00e9fono)\",\n    notable:\"Datos notables \/ Biograf\u00eda\",\n    children:\"Hijos (nombres)\",\n    medical:\"Notas m\u00e9dicas \/ gen\u00e9ticas\",\n    notes:\"Notas\",\n    add_child:\"+ Agregar hijo(a)\",\n    add_block:\"+ Agregar otro familiar\",\n    submit:\"Enviar\",\n    hint_add:\"Puedes agregar tantos familiares como necesites.\",\n    \/\/ Share UI\n    share_native:\"Compartir\u2026\",\n    share_copy:\"Copiar enlace\",\n    share_email:\"Email\",\n    share_whatsapp:\"WhatsApp\",\n    print:\"Imprimir\",\n    dl_pdf:\"Descargar PDF\",\n    dl_json:\"Descargar JSON\",\n    \/\/ Placeholders\n    ph_fullname:\"ej.: Juana P\u00e9rez\",\n    ph_place:\"Ciudad, Pa\u00eds\",\n    ph_occupation:\"ej.: Docente\",\n    ph_contact:\"correo@dominio.com \/ +34\u2026\",\n    ph_child:\"ej.: Emilia P\u00e9rez\",\n    ph_textarea:\"A\u00f1ade detalles\u2026\",\n    \/\/ Docs\n    docs_title:\"Documentos y Certificados\",\n    pick_files:\"Adjuntar archivos\",\n    no_files:\"A\u00fan no hay archivos.\",\n    download:\"Descargar\",\n    remove:\"Eliminar\",\n    share_native_file:\"Compartir\u2026\",\n    share_copy_file:\"Copiar enlace\",\n    share_email_file:\"Email\",\n    share_whatsapp_file:\"WhatsApp\",\n    custom_ph:\"Nombre de documento personalizado\",\n    add_doc:\"+ Agregar documento\",\n    c_birth:\"Certificado de Nacimiento\",\n    c_marriage:\"Certificado de Matrimonio\",\n    c_death:\"Certificado de Defunci\u00f3n\",\n    c_adoption:\"Documentos de Adopci\u00f3n\",\n    c_passport:\"Inmigraci\u00f3n \/ Pasaporte\",\n    c_medical:\"Otros Registros M\u00e9dicos\"\n  }\n};\nfunction getLang(){\n  const q = new URL(location.href).searchParams.get('lang');\n  const saved = localStorage.getItem('form_lang_fh');\n  return (q && I18N[q]) ? q : (saved && I18N[saved]) ? saved : 'en';\n}\nfunction applyLang(lang){\n  const t = I18N[lang];\n  document.getElementById('title').textContent = t.title;\n  document.querySelectorAll('[data-i18n]').forEach(el=>{\n    const k = el.getAttribute('data-i18n');\n    if (t[k] !== undefined) el.textContent = t[k];\n  });\n  document.querySelectorAll('[data-i18n-ph]').forEach(el=>{\n    const k = el.getAttribute('data-i18n-ph');\n    if (t[k] !== undefined) el.setAttribute('placeholder', t[k]);\n  });\n  \/\/ Docs section\n  const dt = document.getElementById('docs-title'); if(dt) dt.textContent = t.docs_title;\n  const inp = document.getElementById('new-doc-name'); if(inp) inp.placeholder = t.custom_ph;\n  const sel = document.getElementById('langSel'); if(sel) sel.value = lang;\n  localStorage.setItem('form_lang_fh', lang);\n}\ndocument.getElementById('langSel').addEventListener('change', e=>applyLang(e.target.value));\napplyLang(getLang());\n\n\/* ======== l\u00f3gica de bloque del formulario ======== *\/\nfunction wireBlock(blk){\n  const deceased = blk.querySelector('.is-deceased');\n  const death = blk.querySelector('.death-date');\n  const rm  = blk.querySelector('.btn-remove');\n  if(deceased && death){\n    const toggle = ()=>{ death.disabled = !deceased.checked; death.style.opacity = deceased.checked ? 1 : .5; if(!deceased.checked) death.value=''; };\n    deceased.addEventListener('change', toggle); toggle();\n  }\n  if(rm && blk.dataset.cloned==='true'){ rm.style.display='inline-block'; }\n}\nfunction addBlock(){\n  const blocks = document.getElementById('blocks');\n  const first = blocks.querySelector('.blk');\n  const clone = first.cloneNode(true);\n  clone.dataset.cloned='true';\n  clone.querySelectorAll('input, textarea, select').forEach(el=>{\n    if(el.type==='checkbox'){ el.checked=false; return; }\n    if(el.tagName==='SELECT'){ el.selectedIndex=0; return; }\n    el.value='';\n  });\n  const chips = clone.querySelector('.chips'); if(chips) chips.innerHTML='';\n  wireBlock(clone);\n  blocks.appendChild(clone);\n}\ndocument.querySelectorAll('.blk').forEach(wireBlock);\n\nfunction addChild(btn){\n  const blk = btn.closest('.blk');\n  const input = blk.querySelector('.child-input');\n  const chips = blk.querySelector('.chips');\n  const v = (input.value||'').trim(); if(!v) return;\n  const chip = document.createElement('span');\n  chip.className='chip'; chip.textContent = v + ' ';\n  const x = document.createElement('button'); x.type='button'; x.textContent='\u00d7'; x.onclick=()=>chip.remove();\n  chip.appendChild(x); chips.appendChild(chip); input.value='';\n}\n\n\/* ======== compartir \/ descargar (general) ======== *\/\nfunction pageTitle(){ return document.getElementById('title')?.textContent || 'Form'; }\nfunction pageURL(){ return location.href; }\nasync function shareNative(){\n  const data = {title: pageTitle(), text: pageTitle(), url: pageURL()};\n  if (navigator.share){ try{ await navigator.share(data); }catch(e){} }\n  else { alert(I18N[getLang()].share_native); }\n}\nasync function copyLink(){\n  try{ await navigator.clipboard.writeText(pageURL()); alert('Link copied!'); }\n  catch(e){\n    const t=document.createElement('textarea'); t.value=pageURL(); document.body.appendChild(t);\n    t.select(); document.execCommand('copy'); t.remove(); alert('Link copied!');\n  }\n}\nfunction shareEmail(){\n  const s = encodeURIComponent(pageTitle());\n  const b = encodeURIComponent(pageURL());\n  location.href = `mailto:?subject=${s}&body=${b}`;\n}\nfunction shareWhatsApp(){\n  const u = encodeURIComponent(pageURL());\n  const t = encodeURIComponent(pageTitle());\n  window.open(`https:\/\/wa.me\/?text=${t}%20${u}`, '_blank');\n}\nfunction downloadJSON(){\n  const fd = new FormData(document.getElementById('fhForm'));\n  const data = {};\n  for (const [k,v] of fd.entries()){\n    if(k.endsWith('[]')){ const key=k.slice(0,-2); (data[key]||(data[key]=[])).push(v); }\n    else { (data[k]!==undefined)?(Array.isArray(data[k])?data[k].push(v):(data[k]=[v])):(data[k]=v); }\n  }\n  const blks=[...document.querySelectorAll('#blocks .blk')];\n  data.blocks = blks.map(b=>({\n    children: [...b.querySelectorAll('.chips .chip')].map(c=>c.firstChild.nodeValue.trim())\n  }));\n  const blob = new Blob([JSON.stringify(data,null,2)],{type:'application\/json'});\n  const a=document.createElement('a'); a.href=URL.createObjectURL(blob);\n  a.download = pageTitle().replace(\/\\s+\/g,'_') + '.json'; a.click();\n  setTimeout(()=>URL.revokeObjectURL(a.href),500);\n}\nfunction printCard(){ window.print(); }\nfunction downloadPDF(){\n  const card = document.getElementById('fh-card').cloneNode(true);\n  const w = window.open('', '_blank', 'width=960,height=1200');\n  const css = `\n    <style>\n      @page { size: A4; margin: 14mm; }\n      html, body { background:#fff; }\n      body{-webkit-print-color-adjust: exact; print-color-adjust: exact;}\n      *{-webkit-print-color-adjust: exact !important; print-color-adjust: exact !important;}\n      input,textarea,select{border:1px solid #333 !important; background:transparent !important; color:#000 !important; text-shadow:none !important;}\n      .btn, .chip button { display:none !important; }\n    <\/style>`;\n  w.document.open();\n  w.document.write(`<!doctype html><html><head><meta charset=\"utf-8\"><title>${pageTitle()} - PDF<\/title>${css}<\/head><body>${card.outerHTML}<script>window.onload=()=>setTimeout(()=>window.print(),250)<\\\/script><\/body><\/html>`);\n  w.document.close();\n}\n\n\/* ======== Documents & Certificates (con compartir individual) ======== *\/\nconst DOCS = {\n  items: [],\n  defaults: ['c_birth','c_marriage','c_death','c_adoption','c_passport','c_medical']\n};\nfunction dLang(){ return document.getElementById('langSel')?.value==='es' ? 'es':'en'; }\nfunction dT(k){ return (I18N[dLang()][k] ?? k); }\nfunction dSize(b){ if (b<1024) return b+' B'; if(b<1048576) return (b\/1024).toFixed(1)+' KB'; if(b<1073741824) return (b\/1048576).toFixed(1)+' MB'; return (b\/1073741824).toFixed(1)+' GB'; }\nfunction dUID(){ return Math.random().toString(36).slice(2); }\n\nfunction Docs_boot(){\n  DOCS.items = DOCS.defaults.map(key=>({ id:dUID(), name:dT(key), key, files:[] }));\n  Docs_render();\n  document.getElementById('langSel').addEventListener('change', ()=>Docs_render());\n}\nfunction Docs_addCustom(){\n  const input = document.getElementById('new-doc-name');\n  const name = (input.value||'').trim();\n  if (!name) return;\n  DOCS.items.push({ id:dUID(), key:null, name, files:[] });\n  input.value='';\n  Docs_render();\n}\nfunction Docs_render(){\n  const list = document.getElementById('docs-list');\n  const dt = document.getElementById('docs-title');\n  if(dt) dt.textContent = dT('docs_title');\n  const inp = document.getElementById('new-doc-name'); if(inp) inp.placeholder = dT('custom_ph');\n  list.innerHTML = '';\n\n  DOCS.items.forEach(item=>{\n    const wrap = document.createElement('div');\n    wrap.style.cssText = \"background:rgba(0,0,0,.22); border:1px solid rgba(255,255,255,.25); color:#fff; padding:12px; border-radius:12px;\";\n\n    const header = document.createElement('div');\n    header.style.cssText = \"display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;\";\n    const h = document.createElement('h4'); h.textContent = item.name; h.style.cssText = \"margin:0; font-size:20px; font-weight:800; text-shadow:0 2px 6px rgba(0,0,0,.6)\";\n    const pick = document.createElement('button'); pick.className='btn btn-primary'; pick.textContent = dT('pick_files');\n    pick.onclick = ()=>{\n      const inp = document.createElement('input'); inp.type='file'; inp.multiple=true; inp.style.display='none';\n      document.body.appendChild(inp);\n      inp.addEventListener('change', e=>{\n        if (e.target.files?.length){\n          [...e.target.files].forEach(f=> item.files.push({ id:dUID(), file:f, url:URL.createObjectURL(f) }));\n          Docs_render();\n        }\n        inp.remove();\n      });\n      inp.click();\n    };\n    header.appendChild(h); header.appendChild(pick);\n\n    const filesWrap = document.createElement('div'); filesWrap.style.cssText = \"display:grid; gap:10px; margin-top:10px;\";\n    if (!item.files.length){\n      const empty = document.createElement('div'); empty.textContent = dT('no_files'); empty.style.cssText = \"font-style:italic; opacity:.9;\";\n      filesWrap.appendChild(empty);\n    } else {\n      item.files.forEach(f=>{\n        const row = document.createElement('div'); row.className='att-row';\n        const meta = document.createElement('div'); meta.style.flex='1';\n        meta.innerHTML = `<strong>${f.file.name}<\/strong><br><span style=\"font-size:13px; opacity:.9\">${dSize(f.file.size)} \u2014 ${f.file.type||'application\/octet-stream'}<\/span>`;\n\n        const btns = document.createElement('div'); btns.style.cssText = \"display:flex; gap:8px; flex-wrap:wrap;\";\n\n        const bDl = document.createElement('button'); bDl.className='btn btn-primary'; bDl.textContent=dT('download');\n        bDl.onclick = ()=>{ const a=document.createElement('a'); a.href=f.url; a.download=f.file.name; a.click(); };\n\n        const bShare = document.createElement('button'); bShare.className='btn btn-primary'; bShare.textContent=dT('share_native_file');\n        bShare.onclick = async ()=>{\n          const data = { title: item.name, text: `${item.name}: ${f.file.name}`, url: location.href + `#${encodeURIComponent(item.name)}` };\n          if (navigator.share){ try{ await navigator.share(data); }catch(e){} } else { alert(dT('share_native_file')); }\n        };\n\n        const bCopy = document.createElement('button'); bCopy.className='btn btn-copy'; bCopy.textContent=dT('share_copy_file');\n        bCopy.onclick = async ()=>{\n          const link = location.href + `#${encodeURIComponent(item.name)}`;\n          try{ await navigator.clipboard.writeText(link); alert('Link copied!'); }\n          catch(e){ const t=document.createElement('textarea'); t.value=link; document.body.appendChild(t); t.select(); document.execCommand('copy'); t.remove(); alert('Link copied!'); }\n        };\n\n        const bEmail = document.createElement('button'); bEmail.className='btn btn-mail'; bEmail.textContent=dT('share_email_file');\n        bEmail.onclick = ()=>{\n          const s = encodeURIComponent(`${item.name} - ${f.file.name}`);\n          const b = encodeURIComponent(location.href + `#${encodeURIComponent(item.name)}`);\n          location.href = `mailto:?subject=${s}&body=${b}`;\n        };\n\n        const bWa = document.createElement('button'); bWa.className='btn btn-wa'; bWa.textContent=dT('share_whatsapp_file');\n        bWa.onclick = ()=>{\n          const u = encodeURIComponent(location.href + `#${encodeURIComponent(item.name)}`);\n          const t = encodeURIComponent(`${item.name} - ${f.file.name}`);\n          window.open(`https:\/\/wa.me\/?text=${t}%20${u}`, '_blank');\n        };\n\n        const bRm = document.createElement('button'); bRm.className='btn btn-remove'; bRm.textContent=dT('remove');\n        bRm.onclick = ()=>{ URL.revokeObjectURL(f.url); item.files = item.files.filter(x=>x.id!==f.id); Docs_render(); };\n\n        btns.appendChild(bDl); btns.appendChild(bShare); btns.appendChild(bCopy); btns.appendChild(bEmail); btns.appendChild(bWa); btns.appendChild(bRm);\n        row.appendChild(meta); row.appendChild(btns); filesWrap.appendChild(row);\n      });\n    }\n\n    wrap.appendChild(header); wrap.appendChild(filesWrap); list.appendChild(wrap);\n  });\n}\ndocument.addEventListener('DOMContentLoaded', Docs_boot);\n<\/script>\n\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:30px\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Family History Language EnglishEspa\u00f1ol \u00d7 Relationship Select one\u2026MotherFatherSiblingSpouseChildMaternal GrandmotherMaternal GrandfatherPaternal GrandmotherPaternal GrandfatherOther Full Name Birth Date Birth Place Deceased Death Date Occupation Contact (email\/phone) Notable Facts \/ Biography Children (names) + Add child Medical \/ Genetic Notes Notes + Add another relative Submit You can add as many relatives as needed. Share\u2026 Copy link Email [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","pmpro_default_level":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-368","page","type-page","status-publish","hentry","pmpro-has-access"],"_links":{"self":[{"href":"https:\/\/tree-of-mylife.com\/es\/wp-json\/wp\/v2\/pages\/368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tree-of-mylife.com\/es\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tree-of-mylife.com\/es\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tree-of-mylife.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tree-of-mylife.com\/es\/wp-json\/wp\/v2\/comments?post=368"}],"version-history":[{"count":29,"href":"https:\/\/tree-of-mylife.com\/es\/wp-json\/wp\/v2\/pages\/368\/revisions"}],"predecessor-version":[{"id":744,"href":"https:\/\/tree-of-mylife.com\/es\/wp-json\/wp\/v2\/pages\/368\/revisions\/744"}],"wp:attachment":[{"href":"https:\/\/tree-of-mylife.com\/es\/wp-json\/wp\/v2\/media?parent=368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}