{
  "id": "spanish_verb_trail",
  "type": "module",
  "version": "1.1",
  "context": {
    "layout": "phone",
    "title": "Spanish Verb Quest",
    "icon": "🇪🇸",
    "lessons": [
      {
        "id": 0,
        "verb": "hablar",
        "group": "Regular",
        "tense": "Present",
        "forms": [
          "hablo",
          "hablas",
          "habla",
          "hablamos",
          "habláis",
          "hablan"
        ],
        "person": 0,
        "gap": "Yo ___ español con Ana.",
        "phrase": "Yo hablo español con Ana.",
        "translation": "I speak Spanish with Ana.",
        "note": "Present: habits and current situations. Regular -ar endings: -o, -as, -a, -amos, -áis, -an."
      },
      {
        "id": 1,
        "verb": "hablar",
        "group": "Regular",
        "tense": "Preterite",
        "forms": [
          "hablé",
          "hablaste",
          "habló",
          "hablamos",
          "hablasteis",
          "hablaron"
        ],
        "person": 2,
        "gap": "Ella ___ con su profesora ayer.",
        "phrase": "Ella habló con su profesora ayer.",
        "translation": "She spoke with her teacher yesterday.",
        "note": "Preterite (pretérito indefinido): completed past events. Hablamos is both present and preterite; context tells you which."
      },
      {
        "id": 2,
        "verb": "hablar",
        "group": "Regular",
        "tense": "Future",
        "forms": [
          "hablaré",
          "hablarás",
          "hablará",
          "hablaremos",
          "hablaréis",
          "hablarán"
        ],
        "person": 3,
        "gap": "Nosotros ___ mañana.",
        "phrase": "Nosotros hablaremos mañana.",
        "translation": "We will speak tomorrow.",
        "note": "Simple future: add -é, -ás, -á, -emos, -éis, -án to the infinitive."
      },
      {
        "id": 3,
        "verb": "comer",
        "group": "Regular",
        "tense": "Present",
        "forms": [
          "como",
          "comes",
          "come",
          "comemos",
          "coméis",
          "comen"
        ],
        "person": 1,
        "gap": "Tú ___ fruta cada día.",
        "phrase": "Tú comes fruta cada día.",
        "translation": "You eat fruit every day.",
        "note": "Regular -er present endings: -o, -es, -e, -emos, -éis, -en."
      },
      {
        "id": 4,
        "verb": "comer",
        "group": "Regular",
        "tense": "Preterite",
        "forms": [
          "comí",
          "comiste",
          "comió",
          "comimos",
          "comisteis",
          "comieron"
        ],
        "person": 5,
        "gap": "Ellos ___ en casa ayer.",
        "phrase": "Ellos comieron en casa ayer.",
        "translation": "They ate at home yesterday.",
        "note": "Regular -er and -ir verbs share preterite endings: -í, -iste, -ió, -imos, -isteis, -ieron."
      },
      {
        "id": 5,
        "verb": "comer",
        "group": "Regular",
        "tense": "Future",
        "forms": [
          "comeré",
          "comerás",
          "comerá",
          "comeremos",
          "comeréis",
          "comerán"
        ],
        "person": 0,
        "gap": "Yo ___ después de clase.",
        "phrase": "Yo comeré después de clase.",
        "translation": "I will eat after class.",
        "note": "Keep the infinitive comer and add the future ending. The same future endings work for -ar, -er and -ir."
      },
      {
        "id": 6,
        "verb": "vivir",
        "group": "Regular",
        "tense": "Present",
        "forms": [
          "vivo",
          "vives",
          "vive",
          "vivimos",
          "vivís",
          "viven"
        ],
        "person": 3,
        "gap": "Nosotros ___ en Madrid.",
        "phrase": "Nosotros vivimos en Madrid.",
        "translation": "We live in Madrid.",
        "note": "Regular -ir present endings: -o, -es, -e, -imos, -ís, -en."
      },
      {
        "id": 7,
        "verb": "vivir",
        "group": "Regular",
        "tense": "Preterite",
        "forms": [
          "viví",
          "viviste",
          "vivió",
          "vivimos",
          "vivisteis",
          "vivieron"
        ],
        "person": 2,
        "gap": "Ella ___ en Sevilla el año pasado.",
        "phrase": "Ella vivió en Sevilla el año pasado.",
        "translation": "She lived in Seville last year.",
        "note": "Vivimos can mean we live or we lived. A completed time frame makes the preterite meaning clear."
      },
      {
        "id": 8,
        "verb": "vivir",
        "group": "Regular",
        "tense": "Future",
        "forms": [
          "viviré",
          "vivirás",
          "vivirá",
          "viviremos",
          "viviréis",
          "vivirán"
        ],
        "person": 4,
        "gap": "Vosotros ___ cerca del mar.",
        "phrase": "Vosotros viviréis cerca del mar.",
        "translation": "You all will live near the sea.",
        "note": "Vosotros is informal plural you, used mainly in Spain. Ustedes takes the ellos/ellas form."
      },
      {
        "id": 9,
        "verb": "ser",
        "group": "Irregular",
        "tense": "Present",
        "forms": [
          "soy",
          "eres",
          "es",
          "somos",
          "sois",
          "son"
        ],
        "person": 0,
        "gap": "Yo ___ estudiante.",
        "phrase": "Yo soy estudiante.",
        "translation": "I am a student.",
        "note": "Ser describes identity, origin and characteristics. Its present forms are irregular; learn them as a set."
      },
      {
        "id": 10,
        "verb": "ser",
        "group": "Irregular",
        "tense": "Preterite",
        "forms": [
          "fui",
          "fuiste",
          "fue",
          "fuimos",
          "fuisteis",
          "fueron"
        ],
        "person": 2,
        "gap": "La reunión ___ breve.",
        "phrase": "La reunión fue breve.",
        "translation": "The meeting was brief.",
        "note": "Ser and ir have identical preterite forms. The sentence context distinguishes was/were from went."
      },
      {
        "id": 11,
        "verb": "ser",
        "group": "Irregular",
        "tense": "Future",
        "forms": [
          "seré",
          "serás",
          "será",
          "seremos",
          "seréis",
          "serán"
        ],
        "person": 5,
        "gap": "Ellos ___ nuestros vecinos.",
        "phrase": "Ellos serán nuestros vecinos.",
        "translation": "They will be our neighbours.",
        "note": "Ser is an irregular verb overall, but its simple future follows the regular infinitive + ending pattern."
      },
      {
        "id": 12,
        "verb": "tener",
        "group": "Irregular",
        "tense": "Present",
        "forms": [
          "tengo",
          "tienes",
          "tiene",
          "tenemos",
          "tenéis",
          "tienen"
        ],
        "person": 1,
        "gap": "Tú ___ dos hermanos.",
        "phrase": "Tú tienes dos hermanos.",
        "translation": "You have two siblings.",
        "note": "Yo is tengo. The stem changes e → ie except in nosotros and vosotros."
      },
      {
        "id": 13,
        "verb": "tener",
        "group": "Irregular",
        "tense": "Preterite",
        "forms": [
          "tuve",
          "tuviste",
          "tuvo",
          "tuvimos",
          "tuvisteis",
          "tuvieron"
        ],
        "person": 3,
        "gap": "Nosotros ___ una idea ayer.",
        "phrase": "Nosotros tuvimos una idea ayer.",
        "translation": "We had an idea yesterday.",
        "note": "Use the irregular stem tuv-. These preterite forms have no written accent."
      },
      {
        "id": 14,
        "verb": "tener",
        "group": "Irregular",
        "tense": "Future",
        "forms": [
          "tendré",
          "tendrás",
          "tendrá",
          "tendremos",
          "tendréis",
          "tendrán"
        ],
        "person": 0,
        "gap": "Yo ___ tiempo mañana.",
        "phrase": "Yo tendré tiempo mañana.",
        "translation": "I will have time tomorrow.",
        "note": "Use the irregular stem tendr- plus the usual future endings."
      },
      {
        "id": 15,
        "verb": "ir",
        "group": "Irregular",
        "tense": "Present",
        "forms": [
          "voy",
          "vas",
          "va",
          "vamos",
          "vais",
          "van"
        ],
        "person": 5,
        "gap": "Ellas ___ al parque cada tarde.",
        "phrase": "Ellas van al parque cada tarde.",
        "translation": "They go to the park every afternoon.",
        "note": "Ir expresses movement. A + el contracts to al: van al parque."
      },
      {
        "id": 16,
        "verb": "ir",
        "group": "Irregular",
        "tense": "Preterite",
        "forms": [
          "fui",
          "fuiste",
          "fue",
          "fuimos",
          "fuisteis",
          "fueron"
        ],
        "person": 4,
        "gap": "Vosotros ___ al cine ayer.",
        "phrase": "Vosotros fuisteis al cine ayer.",
        "translation": "You all went to the cinema yesterday.",
        "note": "These forms are identical to the preterite of ser. A destination such as al cine signals ir here."
      },
      {
        "id": 17,
        "verb": "ir",
        "group": "Irregular",
        "tense": "Future",
        "forms": [
          "iré",
          "irás",
          "irá",
          "iremos",
          "iréis",
          "irán"
        ],
        "person": 2,
        "gap": "Ella ___ a Valencia el lunes.",
        "phrase": "Ella irá a Valencia el lunes.",
        "translation": "She will go to Valencia on Monday.",
        "note": "Ir has a regular simple future: ir + ending. This tense differs from the common ir a + infinitive construction."
      }
    ],
    "verbs": "{{ [{'name':'hablar','meaning':'to speak','group':'Regular','base':0},{'name':'comer','meaning':'to eat','group':'Regular','base':3},{'name':'vivir','meaning':'to live','group':'Regular','base':6},{'name':'ser','meaning':'to be','group':'Irregular','base':9},{'name':'tener','meaning':'to have','group':'Irregular','base':12},{'name':'ir','meaning':'to go','group':'Irregular','base':15}] + map(@{extraVerbs}, {'name':@{item.name},'meaning':@{item.meaning},'group':@{item.group},'base':18 + @{index} * 3}) }}",
    "persons": [
      "yo",
      "tú",
      "él / ella / usted",
      "nosotros / nosotras",
      "vosotros / vosotras",
      "ellos / ellas / ustedes"
    ],
    "tenseNames": [
      "Present",
      "Preterite",
      "Future"
    ],
    "pool": "{{ switch(@{currentTense} == 'Present', ${lessonCache[tense == 'Present']}, @{currentTense} == 'Preterite', ${lessonCache[tense == 'Preterite']}, ${lessonCache[tense == 'Future']}) }}",
    "question": "@{groupPool[@{poolIndex}]}",
    "personIndex": "${person}",
    "expected": "@{question.forms[@{personIndex}]}",
    "isCorrect": "{{ lower(trim(${answer})) == @{expected} }}",
    "xp": "{{ sum(${correct}) * 10 }}",
    "level": "{{ cast(@{xp} / 100, 'int') + 1 }}",
    "coverage": "{{ sum(map(${attempts}, @{item} > 0 ? 1 : 0)) }}",
    "extraVerbs": [
      {
        "name": "estar",
        "meaning": "to be (state / location)",
        "group": "Irregular",
        "forms": [
          [
            "estoy",
            "estás",
            "está",
            "estamos",
            "estáis",
            "están"
          ],
          [
            "estuve",
            "estuviste",
            "estuvo",
            "estuvimos",
            "estuvisteis",
            "estuvieron"
          ],
          [
            "estaré",
            "estarás",
            "estará",
            "estaremos",
            "estaréis",
            "estarán"
          ]
        ],
        "tail": "en casa",
        "en": "at home",
        "baseEn": "be",
        "third": "is",
        "past": "was"
      },
      {
        "name": "hacer",
        "meaning": "to do / make",
        "group": "Irregular",
        "forms": [
          [
            "hago",
            "haces",
            "hace",
            "hacemos",
            "hacéis",
            "hacen"
          ],
          [
            "hice",
            "hiciste",
            "hizo",
            "hicimos",
            "hicisteis",
            "hicieron"
          ],
          [
            "haré",
            "harás",
            "hará",
            "haremos",
            "haréis",
            "harán"
          ]
        ],
        "tail": "la cena",
        "en": "dinner",
        "baseEn": "make",
        "third": "makes",
        "past": "made"
      },
      {
        "name": "poder",
        "meaning": "to be able to",
        "group": "Irregular",
        "forms": [
          [
            "puedo",
            "puedes",
            "puede",
            "podemos",
            "podéis",
            "pueden"
          ],
          [
            "pude",
            "pudiste",
            "pudo",
            "pudimos",
            "pudisteis",
            "pudieron"
          ],
          [
            "podré",
            "podrás",
            "podrá",
            "podremos",
            "podréis",
            "podrán"
          ]
        ],
        "tail": "ayudar",
        "en": "help",
        "baseEn": "be able to",
        "third": "can",
        "past": "managed to"
      },
      {
        "name": "querer",
        "meaning": "to want / love",
        "group": "Irregular",
        "forms": [
          [
            "quiero",
            "quieres",
            "quiere",
            "queremos",
            "queréis",
            "quieren"
          ],
          [
            "quise",
            "quisiste",
            "quiso",
            "quisimos",
            "quisisteis",
            "quisieron"
          ],
          [
            "querré",
            "querrás",
            "querrá",
            "querremos",
            "querréis",
            "querrán"
          ]
        ],
        "tail": "ayudar",
        "en": "to help",
        "baseEn": "want",
        "third": "wants",
        "past": "wanted"
      },
      {
        "name": "decir",
        "meaning": "to say / tell",
        "group": "Irregular",
        "forms": [
          [
            "digo",
            "dices",
            "dice",
            "decimos",
            "decís",
            "dicen"
          ],
          [
            "dije",
            "dijiste",
            "dijo",
            "dijimos",
            "dijisteis",
            "dijeron"
          ],
          [
            "diré",
            "dirás",
            "dirá",
            "diremos",
            "diréis",
            "dirán"
          ]
        ],
        "tail": "la verdad",
        "en": "the truth",
        "baseEn": "tell",
        "third": "tells",
        "past": "told"
      },
      {
        "name": "venir",
        "meaning": "to come",
        "group": "Irregular",
        "forms": [
          [
            "vengo",
            "vienes",
            "viene",
            "venimos",
            "venís",
            "vienen"
          ],
          [
            "vine",
            "viniste",
            "vino",
            "vinimos",
            "vinisteis",
            "vinieron"
          ],
          [
            "vendré",
            "vendrás",
            "vendrá",
            "vendremos",
            "vendréis",
            "vendrán"
          ]
        ],
        "tail": "a clase",
        "en": "to class",
        "baseEn": "come",
        "third": "comes",
        "past": "came"
      },
      {
        "name": "ver",
        "meaning": "to see",
        "group": "Irregular",
        "forms": [
          [
            "veo",
            "ves",
            "ve",
            "vemos",
            "veis",
            "ven"
          ],
          [
            "vi",
            "viste",
            "vio",
            "vimos",
            "visteis",
            "vieron"
          ],
          [
            "veré",
            "verás",
            "verá",
            "veremos",
            "veréis",
            "verán"
          ]
        ],
        "tail": "a Ana",
        "en": "Ana",
        "baseEn": "see",
        "third": "sees",
        "past": "saw"
      },
      {
        "name": "dar",
        "meaning": "to give",
        "group": "Irregular",
        "forms": [
          [
            "doy",
            "das",
            "da",
            "damos",
            "dais",
            "dan"
          ],
          [
            "di",
            "diste",
            "dio",
            "dimos",
            "disteis",
            "dieron"
          ],
          [
            "daré",
            "darás",
            "dará",
            "daremos",
            "daréis",
            "darán"
          ]
        ],
        "tail": "un paseo",
        "en": "a walk",
        "baseEn": "take",
        "third": "takes",
        "past": "took"
      },
      {
        "name": "saber",
        "meaning": "to know (facts / how)",
        "group": "Irregular",
        "forms": [
          [
            "sé",
            "sabes",
            "sabe",
            "sabemos",
            "sabéis",
            "saben"
          ],
          [
            "supe",
            "supiste",
            "supo",
            "supimos",
            "supisteis",
            "supieron"
          ],
          [
            "sabré",
            "sabrás",
            "sabrá",
            "sabremos",
            "sabréis",
            "sabrán"
          ]
        ],
        "tail": "la respuesta",
        "en": "the answer",
        "baseEn": "know",
        "third": "knows",
        "past": "found out"
      },
      {
        "name": "poner",
        "meaning": "to put / place",
        "group": "Irregular",
        "forms": [
          [
            "pongo",
            "pones",
            "pone",
            "ponemos",
            "ponéis",
            "ponen"
          ],
          [
            "puse",
            "pusiste",
            "puso",
            "pusimos",
            "pusisteis",
            "pusieron"
          ],
          [
            "pondré",
            "pondrás",
            "pondrá",
            "pondremos",
            "pondréis",
            "pondrán"
          ]
        ],
        "tail": "la mesa",
        "en": "the table",
        "baseEn": "set",
        "third": "sets",
        "past": "set"
      },
      {
        "name": "salir",
        "meaning": "to leave / go out",
        "group": "Irregular",
        "forms": [
          [
            "salgo",
            "sales",
            "sale",
            "salimos",
            "salís",
            "salen"
          ],
          [
            "salí",
            "saliste",
            "salió",
            "salimos",
            "salisteis",
            "salieron"
          ],
          [
            "saldré",
            "saldrás",
            "saldrá",
            "saldremos",
            "saldréis",
            "saldrán"
          ]
        ],
        "tail": "de casa",
        "en": "home",
        "baseEn": "leave",
        "third": "leaves",
        "past": "left"
      },
      {
        "name": "llegar",
        "meaning": "to arrive",
        "group": "Irregular",
        "forms": [
          [
            "llego",
            "llegas",
            "llega",
            "llegamos",
            "llegáis",
            "llegan"
          ],
          [
            "llegué",
            "llegaste",
            "llegó",
            "llegamos",
            "llegasteis",
            "llegaron"
          ],
          [
            "llegaré",
            "llegarás",
            "llegará",
            "llegaremos",
            "llegaréis",
            "llegarán"
          ]
        ],
        "tail": "a tiempo",
        "en": "on time",
        "baseEn": "arrive",
        "third": "arrives",
        "past": "arrived"
      },
      {
        "name": "trabajar",
        "meaning": "to work",
        "group": "Regular",
        "forms": [
          [
            "trabajo",
            "trabajas",
            "trabaja",
            "trabajamos",
            "trabajáis",
            "trabajan"
          ],
          [
            "trabajé",
            "trabajaste",
            "trabajó",
            "trabajamos",
            "trabajasteis",
            "trabajaron"
          ],
          [
            "trabajaré",
            "trabajarás",
            "trabajará",
            "trabajaremos",
            "trabajaréis",
            "trabajarán"
          ]
        ],
        "tail": "en casa",
        "en": "at home",
        "baseEn": "work",
        "third": "works",
        "past": "worked"
      },
      {
        "name": "necesitar",
        "meaning": "to need",
        "group": "Regular",
        "forms": [
          [
            "necesito",
            "necesitas",
            "necesita",
            "necesitamos",
            "necesitáis",
            "necesitan"
          ],
          [
            "necesité",
            "necesitaste",
            "necesitó",
            "necesitamos",
            "necesitasteis",
            "necesitaron"
          ],
          [
            "necesitaré",
            "necesitarás",
            "necesitará",
            "necesitaremos",
            "necesitaréis",
            "necesitarán"
          ]
        ],
        "tail": "ayuda",
        "en": "help",
        "baseEn": "need",
        "third": "needs",
        "past": "needed"
      },
      {
        "name": "comprar",
        "meaning": "to buy",
        "group": "Regular",
        "forms": [
          [
            "compro",
            "compras",
            "compra",
            "compramos",
            "compráis",
            "compran"
          ],
          [
            "compré",
            "compraste",
            "compró",
            "compramos",
            "comprasteis",
            "compraron"
          ],
          [
            "compraré",
            "comprarás",
            "comprará",
            "compraremos",
            "compraréis",
            "comprarán"
          ]
        ],
        "tail": "pan",
        "en": "bread",
        "baseEn": "buy",
        "third": "buys",
        "past": "bought"
      },
      {
        "name": "beber",
        "meaning": "to drink",
        "group": "Regular",
        "forms": [
          [
            "bebo",
            "bebes",
            "bebe",
            "bebemos",
            "bebéis",
            "beben"
          ],
          [
            "bebí",
            "bebiste",
            "bebió",
            "bebimos",
            "bebisteis",
            "bebieron"
          ],
          [
            "beberé",
            "beberás",
            "beberá",
            "beberemos",
            "beberéis",
            "beberán"
          ]
        ],
        "tail": "agua",
        "en": "water",
        "baseEn": "drink",
        "third": "drinks",
        "past": "drank"
      },
      {
        "name": "aprender",
        "meaning": "to learn",
        "group": "Regular",
        "forms": [
          [
            "aprendo",
            "aprendes",
            "aprende",
            "aprendemos",
            "aprendéis",
            "aprenden"
          ],
          [
            "aprendí",
            "aprendiste",
            "aprendió",
            "aprendimos",
            "aprendisteis",
            "aprendieron"
          ],
          [
            "aprenderé",
            "aprenderás",
            "aprenderá",
            "aprenderemos",
            "aprenderéis",
            "aprenderán"
          ]
        ],
        "tail": "algo nuevo",
        "en": "something new",
        "baseEn": "learn",
        "third": "learns",
        "past": "learned"
      },
      {
        "name": "escribir",
        "meaning": "to write",
        "group": "Regular",
        "forms": [
          [
            "escribo",
            "escribes",
            "escribe",
            "escribimos",
            "escribís",
            "escriben"
          ],
          [
            "escribí",
            "escribiste",
            "escribió",
            "escribimos",
            "escribisteis",
            "escribieron"
          ],
          [
            "escribiré",
            "escribirás",
            "escribirá",
            "escribiremos",
            "escribiréis",
            "escribirán"
          ]
        ],
        "tail": "un mensaje",
        "en": "a message",
        "baseEn": "write",
        "third": "writes",
        "past": "wrote"
      }
    ],
    "extraLessons": "{{ map(@{lessonSlots}, {'id':@{item.id}, 'verb':@{extraVerbs[@{item.v}].name}, 'group':@{extraVerbs[@{item.v}].group}, 'tense':@{tenseNames[@{item.t}]}, 'forms':@{extraVerbs[@{item.v}].forms[@{item.t}]}, 'person':0, 'phrase':'Yo ' + @{extraVerbs[@{item.v}].forms[@{item.t}][0]} + ' ' + @{extraVerbs[@{item.v}].tail} + switch(@{item.t} == 1, ' ayer.', @{item.t} == 2, ' mañana.', '.'), 'translation':'I ' + switch(@{item.t} == 2, 'will ' + @{extraVerbs[@{item.v}].baseEn}, @{item.t} == 1, @{extraVerbs[@{item.v}].past}, @{extraVerbs[@{item.v}].name} == 'estar', 'am', @{extraVerbs[@{item.v}].name} == 'poder', 'can', @{extraVerbs[@{item.v}].baseEn}) + ' ' + @{extraVerbs[@{item.v}].en} + switch(@{item.t} == 1, ' yesterday.', @{item.t} == 2, ' tomorrow.', '.'), 'note':switch(@{extraVerbs[@{item.v}].name} == 'llegar', 'Llegar has a spelling change in the preterite yo form: llegué preserves the hard g sound.', @{extraVerbs[@{item.v}].name} == 'saber', 'In the preterite, saber often means found out. The present means know.', 'Forms are ordered yo, tú, él/ella/usted, nosotros, vosotros, ellos/ellas/ustedes.')}) }}",
    "catalog": "{{ @{lessons} + @{extraLessons} }}",
    "lessonSlots": "{{ map(range(count(@{extraVerbs}) * 3), {'id':18 + @{item}, 'v':cast(@{item} / 3, 'int'), 't':@{item} % 3}) }}",
    "sentenceData": "{{ [{'tail':'español','en':'Spanish','baseEn':'speak','third':'speaks','past':'spoke'},{'tail':'en casa','en':'at home','baseEn':'eat','third':'eats','past':'ate'},{'tail':'en Madrid','en':'in Madrid','baseEn':'live','third':'lives','past':'lived'},{'tail':'de gran ayuda','en':'a great help','baseEn':'be','third':'is','past':'was'},{'tail':'tiempo','en':'time','baseEn':'have','third':'has','past':'had'},{'tail':'al parque','en':'to the park','baseEn':'go','third':'goes','past':'went'}] + @{extraVerbs} }}",
    "currentTenseIndex": "{{ (${tenseStart} + ${number}) % 3 }}",
    "currentTense": "{{ ${tense} == 'Mixed' ? @{tenseNames[@{currentTenseIndex}]} : ${tense} }}",
    "groupPool": "@{pool[group == ${group} || ${group} == 'Mixed']}",
    "poolIndex": "{{ ${qIndex} % count(@{groupPool}) }}",
    "subjects": [
      "Yo",
      "Tú",
      "Ella",
      "Nosotros",
      "Vosotros",
      "Ellos"
    ],
    "englishSubjects": [
      "I",
      "You",
      "She",
      "We",
      "You all",
      "They"
    ],
    "exampleIndex": "{{ cast(@{question.id} / 3, 'int') }}",
    "exampleData": "@{sentenceData[@{exampleIndex}]}",
    "esTime": "{{ switch(@{question.tense} == 'Preterite', ' ayer.', @{question.tense} == 'Future', ' mañana.', '.') }}",
    "enTime": "{{ switch(@{question.tense} == 'Preterite', ' yesterday.', @{question.tense} == 'Future', ' tomorrow.', '.') }}",
    "bePresent": "{{ switch(@{personIndex} == 0, 'am', @{personIndex} == 2, 'is', 'are') }}",
    "bePast": "{{ @{personIndex} == 0 || @{personIndex} == 2 ? 'was' : 'were' }}",
    "enPresent": "{{ switch(@{exampleData.baseEn} == 'be', @{bePresent}, @{question.verb} == 'poder', 'can', @{personIndex} == 2, @{exampleData.third}, @{exampleData.baseEn}) }}",
    "enPast": "{{ @{exampleData.baseEn} == 'be' ? @{bePast} : @{exampleData.past} }}",
    "enForm": "{{ switch(@{question.tense} == 'Present', @{enPresent}, @{question.tense} == 'Preterite', @{enPast}, 'will ' + @{exampleData.baseEn}) }}",
    "answerPhrase": "{{ @{subjects[@{personIndex}]} + ' ' + @{expected} + ' ' + @{exampleData.tail} + @{esTime} }}",
    "answerGap": "{{ @{subjects[@{personIndex}]} + ' ___ ' + @{exampleData.tail} + @{esTime} }}",
    "answerTranslation": "{{ @{englishSubjects[@{personIndex}]} + ' ' + @{enForm} + ' ' + @{exampleData.en} + @{enTime} }}"
  },
  "state": {
    "attempts": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "correct": [
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0
    ],
    "loaded": false,
    "saving": false,
    "saveError": "",
    "saveNotice": "",
    "resetAlert": false,
    "tense": "Present",
    "group": "Mixed",
    "practiceMode": "Forms",
    "active": false,
    "finished": false,
    "answered": false,
    "qIndex": 0,
    "person": 0,
    "number": 0,
    "answer": "",
    "focused": "",
    "inputError": "",
    "roundResults": [],
    "tenseStart": 0,
    "lessonCache": []
  },
  "dependencies": [
    {
      "repository": {
        "local": {
          "id": "spanish_verb_trail_v1",
          "config": {}
        }
      }
    },
    {
      "service": {
        "audio": {
          "id": "verb_audio"
        }
      }
    },
    {
      "action": {
        "repo": {
          "id": "persist_progress",
          "input": {
            "repositoryId": "spanish_verb_trail_v1",
            "operation": "create",
            "params": {
              "collection": "learning",
              "documentId": "progress",
              "rewrite": true,
              "body": {
                "attempts": "${attempts}",
                "correct": "${correct}"
              }
            }
          },
          "output": {
            "success": [
              {
                "state": {
                  "id": "persist_ok",
                  "input": {
                    "saving": false,
                    "saveError": "",
                    "saveNotice": "Progress saved on this device."
                  }
                }
              }
            ],
            "failure": [
              {
                "state": {
                  "id": "persist_failed",
                  "input": {
                    "saving": false,
                    "saveError": "Progress could not be saved. Retry before leaving to keep this practice.",
                    "saveNotice": ""
                  }
                }
              }
            ]
          }
        }
      }
    },
    {
      "action": {
        "state": {
          "id": "begin_round",
          "input": {
            "active": true,
            "finished": false,
            "answered": false,
            "qIndex": "{{ random(0, count(@{verbs}) - 1) }}",
            "person": "{{ random(0, 5) }}",
            "number": 0,
            "answer": "",
            "focused": "",
            "inputError": "",
            "roundResults": [],
            "tenseStart": "{{ random(0, 2) }}"
          },
          "output": {
            "success": [
              {
                "service": {
                  "id": "begin_haptic",
                  "input": {
                    "serviceId": "verb_audio",
                    "params": {
                      "haptic": "light"
                    }
                  }
                }
              }
            ]
          }
        }
      }
    },
    {
      "action": {
        "condition": {
          "id": "check_answer",
          "input": "{{ !${answered} && notEmpty(trim(${answer})) }}",
          "output": {
            "success": [
              {
                "state": {
                  "id": "record_answer",
                  "input": {
                    "answered": true,
                    "focused": "",
                    "inputError": "",
                    "attempts": "{{ setAt(${attempts}, @{question.id}, ${attempts[@{question.id}]} + 1) }}",
                    "correct": "{{ setAt(${correct}, @{question.id}, ${correct[@{question.id}]} + (@{isCorrect} ? 1 : 0)) }}",
                    "roundResults": "{{ ${roundResults} + (@{isCorrect} ? 1 : 0) }}",
                    "saving": true,
                    "saveNotice": "",
                    "saveError": ""
                  },
                  "output": {
                    "success": [
                      {
                        "service": {
                          "id": "answer_haptic",
                          "input": {
                            "serviceId": "verb_audio",
                            "params": {
                              "haptic": "{{ @{isCorrect} ? 'success' : 'warning' }}"
                            }
                          }
                        }
                      },
                      {
                        "template": {
                          "id": "persist_answer_call",
                          "input": "persist_progress"
                        }
                      }
                    ]
                  }
                }
              }
            ],
            "failure": [
              {
                "state": {
                  "id": "answer_invalid",
                  "input": {
                    "inputError": "Enter just the conjugated verb form.",
                    "focused": ""
                  }
                }
              },
              {
                "service": {
                  "id": "invalid_haptic",
                  "input": {
                    "serviceId": "verb_audio",
                    "params": {
                      "haptic": "warning"
                    }
                  }
                }
              }
            ]
          }
        }
      }
    }
  ],
  "events": {
    "onAppear": [
      {
        "condition": {
          "id": "load_once",
          "input": "{{ !${loaded} }}",
          "output": {
            "success": [
              {
                "state": {
                  "id": "prepare_lesson_cache",
                  "input": {
                    "lessonCache": "@{catalog}"
                  },
                  "output": {
                    "success": [
                      {
                        "repo": {
                          "id": "load_progress",
                          "input": {
                            "repositoryId": "spanish_verb_trail_v1",
                            "operation": "read",
                            "params": {
                              "collection": "learning",
                              "documentId": "progress"
                            }
                          },
                          "output": {
                            "success": [
                              {
                                "state": {
                                  "id": "hydrate_progress",
                                  "input": {
                                    "attempts": "{{ map(range(count(${lessonCache})), @{item} < count(@{load_progress.attempts}) ? @{load_progress.attempts[@{item}]} : 0) }}",
                                    "correct": "{{ map(range(count(${lessonCache})), @{item} < count(@{load_progress.correct}) ? @{load_progress.correct[@{item}]} : 0) }}",
                                    "loaded": true
                                  }
                                }
                              }
                            ],
                            "failure": [
                              {
                                "state": {
                                  "id": "first_launch",
                                  "input": {
                                    "loaded": true,
                                    "attempts": "{{ map(range(count(${lessonCache})), 0) }}",
                                    "correct": "{{ map(range(count(${lessonCache})), 0) }}"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        }
      }
    ]
  },
  "children": [
    {
      "id": "quest_navigation",
      "type": "navigation",
      "children": [
        {
          "id": "quest_scroll",
          "type": "scroll",
          "style": {
            "scroll": {
              "dismissesKeyboard": "interactively"
            },
            "layout": {
              "maxWidth": "infinity",
              "maxHeight": "infinity"
            },
            "common": {
              "background": "background"
            }
          },
          "children": [
            {
              "id": "quest_stack",
              "type": "vstack",
              "context": {
                "_spacing": 20,
                "_alignment": "leading"
              },
              "style": {
                "layout": {
                  "padding": {
                    "horizontal": 20,
                    "top": 12,
                    "bottom": 28
                  },
                  "maxWidth": "infinity"
                }
              },
              "children": [
                {
                  "id": "storage_status",
                  "type": "conditional",
                  "context": {
                    "_condition": "{{ !${loaded} || notEmpty(${saveError}) }}",
                    "_trueComponent": {
                      "id": "storage_contents",
                      "type": "vstack",
                      "context": {
                        "_spacing": 10,
                        "_alignment": "leading"
                      },
                      "children": [
                        {
                          "id": "loading_state",
                          "type": "conditional",
                          "context": {
                            "_condition": "{{ !${loaded} }}",
                            "_trueComponent": {
                              "id": "loading_progress",
                              "type": "hstack",
                              "context": {
                                "_spacing": 10
                              },
                              "style": {
                                "layout": {
                                  "padding": 16,
                                  "maxWidth": "infinity"
                                },
                                "common": {
                                  "background": "surface",
                                  "foreground": "onSurface",
                                  "cornerRadius": 16
                                }
                              },
                              "children": [
                                {
                                  "id": "load_spinner",
                                  "type": "progress"
                                },
                                {
                                  "id": "load_copy",
                                  "type": "text",
                                  "context": {
                                    "_text": "Loading your saved progress…"
                                  },
                                  "style": {
                                    "common": {
                                      "foreground": "onSurface",
                                      "font": "subheadline"
                                    }
                                  }
                                }
                              ]
                            }
                          }
                        },
                        {
                          "id": "save_error_state",
                          "type": "conditional",
                          "context": {
                            "_condition": "{{ notEmpty(${saveError}) }}",
                            "_trueComponent": {
                              "id": "save_error_card",
                              "type": "vstack",
                              "context": {
                                "_spacing": 10,
                                "_alignment": "leading"
                              },
                              "style": {
                                "layout": {
                                  "padding": 18,
                                  "maxWidth": "infinity"
                                },
                                "common": {
                                  "background": "surfaceVariant",
                                  "foreground": "onSurfaceVariant",
                                  "cornerRadius": 18
                                }
                              },
                              "children": [
                                {
                                  "id": "save_error_title",
                                  "type": "label",
                                  "context": {
                                    "_title": "Not saved yet",
                                    "_image": "sf://exclamationmark.triangle.fill"
                                  },
                                  "style": {
                                    "common": {
                                      "font": "headline",
                                      "foreground": "onSurfaceVariant"
                                    }
                                  }
                                },
                                {
                                  "id": "save_error_copy",
                                  "type": "text",
                                  "context": {
                                    "_text": "${saveError}"
                                  },
                                  "style": {
                                    "common": {
                                      "font": "subheadline",
                                      "foreground": "onSurfaceVariant"
                                    }
                                  }
                                },
                                {
                                  "id": "retry_save_button",
                                  "type": "button",
                                  "style": {
                                    "button": {
                                      "standard": {
                                        "type": "bordered",
                                        "shape": "capsule"
                                      }
                                    },
                                    "layout": {
                                      "minHeight": 44
                                    },
                                    "common": {
                                      "foreground": "onSurfaceVariant"
                                    }
                                  },
                                  "children": [
                                    {
                                      "id": "retry_save_label",
                                      "type": "label",
                                      "context": {
                                        "_title": "Retry save",
                                        "_image": "sf://arrow.clockwise"
                                      },
                                      "style": {
                                        "common": {
                                          "foreground": "onSurfaceVariant"
                                        }
                                      }
                                    }
                                  ],
                                  "events": {
                                    "onTap": [
                                      {
                                        "state": {
                                          "id": "retry_save_state",
                                          "input": {
                                            "saving": true,
                                            "saveError": ""
                                          },
                                          "output": {
                                            "success": [
                                              {
                                                "template": {
                                                  "id": "retry_save_call",
                                                  "input": "persist_progress"
                                                }
                                              }
                                            ]
                                          }
                                        }
                                      }
                                    ]
                                  }
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  }
                },
                {
                  "id": "screen_state",
                  "type": "conditional",
                  "context": {
                    "_condition": "${active}",
                    "_trueComponent": {
                      "id": "practice_screen",
                      "type": "vstack",
                      "context": {
                        "_spacing": 20,
                        "_alignment": "leading"
                      },
                      "style": {
                        "layout": {
                          "maxWidth": "infinity"
                        }
                      },
                      "children": [
                        {
                          "id": "round_stage",
                          "type": "conditional",
                          "context": {
                            "_condition": "${finished}",
                            "_trueComponent": {
                              "id": "round_summary",
                              "type": "vstack",
                              "context": {
                                "_spacing": 20,
                                "_alignment": "leading"
                              },
                              "style": {
                                "layout": {
                                  "maxWidth": "infinity"
                                },
                                "animation": {
                                  "kind": "spring",
                                  "value": "${finished}",
                                  "bounce": 0.12
                                }
                              },
                              "children": [
                                {
                                  "id": "summary_hero",
                                  "type": "vstack",
                                  "context": {
                                    "_spacing": 14,
                                    "_alignment": "leading"
                                  },
                                  "style": {
                                    "layout": {
                                      "maxWidth": "infinity",
                                      "padding": 24
                                    },
                                    "common": {
                                      "background": {
                                        "gradient": {
                                          "linear": {
                                            "colors": [
                                              "#30285D",
                                              "#653960"
                                            ],
                                            "startPoint": "topLeading",
                                            "endPoint": "bottomTrailing"
                                          }
                                        }
                                      },
                                      "foreground": "white",
                                      "cornerRadius": 26
                                    },
                                    "shadow": {
                                      "color": "#1D123333",
                                      "radius": 14,
                                      "y": 7
                                    }
                                  },
                                  "children": [
                                    {
                                      "id": "summary_eyebrow",
                                      "type": "label",
                                      "context": {
                                        "_title": "ROUND COMPLETE",
                                        "_image": "sf://flag.checkered"
                                      },
                                      "style": {
                                        "common": {
                                          "font": {
                                            "kind": "caption",
                                            "weight": "bold"
                                          },
                                          "foreground": "#F8D68C"
                                        }
                                      }
                                    },
                                    {
                                      "id": "summary_score",
                                      "type": "text",
                                      "context": {
                                        "_text": "{{ cast(sum(${roundResults}), 'str') + ' / 5' }}"
                                      },
                                      "style": {
                                        "common": {
                                          "font": {
                                            "kind": "system",
                                            "size": 48,
                                            "weight": "bold"
                                          },
                                          "foreground": "white"
                                        }
                                      }
                                    },
                                    {
                                      "id": "summary_caption",
                                      "type": "text",
                                      "context": {
                                        "_text": "{{ 'correct · ' + cast(sum(${roundResults}) * 10, 'str') + ' XP earned' }}"
                                      },
                                      "style": {
                                        "common": {
                                          "font": "title3",
                                          "foreground": "white"
                                        }
                                      }
                                    },
                                    {
                                      "id": "summary_mode",
                                      "type": "text",
                                      "context": {
                                        "_text": "{{ ${tense} + ' · ' + ${group} + ' verbs · ' + ${practiceMode} }}"
                                      },
                                      "style": {
                                        "common": {
                                          "font": "caption",
                                          "foreground": "white"
                                        }
                                      }
                                    },
                                    {
                                      "id": "summary_meter",
                                      "type": "progress",
                                      "context": {
                                        "_value": "{{ sum(${roundResults}) }}",
                                        "_total": 5
                                      },
                                      "style": {
                                        "common": {
                                          "tint": "#F8D68C"
                                        }
                                      }
                                    },
                                    {
                                      "id": "summary_message",
                                      "type": "text",
                                      "context": {
                                        "_text": "{{ sum(${roundResults}) == 5 ? 'All five forms matched. Try a different tense to widen your range.' : 'The corrections are part of practice. Repeat this set or explore the reference before your next round.' }}"
                                      },
                                      "style": {
                                        "common": {
                                          "font": "body",
                                          "foreground": "white"
                                        },
                                        "text": {
                                          "lineSpacing": 4
                                        }
                                      }
                                    }
                                  ]
                                },
                                {
                                  "id": "summary_actions",
                                  "type": "vstack",
                                  "context": {
                                    "_spacing": 12
                                  },
                                  "style": {
                                    "layout": {
                                      "padding": 20,
                                      "maxWidth": "infinity"
                                    },
                                    "common": {
                                      "background": {
                                        "material": "regular"
                                      },
                                      "foreground": "primary",
                                      "cornerRadius": 22
                                    },
                                    "shadow": {
                                      "color": "#00000012",
                                      "radius": 8,
                                      "y": 3
                                    }
                                  },
                                  "children": [
                                    {
                                      "id": "play_again",
                                      "type": "button",
                                      "style": {
                                        "button": {
                                          "standard": {
                                            "type": "borderedProminent",
                                            "shape": "capsule"
                                          }
                                        },
                                        "layout": {
                                          "minHeight": 50
                                        },
                                        "common": {
                                          "tint": {
                                            "light": "#BAD6BE",
                                            "dark": "#BAD6BE"
                                          }
                                        }
                                      },
                                      "children": [
                                        {
                                          "id": "play_again_label",
                                          "type": "label",
                                          "context": {
                                            "_title": "Practise this set again",
                                            "_image": "sf://arrow.clockwise"
                                          },
                                          "style": {
                                            "layout": {
                                              "maxWidth": "infinity",
                                              "padding": {
                                                "vertical": 8
                                              }
                                            },
                                            "common": {
                                              "font": "headline",
                                              "foreground": "#13241D"
                                            }
                                          }
                                        }
                                      ],
                                      "events": {
                                        "onTap": [
                                          {
                                            "template": {
                                              "id": "repeat_round_call",
                                              "input": "begin_round"
                                            }
                                          }
                                        ]
                                      }
                                    },
                                    {
                                      "id": "new_set_button",
                                      "type": "button",
                                      "style": {
                                        "button": {
                                          "standard": {
                                            "type": "bordered",
                                            "shape": "capsule"
                                          }
                                        },
                                        "layout": {
                                          "minHeight": 50
                                        },
                                        "common": {
                                          "foreground": "primary"
                                        }
                                      },
                                      "children": [
                                        {
                                          "id": "new_set_label",
                                          "type": "label",
                                          "context": {
                                            "_title": "Choose a new set",
                                            "_image": "sf://slider.horizontal.3"
                                          },
                                          "style": {
                                            "layout": {
                                              "maxWidth": "infinity",
                                              "padding": {
                                                "vertical": 8
                                              }
                                            },
                                            "common": {
                                              "foreground": "primary"
                                            }
                                          }
                                        }
                                      ],
                                      "events": {
                                        "onTap": [
                                          {
                                            "state": {
                                              "id": "show_learn",
                                              "input": {
                                                "active": false,
                                                "finished": false,
                                                "focused": ""
                                              }
                                            }
                                          }
                                        ]
                                      }
                                    },
                                    {
                                      "id": "summary_persistence",
                                      "type": "text",
                                      "context": {
                                        "_text": "{{ empty(${saveError}) ? 'Your XP and tense progress are saved on this device.' : 'Progress is not saved yet. Retry save above.' }}"
                                      },
                                      "style": {
                                        "common": {
                                          "font": "caption",
                                          "foreground": "secondary"
                                        },
                                        "text": {
                                          "multilineTextAlignment": "center"
                                        }
                                      }
                                    }
                                  ]
                                }
                              ]
                            },
                            "_falseComponent": {
                              "id": "question_screen",
                              "type": "vstack",
                              "context": {
                                "_spacing": 20,
                                "_alignment": "leading"
                              },
                              "children": [
                                {
                                  "id": "question_header",
                                  "type": "vstack",
                                  "context": {
                                    "_spacing": 16,
                                    "_alignment": "leading"
                                  },
                                  "style": {
                                    "layout": {
                                      "maxWidth": "infinity",
                                      "padding": 22
                                    },
                                    "common": {
                                      "background": {
                                        "gradient": {
                                          "linear": {
                                            "colors": [
                                              "#30285D",
                                              "#653960"
                                            ],
                                            "startPoint": "topLeading",
                                            "endPoint": "bottomTrailing"
                                          }
                                        }
                                      },
                                      "foreground": "white",
                                      "cornerRadius": 26
                                    },
                                    "shadow": {
                                      "color": "#1D123333",
                                      "radius": 12,
                                      "y": 6
                                    },
                                    "animation": {
                                      "kind": "easeInOut",
                                      "value": "${number}",
                                      "duration": 0.2
                                    }
                                  },
                                  "children": [
                                    {
                                      "id": "question_topline",
                                      "type": "hstack",
                                      "children": [
                                        {
                                          "id": "question_counter",
                                          "type": "label",
                                          "context": {
                                            "_title": "{{ 'Question ' + cast(${number} + 1, 'str') + ' of 5' }}",
                                            "_image": "sf://bolt.fill"
                                          },
                                          "style": {
                                            "common": {
                                              "font": {
                                                "kind": "subheadline",
                                                "weight": "semibold"
                                              },
                                              "foreground": "#F8D68C"
                                            }
                                          }
                                        },
                                        {
                                          "id": "question_top_spacer",
                                          "type": "spacer"
                                        },
                                        {
                                          "id": "round_score",
                                          "type": "text",
                                          "context": {
                                            "_text": "{{ cast(sum(${roundResults}) * 10, 'str') + ' XP' }}"
                                          },
                                          "style": {
                                            "common": {
                                              "font": "subheadline",
                                              "foreground": "white"
                                            }
                                          }
                                        }
                                      ]
                                    },
                                    {
                                      "id": "question_progress",
                                      "type": "progress",
                                      "context": {
                                        "_value": "{{ ${number} + (${answered} ? 1 : 0) }}",
                                        "_total": 5
                                      },
                                      "style": {
                                        "common": {
                                          "tint": "#F8D68C"
                                        }
                                      }
                                    },
                                    {
                                      "id": "question_tags",
                                      "type": "text",
                                      "context": {
                                        "_text": "{{ @{question.tense} + ' · ' + @{question.group} + ' · ' + ${practiceMode} }}"
                                      },
                                      "style": {
                                        "common": {
                                          "font": "caption",
                                          "foreground": "white"
                                        }
                                      }
                                    },
                                    {
                                      "id": "question_verb",
                                      "type": "text",
                                      "context": {
                                        "_text": "@{question.verb}"
                                      },
                                      "style": {
                                        "common": {
                                          "font": {
                                            "kind": "largeTitle",
                                            "weight": "bold"
                                          },
                                          "foreground": "white"
                                        }
                                      }
                                    },
                                    {
                                      "id": "question_prompt",
                                      "type": "text",
                                      "context": {
                                        "_text": "{{ ${practiceMode} == 'Phrases' ? @{answerGap} : @{subjects[@{personIndex}]} + ' → ?' }}"
                                      },
                                      "style": {
                                        "common": {
                                          "font": {
                                            "kind": "title2",
                                            "weight": "semibold"
                                          },
                                          "foreground": "white"
                                        },
                                        "text": {
                                          "lineSpacing": 5
                                        }
                                      }
                                    },
                                    {
                                      "id": "question_helper",
                                      "type": "text",
                                      "context": {
                                        "_text": "{{ ${practiceMode} == 'Phrases' ? @{answerTranslation} : 'Write the ' + lower(@{question.tense}) + ' form for this person.' }}"
                                      },
                                      "style": {
                                        "common": {
                                          "font": "subheadline",
                                          "foreground": "white"
                                        }
                                      }
                                    }
                                  ]
                                },
                                {
                                  "id": "answer_card",
                                  "type": "conditional",
                                  "context": {
                                    "_condition": "{{ !${answered} }}",
                                    "_trueComponent": {
                                      "id": "answer_surface",
                                      "type": "vstack",
                                      "context": {
                                        "_spacing": 12,
                                        "_alignment": "leading"
                                      },
                                      "style": {
                                        "layout": {
                                          "maxWidth": "infinity",
                                          "padding": 18
                                        },
                                        "common": {
                                          "background": {
                                            "material": "regular"
                                          },
                                          "foreground": "primary",
                                          "cornerRadius": 22
                                        },
                                        "shadow": {
                                          "color": "#00000012",
                                          "radius": 10,
                                          "y": 4
                                        }
                                      },
                                      "children": [
                                        {
                                          "id": "answer_heading",
                                          "type": "label",
                                          "context": {
                                            "_title": "Your answer",
                                            "_image": "sf://pencil"
                                          },
                                          "style": {
                                            "common": {
                                              "font": "headline",
                                              "foreground": "primary"
                                            }
                                          }
                                        },
                                        {
                                          "id": "answer_field",
                                          "type": "textfield",
                                          "context": {
                                            "_label": "Conjugated verb only",
                                            "_text": "${answer}",
                                            "_focused": "${focused}",
                                            "_debounce": 0,
                                            "_keyboard": "default"
                                          },
                                          "style": {
                                            "textField": {
                                              "standard": "roundedBorder",
                                              "autocapitalization": "none",
                                              "autocorrectionDisabled": true,
                                              "submitLabel": "send"
                                            },
                                            "layout": {
                                              "minHeight": 48
                                            },
                                            "common": {
                                              "foreground": "primary",
                                              "background": "{{ notEmpty(${inputError}) ? { 'color': 'red', 'opacity': 0.12 } : { 'color': 'clear' } }}",
                                              "cornerRadius": 10
                                            }
                                          },
                                          "events": {
                                            "onSubmit": [
                                              {
                                                "template": {
                                                  "id": "keyboard_check",
                                                  "input": "check_answer"
                                                }
                                              }
                                            ]
                                          }
                                        },
                                        {
                                          "id": "input_validation",
                                          "type": "conditional",
                                          "context": {
                                            "_condition": "{{ notEmpty(${inputError}) }}",
                                            "_trueComponent": {
                                              "id": "input_error_text",
                                              "type": "text",
                                              "context": {
                                                "_text": "${inputError}"
                                              },
                                              "style": {
                                                "common": {
                                                  "font": "caption",
                                                  "foreground": {
                                                    "light": "#A52D36",
                                                    "dark": "#FFABB2"
                                                  }
                                                }
                                              }
                                            }
                                          }
                                        },
                                        {
                                          "id": "accent_keys",
                                          "type": "hstack",
                                          "context": {
                                            "_spacing": 4
                                          },
                                          "children": [
                                            {
                                              "id": "accent_dynamic",
                                              "type": "dynamic",
                                              "context": {
                                                "_data": [
                                                  "á",
                                                  "é",
                                                  "í",
                                                  "ó",
                                                  "ú",
                                                  "ñ"
                                                ]
                                              },
                                              "prototype": {
                                                "id": "accent_key",
                                                "type": "button",
                                                "context": {
                                                  "_label": "@{item}"
                                                },
                                                "style": {
                                                  "button": {
                                                    "standard": {
                                                      "type": "bordered",
                                                      "shape": "roundedRectangle"
                                                    }
                                                  },
                                                  "layout": {
                                                    "minWidth": 44,
                                                    "minHeight": 44
                                                  },
                                                  "common": {
                                                    "font": {
                                                      "kind": "body",
                                                      "weight": "semibold"
                                                    },
                                                    "foreground": "primary"
                                                  }
                                                },
                                                "events": {
                                                  "onTap": [
                                                    {
                                                      "state": {
                                                        "id": "append_accent",
                                                        "input": {
                                                          "answer": "{{ ${answer} + @{item} }}",
                                                          "inputError": ""
                                                        }
                                                      }
                                                    }
                                                  ]
                                                }
                                              }
                                            }
                                          ]
                                        },
                                        {
                                          "id": "answer_hint",
                                          "type": "text",
                                          "context": {
                                            "_text": "Tap Send on the keyboard or Check answer below. Accents matter; the keys above append a character. Capital letters and outer spaces are ignored."
                                          },
                                          "style": {
                                            "common": {
                                              "font": "caption",
                                              "foreground": "secondary"
                                            }
                                          }
                                        },
                                        {
                                          "id": "check_button",
                                          "type": "button",
                                          "style": {
                                            "button": {
                                              "standard": {
                                                "type": "borderedProminent",
                                                "shape": "capsule"
                                              }
                                            },
                                            "layout": {
                                              "minHeight": 50
                                            },
                                            "common": {
                                              "tint": {
                                                "light": "#BAD6BE",
                                                "dark": "#BAD6BE"
                                              }
                                            }
                                          },
                                          "children": [
                                            {
                                              "id": "check_label",
                                              "type": "label",
                                              "context": {
                                                "_title": "Check answer",
                                                "_image": "sf://checkmark.circle.fill"
                                              },
                                              "style": {
                                                "layout": {
                                                  "maxWidth": "infinity",
                                                  "padding": {
                                                    "vertical": 8
                                                  }
                                                },
                                                "common": {
                                                  "font": "headline",
                                                  "foreground": "#13241D"
                                                }
                                              }
                                            }
                                          ],
                                          "events": {
                                            "onTap": [
                                              {
                                                "template": {
                                                  "id": "check_button_call",
                                                  "input": "check_answer"
                                                }
                                              }
                                            ]
                                          }
                                        }
                                      ]
                                    }
                                  }
                                },
                                {
                                  "id": "feedback_container",
                                  "type": "conditional",
                                  "context": {
                                    "_condition": "${answered}",
                                    "_trueComponent": {
                                      "id": "feedback_stack",
                                      "type": "vstack",
                                      "context": {
                                        "_spacing": 16,
                                        "_alignment": "leading"
                                      },
                                      "style": {
                                        "layout": {
                                          "maxWidth": "infinity"
                                        },
                                        "animation": {
                                          "kind": "easeOut",
                                          "value": "${answered}",
                                          "duration": 0.12
                                        }
                                      },
                                      "children": [
                                        {
                                          "id": "feedback_card",
                                          "type": "vstack",
                                          "context": {
                                            "_spacing": 12,
                                            "_alignment": "leading",
                                            "feedbackInk": "{{ @{isCorrect} ? { 'light': '#18352B', 'dark': '#E2F6EB' } : { 'light': '#4B3115', 'dark': '#FFE9C8' } }}"
                                          },
                                          "style": {
                                            "layout": {
                                              "maxWidth": "infinity",
                                              "padding": 20
                                            },
                                            "common": {
                                              "background": "{{ @{isCorrect} ? { 'light': '#E6F3E9', 'dark': '#173C2D' } : { 'light': '#FFF0D8', 'dark': '#45311D' } }}",
                                              "foreground": "@{feedbackInk}",
                                              "cornerRadius": 22
                                            },
                                            "shadow": {
                                              "color": "#00000012",
                                              "radius": 10,
                                              "y": 4
                                            }
                                          },
                                          "children": [
                                            {
                                              "id": "feedback_title",
                                              "type": "label",
                                              "context": {
                                                "_title": "{{ @{isCorrect} ? 'Correct · +10 XP' : 'Not quite · here is the form' }}",
                                                "_image": "{{ @{isCorrect} ? 'sf://checkmark.circle.fill' : 'sf://arrow.triangle.2.circlepath' }}"
                                              },
                                              "style": {
                                                "common": {
                                                  "font": "headline",
                                                  "foreground": "@{feedbackInk}"
                                                }
                                              }
                                            },
                                            {
                                              "id": "feedback_expected",
                                              "type": "text",
                                              "context": {
                                                "_text": "@{expected}"
                                              },
                                              "style": {
                                                "common": {
                                                  "font": {
                                                    "kind": "largeTitle",
                                                    "weight": "bold"
                                                  },
                                                  "foreground": "@{feedbackInk}"
                                                }
                                              }
                                            },
                                            {
                                              "id": "feedback_written",
                                              "type": "text",
                                              "context": {
                                                "_text": "{{ 'Your answer: ' + trim(${answer}) }}"
                                              },
                                              "style": {
                                                "common": {
                                                  "font": "caption",
                                                  "foreground": "@{feedbackInk}"
                                                }
                                              }
                                            },
                                            {
                                              "id": "feedback_phrase",
                                              "type": "text",
                                              "context": {
                                                "_text": "@{answerPhrase}"
                                              },
                                              "style": {
                                                "common": {
                                                  "font": {
                                                    "kind": "title3",
                                                    "weight": "semibold"
                                                  },
                                                  "foreground": "@{feedbackInk}"
                                                },
                                                "text": {
                                                  "lineSpacing": 3
                                                }
                                              }
                                            },
                                            {
                                              "id": "feedback_translation",
                                              "type": "text",
                                              "context": {
                                                "_text": "@{answerTranslation}"
                                              },
                                              "style": {
                                                "common": {
                                                  "font": "subheadline",
                                                  "foreground": "@{feedbackInk}"
                                                }
                                              }
                                            },
                                            {
                                              "id": "feedback_note",
                                              "type": "text",
                                              "context": {
                                                "_text": "@{question.note}"
                                              },
                                              "style": {
                                                "common": {
                                                  "font": "footnote",
                                                  "foreground": "@{feedbackInk}"
                                                },
                                                "text": {
                                                  "lineSpacing": 3
                                                }
                                              }
                                            }
                                          ]
                                        },
                                        {
                                          "id": "feedback_save_note",
                                          "type": "text",
                                          "context": {
                                            "_text": "{{ ${saving} ? 'Saving your answer…' : (notEmpty(${saveError}) ? 'Your answer is counted here. Use Retry save above to keep it after reopening.' : ${saveNotice}) }}"
                                          },
                                          "style": {
                                            "common": {
                                              "font": "caption",
                                              "foreground": "secondary"
                                            }
                                          }
                                        },
                                        {
                                          "id": "next_question",
                                          "type": "button",
                                          "style": {
                                            "button": {
                                              "standard": {
                                                "type": "borderedProminent",
                                                "shape": "capsule"
                                              }
                                            },
                                            "layout": {
                                              "minHeight": 50
                                            },
                                            "common": {
                                              "disabled": "${saving}",
                                              "tint": {
                                                "light": "#BAD6BE",
                                                "dark": "#BAD6BE"
                                              }
                                            }
                                          },
                                          "children": [
                                            {
                                              "id": "next_question_label",
                                              "type": "label",
                                              "context": {
                                                "_title": "{{ ${number} == 4 ? 'See round results' : 'Next question' }}",
                                                "_image": "sf://arrow.right"
                                              },
                                              "style": {
                                                "layout": {
                                                  "maxWidth": "infinity",
                                                  "padding": {
                                                    "vertical": 8
                                                  }
                                                },
                                                "common": {
                                                  "font": "headline",
                                                  "foreground": "#13241D"
                                                }
                                              }
                                            }
                                          ],
                                          "events": {
                                            "onTap": [
                                              {
                                                "condition": {
                                                  "id": "advance_round",
                                                  "input": "{{ ${number} == 4 }}",
                                                  "output": {
                                                    "success": [
                                                      {
                                                        "state": {
                                                          "id": "finish_round",
                                                          "input": {
                                                            "finished": true,
                                                            "focused": ""
                                                          }
                                                        }
                                                      }
                                                    ],
                                                    "failure": [
                                                      {
                                                        "state": {
                                                          "id": "next_question_state",
                                                          "input": {
                                                            "number": "{{ ${number} + 1 }}",
                                                            "qIndex": "{{ (${qIndex} + random(1, count(@{verbs}) - 1)) % count(@{verbs}) }}",
                                                            "person": "{{ random(0, 5) }}",
                                                            "answered": false,
                                                            "answer": "",
                                                            "focused": "",
                                                            "inputError": ""
                                                          }
                                                        }
                                                      }
                                                    ]
                                                  }
                                                }
                                              },
                                              {
                                                "service": {
                                                  "id": "next_haptic",
                                                  "input": {
                                                    "serviceId": "verb_audio",
                                                    "params": {
                                                      "haptic": "light"
                                                    }
                                                  }
                                                }
                                              }
                                            ]
                                          }
                                        }
                                      ]
                                    }
                                  }
                                },
                                {
                                  "id": "change_set_during_round",
                                  "type": "button",
                                  "style": {
                                    "button": {
                                      "standard": {
                                        "type": "bordered",
                                        "shape": "capsule"
                                      }
                                    },
                                    "layout": {
                                      "minHeight": 44,
                                      "maxWidth": "infinity"
                                    },
                                    "common": {
                                      "foreground": "primary"
                                    }
                                  },
                                  "children": [
                                    {
                                      "id": "change_set_label",
                                      "type": "label",
                                      "context": {
                                        "_title": "Change practice set",
                                        "_image": "sf://slider.horizontal.3"
                                      },
                                      "style": {
                                        "common": {
                                          "foreground": "primary",
                                          "font": "subheadline"
                                        }
                                      }
                                    }
                                  ],
                                  "events": {
                                    "onTap": [
                                      {
                                        "state": {
                                          "id": "change_set_state",
                                          "input": {
                                            "active": false,
                                            "finished": false,
                                            "focused": ""
                                          }
                                        }
                                      }
                                    ]
                                  }
                                }
                              ]
                            }
                          }
                        }
                      ]
                    },
                    "_falseComponent": {
                      "id": "learn_screen",
                      "type": "vstack",
                      "context": {
                        "_spacing": 20,
                        "_alignment": "leading"
                      },
                      "children": [
                        {
                          "id": "xp_hero",
                          "type": "vstack",
                          "context": {
                            "_spacing": 12,
                            "_alignment": "leading"
                          },
                          "style": {
                            "layout": {
                              "maxWidth": "infinity",
                              "padding": 22
                            },
                            "common": {
                              "background": {
                                "gradient": {
                                  "linear": {
                                    "colors": [
                                      "#30285D",
                                      "#653960"
                                    ],
                                    "startPoint": "topLeading",
                                    "endPoint": "bottomTrailing"
                                  }
                                }
                              },
                              "foreground": "white",
                              "cornerRadius": 26
                            },
                            "shadow": {
                              "color": "#1D123333",
                              "radius": 14,
                              "y": 7
                            },
                            "animation": {
                              "kind": "spring",
                              "value": "@{xp}"
                            }
                          },
                          "children": [
                            {
                              "id": "hero_eyebrow",
                              "type": "label",
                              "context": {
                                "_title": "YOUR VERB JOURNEY",
                                "_image": "sf://sparkles"
                              },
                              "style": {
                                "common": {
                                  "font": {
                                    "kind": "caption",
                                    "weight": "bold"
                                  },
                                  "foreground": "#F8D68C"
                                }
                              }
                            },
                            {
                              "id": "hero_value",
                              "type": "hstack",
                              "context": {
                                "_spacing": 8,
                                "_alignment": "center"
                              },
                              "children": [
                                {
                                  "id": "xp_value",
                                  "type": "text",
                                  "context": {
                                    "_text": "@{xp}",
                                    "_format": {
                                      "number": {
                                        "style": "decimal",
                                        "maximumFractionDigits": 0
                                      }
                                    }
                                  },
                                  "style": {
                                    "common": {
                                      "font": {
                                        "kind": "system",
                                        "size": 46,
                                        "weight": "bold"
                                      },
                                      "foreground": "white"
                                    }
                                  }
                                },
                                {
                                  "id": "xp_unit",
                                  "type": "text",
                                  "context": {
                                    "_text": "XP"
                                  },
                                  "style": {
                                    "common": {
                                      "font": "title2",
                                      "foreground": "#F8D68C"
                                    }
                                  }
                                },
                                {
                                  "id": "hero_spacer",
                                  "type": "spacer"
                                },
                                {
                                  "id": "level_chip",
                                  "type": "text",
                                  "context": {
                                    "_text": "{{ 'Level ' + cast(@{level}, 'str') }}"
                                  },
                                  "style": {
                                    "layout": {
                                      "padding": {
                                        "horizontal": 12,
                                        "vertical": 8
                                      }
                                    },
                                    "common": {
                                      "font": {
                                        "kind": "subheadline",
                                        "weight": "semibold"
                                      },
                                      "foreground": "white",
                                      "background": {
                                        "color": "white",
                                        "opacity": 0.12
                                      },
                                      "cornerRadius": 12
                                    }
                                  }
                                }
                              ]
                            },
                            {
                              "id": "level_progress",
                              "type": "progress",
                              "context": {
                                "_value": "{{ (@{xp} % 100) / 100 }}"
                              },
                              "style": {
                                "common": {
                                  "tint": "#F8D68C"
                                }
                              }
                            },
                            {
                              "id": "level_caption",
                              "type": "text",
                              "context": {
                                "_text": "{{ cast(100 - (@{xp} % 100), 'str') + ' XP to your next level · +10 per correct answer' }}"
                              },
                              "style": {
                                "common": {
                                  "font": "caption",
                                  "foreground": "white"
                                }
                              }
                            },
                            {
                              "id": "hero_message",
                              "type": "text",
                              "context": {
                                "_text": "{{ sum(${attempts}) == 0 ? '24 everyday verbs. Three tenses. Start with five questions.' : cast(@{coverage}, 'str') + ' of ' + cast(count(@{catalog}), 'str') + ' verb–tense sets explored. Keep building your range.' }}"
                              },
                              "style": {
                                "common": {
                                  "font": "subheadline",
                                  "foreground": "white"
                                },
                                "text": {
                                  "lineSpacing": 3
                                }
                              }
                            }
                          ]
                        },
                        {
                          "id": "round_options",
                          "type": "vstack",
                          "context": {
                            "_spacing": 12,
                            "_alignment": "leading"
                          },
                          "style": {
                            "layout": {
                              "maxWidth": "infinity",
                              "padding": 20
                            },
                            "common": {
                              "background": {
                                "material": "regular"
                              },
                              "foreground": "primary",
                              "cornerRadius": 22
                            },
                            "shadow": {
                              "color": "#00000012",
                              "radius": 10,
                              "y": 4
                            }
                          },
                          "children": [
                            {
                              "id": "round_heading",
                              "type": "label",
                              "context": {
                                "_title": "Your next five",
                                "_image": "sf://bolt.fill"
                              },
                              "style": {
                                "common": {
                                  "font": "headline",
                                  "foreground": "primary"
                                }
                              }
                            },
                            {
                              "id": "tense_label",
                              "type": "text",
                              "context": {
                                "_text": "Tense"
                              },
                              "style": {
                                "common": {
                                  "font": "caption",
                                  "foreground": "secondary"
                                }
                              }
                            },
                            {
                              "id": "tense_picker",
                              "type": "picker",
                              "context": {
                                "_selection": "${tense}",
                                "_options": [
                                  "Present",
                                  "Preterite",
                                  "Future",
                                  "Mixed"
                                ],
                                "_label": "Tense"
                              },
                              "style": {
                                "picker": "segmented",
                                "layout": {
                                  "minHeight": 44
                                },
                                "common": {
                                  "foreground": "primary"
                                }
                              }
                            },
                            {
                              "id": "tense_hint",
                              "type": "text",
                              "context": {
                                "_text": "{{ switch(${tense} == 'Mixed', 'Mixed tenses · each round includes present, preterite and future.', ${tense} == 'Present', 'Presente · habits and current situations', ${tense} == 'Preterite', 'Pretérito indefinido · completed past events', 'Futuro simple · what will happen') }}"
                              },
                              "style": {
                                "common": {
                                  "font": "caption",
                                  "foreground": "secondary"
                                }
                              }
                            },
                            {
                              "id": "set_picker",
                              "type": "picker",
                              "context": {
                                "_label": "Verb set",
                                "_selection": "${group}",
                                "_options": [
                                  "Mixed",
                                  "Regular",
                                  "Irregular"
                                ]
                              },
                              "style": {
                                "picker": "segmented",
                                "layout": {
                                  "minHeight": 44
                                },
                                "common": {
                                  "foreground": "primary"
                                }
                              }
                            },
                            {
                              "id": "mode_picker",
                              "type": "picker",
                              "context": {
                                "_label": "Practice",
                                "_selection": "${practiceMode}",
                                "_options": [
                                  "Forms",
                                  "Phrases"
                                ]
                              },
                              "style": {
                                "picker": "segmented",
                                "layout": {
                                  "minHeight": 44
                                },
                                "common": {
                                  "foreground": "primary"
                                }
                              }
                            },
                            {
                              "id": "mode_hint",
                              "type": "text",
                              "context": {
                                "_text": "{{ ${practiceMode} == 'Forms' ? 'Conjugate for a person. All six forms, including vosotros.' : 'Complete a Spanish sentence with the missing verb form.' }}"
                              },
                              "style": {
                                "common": {
                                  "font": "caption",
                                  "foreground": "secondary"
                                }
                              }
                            },
                            {
                              "id": "start_round_button",
                              "type": "button",
                              "children": [
                                {
                                  "id": "start_round_label",
                                  "type": "label",
                                  "context": {
                                    "_title": "{{ ${loaded} ? 'Start round' : 'Loading progress…' }}",
                                    "_image": "sf://play.fill"
                                  },
                                  "style": {
                                    "layout": {
                                      "maxWidth": "infinity",
                                      "padding": {
                                        "vertical": 8
                                      }
                                    },
                                    "common": {
                                      "foreground": "#13241D",
                                      "font": "headline"
                                    }
                                  }
                                }
                              ],
                              "style": {
                                "button": {
                                  "standard": {
                                    "type": "borderedProminent",
                                    "shape": "capsule"
                                  }
                                },
                                "common": {
                                  "tint": {
                                    "light": "#BAD6BE",
                                    "dark": "#BAD6BE"
                                  },
                                  "disabled": "{{ !${loaded} || ${saving} }}"
                                },
                                "layout": {
                                  "minHeight": 50
                                }
                              },
                              "events": {
                                "onTap": [
                                  {
                                    "template": {
                                      "id": "start_round_call",
                                      "input": "begin_round"
                                    }
                                  }
                                ]
                              }
                            },
                            {
                              "id": "options_scope",
                              "type": "text",
                              "context": {
                                "_text": "{{ 'Offline starter pack · ' + cast(count(@{verbs}), 'str') + ' useful verbs · 3 tenses' }}"
                              },
                              "style": {
                                "common": {
                                  "font": "caption",
                                  "foreground": "secondary"
                                }
                              }
                            }
                          ]
                        },
                        {
                          "id": "tense_progress",
                          "type": "vstack",
                          "context": {
                            "_spacing": 14,
                            "_alignment": "leading"
                          },
                          "style": {
                            "layout": {
                              "maxWidth": "infinity",
                              "padding": 20
                            },
                            "common": {
                              "background": "surface",
                              "foreground": "onSurface",
                              "cornerRadius": 22
                            },
                            "shadow": {
                              "color": "#00000010",
                              "radius": 8,
                              "y": 3
                            }
                          },
                          "children": [
                            {
                              "id": "progress_heading",
                              "type": "label",
                              "context": {
                                "_title": "Your practice map",
                                "_image": "sf://chart.bar.fill"
                              },
                              "style": {
                                "common": {
                                  "font": "headline",
                                  "foreground": "onSurface"
                                }
                              }
                            },
                            {
                              "id": "progress_hint",
                              "type": "text",
                              "context": {
                                "_text": "{{ 'Each tense has ' + cast(count(@{verbs}), 'str') + ' verbs to explore. Counts include every attempt, not just correct answers.' }}"
                              },
                              "style": {
                                "common": {
                                  "font": "caption",
                                  "foreground": "secondary"
                                }
                              }
                            },
                            {
                              "id": "progress_rows",
                              "type": "dynamic",
                              "context": {
                                "_data": [
                                  {
                                    "name": "Present",
                                    "ids": "{{ map(range(count(@{verbs})), @{item} * 3) }}"
                                  },
                                  {
                                    "name": "Preterite",
                                    "ids": "{{ map(range(count(@{verbs})), @{item} * 3 + 1) }}"
                                  },
                                  {
                                    "name": "Future",
                                    "ids": "{{ map(range(count(@{verbs})), @{item} * 3 + 2) }}"
                                  }
                                ]
                              },
                              "prototype": {
                                "id": "progress_row",
                                "type": "vstack",
                                "context": {
                                  "_spacing": 6,
                                  "_alignment": "leading",
                                  "tenseTries": "{{ sum(map(@{item.ids}, ${attempts[@{item}]})) }}",
                                  "tenseCorrect": "{{ sum(map(@{item.ids}, ${correct[@{item}]})) }}",
                                  "tenseCoverage": "{{ sum(map(@{item.ids}, ${attempts[@{item}]} > 0 ? 1 : 0)) }}"
                                },
                                "children": [
                                  {
                                    "id": "progress_row_header",
                                    "type": "hstack",
                                    "children": [
                                      {
                                        "id": "progress_tense",
                                        "type": "text",
                                        "context": {
                                          "_text": "@{item.name}"
                                        },
                                        "style": {
                                          "common": {
                                            "font": {
                                              "kind": "subheadline",
                                              "weight": "semibold"
                                            },
                                            "foreground": "onSurface"
                                          }
                                        }
                                      },
                                      {
                                        "id": "progress_spacer",
                                        "type": "spacer"
                                      },
                                      {
                                        "id": "progress_count",
                                        "type": "text",
                                        "context": {
                                          "_text": "{{ cast(@{tenseCoverage}, 'str') + ' / ' + cast(count(@{verbs}), 'str') + ' explored' }}"
                                        },
                                        "style": {
                                          "common": {
                                            "font": "caption",
                                            "foreground": "secondary"
                                          }
                                        }
                                      }
                                    ]
                                  },
                                  {
                                    "id": "progress_bar",
                                    "type": "progress",
                                    "context": {
                                      "_value": "@{tenseCoverage}",
                                      "_total": "{{ count(@{verbs}) }}"
                                    },
                                    "style": {
                                      "common": {
                                        "tint": {
                                          "light": "#62528E",
                                          "dark": "#BEACEB"
                                        }
                                      }
                                    }
                                  },
                                  {
                                    "id": "progress_accuracy",
                                    "type": "text",
                                    "context": {
                                      "_text": "{{ @{tenseTries} == 0 ? 'Ready for your first round' : cast(@{tenseCorrect}, 'str') + ' correct from ' + cast(@{tenseTries}, 'str') + ' answers' }}"
                                    },
                                    "style": {
                                      "common": {
                                        "font": "caption",
                                        "foreground": "secondary"
                                      }
                                    }
                                  }
                                ]
                              }
                            }
                          ]
                        },
                        {
                          "id": "verb_library",
                          "type": "vstack",
                          "context": {
                            "_spacing": 12,
                            "_alignment": "leading"
                          },
                          "style": {
                            "layout": {
                              "maxWidth": "infinity",
                              "padding": 20
                            },
                            "common": {
                              "background": {
                                "material": "regular"
                              },
                              "foreground": "primary",
                              "cornerRadius": 22
                            },
                            "shadow": {
                              "color": "#00000012",
                              "radius": 10,
                              "y": 4
                            }
                          },
                          "children": [
                            {
                              "id": "library_heading",
                              "type": "label",
                              "context": {
                                "_title": "Pocket reference",
                                "_image": "sf://book.closed.fill"
                              },
                              "style": {
                                "common": {
                                  "font": "headline",
                                  "foreground": "primary"
                                }
                              }
                            },
                            {
                              "id": "library_hint",
                              "type": "text",
                              "context": {
                                "_text": "Explore every form, with phrases that put it to use."
                              },
                              "style": {
                                "common": {
                                  "font": "caption",
                                  "foreground": "secondary"
                                }
                              }
                            },
                            {
                              "id": "library_rows",
                              "type": "dynamic",
                              "context": {
                                "_data": "@{verbs}"
                              },
                              "prototype": {
                                "id": "verb_link",
                                "type": "link",
                                "children": [
                                  {
                                    "id": "verb_link_row",
                                    "type": "hstack",
                                    "context": {
                                      "_spacing": 12
                                    },
                                    "style": {
                                      "layout": {
                                        "minHeight": 58,
                                        "maxWidth": "infinity"
                                      }
                                    },
                                    "children": [
                                      {
                                        "id": "verb_glyph",
                                        "type": "image",
                                        "context": {
                                          "_source": "{{ @{item.group} == 'Regular' ? 'sf://square.grid.2x2.fill' : 'sf://bolt.fill' }}"
                                        },
                                        "style": {
                                          "layout": {
                                            "width": 22,
                                            "height": 22
                                          },
                                          "common": {
                                            "foreground": {
                                              "light": "#62528E",
                                              "dark": "#BEACEB"
                                            }
                                          }
                                        }
                                      },
                                      {
                                        "id": "verb_row_words",
                                        "type": "vstack",
                                        "context": {
                                          "_spacing": 3,
                                          "_alignment": "leading"
                                        },
                                        "style": {
                                          "layout": {
                                            "maxWidth": "infinity",
                                            "alignment": "leading"
                                          }
                                        },
                                        "children": [
                                          {
                                            "id": "verb_row_name",
                                            "type": "text",
                                            "context": {
                                              "_text": "@{item.name}"
                                            },
                                            "style": {
                                              "common": {
                                                "font": {
                                                  "kind": "title3",
                                                  "weight": "semibold"
                                                },
                                                "foreground": "primary"
                                              }
                                            }
                                          },
                                          {
                                            "id": "verb_row_meaning",
                                            "type": "text",
                                            "context": {
                                              "_text": "{{ @{item.meaning} + ' · ' + @{item.group} }}"
                                            },
                                            "style": {
                                              "common": {
                                                "font": "caption",
                                                "foreground": "secondary"
                                              }
                                            }
                                          }
                                        ]
                                      },
                                      {
                                        "id": "verb_chevron",
                                        "type": "image",
                                        "context": {
                                          "_source": "sf://chevron.right"
                                        },
                                        "style": {
                                          "layout": {
                                            "width": 12,
                                            "height": 16
                                          },
                                          "common": {
                                            "foreground": "secondary"
                                          }
                                        }
                                      }
                                    ]
                                  }
                                ],
                                "destination": {
                                  "id": "verb_detail",
                                  "type": "module",
                                  "state": {
                                    "selected": {
                                      "base": 0,
                                      "name": "hablar",
                                      "meaning": "to speak",
                                      "group": "Regular"
                                    },
                                    "referenceTense": "Present"
                                  },
                                  "context": {
                                    "detailOffset": "{{ switch(${referenceTense} == 'Present', 0, ${referenceTense} == 'Preterite', 1, 2) }}",
                                    "detailIndex": "{{ ${selected.base} + @{detailOffset} }}",
                                    "detailLesson": "@{catalog[@{detailIndex}]}"
                                  },
                                  "events": {
                                    "onAppear": [
                                      {
                                        "state": {
                                          "id": "select_reference_verb",
                                          "input": {
                                            "selected": "@{item}"
                                          }
                                        }
                                      }
                                    ]
                                  },
                                  "children": [
                                    {
                                      "id": "detail_scroll",
                                      "type": "scroll",
                                      "children": [
                                        {
                                          "id": "detail_content",
                                          "type": "vstack",
                                          "context": {
                                            "_spacing": 20,
                                            "_alignment": "leading"
                                          },
                                          "style": {
                                            "layout": {
                                              "maxWidth": "infinity",
                                              "padding": 20
                                            }
                                          },
                                          "children": [
                                            {
                                              "id": "detail_hero",
                                              "type": "vstack",
                                              "context": {
                                                "_spacing": 8,
                                                "_alignment": "leading"
                                              },
                                              "style": {
                                                "layout": {
                                                  "maxWidth": "infinity",
                                                  "padding": 22
                                                },
                                                "common": {
                                                  "background": {
                                                    "gradient": {
                                                      "linear": {
                                                        "colors": [
                                                          "#30285D",
                                                          "#653960"
                                                        ],
                                                        "startPoint": "topLeading",
                                                        "endPoint": "bottomTrailing"
                                                      }
                                                    }
                                                  },
                                                  "foreground": "white",
                                                  "cornerRadius": 24
                                                },
                                                "shadow": {
                                                  "color": "#1D123322",
                                                  "radius": 12,
                                                  "y": 5
                                                }
                                              },
                                              "children": [
                                                {
                                                  "id": "detail_kind",
                                                  "type": "label",
                                                  "context": {
                                                    "_title": "{{ ${selected.group} + ' verb' }}",
                                                    "_image": "sf://book.fill"
                                                  },
                                                  "style": {
                                                    "common": {
                                                      "foreground": "#F8D68C",
                                                      "font": "caption"
                                                    }
                                                  }
                                                },
                                                {
                                                  "id": "detail_name",
                                                  "type": "text",
                                                  "context": {
                                                    "_text": "${selected.name}"
                                                  },
                                                  "style": {
                                                    "common": {
                                                      "font": {
                                                        "kind": "largeTitle",
                                                        "weight": "bold"
                                                      },
                                                      "foreground": "white"
                                                    }
                                                  }
                                                },
                                                {
                                                  "id": "detail_meaning",
                                                  "type": "text",
                                                  "context": {
                                                    "_text": "${selected.meaning}"
                                                  },
                                                  "style": {
                                                    "common": {
                                                      "font": "title3",
                                                      "foreground": "white"
                                                    }
                                                  }
                                                }
                                              ]
                                            },
                                            {
                                              "id": "detail_table_card",
                                              "type": "vstack",
                                              "context": {
                                                "_spacing": 14,
                                                "_alignment": "leading"
                                              },
                                              "style": {
                                                "layout": {
                                                  "maxWidth": "infinity",
                                                  "padding": 20
                                                },
                                                "common": {
                                                  "background": {
                                                    "material": "regular"
                                                  },
                                                  "foreground": "primary",
                                                  "cornerRadius": 22
                                                },
                                                "shadow": {
                                                  "color": "#00000012",
                                                  "radius": 8,
                                                  "y": 3
                                                },
                                                "animation": {
                                                  "kind": "easeInOut",
                                                  "value": "${referenceTense}",
                                                  "duration": 0.2
                                                }
                                              },
                                              "children": [
                                                {
                                                  "id": "detail_tense_picker",
                                                  "type": "picker",
                                                  "context": {
                                                    "_label": "Tense",
                                                    "_selection": "${referenceTense}",
                                                    "_options": [
                                                      "Present",
                                                      "Preterite",
                                                      "Future"
                                                    ]
                                                  },
                                                  "style": {
                                                    "picker": "segmented",
                                                    "layout": {
                                                      "minHeight": 44
                                                    },
                                                    "common": {
                                                      "foreground": "primary"
                                                    }
                                                  }
                                                },
                                                {
                                                  "id": "detail_tense_full",
                                                  "type": "text",
                                                  "context": {
                                                    "_text": "{{ switch(${referenceTense} == 'Present', 'Presente', ${referenceTense} == 'Preterite', 'Pretérito indefinido', 'Futuro simple') }}"
                                                  },
                                                  "style": {
                                                    "common": {
                                                      "font": "headline",
                                                      "foreground": "primary"
                                                    }
                                                  }
                                                },
                                                {
                                                  "id": "conjugation_rows",
                                                  "type": "dynamic",
                                                  "context": {
                                                    "_data": [
                                                      0,
                                                      1,
                                                      2,
                                                      3,
                                                      4,
                                                      5
                                                    ]
                                                  },
                                                  "prototype": {
                                                    "id": "conjugation_row",
                                                    "type": "hstack",
                                                    "context": {
                                                      "_spacing": 12
                                                    },
                                                    "style": {
                                                      "layout": {
                                                        "minHeight": 40,
                                                        "maxWidth": "infinity"
                                                      }
                                                    },
                                                    "children": [
                                                      {
                                                        "id": "conjugation_person",
                                                        "type": "text",
                                                        "context": {
                                                          "_text": "@{persons[@{item}]}"
                                                        },
                                                        "style": {
                                                          "layout": {
                                                            "maxWidth": "infinity",
                                                            "alignment": "leading"
                                                          },
                                                          "common": {
                                                            "font": "subheadline",
                                                            "foreground": "secondary"
                                                          }
                                                        }
                                                      },
                                                      {
                                                        "id": "conjugation_form",
                                                        "type": "text",
                                                        "context": {
                                                          "_text": "@{detailLesson.forms[@{item}]}"
                                                        },
                                                        "style": {
                                                          "common": {
                                                            "font": {
                                                              "kind": "title3",
                                                              "weight": "semibold"
                                                            },
                                                            "foreground": "primary"
                                                          }
                                                        }
                                                      }
                                                    ]
                                                  }
                                                },
                                                {
                                                  "id": "pronoun_note",
                                                  "type": "text",
                                                  "context": {
                                                    "_text": "Usted uses the él/ella form. Ustedes uses the ellos/ellas form. Vosotros is used mainly in Spain."
                                                  },
                                                  "style": {
                                                    "common": {
                                                      "font": "caption",
                                                      "foreground": "secondary"
                                                    }
                                                  }
                                                }
                                              ]
                                            },
                                            {
                                              "id": "detail_phrase_card",
                                              "type": "vstack",
                                              "context": {
                                                "_spacing": 12,
                                                "_alignment": "leading"
                                              },
                                              "style": {
                                                "layout": {
                                                  "maxWidth": "infinity",
                                                  "padding": 20
                                                },
                                                "common": {
                                                  "background": "surfaceVariant",
                                                  "foreground": "onSurfaceVariant",
                                                  "cornerRadius": 22
                                                },
                                                "shadow": {
                                                  "color": "#00000010",
                                                  "radius": 8,
                                                  "y": 3
                                                }
                                              },
                                              "children": [
                                                {
                                                  "id": "phrase_heading",
                                                  "type": "label",
                                                  "context": {
                                                    "_title": "In a sentence",
                                                    "_image": "sf://text.bubble.fill"
                                                  },
                                                  "style": {
                                                    "common": {
                                                      "font": "headline",
                                                      "foreground": "onSurfaceVariant"
                                                    }
                                                  }
                                                },
                                                {
                                                  "id": "detail_phrase",
                                                  "type": "text",
                                                  "context": {
                                                    "_text": "@{detailLesson.phrase}"
                                                  },
                                                  "style": {
                                                    "common": {
                                                      "font": {
                                                        "kind": "title3",
                                                        "weight": "semibold"
                                                      },
                                                      "foreground": "onSurfaceVariant"
                                                    },
                                                    "text": {
                                                      "lineSpacing": 4
                                                    }
                                                  }
                                                },
                                                {
                                                  "id": "detail_translation",
                                                  "type": "text",
                                                  "context": {
                                                    "_text": "@{detailLesson.translation}"
                                                  },
                                                  "style": {
                                                    "common": {
                                                      "font": "subheadline",
                                                      "foreground": "onSurfaceVariant"
                                                    }
                                                  }
                                                },
                                                {
                                                  "id": "detail_note",
                                                  "type": "text",
                                                  "context": {
                                                    "_text": "@{detailLesson.note}"
                                                  },
                                                  "style": {
                                                    "common": {
                                                      "font": "footnote",
                                                      "foreground": "onSurfaceVariant"
                                                    },
                                                    "text": {
                                                      "lineSpacing": 3
                                                    }
                                                  }
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  ]
                                }
                              }
                            }
                          ]
                        },
                        {
                          "id": "reset_section",
                          "type": "vstack",
                          "context": {
                            "_spacing": 8,
                            "_alignment": "leading"
                          },
                          "style": {
                            "layout": {
                              "maxWidth": "infinity",
                              "padding": 18
                            },
                            "common": {
                              "background": "surface",
                              "foreground": "onSurface",
                              "cornerRadius": 18
                            },
                            "shadow": {
                              "color": "#00000010",
                              "radius": 8,
                              "y": 3
                            },
                            "modal": {
                              "alert": {
                                "title": "Reset learning progress?",
                                "message": "This clears all XP and answer counts on this device. The verb reference stays available.",
                                "isPresented": "${resetAlert}",
                                "actions": [
                                  {
                                    "id": "keep_progress_button",
                                    "type": "button",
                                    "context": {
                                      "_label": "Keep progress"
                                    },
                                    "events": {
                                      "onTap": [
                                        {
                                          "state": {
                                            "id": "keep_progress",
                                            "input": {
                                              "resetAlert": false
                                            }
                                          }
                                        }
                                      ]
                                    }
                                  },
                                  {
                                    "id": "confirm_reset_button",
                                    "type": "button",
                                    "context": {
                                      "_label": "Reset progress"
                                    },
                                    "style": {
                                      "common": {
                                        "tint": "red"
                                      }
                                    },
                                    "events": {
                                      "onTap": [
                                        {
                                          "state": {
                                            "id": "reset_progress",
                                            "input": {
                                              "attempts": "{{ map(range(count(@{catalog})), 0) }}",
                                              "correct": "{{ map(range(count(@{catalog})), 0) }}",
                                              "resetAlert": false,
                                              "saving": true,
                                              "saveError": "",
                                              "saveNotice": "",
                                              "focused": ""
                                            },
                                            "output": {
                                              "success": [
                                                {
                                                  "service": {
                                                    "id": "reset_haptic",
                                                    "input": {
                                                      "serviceId": "verb_audio",
                                                      "params": {
                                                        "haptic": "error"
                                                      }
                                                    }
                                                  }
                                                },
                                                {
                                                  "template": {
                                                    "id": "reset_save_call",
                                                    "input": "persist_progress"
                                                  }
                                                }
                                              ]
                                            }
                                          }
                                        }
                                      ]
                                    }
                                  }
                                ]
                              }
                            }
                          },
                          "children": [
                            {
                              "id": "reset_button",
                              "type": "button",
                              "style": {
                                "button": {
                                  "standard": {
                                    "type": "bordered",
                                    "shape": "capsule"
                                  }
                                },
                                "layout": {
                                  "minHeight": 44
                                },
                                "common": {
                                  "foreground": "onSurface",
                                  "disabled": "{{ !${loaded} || ${saving} }}"
                                }
                              },
                              "children": [
                                {
                                  "id": "reset_label",
                                  "type": "label",
                                  "context": {
                                    "_title": "Reset progress",
                                    "_image": "sf://trash"
                                  },
                                  "style": {
                                    "common": {
                                      "foreground": "onSurface"
                                    }
                                  }
                                }
                              ],
                              "events": {
                                "onTap": [
                                  {
                                    "state": {
                                      "id": "ask_reset",
                                      "input": {
                                        "resetAlert": true
                                      }
                                    }
                                  }
                                ]
                              }
                            },
                            {
                              "id": "local_note",
                              "type": "text",
                              "context": {
                                "_text": "{{ ${saving} ? 'Saving progress… controls will be ready shortly.' : (notEmpty(${saveNotice}) ? ${saveNotice} : 'Progress stays on this device. Resetting asks for confirmation.') }}"
                              },
                              "style": {
                                "common": {
                                  "font": "caption",
                                  "foreground": "secondary"
                                }
                              }
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}