| 1 | // Host de extensiones de VS Code — nivel 1: solo contribuciones declarativas |
| 2 | // (temas de color, gramáticas TextMate, snippets y configuración de lenguajes). |
| 3 | // NINGÚN JavaScript de una extensión se ejecuta aquí. |
| 4 | // |
| 5 | // El código de las extensiones (nivel 2) lo lleva ../ext2/host2.js, que solo |
| 6 | // se importa con alguna con su código encendido o al pedir algo de eso. |
| 7 | // |
| 8 | // ide.js lo carga solo si hay alguna extensión activa (o un tema elegido) y el |
| 9 | // panel lo carga al abrirse: sin extensiones, el arranque de Code no cambia. |
| 10 | // Cada cambio (instalar, activar, desactivar, desinstalar) deshace lo aplicado |
| 11 | // y lo vuelve a aplicar desde cero, de uno en uno: más simple y sin restos. |
| 12 | // Las gramáticas solo se rehacen si su lista cambia. |
| 13 | import * as store from './store.js'; |
| 14 | import * as maindb from '../db.js'; |
| 15 | import { BASES, builtinTheme, toMonacoTheme, toTextMateTheme, chromeCss, themeIdFor } from './themes.js'; |
| 16 | import { registerSnippets } from './snippets.js'; |
| 17 | import { toLanguageConfiguration, matchLanguage, firstLineCandidates } from './languages.js'; |
| 18 | import { Grammars, canOverride } from './grammars.js'; |
| 19 | import { uiLang } from '../i18n.js'; |
| 20 | |
| 21 | export const THEME_PREF = 'elffusscode.theme'; |
| 22 | let instancia = null; |
| 23 | |
| 24 | // ── primera línea (firstLine) en un Worker con tiempo tope ── |
| 25 | // Una expresión de un paquete puede no terminar nunca con según qué línea; en |
| 26 | // el hilo de la página congelaría la pestaña al abrir un fichero. El Worker |
| 27 | // avisa antes de probar cada expresión: si una se pasa de tiempo, se corta el |
| 28 | // Worker, esa expresión queda fuera hasta recargar y se repite con las demás. |
| 29 | const TOPE_EXPRESION_MS = 250; |
| 30 | const TOPE_ARRANQUE_MS = 8000; // el Worker ni contestó (no cargó) |
| 31 | const lentas = new Set(); |
| 32 | const peticiones = new Map(); |
| 33 | let trabajador = null, nPeticion = 0; |
| 34 | |
| 35 | function sueltaTrabajador() { |
| 36 | trabajador?.terminate(); |
| 37 | trabajador = null; |
| 38 | const resto = [...peticiones.values()]; |
| 39 | peticiones.clear(); |
| 40 | for (const p of resto) clearTimeout(p.timer); |
| 41 | return resto; |
| 42 | } |
| 43 | function alRecibir({ data }) { |
| 44 | const p = peticiones.get(data.id); |
| 45 | if (!p) return; |
| 46 | clearTimeout(p.timer); |
| 47 | if ('trying' in data) { |
| 48 | p.timer = setTimeout(() => { |
| 49 | const mala = p.candidatos[data.trying]; |
| 50 | lentas.add(mala.src); |
| 51 | console.warn(`[elffuss-ext] la firstLine de «${mala.id}» no termina a tiempo: no se usa en esta sesión`); |
| 52 | for (const q of sueltaTrabajador()) firstLineEnWorker(q.candidatos, q.linea).then(q.resolve); |
| 53 | }, TOPE_EXPRESION_MS); |
| 54 | return; |
| 55 | } |
| 56 | peticiones.delete(data.id); |
| 57 | p.resolve(data.lang ?? null); |
| 58 | } |
| 59 | function firstLineEnWorker(candidatos, linea) { |
| 60 | candidatos = candidatos.filter(c => !lentas.has(c.src)); |
| 61 | if (!candidatos.length || !linea) return Promise.resolve(null); |
| 62 | return new Promise(resolve => { |
| 63 | try { |
| 64 | if (!trabajador) { |
| 65 | trabajador = new Worker(new URL('./firstline-worker.js', import.meta.url), { type: 'module' }); |
| 66 | trabajador.onmessage = alRecibir; |
| 67 | trabajador.onerror = () => { for (const q of sueltaTrabajador()) q.resolve(null); }; |
| 68 | } |
| 69 | const id = ++nPeticion; |
| 70 | const p = { resolve, candidatos, linea, timer: null }; |
| 71 | p.timer = setTimeout(() => { if (peticiones.get(id) === p) { peticiones.delete(id); resolve(null); } }, TOPE_ARRANQUE_MS); |
| 72 | peticiones.set(id, p); |
| 73 | trabajador.postMessage({ id, candidates: candidatos, line: linea }); |
| 74 | } catch { resolve(null); } // sin Workers: sin detección por primera línea |
| 75 | }); |
| 76 | } |
| 77 | |
| 78 | export function init(monaco, opts = {}) { |
| 79 | instancia ??= crear(monaco, opts).catch(e => { instancia = null; throw e; }); |
| 80 | return instancia; |
| 81 | } |
| 82 | |
| 83 | async function crear(monaco, { onLanguagesChanged = () => {} } = {}) { |
| 84 | const paused = /[?&]noext\b/.test(location.search); |
| 85 | const sinCodigo = /[?&]noext2(?:[=&]|$)/.test(location.search); |
| 86 | const builtin = new Set(monaco.languages.getLanguages().map(l => l.id)); |
| 87 | const registrados = new Set(); // lenguajes que registramos (Monaco no permite quitarlos) |
| 88 | const listeners = new Set(); |
| 89 | let exts = []; |
| 90 | let aplicado = []; // disposables de lo aplicado |
| 91 | let langContribs = []; |
| 92 | let themeIndex = new Map(); // id de tema → { key, label, uiTheme, ext, extName } |
| 93 | let pref = leePref(); |
| 94 | let actual = 'vs-dark', monacoId = 'vs-dark', uiTheme = 'vs-dark'; |
| 95 | let n2 = null, dos = null; // ../ext2/host2.js: su carga, y ya cargado |
| 96 | let estilo = null; |
| 97 | let firmaGramaticas = '[]'; |
| 98 | let cola = Promise.resolve(); // los cambios se aplican de uno en uno |
| 99 | |
| 100 | const grammars = new Grammars(monaco, { |
| 101 | loadFile: store.getFile, |
| 102 | builtin, |
| 103 | // la primera gramática enciende el motor: el tema se redefine con el mapa |
| 104 | // de colores de TextMate antes de pintar ningún token |
| 105 | onActivate: () => aplicaTema(actual), |
| 106 | }); |
| 107 | |
| 108 | function leePref() { try { return localStorage.getItem(THEME_PREF) || 'vs-dark'; } catch { return 'vs-dark'; } } |
| 109 | function guardaPref(id) { |
| 110 | pref = id; |
| 111 | try { if (id === 'vs-dark') localStorage.removeItem(THEME_PREF); else localStorage.setItem(THEME_PREF, id); } catch { /* sin almacenamiento */ } |
| 112 | } |
| 113 | |
| 114 | function pintaCromo(tema, id) { |
| 115 | if (!estilo) { estilo = document.createElement('style'); estilo.id = 'ext-theme-chrome'; document.head.appendChild(estilo); } |
| 116 | estilo.textContent = id === 'vs-dark' ? '' : chromeCss(tema); |
| 117 | } |
| 118 | |
| 119 | let turnoTema = 0; |
| 120 | async function aplicaTema(id, { guardar = false } = {}) { |
| 121 | const turno = ++turnoTema; |
| 122 | let elegido = id, tema = null; |
| 123 | if (themeIndex.has(id)) { |
| 124 | tema = await store.getFile(themeIndex.get(id).key).catch(() => null); |
| 125 | if (!tema) elegido = 'vs-dark'; |
| 126 | } else if (!BASES.includes(id)) elegido = 'vs-dark'; |
| 127 | // flechas rápidas en el selector: solo cuenta la última petición |
| 128 | if (turno !== turnoTema) return actual; |
| 129 | tema ??= builtinTheme(elegido); |
| 130 | const encoded = grammars.setTheme(toTextMateTheme(tema)); |
| 131 | let mid = elegido; |
| 132 | if (!tema.builtin) monaco.editor.defineTheme(elegido, toMonacoTheme(tema, encoded)); |
| 133 | else if (encoded) { |
| 134 | mid = 'elffuss-tm-' + elegido; |
| 135 | monaco.editor.defineTheme(mid, { base: elegido, inherit: true, rules: [], colors: {}, encodedTokensColors: encoded }); |
| 136 | } |
| 137 | monaco.editor.setTheme(mid); |
| 138 | actual = elegido; |
| 139 | monacoId = mid; |
| 140 | pintaCromo(tema, elegido); |
| 141 | uiTheme = tema.uiTheme; |
| 142 | dos?.setTheme(uiTheme); |
| 143 | if (guardar) guardaPref(elegido); |
| 144 | return elegido; |
| 145 | } |
| 146 | |
| 147 | async function reaplica() { |
| 148 | for (const d of aplicado) { try { d.dispose(); } catch { /* ya fuera */ } } |
| 149 | aplicado = []; |
| 150 | const activas = paused ? [] : exts.filter(e => e.enabled); |
| 151 | |
| 152 | langContribs = []; |
| 153 | for (const e of activas) { |
| 154 | for (const l of e.languages || []) { |
| 155 | langContribs.push(l); |
| 156 | if (builtin.has(l.id)) continue; // los de serie conservan su configuración |
| 157 | if (!registrados.has(l.id)) { |
| 158 | // sin firstLine: Monaco la ejecutaría en la página; la detección por |
| 159 | // primera línea es nuestra y va en un Worker (languageForFirstLine) |
| 160 | monaco.languages.register({ id: l.id, extensions: l.extensions, filenames: l.filenames, filenamePatterns: l.filenamePatterns, aliases: l.aliases, mimetypes: l.mimetypes }); |
| 161 | registrados.add(l.id); |
| 162 | } |
| 163 | if (l.configKey) { |
| 164 | const conf = await store.getFile(l.configKey).catch(() => null); |
| 165 | if (conf) aplicado.push(monaco.languages.setLanguageConfiguration(l.id, toLanguageConfiguration(conf, monaco))); |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | const porLang = new Map(); |
| 171 | for (const e of activas) { |
| 172 | for (const s of e.snippets || []) { |
| 173 | if (!porLang.has(s.language)) porLang.set(s.language, []); |
| 174 | porLang.get(s.language).push({ key: s.key, ext: e.displayName }); |
| 175 | } |
| 176 | } |
| 177 | for (const [lang, fuentes] of porLang) { |
| 178 | const cargar = async () => (await Promise.all(fuentes.map(async f => ((await store.getFile(f.key)) || []).map(s => ({ ...s, ext: f.ext }))))).flat(); |
| 179 | aplicado.push(registerSnippets(monaco, lang, cargar, s => s.ext)); |
| 180 | } |
| 181 | |
| 182 | // las gramáticas solo se rehacen si cambian: un tema nuevo no obliga a |
| 183 | // recompilarlas ni a repintar los ficheros con gramática |
| 184 | const gramaticas = activas.flatMap(e => (e.grammars || []).map(g => ({ ...g, ext: e.id }))); |
| 185 | const firma = JSON.stringify(gramaticas.map(g => [g.key, g.language, g.scopeName])); |
| 186 | if (firma !== firmaGramaticas) { firmaGramaticas = firma; grammars.configure(gramaticas); } |
| 187 | |
| 188 | themeIndex = new Map(); |
| 189 | for (const e of activas) for (const t of e.themes || []) themeIndex.set(t.themeId, { ...t, ext: e.id, extName: e.displayName }); |
| 190 | await aplicaTema(pref); |
| 191 | } |
| 192 | |
| 193 | const emit = () => { |
| 194 | for (const f of listeners) { try { f(); } catch { /* un oyente roto no para al resto */ } } |
| 195 | try { onLanguagesChanged(); } catch { /* — */ } |
| 196 | }; |
| 197 | |
| 198 | // ── nivel 2 ── |
| 199 | const oyentesCodigo = new Set(); // el panel: estado del recinto |
| 200 | const nivelDos = () => (n2 ??= import('../ext2/host2.js').then(m => (dos = m.attach({ |
| 201 | monaco, exts: () => exts, recarga, emit, paused, sinCodigo, listeners: oyentesCodigo, uiTheme: () => uiTheme, |
| 202 | })))); |
| 203 | const deDos = f => (...a) => nivelDos().then(d => d[f](...a)); |
| 204 | function sincronizaCodigo() { |
| 205 | if (n2 || (!paused && !sinCodigo && exts.some(e => e.enabled && e.runs))) deDos('sync')().catch(e => console.warn('[elffuss-ext] nivel 2:', e?.message || e)); |
| 206 | } |
| 207 | // Con alguna extensión con código instalada, la vista previa HTML de un |
| 208 | // fichero en el que entró texto suyo (kv «x2.touched») pregunta antes. |
| 209 | async function guardaVistaPrevia() { |
| 210 | (await import('../ide.js')).setBeforePreview(exts.some(e => e.code) ? async path => { |
| 211 | const marcas = await maindb.get('kv', 'x2.touched').catch(() => null); |
| 212 | return !marcas?.[path] || (await import('../ext2/gates.js')).allowPreview(path); |
| 213 | } : null); |
| 214 | } |
| 215 | |
| 216 | function recarga() { |
| 217 | const r = cola.then(async () => { exts = await store.list(); await reaplica(); sincronizaCodigo(); await guardaVistaPrevia(); }); |
| 218 | cola = r.catch(() => {}); |
| 219 | return r.then(emit); |
| 220 | } |
| 221 | |
| 222 | // ── arranque ── |
| 223 | try { await store.reconcile(); } catch (e) { console.warn('[elffuss-ext] no pude ordenar las extensiones guardadas:', e?.message || e); } |
| 224 | exts = await store.list().catch(() => []); |
| 225 | await reaplica(); |
| 226 | sincronizaCodigo(); |
| 227 | guardaVistaPrevia().catch(() => {}); |
| 228 | |
| 229 | const quitaTemasDe = id => { if (themeIndex.get(pref)?.ext === id) guardaPref('vs-dark'); }; |
| 230 | |
| 231 | // Instalar: lo declarativo y, con `withCode` (aceptado por el usuario), su |
| 232 | // código vía host2.js, con la suma SHA-256 publicada obligatoria. |
| 233 | async function install(src, { onProgress, confirmLarge, signal, withCode = false } = {}) { |
| 234 | let bytes, sha256, verified = false, source = 'file', meta = null; |
| 235 | const ovsx = await import('./openvsx.js'); |
| 236 | if (src instanceof Blob) { |
| 237 | bytes = new Uint8Array(await src.arrayBuffer()); |
| 238 | sha256 = await ovsx.sha256Hex(bytes); |
| 239 | } else { |
| 240 | meta = await ovsx.metadata(src.namespace, src.name, src.version || '', { signal }); |
| 241 | ({ bytes, sha256, verified } = await ovsx.download(meta, { onProgress, confirmLarge, signal, requireHash: withCode })); |
| 242 | source = 'open-vsx'; |
| 243 | } |
| 244 | const { readVsix } = await import('./vsix.js'); |
| 245 | const v = await readVsix(bytes, { lang: uiLang() }); |
| 246 | if (meta && v.id !== `${meta.namespace}.${meta.name}`.toLowerCase()) { |
| 247 | throw Object.assign(new Error(`el paquete dice ser ${v.id}, no ${meta.namespace}.${meta.name}`), { code: 'mismatch', got: v.id, want: `${meta.namespace}.${meta.name}` }); |
| 248 | } |
| 249 | const previo = exts.find(e => e.id === v.id); |
| 250 | const codigo = withCode ? await deDos('codeFiles')(v, bytes, previo) : null; |
| 251 | // lo que el usuario VERÍA: temas, snippets, resaltado de un lenguaje o los |
| 252 | // ajustes de uno nuevo. Un lenguaje que solo asocia extensiones de fichero |
| 253 | // no cambia nada en pantalla; si además el valor de la extensión es su |
| 254 | // código y NO se instala con él (nivel 2), instalarla sería inútil y se dice |
| 255 | // en vez de fingir que funciona. |
| 256 | const seVe = v.themes.length || v.snippets.length |
| 257 | || v.grammars.some(g => g.language && !(builtin.has(g.language) && !canOverride(monaco, g.language))) |
| 258 | || v.languages.some(l => l.config && !builtin.has(l.id)); |
| 259 | if (!withCode && !seVe && v.analysis.hasCode) throw Object.assign(new Error('codeonly'), { code: 'codeonly', analysis: v.analysis, displayName: v.displayName }); |
| 260 | if (!withCode && !v.themes.length && !v.grammars.length && !v.snippets.length && !v.languages.length) { |
| 261 | // declaraba cosas aplicables pero ninguna se pudo leer: no es lo mismo |
| 262 | // que no traer nada, y el usuario tiene que saber por qué |
| 263 | if (v.warnings.length) throw Object.assign(new Error('unreadable'), { code: 'unreadable', warning: v.warnings[0], warnings: v.warnings }); |
| 264 | // solo trae código para el navegador: eso se instala desde «… y ejecutar su código» |
| 265 | if (typeof v.manifest.browser === 'string') throw Object.assign(new Error('code-only'), { code: 'codeonly' }); |
| 266 | throw Object.assign(new Error('nothing-applies'), { code: 'nothing' }); |
| 267 | } |
| 268 | const usados = new Set(exts.filter(e => e.id !== v.id).flatMap(e => (e.themes || []).map(t => t.themeId))); |
| 269 | const files = new Map(); |
| 270 | const k = p => store.fileKey(v.id, v.version, p); |
| 271 | const rec = { |
| 272 | id: v.id, publisher: v.publisher, name: v.name, version: v.version, |
| 273 | displayName: v.displayName, description: v.description.slice(0, 500), |
| 274 | license: (meta?.license || v.license || '').slice(0, 200), sha256, verified, source, size: bytes.length, |
| 275 | installedAt: previo?.installedAt || Date.now(), enabled: previo ? previo.enabled : true, |
| 276 | hasCode: v.analysis.hasCode, browser: typeof v.manifest.browser === 'string', ignored: v.analysis.ignored, pack: v.analysis.pack, warnings: v.warnings.slice(0, 20), |
| 277 | categories: v.analysis.categories, sizes: v.analysis.sizes, webviews: v.analysis.webviews, browserEntry: v.analysis.browserEntry, |
| 278 | themes: v.themes.map(t => { const key = k('theme/' + t.index); files.set(key, t.data); return { key, label: t.label, uiTheme: t.uiTheme, themeId: themeIdFor(v.id, t, t.index, usados) }; }), |
| 279 | grammars: v.grammars.map(g => { |
| 280 | const key = k(g.path); files.set(key, g.data); |
| 281 | return { key, scopeName: g.scopeName, language: g.language, embeddedLanguages: g.embeddedLanguages, tokenTypes: g.tokenTypes, injectTo: g.injectTo, balancedBracketScopes: g.balancedBracketScopes, unbalancedBracketScopes: g.unbalancedBracketScopes }; |
| 282 | }), |
| 283 | snippets: v.snippets.map(s => { const key = k(s.path); files.set(key, s.data); return { key, language: s.language, count: s.data.length }; }), |
| 284 | languages: v.languages.map(l => { |
| 285 | let configKey = null; |
| 286 | if (l.config) { configKey = k(l.configPath); files.set(configKey, l.config); } |
| 287 | return { id: l.id, aliases: l.aliases, extensions: l.extensions, filenames: l.filenames, filenamePatterns: l.filenamePatterns, firstLine: l.firstLine, mimetypes: l.mimetypes, configKey }; |
| 288 | }), |
| 289 | licenseKey: null, |
| 290 | }; |
| 291 | if (v.licenseText) { rec.licenseKey = k('LICENSE'); files.set(rec.licenseKey, v.licenseText); } |
| 292 | if (codigo) { for (const [key, d] of codigo.files) files.set(key, d); Object.assign(rec, codigo.fields); } |
| 293 | await store.put(rec, files); |
| 294 | await recarga(); |
| 295 | return rec; |
| 296 | } |
| 297 | |
| 298 | async function setEnabled(id, on) { |
| 299 | if (!on) quitaTemasDe(id); |
| 300 | await store.setEnabled(id, on); |
| 301 | await recarga(); |
| 302 | } |
| 303 | async function uninstall(id) { |
| 304 | quitaTemasDe(id); |
| 305 | await store.remove(id); |
| 306 | await recarga(); |
| 307 | } |
| 308 | |
| 309 | const nombresSerie = { 'vs-dark': 'builtinDark', vs: 'builtinLight', 'hc-black': 'builtinHc', 'hc-light': 'builtinHcLight' }; |
| 310 | return { |
| 311 | paused, |
| 312 | list: () => exts.map(e => ({ ...e })), |
| 313 | onChange(fn) { listeners.add(fn); return () => listeners.delete(fn); }, |
| 314 | install, setEnabled, uninstall, |
| 315 | // nivel 2 (host2.js) |
| 316 | setRuns: deDos('setRuns'), setSettings: deDos('setSettings'), setFormatter: deDos('setFormatter'), codeRuntime: deDos('runtime'), |
| 317 | codeState: () => (dos ? dos.state() : { state: 'stopped', extensions: [], commands: [] }), |
| 318 | codeCommands: () => (dos ? dos.commands() : []), |
| 319 | onCodeChange(fn) { oyentesCodigo.add(fn); return () => oyentesCodigo.delete(fn); }, |
| 320 | noCode: paused || sinCodigo, |
| 321 | licenseText: async id => { const e = exts.find(x => x.id === id); return e?.licenseKey ? (await store.getFile(e.licenseKey)) || '' : ''; }, |
| 322 | themes: () => [ |
| 323 | ...BASES.map(id => ({ id, builtin: true, labelKey: nombresSerie[id], uiTheme: id })), |
| 324 | ...[...themeIndex].map(([id, t]) => ({ id, label: t.label, uiTheme: t.uiTheme, ext: t.ext, extName: t.extName })), |
| 325 | ], |
| 326 | currentTheme: () => actual, |
| 327 | themeId: () => monacoId, |
| 328 | setTheme: id => aplicaTema(id, { guardar: true }), |
| 329 | previewTheme: id => aplicaTema(id), |
| 330 | languageForPath: path => (paused ? null : matchLanguage(langContribs, path)), |
| 331 | // solo para ficheros que nadie reclama por su nombre (ide.js) |
| 332 | languageForFirstLine: line => (paused ? Promise.resolve(null) : firstLineEnWorker(firstLineCandidates(langContribs), line)), |
| 333 | prepareLanguage: async lang => (paused || !grammars.hasGrammarFor(lang) ? false : grammars.prepare(lang)), |
| 334 | skippedGrammars: () => grammars.skipped.map(g => ({ ext: g.ext, language: g.language, scopeName: g.scopeName })), |
| 335 | // lo que no se aplicaría aunque la extensión esté activa: la gramática de |
| 336 | // un lenguaje de serie sin Monarch (JSON) y la configuración de un lenguaje |
| 337 | // de serie (Monaco conserva la suya) |
| 338 | grammarSkippedFor: lang => typeof lang === 'string' && builtin.has(lang) && !canOverride(monaco, lang), |
| 339 | builtinLanguage: id => builtin.has(id), |
| 340 | // para decir en llano lo que hace cada extensión (panel.js) |
| 341 | languageName(id) { |
| 342 | for (let i = langContribs.length - 1; i >= 0; i--) if (langContribs[i].id === id && langContribs[i].aliases?.[0]) return langContribs[i].aliases[0]; |
| 343 | return monaco.languages.getLanguages().find(l => l.id === id)?.aliases?.[0] || null; |
| 344 | }, |
| 345 | languageExtensions(id) { |
| 346 | const out = new Set(); |
| 347 | for (const l of langContribs) if (l.id === id) for (const x of l.extensions || []) out.add(x); |
| 348 | for (const x of monaco.languages.getLanguages().find(l => l.id === id)?.extensions || []) out.add(x); |
| 349 | return [...out]; |
| 350 | }, |
| 351 | async snippetPrefixes(id, n = 3) { |
| 352 | const e = exts.find(x => x.id === id); |
| 353 | const out = []; |
| 354 | for (const s of e?.snippets || []) { |
| 355 | for (const x of (await store.getFile(s.key).catch(() => null)) || []) { |
| 356 | if (x?.prefix && !out.includes(x.prefix)) out.push(x.prefix); |
| 357 | if (out.length >= n) return out; |
| 358 | } |
| 359 | } |
| 360 | return out; |
| 361 | }, |
| 362 | async languageConfig(id, lang) { |
| 363 | const l = exts.find(x => x.id === id)?.languages?.find(x => x.id === lang); |
| 364 | return l?.configKey ? store.getFile(l.configKey).catch(() => null) : null; |
| 365 | }, |
| 366 | }; |
| 367 | } |