clearotron 0.6.0 → 0.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +7 -4
- package/QUICKSTART.md +1 -0
- package/README.md +5 -2
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/bin/clearotron.mjs +4 -2
- package/bin/onboard.mjs +158 -29
- package/build-info.json +2 -2
- package/docs/CLIENT-MCP.md +3 -1
- package/docs/DELIVERY.md +6 -3
- package/docs/architecture/02-architecture.md +1 -1
- package/docs/architecture/04-configuration-reference.md +105 -8
- package/docs/branding.md +4 -4
- package/docs/report-data/clearance-1.schema.json +320 -0
- package/docs/report-data/knockout-1.schema.json +268 -0
- package/driver/CHANGELOG.md +77 -0
- package/driver/cancel.mjs +19 -0
- package/driver/connotation-search.mjs +1 -1
- package/driver/contract-e3-backlog.mjs +41 -41
- package/driver/contract-vocabulary.mjs +1 -1
- package/driver/coverage-ledger.mjs +18 -2
- package/driver/deferral-row.mjs +1 -1
- package/driver/degraded-parts.mjs +1 -0
- package/driver/driver.config.mjs +5 -5
- package/driver/effective-scope.mjs +3 -1
- package/driver/engagement-receipt.mjs +3 -3
- package/driver/engine/anthropic-agent.mjs +15 -1
- package/driver/engine/common.mjs +7 -0
- package/driver/engine/mcp/band-server.mjs +7 -16
- package/driver/engine/mcp/codex-config.mjs +3 -0
- package/driver/engine/mcp/recording-server.mjs +45 -34
- package/driver/engine/openai-agent.mjs +74 -7
- package/driver/engine/session-record.mjs +44 -2
- package/driver/findings-model.mjs +14 -2
- package/driver/follow-up-twins.mjs +86 -0
- package/driver/gateway.mjs +77 -12
- package/driver/jx-units.mjs +3 -1
- package/driver/jx.mjs +13 -5
- package/driver/manuals-inline.mjs +98 -0
- package/driver/manuals-seen.mjs +134 -0
- package/driver/mark-logos.mjs +174 -0
- package/driver/methodology-witness.mjs +2 -1
- package/driver/owner-use-check.mjs +8 -4
- package/driver/package.json +1 -1
- package/driver/pipeline-knockout.mjs +23 -4
- package/driver/pipeline.mjs +128 -15
- package/driver/portal-local-auth.mjs +6 -2
- package/driver/portal-report.mjs +45 -14
- package/driver/portal-routes/me.mjs +4 -1
- package/driver/portal-runs.mjs +19 -16
- package/driver/predelivery-lint.mjs +7 -5
- package/driver/profiles.mjs +4 -4
- package/driver/publish/README.md +9 -7
- package/driver/publish/email-conditions.mjs +22 -5
- package/driver/publish/evidence-words.mjs +21 -0
- package/driver/publish/index.mjs +304 -211
- package/driver/publish/knockout.mjs +297 -247
- package/driver/publish/office-record-links.mjs +11 -9
- package/driver/publish/page-shell.mjs +98 -0
- package/driver/publish/pool-admin.mjs +2 -2
- package/driver/publish/publish-inputs.mjs +4 -0
- package/driver/publish/regions.mjs +28 -3
- package/driver/publish/register-record-html.mjs +105 -0
- package/driver/publish/register-record.mjs +165 -0
- package/driver/publish/render-knockout.mjs +299 -671
- package/driver/publish/render.mjs +561 -492
- package/driver/publish/report-data.mjs +226 -13
- package/driver/publish/report-document.mjs +353 -0
- package/driver/publish/search-depth.mjs +88 -7
- package/driver/publish/shell.mjs +41 -1
- package/driver/publish/strings.mjs +810 -0
- package/driver/publish/templates/clearance-print.css +23 -0
- package/driver/publish/templates/knockout.css +224 -0
- package/driver/publish/templates/report.css +112 -53
- package/driver/publish/xlsx.mjs +158 -139
- package/driver/record-goods.mjs +42 -0
- package/driver/reference-score.mjs +4 -1
- package/driver/register-count.mjs +5 -1
- package/driver/register-reach.mjs +39 -0
- package/driver/registry-fidelity.mjs +155 -37
- package/driver/repair-composers.mjs +7 -3
- package/driver/repair-targets.mjs +4 -1
- package/driver/replay-archive.mjs +4 -3
- package/driver/run-delivered.mjs +14 -8
- package/driver/run-record.mjs +1 -0
- package/driver/runner.mjs +73 -29
- package/driver/scope-facts.mjs +27 -6
- package/driver/search-policy.mjs +9 -4
- package/driver/skills/clearance-search/report-prose.md +3 -0
- package/driver/skills/knockout-assess/SKILL.md +8 -0
- package/driver/stage-freshness.mjs +8 -5
- package/driver/stages.mjs +69 -43
- package/driver/steps/delivery.mjs +9 -5
- package/driver/steps/overview-and-cards.mjs +54 -15
- package/driver/steps/register-sweep.mjs +5 -4
- package/driver/steps/skeptic-and-follow-up.mjs +3 -2
- package/driver/steps/verdict-gate.mjs +35 -14
- package/driver/suite-census.json +579 -87
- package/driver/synthesis-record.mjs +4 -3
- package/driver/terminal-clamp.mjs +6 -1
- package/driver/withdrawn-rating.mjs +72 -0
- package/mcp-server/CHANGELOG.md +8 -0
- package/mcp-server/lib/audit-view.mjs +5 -2
- package/mcp-server/lib/brief.mjs +6 -2
- package/mcp-server/lib/evidence.mjs +94 -23
- package/mcp-server/lib/findings.mjs +19 -2
- package/mcp-server/lib/knockout.mjs +13 -4
- package/mcp-server/lib/scrub.mjs +1 -1
- package/mcp-server/package.json +1 -1
- package/mcp-server/server.mjs +22 -3
- package/package.json +4 -1
- package/portal-ui/dist/assets/{index-CYaO2ygd.js → index-BBlN4CYq.js} +238 -80
- package/portal-ui/dist/assets/{index-izLa9apq.css → index-CxAkJXIT.css} +25 -5
- package/portal-ui/dist/index.html +2 -2
- package/portal-ui/package.json +3 -3
- package/providers/_shared/ledger.mjs +30 -2
- package/providers/_shared/record-uri.mjs +15 -0
- package/providers/clarivate/src/adapter.js +11 -0
- package/providers/clarivate/src/core.js +17 -1
- package/providers/jx/src/core.js +4 -4
- package/providers/jx/src/judge.js +1 -3
- package/providers/jx/src/nativeread.js +1 -3
- package/providers/oauth-mcp-bridge/CHANGELOG.md +8 -0
- package/providers/oauth-mcp-bridge/package.json +1 -1
- package/scripts/README.md +147 -3
- package/scripts/added-reference-check.mjs +35 -7
- package/scripts/e2e-first-time.mjs +4 -4
- package/scripts/env-audit.mjs +16 -9
- package/scripts/freeze-example-run.mjs +3 -3
- package/scripts/mint-public-residue.mjs +3 -3
- package/scripts/mint-search-level-tags.mjs +61 -0
- package/scripts/mint-source-pin-census.mjs +89 -0
- package/scripts/release-note-required.mjs +65 -6
- package/scripts/test-durations-reporter.mjs +25 -0
- package/scripts/test-full.mjs +72 -18
- package/scripts/test-run.mjs +18 -1
- package/shared/brand.mjs +93 -6
- package/shared/inline-markdown.mjs +53 -0
- package/shared/names-in-force.mjs +0 -1
- package/shared/portal-tokens.mjs +2 -1
- package/shared/reference-guard-classes.mjs +43 -2
- package/shared/register-selection.mjs +8 -3
- package/shared/search-level-tags.json +25 -0
- package/shared/source-spans.mjs +91 -0
- package/shared/tools/derive-band-pairs.mjs +10 -0
- package/driver/own-rights.mjs +0 -83
- package/driver/use-check.mjs +0 -85
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
//
|
|
23
23
|
// Each address was checked on 2026-09-10 against a real record, and each row says how.
|
|
24
24
|
|
|
25
|
+
import { RECORD_LINKS as L } from "./strings.mjs";
|
|
26
|
+
|
|
25
27
|
const pad = (s, n) => String(s).padStart(n, "0");
|
|
26
28
|
const clean = (v) => (v == null ? "" : String(v).trim());
|
|
27
29
|
|
|
@@ -244,33 +246,33 @@ export function officeReasonSentences(byUri) {
|
|
|
244
246
|
const each = [...keys].sort().map((k) => {
|
|
245
247
|
const [office, reason] = k.split(" ");
|
|
246
248
|
const name = nameOf(office);
|
|
247
|
-
if (reason === "no-page") return
|
|
248
|
-
return
|
|
249
|
+
if (reason === "no-page") return L.noPage(name);
|
|
250
|
+
return L.numberForm(name);
|
|
249
251
|
});
|
|
250
252
|
const codes = [...unknown].sort().map(nameOf);
|
|
251
|
-
if (codes.length === 1) each.push(
|
|
252
|
-
else if (codes.length > 1) each.push(
|
|
253
|
+
if (codes.length === 1) each.push(L.noAddress(codes[0]));
|
|
254
|
+
else if (codes.length > 1) each.push(L.noAddresses(codes.join(", ")));
|
|
253
255
|
return each;
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
/**
|
|
257
259
|
* What a linked registration number opens, when one is linked, then the reasons per office, as the
|
|
258
260
|
* knockout says them under its listed filings. They are the sentences the clearance says in Scope; its
|
|
259
|
-
* renderer
|
|
261
|
+
* renderer was hash-frozen when this was written (render-frozen.test.mjs) and keeps its own copy of the first.
|
|
260
262
|
*/
|
|
261
263
|
export function officeLinkSentences(byUri) {
|
|
262
264
|
if (!(byUri instanceof Map)) return [];
|
|
263
265
|
const linked = [...byUri.values()].some((l) => l?.href);
|
|
264
|
-
return [...(linked ? [
|
|
266
|
+
return [...(linked ? [L.opensOfficePage] : []),
|
|
265
267
|
...officeReasonSentences(byUri)];
|
|
266
268
|
}
|
|
267
269
|
|
|
268
270
|
/** Why a registration is cited by number rather than linked, in the workbook's words. */
|
|
269
271
|
export function reasonCellFor(link) {
|
|
270
272
|
const name = nameOf(link.office);
|
|
271
|
-
if (link.reason === "no-page") return
|
|
272
|
-
if (link.reason === "unknown-office") return
|
|
273
|
-
return
|
|
273
|
+
if (link.reason === "no-page") return L.cell.noPage(name);
|
|
274
|
+
if (link.reason === "unknown-office") return L.cell.noAddress(name);
|
|
275
|
+
return L.cell.numberForm(name);
|
|
274
276
|
}
|
|
275
277
|
|
|
276
278
|
/** The workbook's Link cell for a finding: its first linked registration, else the first stated reason. */
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright 2026 Cordillera Sàrl. Additional terms under section 7 of the AGPL-3.0 apply — see ADDITIONAL-TERMS.md
|
|
3
|
+
// publish/page-shell.mjs — the document both report renderers wrap their page in.
|
|
4
|
+
//
|
|
5
|
+
// The clearance report (render.mjs) and the Knockout (render-knockout.mjs) built this shell each on its own: the same
|
|
6
|
+
// head, title, typefaces, favicon, theme script and style block, written twice, with the report's base sheet and the
|
|
7
|
+
// print rule defined in both files. A change a skin needs, to the head, the fonts, the theme or print, had to be made
|
|
8
|
+
// twice, and the two copies had already drifted on the chrome sheet.
|
|
9
|
+
//
|
|
10
|
+
// WHAT DIFFERS BETWEEN THE TWO PAGES IS AN INPUT, NEVER A SWITCH. Each renderer passes its own title, its own sheet and,
|
|
11
|
+
// when the pool serves one, the address of the shared chrome sheet. The clearance inlines the chrome only when it is
|
|
12
|
+
// given no address, and the Knockout always inlines it; each decides that in what it passes as `css`, so the shell
|
|
13
|
+
// emits each page's bytes exactly as its renderer wrote them before. Converging the two would change a page a reader
|
|
14
|
+
// sees, and is not this module's to do.
|
|
15
|
+
import { readFileSync } from 'node:fs';
|
|
16
|
+
import { join, dirname } from 'node:path';
|
|
17
|
+
import { fileURLToPath } from 'node:url';
|
|
18
|
+
import { REPORT_ROOT, REPORT_ROOT_DARK_EXPLICIT, THEME_INIT_EXPLICIT, FAVICON_LINK, BRAND } from '../../shared/brand.mjs';
|
|
19
|
+
import { REPORT_FONT_STYLE } from '../../shared/brand-fonts.mjs'; // the typefaces travel inside the report; it fetches nothing to draw its text
|
|
20
|
+
|
|
21
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
22
|
+
const escHtml = (s) => String(s ?? '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
23
|
+
|
|
24
|
+
// Brand :root tokens are sourced from shared/brand.mjs (REPORT_ROOT) and prepended to the report stylesheet, so
|
|
25
|
+
// report.css carries only rules — the palette lives in ONE place across surfaces.
|
|
26
|
+
export const REPORT_BASE = REPORT_ROOT + '\n' + readFileSync(join(HERE, 'templates', 'report.css'), 'utf8');
|
|
27
|
+
// Print always renders light: re-assert the REPORT_ROOT light tokens under [data-theme=dark] inside @media
|
|
28
|
+
// print (a dark-toggled report must never print on near-black — ink/banding + legal-document convention).
|
|
29
|
+
const PRINT_LIGHT = '\n@media print{' + REPORT_ROOT.replace(':root{', ':root[data-theme="dark"]{color-scheme:light;') + '}';
|
|
30
|
+
|
|
31
|
+
// Dark theme rides at EMIT time — the module-level sheets stay untouched (their light half must render
|
|
32
|
+
// byte-identically). The toggle arrives via the nav.
|
|
33
|
+
//
|
|
34
|
+
// EXPLICIT ONLY. A report is the product's most client-facing artefact — it is opened in front of a client, and the
|
|
35
|
+
// portal frames it for one — and a client surface must never follow the OS colour preference. The clearance report
|
|
36
|
+
// once emitted the automatic pair and went dark on a dark-mode laptop, as a delivered legal document, on the
|
|
37
|
+
// standalone file AND framed in the portal, because the portal's shell does not strip the rule. The Knockout already
|
|
38
|
+
// took the explicit pair. Dark is still fully reachable, by the toggle and by a choice carried from any other
|
|
39
|
+
// surface; only the automatic part is gone.
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A stylesheet without its comments, for a page a client receives. The source files keep every comment: they carry
|
|
43
|
+
* the reasoning (a stylesheet's notes are for whoever edits it), and a client who views the source of a forwarded
|
|
44
|
+
* report would read internal process notes. A comment opener inside a quoted string or an unquoted url() is text, not
|
|
45
|
+
* a comment, and is kept as it is; a comment between two word characters leaves a space, so no two tokens merge.
|
|
46
|
+
* PURE.
|
|
47
|
+
*/
|
|
48
|
+
export function stripCssComments(css) {
|
|
49
|
+
const src = String(css ?? '');
|
|
50
|
+
let out = '';
|
|
51
|
+
for (let i = 0; i < src.length;) {
|
|
52
|
+
const ch = src[i];
|
|
53
|
+
if (ch === '"' || ch === "'") { // a quoted string, copied whole, escapes included
|
|
54
|
+
let j = i + 1;
|
|
55
|
+
while (j < src.length && src[j] !== ch) j += src[j] === '\\' ? 2 : 1;
|
|
56
|
+
out += src.slice(i, j + 1); i = j + 1; continue;
|
|
57
|
+
}
|
|
58
|
+
if (/^url\(/i.test(src.slice(i, i + 4)) && !/[\w-]/.test(src[i - 1] ?? '')) { // url( … ), quoted or not
|
|
59
|
+
let j = i + 4, quote = null;
|
|
60
|
+
for (; j < src.length; j++) {
|
|
61
|
+
if (quote) { if (src[j] === '\\') j++; else if (src[j] === quote) quote = null; }
|
|
62
|
+
else if (src[j] === '"' || src[j] === "'") quote = src[j];
|
|
63
|
+
else if (src[j] === ')') break;
|
|
64
|
+
}
|
|
65
|
+
out += src.slice(i, j + 1); i = j + 1; continue;
|
|
66
|
+
}
|
|
67
|
+
if (ch === '/' && src[i + 1] === '*') {
|
|
68
|
+
const end = src.indexOf('*/', i + 2);
|
|
69
|
+
const next = end < 0 ? src.length : end + 2;
|
|
70
|
+
if (/[\w-]$/.test(out) && /^[\w-]/.test(src.slice(next, next + 1))) out += ' ';
|
|
71
|
+
i = next; continue;
|
|
72
|
+
}
|
|
73
|
+
out += ch; i++;
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// THE PAGE'S OWN CHROME CARRIES ONE ATTRIBUTE, data-report-chrome: the sticky header (the bar, the export menu, the
|
|
79
|
+
// section strip) on both reports, and the Knockout's theme button. The portal frames a report and removes that chrome,
|
|
80
|
+
// and it found it by class names a re-skin could rename without a sound. An element carrying the attribute is the
|
|
81
|
+
// renderer saying "this is mine, not the report's". No stylesheet selects on it, so it changes nothing a reader sees.
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* One report page. `title` is the page's own title as HTML, already escaped by its renderer; the shell adds the
|
|
85
|
+
* product's name after it. `css` is the renderer's sheet, placed after the base sheet and before the dark and print
|
|
86
|
+
* rules. `chromeHref`, when given, links the pool's shared chrome sheet after the inline style, so the chrome stays
|
|
87
|
+
* last in the cascade. `body` is everything inside <body>.
|
|
88
|
+
*/
|
|
89
|
+
export function pageShell({ title, css, chromeHref, body }) {
|
|
90
|
+
const chromeLinkTag = chromeHref ? `<link rel="stylesheet" href="${escHtml(chromeHref)}">` : '';
|
|
91
|
+
return `<!DOCTYPE html>
|
|
92
|
+
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
|
93
|
+
<title>${title} · ${escHtml(BRAND.name)}</title>
|
|
94
|
+
${REPORT_FONT_STYLE}${FAVICON_LINK}${THEME_INIT_EXPLICIT}
|
|
95
|
+
<style>${stripCssComments(`${REPORT_BASE}\n${css}${REPORT_ROOT_DARK_EXPLICIT}${PRINT_LIGHT}`)}</style>${chromeLinkTag}</head><body class="has-glow">
|
|
96
|
+
${body}
|
|
97
|
+
</body></html>`;
|
|
98
|
+
}
|
|
@@ -99,7 +99,7 @@ function injectHome(html, href) {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
// Retrofit existing reports across the pool with the home pill. report.html → the staff index
|
|
102
|
-
// (../index.html). One report
|
|
102
|
+
// (../index.html). One report: stale report.client.html files in old pool dirs are
|
|
103
103
|
// dead bytes nothing links to — this deliberately leaves them alone rather than retrofitting them.
|
|
104
104
|
function linkHome(poolDir) {
|
|
105
105
|
const runs = listRuns(poolDir);
|
|
@@ -148,7 +148,7 @@ function parseRepublishFlags(rest) {
|
|
|
148
148
|
const flags = new Map(); const pos = [];
|
|
149
149
|
for (let i = 0; i < rest.length; i++) {
|
|
150
150
|
if (rest[i] === '--internal-only' || rest[i] === '--include-client')
|
|
151
|
-
throw new Error(`${rest[i]} is retired — there is ONE report now
|
|
151
|
+
throw new Error(`${rest[i]} is retired — there is ONE report now; republish always re-renders report.html and nothing else exists to hold back.`);
|
|
152
152
|
else if (rest[i] === '--pool' || rest[i] === '--run-dir') flags.set(rest[i], rest[++i]);
|
|
153
153
|
else if (rest[i].startsWith('--')) throw new Error(`unknown flag ${rest[i]}`);
|
|
154
154
|
else pos.push(rest[i]);
|
|
@@ -75,6 +75,10 @@ export const PUBLISH_INPUTS = {
|
|
|
75
75
|
"register-named-band.json": "optional",
|
|
76
76
|
// The instructed scope, read only as the register plan's fallback for the searched-jurisdiction set.
|
|
77
77
|
"_driver/instructed-scope.json": "optional",
|
|
78
|
+
// The scope facts, read only for the register service's reach the run recorded beside its coverage line: the head
|
|
79
|
+
// of the workbook's register rows states it. Optional: a run from before the record, and every run whose service
|
|
80
|
+
// declares no office list, has no reach, and the head keeps its earlier words.
|
|
81
|
+
"_driver/scope-facts.json": "optional",
|
|
78
82
|
// The frozen local-language lane decision, and the units the fold wrote. Read to derive how deep that
|
|
79
83
|
// investigation went against what the matter configured — through the engine's own asked-versus-ran
|
|
80
84
|
// reader, not by re-deciding it here. Optional and genuinely so: a plain clearance never runs the
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// The common-law sentinel is 'C/L', never 'CL' — to a trademark lawyer CL is Chile (ISO 3166), and an
|
|
7
7
|
// actual Chilean registration must not collide with the common-law bucket (the latent bug a reviewing
|
|
8
8
|
// lawyer hit on a live matter). Every ISO-3166 alpha-2 key in REGION_NAMES must therefore carry its
|
|
9
|
-
// country meaning; only non-ISO keys ('C/L', 'WO', 'BX', 'EU') may carry a non-country meaning —
|
|
9
|
+
// country meaning; only non-ISO keys ('C/L', 'WO', 'BX', 'EU', 'XS') may carry a non-country meaning —
|
|
10
10
|
// regions.test.mjs guards this.
|
|
11
11
|
//
|
|
12
12
|
// PURE (no node imports) so tests run offline and any surface (render, email, xlsx) can import it.
|
|
@@ -22,6 +22,13 @@ export const REGION_NAMES = {
|
|
|
22
22
|
MX: 'Mexico', TW: 'Taiwan', HK: 'Hong Kong', SA: 'Saudi Arabia', AE: 'United Arab Emirates',
|
|
23
23
|
DK: 'Denmark', FI: 'Finland', PL: 'Poland', PT: 'Portugal', AT: 'Austria', BE: 'Belgium',
|
|
24
24
|
IE: 'Ireland', GR: 'Greece', IL: 'Israel', TK: 'Tokelau',
|
|
25
|
+
// XS is no country: it is the code the US state registers are filed under beside the federal one, read as they are
|
|
26
|
+
// named (owner, 2026-11-18). It printed as "XS".
|
|
27
|
+
XS: 'US state registers',
|
|
28
|
+
// Two regional offices and a user-assigned code, by the names a lawyer knows them (owner, 2026-11-19). They printed
|
|
29
|
+
// as codes in a report's list of places where nothing was found. XA, XG and XW stay as the register records them
|
|
30
|
+
// until the register's own names for them are verified.
|
|
31
|
+
AP: 'ARIPO', OA: 'OAPI', XK: 'Kosovo',
|
|
25
32
|
CL: 'Chile', [COMMON_LAW]: 'Common-law',
|
|
26
33
|
};
|
|
27
34
|
|
|
@@ -34,5 +41,23 @@ export const REGION_ALIAS = { GB: 'UK', EM: 'EU', EUTM: 'EU', EUIPO: 'EU', INT:
|
|
|
34
41
|
|
|
35
42
|
export const normRegion = (c) => { const u = String(c || '').toUpperCase(); return REGION_ALIAS[u] || u; };
|
|
36
43
|
|
|
37
|
-
//
|
|
38
|
-
|
|
44
|
+
// THE NAME A READER SEES. The table above wins; a two-letter country code it lacks takes the name the runtime's own
|
|
45
|
+
// region names give it (Intl.DisplayNames, a global, so this file stays import-free); anything else is printed as
|
|
46
|
+
// the code itself, so a new register still surfaces without a change here. 128 of 320 country rows on delivered
|
|
47
|
+
// reports printed a bare code (AR, CO, CZ) because the table is hand-kept.
|
|
48
|
+
//
|
|
49
|
+
// ONLY A REAL COUNTRY CODE IS ASKED. ZZ reads "Unknown Region" and a numeric code "world", and neither may reach a
|
|
50
|
+
// page, so the question is put only for two capital letters outside ZZ and the private-use ranges (AA, QM to QZ,
|
|
51
|
+
// XA to XZ), and a name that comes back as the code itself (EM) is no name. The runtime's names come from its ICU
|
|
52
|
+
// data, so a newer Node can spell one differently; the table is where a spelling is pinned (TR stays Turkey).
|
|
53
|
+
const PRIVATE_USE = /^(?:AA|ZZ|Q[M-Z]|X[A-Z])$/;
|
|
54
|
+
let displayNames;
|
|
55
|
+
function runtimeRegionName(code) {
|
|
56
|
+
if (!/^[A-Z]{2}$/.test(code) || PRIVATE_USE.test(code) || typeof Intl?.DisplayNames !== 'function') return null;
|
|
57
|
+
try {
|
|
58
|
+
displayNames ??= new Intl.DisplayNames(['en'], { type: 'region' });
|
|
59
|
+
const name = displayNames.of(code);
|
|
60
|
+
return name && name !== code ? name : null;
|
|
61
|
+
} catch { return null; }
|
|
62
|
+
}
|
|
63
|
+
export const regionName = (code) => REGION_NAMES[code] || runtimeRegionName(code) || code;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright 2026 Cordillera Sàrl. Additional terms under section 7 of the AGPL-3.0 apply — see ADDITIONAL-TERMS.md
|
|
3
|
+
// publish/register-record-html.mjs — one cited registration's register record, and its logo, as both report pages
|
|
4
|
+
// draw them.
|
|
5
|
+
//
|
|
6
|
+
// The clearance draws a record on each finding card and the Knockout under each listed filing (owner, 2026-11-18).
|
|
7
|
+
// The rows come from registerRecordView, which copies every fact from the saved record; this module lays them out
|
|
8
|
+
// once, so the two pages cannot drift apart. What differs between the pages is an input: the register number's cell,
|
|
9
|
+
// which each page already prints its own way, the receipt line, and the owner's name as that page resolves it.
|
|
10
|
+
import { registerRecordView, RECORD_LABELS as L, countryOf, LOGO_NOT_RETRIEVED } from './register-record.mjs';
|
|
11
|
+
import { REC, inPriorityWindow } from '../registry-fidelity.mjs';
|
|
12
|
+
import { registrationSystem } from '../jurisdiction-systems.mjs';
|
|
13
|
+
import { normRegion } from './regions.mjs';
|
|
14
|
+
import { REGISTER_RECORD as RR } from './strings.mjs';
|
|
15
|
+
|
|
16
|
+
const esc = (s) => String(s ?? '').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
17
|
+
const escAttr = (s) => esc(s).replace(/"/g, '"');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* One register record entry: Mark, Goods and services, Owner, Country, Status and Register number, each row drawn
|
|
21
|
+
* only when the record states it. `number` is the page's own register number for the registration: `label`, the
|
|
22
|
+
* office's number as plain text, or null where the page cites the record by its handle; `fallbackText`, the text the
|
|
23
|
+
* page shows then; and `cell(label)`, the page's cell for a label, which escapes it;
|
|
24
|
+
* `receipt` the page's receipt line or null; `ownerName` the owner as the page resolves it; `jurisdiction` the
|
|
25
|
+
* registration's jurisdiction where the record names none; `asOf` the publish date the Paris-priority flag is read
|
|
26
|
+
* against, or null for no flag. PURE.
|
|
27
|
+
*/
|
|
28
|
+
export function recordEntryHtml(rec, { uri = '', jurisdiction = '', receipt = null, asOf = null, number, ownerName = null }) {
|
|
29
|
+
const view = registerRecordView(rec, { uri, receipt });
|
|
30
|
+
const by = Object.fromEntries(view.rows.map((row) => [row.label, row]));
|
|
31
|
+
const faint = (t) => (t ? ` <span class="rr-faint">${esc(t)}</span>` : '');
|
|
32
|
+
const row = (label, v) => (v ? `<div class="rr-row"><span class="k">${esc(label)}</span><span class="v">${v}</span></div>` : '');
|
|
33
|
+
// The goods: the translation marker or the original's note first, then each class statement, a long one cut at
|
|
34
|
+
// a term boundary with the rest one tap away.
|
|
35
|
+
const g = by[L.goods];
|
|
36
|
+
const statement = (st) => `<div class="rr-g"><span class="rr-cls">${esc(st.class)}</span> ${st.preview
|
|
37
|
+
? `<span class="rr-txt">${esc(st.preview)}; …</span><details class="rr-all"><summary>${esc(st.showAll)}</summary><span class="rr-txt">${esc(st.text)}</span></details>`
|
|
38
|
+
: `<span class="rr-txt">${esc(st.text)}</span>`}</div>`;
|
|
39
|
+
const goods = g.entries.length
|
|
40
|
+
? `${g.marker ? `<details class="rr-mt"><summary>${esc(g.marker.tag)}</summary><span class="rr-mtnote">${esc(g.marker.note)}</span></details>` : ''}${g.note ? `<div class="rr-orig">${esc(g.note)}</div>` : ''}${g.entries.map(statement).join('')}`
|
|
41
|
+
: `<div class="rr-g rr-faint">${esc(g.note)}</div>`;
|
|
42
|
+
// The Country row carries the registration system and, for an international registration, where its rights
|
|
43
|
+
// reach, in the words the registration line carried before the record replaced it (design, 2026-11-19).
|
|
44
|
+
const jur = jurisdiction || rec.jurisdiction || '';
|
|
45
|
+
const sys = registrationSystem(jur);
|
|
46
|
+
const isWO = normRegion(jur) === 'WO' || /\/mark\/wo\//i.test(uri);
|
|
47
|
+
const desig = isWO ? REC.designations(rec) : null;
|
|
48
|
+
const reach = !isWO ? ''
|
|
49
|
+
: (desig ? RR.designating(esc(desig.join(', ')))
|
|
50
|
+
: ` · <i>${RR.designationsNotOnRecord}</i>`);
|
|
51
|
+
// A record that names no office still names its jurisdiction, and the country is read from that.
|
|
52
|
+
const place = by[L.country].value || countryOf(rec.jurisdiction);
|
|
53
|
+
const country = place || isWO || sys
|
|
54
|
+
? `${esc(place || '')}${sys ? ` <i class="jsys">(${sys})</i>` : ''}${reach}` : '';
|
|
55
|
+
// The Status row: the register's status, its dates, and the Paris-priority flag beside them, with its emphasis.
|
|
56
|
+
const st = by[L.status];
|
|
57
|
+
const prio = asOf && inPriorityWindow(rec, asOf)
|
|
58
|
+
? ` · <b>${RR.priorityWindow}</b>` : '';
|
|
59
|
+
const status = st.value || st.faint || prio
|
|
60
|
+
? `${esc(st.value || '')}${st.value && st.faint ? ' · ' : ''}${st.faint ? `<span class="rr-faint">${esc(st.faint)}</span>` : ''}${prio}` : '';
|
|
61
|
+
// The register number is the page's own cell for this registration; the application number follows only where
|
|
62
|
+
// the cell does not already show it. Compared by letters and digits alone: an office can write the number the
|
|
63
|
+
// record holds as 2019046708 with dashes, "2019-046708".
|
|
64
|
+
//
|
|
65
|
+
// THE ROW SHOWS THE REGISTRATION NUMBER, as the board draws it ("US 6123457 application 90770114"). Some offices
|
|
66
|
+
// key their record page on the application number (the USPTO's serial, the JPO's application), so the page's cell
|
|
67
|
+
// reads the application number; there the cell's visible number becomes the registration number, its link still
|
|
68
|
+
// opening the office's page, and "application N" follows. The words are the approved ones; only which number
|
|
69
|
+
// shows changes.
|
|
70
|
+
//
|
|
71
|
+
// THE SWAP IS MADE ON PLAIN TEXT, NEVER ON MARKUP. The office's number arrives as the label the page would print,
|
|
72
|
+
// the registration number takes the application number's place in that text, and the page's own cell builder
|
|
73
|
+
// escapes the result, as it escapes every label it prints. A record handle (`/mark/us/…`) is an identifier, not a
|
|
74
|
+
// number, and is never rewritten.
|
|
75
|
+
const num = by[L.number];
|
|
76
|
+
const bare = (t) => String(t ?? '').replace(/[^0-9A-Za-z]/g, '');
|
|
77
|
+
const appNo = REC.serial(rec), regNo = REC.regNumber(rec);
|
|
78
|
+
let label = number?.label ?? null;
|
|
79
|
+
if (label && appNo && regNo && bare(appNo) !== bare(regNo) && bare(label).includes(bare(appNo)) && !bare(label).includes(bare(regNo))) {
|
|
80
|
+
const loose = new RegExp([...bare(appNo)].join('[^0-9A-Za-z]?'));
|
|
81
|
+
label = label.replace(loose, () => String(regNo));
|
|
82
|
+
}
|
|
83
|
+
const cell = typeof number?.cell === 'function' ? number.cell(label) : '';
|
|
84
|
+
const shown = label ?? number?.fallbackText ?? '';
|
|
85
|
+
const app = num.faint && !bare(shown).includes(bare(num.faint.replace(/^application /, ''))) ? faint(num.faint) : '';
|
|
86
|
+
const mark = by[L.mark].value ? `<b>${esc(by[L.mark].value)}</b>${faint(by[L.mark].faint)}` : '';
|
|
87
|
+
const owner = ownerName || by[L.owner].value;
|
|
88
|
+
const ownerHtml = owner ? `${esc(owner)}${faint(by[L.owner].faint)}` : '';
|
|
89
|
+
return `<div class="rr">${row(L.mark, mark)}${row(L.goods, goods)}${row(L.owner, ownerHtml)}${row(L.country, country)}${row(L.status, status)}${row(L.number, `${cell}${app}${receipt ? `<div><i class="receipt">${esc(receipt)}</i></div>` : ''}`)}</div>`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* One logo in its fixed box: the saved image, or "Logo not retrieved" where the fetch failed, opening the office's
|
|
94
|
+
* record at `href` when there is one. `logo` is { state, src } from the run's logo step; `caption` draws the
|
|
95
|
+
* register under the box. Null when the registration has no logo to show. PURE.
|
|
96
|
+
*/
|
|
97
|
+
export function logoFigureHtml(rec, { uri = '', logo = null, href = null, caption = true }) {
|
|
98
|
+
if (!logo || (logo.state !== 'fetched' && logo.state !== 'failed')) return null;
|
|
99
|
+
const { logo: v } = registerRecordView(rec, { uri });
|
|
100
|
+
const link = (inner, cls = '') => (href ? `<a${cls} href="${href}" target="_blank" rel="noopener noreferrer">${inner}</a>` : inner);
|
|
101
|
+
const body = logo.state === 'fetched'
|
|
102
|
+
? link(`<img src="${logo.src}" alt="${escAttr(v.alt || '')}">`)
|
|
103
|
+
: (href ? link(esc(LOGO_NOT_RETRIEVED), ' class="rr-nologo"') : `<span class="rr-nologo">${esc(LOGO_NOT_RETRIEVED)}</span>`);
|
|
104
|
+
return `<figure class="rr-lg">${body}${caption && v.caption ? `<figcaption>${esc(v.caption)}</figcaption>` : ''}</figure>`;
|
|
105
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
// Copyright 2026 Cordillera Sàrl. Additional terms under section 7 of the AGPL-3.0 apply — see ADDITIONAL-TERMS.md
|
|
3
|
+
// publish/register-record.mjs — the register's own record of one cited registration, as the report shows it.
|
|
4
|
+
//
|
|
5
|
+
// A reviewing lawyer checks every cited mark against the register by hand before reading the analysis. The
|
|
6
|
+
// report now opens each cited registration with the register's facts: the mark and its type, the goods by
|
|
7
|
+
// class, the owner and the owner's country, the country, the status with its dates, and the register number
|
|
8
|
+
// linked to the office's own record. This module builds
|
|
9
|
+
// those rows from the record the run saved; the renderers lay them out.
|
|
10
|
+
//
|
|
11
|
+
// EVERY FACT IS COPIED FROM THE SAVED RECORD. Nothing here is composed by a model, and nothing is translated
|
|
12
|
+
// here: a record's goods are its English where it holds English, the vendor's machine translation marked as
|
|
13
|
+
// one where it holds that, and the original as registered otherwise. The goods are read by record-goods.mjs,
|
|
14
|
+
// the one reader of a record's goods; the record's other fields by registry-fidelity.mjs's REC, as the
|
|
15
|
+
// renderer reads them today.
|
|
16
|
+
//
|
|
17
|
+
// PURE — no IO, no register call. A logo is not fetched here: `logo.wanted` says whether a registration's
|
|
18
|
+
// record carries one worth fetching, and the run's logo step does the fetching.
|
|
19
|
+
import { recordGoods, niceClass, untaggedIsEnglish, DEFAULT_ANSWER_CUT } from '../record-goods.mjs';
|
|
20
|
+
import { REC } from '../registry-fidelity.mjs';
|
|
21
|
+
import { officeRecordLink } from './office-record-links.mjs';
|
|
22
|
+
import { normRegion, regionName } from './regions.mjs';
|
|
23
|
+
import { REGISTER_RECORD as R } from './strings.mjs';
|
|
24
|
+
|
|
25
|
+
// The labels and notes, from the catalogue. A renderer takes them from here.
|
|
26
|
+
export const RECORD_LABELS = R.labels;
|
|
27
|
+
export const MT_NOTE = R.mtNote;
|
|
28
|
+
export const NO_GOODS = R.noGoods;
|
|
29
|
+
export const CLASS_NOT_STATED = R.classNotStated;
|
|
30
|
+
export const LOGO_NOT_RETRIEVED = R.logoNotRetrieved;
|
|
31
|
+
export const registrationsCount = R.registrationsCount;
|
|
32
|
+
export const showAllTerms = R.showAllTerms;
|
|
33
|
+
const machineTranslation = R.machineTranslation;
|
|
34
|
+
const asRegistered = R.asRegistered;
|
|
35
|
+
export const logoAlt = R.logoAlt;
|
|
36
|
+
|
|
37
|
+
// A code into the English name a reader knows, from the one naming source every report surface uses.
|
|
38
|
+
export function countryOf(office) {
|
|
39
|
+
const code = normRegion(String(office ?? '').trim());
|
|
40
|
+
return code ? regionName(code) : null;
|
|
41
|
+
}
|
|
42
|
+
// A logo is captioned with its register as a reader names it (EU, US, WIPO), not the office code the record
|
|
43
|
+
// carries (EM for the EUIPO).
|
|
44
|
+
const logoCaption = (office) => {
|
|
45
|
+
const code = normRegion(String(office ?? '').trim());
|
|
46
|
+
return code === 'WO' ? 'WIPO' : code || null;
|
|
47
|
+
};
|
|
48
|
+
const languageNames = new Intl.DisplayNames(['en'], { type: 'language' });
|
|
49
|
+
const nameOf = (names, code) => {
|
|
50
|
+
try { const n = names.of(code); return n && n !== code ? n : null; } catch { return null; }
|
|
51
|
+
};
|
|
52
|
+
// A REGISTER'S OWN LANGUAGE CODES, WHERE THEY ARE NOT THE STANDARD'S. Clarivate tags Chinese "cn", Greek "gr" and
|
|
53
|
+
// Swedish "sw" (counted on the demo records, 2026-11-19: "sw" holds Swedish text, where the standard's "sw" is Swahili).
|
|
54
|
+
// Read through the standard alone, the first two had no name and the third named the wrong language. Only that
|
|
55
|
+
// register's records are read this way; every other code is the standard's.
|
|
56
|
+
const PROVIDER_LANGUAGE = Object.freeze({ clarivate: Object.freeze({ cn: 'zh', gr: 'el', sw: 'sv' }) });
|
|
57
|
+
const languageOf = (code, provider = null) => {
|
|
58
|
+
const c = String(code ?? '').trim();
|
|
59
|
+
if (!c) return null;
|
|
60
|
+
const own = PROVIDER_LANGUAGE[String(provider ?? '').trim().toLowerCase()];
|
|
61
|
+
return nameOf(languageNames, (own && Object.hasOwn(own, c.toLowerCase())) ? own[c.toLowerCase()] : c);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// A register's own words for its status, in the case a sentence takes: "REGISTERED" reads "Registered".
|
|
65
|
+
const statusOf = (rec) => {
|
|
66
|
+
const s = REC.statusStr(rec).trim();
|
|
67
|
+
return s && s === s.toUpperCase() ? s.charAt(0) + s.slice(1).toLowerCase() : s || null;
|
|
68
|
+
};
|
|
69
|
+
const markTypeOf = (rec) => {
|
|
70
|
+
const t = String(rec?.markFeature ?? rec?.markType ?? '').trim();
|
|
71
|
+
return t && t === t.toUpperCase() ? t.charAt(0) + t.slice(1).toLowerCase() : t || null;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Whether a registration's logo is worth fetching: the record marks the mark as figurative and says an image
|
|
76
|
+
* exists. A plain word mark is skipped even when its record has an image, because that image is only the word.
|
|
77
|
+
*/
|
|
78
|
+
export function logoWanted(rec) {
|
|
79
|
+
if (rec?.imageAvailable !== true) return false;
|
|
80
|
+
return /design|device|figurative|stylis|styliz|combined|logo|composite|special form/i.test(String(rec?.markFeature ?? rec?.markType ?? ''));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** A statement's terms: the register separates them with semicolons. */
|
|
84
|
+
const termsOf = (text) => String(text).split(/\s*;\s*/).map((t) => t.trim()).filter(Boolean);
|
|
85
|
+
|
|
86
|
+
/** One class statement as the board draws it: whole, or a preview cut at a term boundary with the count. */
|
|
87
|
+
function statementOf(g) {
|
|
88
|
+
const cls = g.classes.length ? g.classes.map((c) => `Class ${niceClass(c) ?? c}`).join(', ') : CLASS_NOT_STATED;
|
|
89
|
+
const terms = termsOf(g.text);
|
|
90
|
+
if ([...g.text].length <= DEFAULT_ANSWER_CUT || terms.length < 2) return { class: cls, text: g.text };
|
|
91
|
+
let preview = '';
|
|
92
|
+
for (const t of terms) {
|
|
93
|
+
const next = preview ? `${preview}; ${t}` : t;
|
|
94
|
+
if ([...next].length > DEFAULT_ANSWER_CUT) break;
|
|
95
|
+
preview = next;
|
|
96
|
+
}
|
|
97
|
+
return { class: cls, text: g.text, preview: preview || terms[0], showAll: showAllTerms(terms.length) };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** The goods row: English, or a marked machine translation, or the original as registered, or none stated. */
|
|
101
|
+
function goodsRow(rec, uri) {
|
|
102
|
+
// An untagged statement on an English-language register is English, as the run's own goods reader takes it.
|
|
103
|
+
const read = recordGoods(rec, { english: untaggedIsEnglish(String(rec.uri ?? uri ?? '')) });
|
|
104
|
+
// THE REGISTER'S OWN ENGLISH REPLACES THE ORIGINAL, class for class. A record can hold a class's statement twice,
|
|
105
|
+
// in the language it was granted in and in English; the reader returns both, and the report shows the English
|
|
106
|
+
// alone. An original stays only for classes no English statement covers.
|
|
107
|
+
const englishFor = new Set(read.filter((g) => g.en !== false).map((g) => g.classes.join(',')));
|
|
108
|
+
const goods = read.filter((g) => g.en !== false || !englishFor.has(g.classes.join(',')));
|
|
109
|
+
if (!goods.length) return { label: RECORD_LABELS.goods, note: NO_GOODS, entries: [] };
|
|
110
|
+
const translated = goods.filter((g) => g.alt);
|
|
111
|
+
const original = goods.filter((g) => g.en === false);
|
|
112
|
+
const row = { label: RECORD_LABELS.goods, entries: goods.map(statementOf) };
|
|
113
|
+
if (translated.length) {
|
|
114
|
+
const langs = [...new Set(translatedLanguages(rec))];
|
|
115
|
+
row.marker = { tag: machineTranslation(langs.length === 1 ? languageOf(langs[0], rec.provider) : null), note: MT_NOTE };
|
|
116
|
+
} else if (original.length) {
|
|
117
|
+
const langs = [...new Set(originalLanguages(rec))];
|
|
118
|
+
row.note = asRegistered(langs.length === 1 ? languageOf(langs[0], rec.provider) : null);
|
|
119
|
+
}
|
|
120
|
+
return row;
|
|
121
|
+
}
|
|
122
|
+
// A Signa record keeps no goodsServices: each class's language rides on its classification in the full record
|
|
123
|
+
// (`_raw.classifications[].goods_services_language`), which is where the goods reader reads that record's statements.
|
|
124
|
+
const originalLanguages = (rec) => (Array.isArray(rec?.goodsServices)
|
|
125
|
+
? rec.goodsServices.filter((g) => !g?.translation).map((g) => g?.language)
|
|
126
|
+
: (Array.isArray(rec?._raw?.classifications) ? rec._raw.classifications : []).map((c) => c?.goods_services_language))
|
|
127
|
+
.map((l) => String(l ?? '').trim()).filter((l) => l && !/^en/i.test(l));
|
|
128
|
+
const translatedLanguages = (rec) => (Array.isArray(rec?.goodsServices) ? rec.goodsServices : [])
|
|
129
|
+
.filter((g) => g?.translation && String(g?.language ?? '').trim() && !/^en/i.test(String(g.language)))
|
|
130
|
+
.map((g) => String(g.language).trim());
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The register record of one cited registration: its rows in the board's order, and whether its logo is wanted.
|
|
134
|
+
* `receipt` is the report's own receipt line for the record ("verified — … record fetched <date>"), passed as
|
|
135
|
+
* the report already writes it. Returns null when there is no record.
|
|
136
|
+
*/
|
|
137
|
+
export function registerRecordView(rec, { uri = '', receipt = null } = {}) {
|
|
138
|
+
if (!rec || typeof rec !== 'object') return null;
|
|
139
|
+
const mark = String(rec.markText ?? rec.mark ?? '').trim() || null;
|
|
140
|
+
const country = countryOf(rec.office);
|
|
141
|
+
const ownerCountry = countryOf(rec.ownerCountry);
|
|
142
|
+
const link = officeRecordLink(rec, uri);
|
|
143
|
+
const app = REC.serial(rec), reg = REC.regNumber(rec);
|
|
144
|
+
const dates = [
|
|
145
|
+
rec.applicationDate && `filed ${rec.applicationDate}`,
|
|
146
|
+
rec.registrationDate && `registered ${rec.registrationDate}`,
|
|
147
|
+
rec.expiryDate && `expires ${rec.expiryDate}`,
|
|
148
|
+
].filter(Boolean).join(' · ');
|
|
149
|
+
const rows = [
|
|
150
|
+
{ label: RECORD_LABELS.mark, value: mark, ...(markTypeOf(rec) ? { faint: markTypeOf(rec) } : {}) },
|
|
151
|
+
goodsRow(rec, uri),
|
|
152
|
+
{ label: RECORD_LABELS.owner, value: REC.owner(rec) || null, ...(ownerCountry ? { faint: `(${ownerCountry})` } : {}) },
|
|
153
|
+
{ label: RECORD_LABELS.country, value: country },
|
|
154
|
+
{ label: RECORD_LABELS.status, value: statusOf(rec), ...(dates ? { faint: dates } : {}) },
|
|
155
|
+
{
|
|
156
|
+
label: RECORD_LABELS.number, value: link?.label ?? null, href: link?.href ?? null,
|
|
157
|
+
...(app && reg && app !== reg ? { faint: `application ${app}` } : {}),
|
|
158
|
+
...(receipt ? { receipt } : {}),
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
return {
|
|
162
|
+
rows,
|
|
163
|
+
logo: { wanted: logoWanted(rec), caption: logoCaption(rec.office), alt: mark && country ? logoAlt(mark, country) : null, href: link?.href ?? null },
|
|
164
|
+
};
|
|
165
|
+
}
|