@zh-xx/antu 0.15.0 → 0.16.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/assets/viewer.html +24 -24
- package/bin/antu-mcp.mjs +8 -8
- package/bin/antu.mjs +6 -6
- package/embed/antu-embed.d.ts +11 -1
- package/embed/antu-embed.js +23333 -23042
- package/lib/chunks/{report-2s3R1IjI.mjs → report-DzBBBsVD.mjs} +5 -5
- package/lib/html.mjs +5 -5
- package/lib/validate.mjs +5 -5
- package/package.json +1 -1
- package/server.json +2 -2
package/bin/antu.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Antu 0.
|
|
2
|
+
// Antu 0.16.1
|
|
3
3
|
// Copyright (C) 2026 Ji Cheng
|
|
4
4
|
//
|
|
5
5
|
// Antu is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
// publish them, or sell them on any terms you like. This licence covers Antu's code in the page, and the notices in
|
|
14
14
|
// the page must stay with it.
|
|
15
15
|
//
|
|
16
|
-
// Corresponding Source of this version: https://github.com/zh-xx/Antu/tree/v0.
|
|
17
|
-
// The licence: https://github.com/zh-xx/Antu/blob/v0.
|
|
18
|
-
// Third-party notices: https://github.com/zh-xx/Antu/blob/v0.
|
|
16
|
+
// Corresponding Source of this version: https://github.com/zh-xx/Antu/tree/v0.16.1
|
|
17
|
+
// The licence: https://github.com/zh-xx/Antu/blob/v0.16.1/LICENSE
|
|
18
|
+
// Third-party notices: https://github.com/zh-xx/Antu/blob/v0.16.1/skills/antu/THIRD-PARTY-NOTICES.md
|
|
19
19
|
//
|
|
20
20
|
// === The licence of Antu ===
|
|
21
21
|
//
|
|
@@ -1423,7 +1423,7 @@
|
|
|
1423
1423
|
// SOFTWARE.
|
|
1424
1424
|
// ````
|
|
1425
1425
|
//
|
|
1426
|
-
import{execFileSync as e,spawn as t,spawnSync as n}from"node:child_process";import{existsSync as r,mkdtempSync as i,readFileSync as a,rmSync as o,statSync as s,writeFileSync as c}from"node:fs";import{tmpdir as l}from"node:os";import{basename as u,dirname as d,join as f,resolve as p}from"node:path";import{fileURLToPath as m,pathToFileURL as h}from"node:url";import{createHash as g}from"node:crypto";var _=Object.create,v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,x=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,C=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ee=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=b(t),a=0,o=i.length,s;a<o;a++)s=i[a],!S.call(e,s)&&s!==n&&v(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=y(t,s))||r.enumerable});return e},w=(e,t,n)=>(n=e==null?{}:_(x(e)),ee(t||!e||!e.__esModule||!S.call(e,`default`)?v(n,`default`,{value:e,enumerable:!0}):n,e)),te=(e,t=8)=>Math.ceil(e/t-1e-9)*t,ne={minH:40,minW:120,stepW:40,gap:24,levelGap:48,padX:12,padY:6},re={hair:.75,normal:1.1,strong:1.75,heavy:2.5},ie={solid:void 0,dashed:`6 4`,dotted:`2 3`,longDash:`10 4`,dashDot:`10 3 2 3`},ae=e=>Math.max(ne.minW,Math.ceil(e/ne.stepW-1e-9)*ne.stepW),oe=e=>Math.max(ne.minH,te(e)),se=[`document`,`modern`,`legal`],ce={equity:{width:re.normal},control:{width:re.heavy},contract:{width:re.normal,dash:ie.longDash},debt:{width:re.strong,dash:ie.dashDot},guarantee:{width:re.normal,dash:ie.dashed},kinship:{width:3.6,double:!0},employment:{width:re.normal,dash:ie.dotted},agency:{width:re.strong,dash:`1 4`,round:!0},other:{width:re.hair,dash:`3 3`}},le={equity:{width:.85},control:{width:1.9},contract:{width:.85,dash:`5 3`},debt:{width:1.3,dash:`5 2 1.5 2`},guarantee:{width:.85,dash:`4 3`},kinship:{width:3.2,double:!0},employment:{width:.85,dash:ie.dotted},agency:{width:1.3,dash:`1 4`,round:!0},other:{width:.6,dash:`3 3`}},ue=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,{...n,stroke:t}])),de={neutral:{width:re.normal},positive:{width:re.strong},negative:{width:re.normal,dash:ie.dashed}},fe={main:{width:re.strong},plain:{width:re.normal},back:{width:re.normal,dash:ie.dashed}},pe={conclusion:{width:re.heavy},norm:{width:re.normal},element:{width:re.normal},fact:{width:re.hair},inference:{width:re.normal,dash:ie.dotted},judgement:{width:re.strong}},me={for:{width:re.normal},against:{width:re.strong,dash:ie.dashed},basis:{width:re.normal,dash:ie.dotted}},he=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,{...n,...t[e]}])),ge={document:{id:`document`,shadowRgb:`17, 17, 17`,chrome:{radius:2,capsule:2,chip:2,bg:`#ffffff`,bgPop:`#ffffff`,border:`1px solid #111111`,shadow:`none`,blur:`none`},labelKey:`theme.document`,font:{body:`"FangSong", "STFangsong", "FangSong_GB2312", "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif`,head:`"SimHei", "Heiti SC", "STHeiti", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#111111`,ink2:`#2b2b2b`,ink3:`#4d4d4d`,ink4:`#767676`,bg:`#ffffff`,canvas:`#ffffff`,frame:`#111111`,line:`#c9c9c9`,chip:`#f0f0f0`,side1:`#111111`,side2:`#555555`,axis:`#767676`},radius:{person:18,company:3,organization:3,government:3,other:3,pill:2,group:12},entity:{person:{stroke:`#111111`,fill:`#ffffff`,width:1.3},company:{stroke:`#111111`,fill:`#ffffff`,width:1.6},organization:{stroke:`#111111`,fill:`#ffffff`,width:1.3,dash:ie.dashed},government:{stroke:`#111111`,fill:`#ffffff`,width:1.3},other:{stroke:`#555555`,fill:`#ffffff`,width:1.1,dash:ie.dotted}},relation:ue(le,`#767676`),camp:[{fill:`#ffffff`,stroke:`#111111`,text:`#111111`},{fill:`#ececec`,stroke:`#111111`,text:`#111111`},{fill:`#f7f7f7`,stroke:`#8a8a8a`,text:`#4d4d4d`}],group:{fill:`#f5f5f5`,stroke:`#8a8a8a`,title:`#111111`},campBox:{fill:`none`,stroke:`#111111`,width:.75,dash:`2 3`},flow:{outcome:he(de,{neutral:{stroke:`#111111`,fill:`#ffffff`},positive:{stroke:`#111111`,fill:`#ffffff`},negative:{stroke:`#111111`,fill:`#ececec`}}),start:{stroke:`#111111`,fill:`#e2e2e2`},state:{warn:{stroke:`#a16207`,fill:`#fef3c7`},stop:{stroke:`#b91c1c`,fill:`#fee2e2`},done:{stroke:`#15803d`,fill:`#dcfce7`}},note:{stroke:`none`,fill:`#f5f5f5`,fold:`#767676`},stage:{fill:`#f5f5f5`,stroke:`#8a8a8a`,title:`#111111`},stageLit:{fill:`#e2e2e2`,stroke:`#111111`,title:`#111111`},link:he(fe,{main:{stroke:`#111111`},plain:{stroke:`#2b2b2b`},back:{stroke:`#4d4d4d`}})},justify:{node:he(pe,{conclusion:{stroke:`#111111`,fill:`#ffffff`},norm:{stroke:`#111111`,fill:`#ececec`},element:{stroke:`#111111`,fill:`#ffffff`},fact:{stroke:`#111111`,fill:`#ffffff`},inference:{stroke:`#111111`,fill:`#ffffff`},judgement:{stroke:`#111111`,fill:`#ececec`}}),stance:he(me,{for:{stroke:`#2b2b2b`},against:{stroke:`#111111`},basis:{stroke:`#4d4d4d`}})},pill:{colored:!1,border:`#111111`}},modern:{id:`modern`,shadowRgb:`15, 23, 42`,chrome:{radius:14,capsule:999,chip:999,bg:`rgba(255, 255, 255, 0.78)`,bgPop:`rgba(255, 255, 255, 0.94)`,border:`1px solid rgba(15, 23, 42, 0.07)`,shadow:`0 4px 18px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.06)`,blur:`blur(16px) saturate(1.8)`},labelKey:`theme.modern`,font:{body:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`,head:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#0f172a`,ink2:`#475569`,ink3:`#64748b`,ink4:`#94a3b8`,bg:`#fbfcfd`,canvas:`#fbfcfd`,frame:`#e2e8f0`,line:`#e8ebef`,chip:`#f1f4f8`,side1:`#475569`,side2:`#64748b`,axis:`#94a3b8`},radius:{person:14,company:8,organization:8,government:6,other:8,pill:12,group:12},entity:{person:{stroke:`#94a3b8`,fill:`#f1f5f9`,width:1},company:{stroke:`#334155`,fill:`#ffffff`,width:1.25},organization:{stroke:`#94a3b8`,fill:`#ffffff`,width:1,dash:ie.dashed},government:{stroke:`#64748b`,fill:`#f8fafc`,width:1},other:{stroke:`#94a3b8`,fill:`#f8fafc`,width:.9,dash:ie.dotted}},relation:ue(ce,`#475569`),camp:[{fill:`#f1f5f9`,stroke:`#94a3b8`,text:`#334155`},{fill:`#ffffff`,stroke:`#94a3b8`,text:`#334155`},{fill:`#f8fafc`,stroke:`#e2e8f0`,text:`#64748b`}],group:{fill:`#f8fafc`,stroke:`#e2e8f0`,title:`#475569`},campBox:{fill:`#f8fafc`,stroke:`#e2e8f0`,width:1},flow:{outcome:he(de,{neutral:{stroke:`#64748b`,fill:`#f8fafc`},positive:{stroke:`#334155`,fill:`#f1f5f9`},negative:{stroke:`#64748b`,fill:`#f1f5f9`}}),start:{stroke:`#334155`,fill:`#e2e8f0`},state:{warn:{stroke:`#b45309`,fill:`#fffbeb`},stop:{stroke:`#be123c`,fill:`#fff1f2`},done:{stroke:`#047857`,fill:`#ecfdf5`}},note:{stroke:`none`,fill:`#f1f5f9`,fold:`#94a3b8`},stage:{fill:`#f8fafc`,stroke:`#e2e8f0`,title:`#475569`},stageLit:{fill:`#f1f5f9`,stroke:`#64748b`,title:`#334155`},link:he(fe,{main:{stroke:`#0f172a`},plain:{stroke:`#475569`},back:{stroke:`#64748b`}})},justify:{node:he(pe,{conclusion:{stroke:`#0f172a`,fill:`#f1f5f9`},norm:{stroke:`#475569`,fill:`#e2e8f0`},element:{stroke:`#64748b`,fill:`#f8fafc`},fact:{stroke:`#94a3b8`,fill:`#ffffff`},inference:{stroke:`#64748b`,fill:`#f8fafc`},judgement:{stroke:`#334155`,fill:`#e2e8f0`}}),stance:he(me,{for:{stroke:`#475569`},against:{stroke:`#334155`},basis:{stroke:`#94a3b8`}})},pill:{colored:!1,border:`#cbd5e1`}},legal:{id:`legal`,shadowRgb:`19, 35, 63`,chrome:{radius:6,capsule:6,chip:4,bg:`#ffffff`,bgPop:`#ffffff`,border:`1px solid #c7d2e4`,shadow:`0 2px 10px rgba(19, 35, 63, 0.10)`,blur:`none`},labelKey:`theme.legal`,font:{body:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`,head:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#13233f`,ink2:`#2d4366`,ink3:`#5b6f8f`,ink4:`#8aa0c4`,bg:`#ffffff`,canvas:`#ffffff`,frame:`#c7d2e4`,line:`#dbe3f0`,chip:`#eef3fb`,side1:`#1f3f7f`,side2:`#9a1b1b`,axis:`#8aa0c4`},radius:{person:14,company:3,organization:4,government:3,other:4,pill:4,group:6},entity:{person:{stroke:`#2f5aa8`,fill:`#eef3fb`,width:1},company:{stroke:`#1f3f7f`,fill:`#e3ecfa`,width:1.5},organization:{stroke:`#2f5aa8`,fill:`#f4f7fc`,width:1,dash:ie.dashed},government:{stroke:`#13233f`,fill:`#eef3fb`,width:1.1},other:{stroke:`#8aa0c4`,fill:`#f8fafd`,width:.9,dash:ie.dotted}},relation:{equity:{...ce.equity,stroke:`#1f3f7f`},control:{...ce.control,stroke:`#13233f`},contract:{...ce.contract,stroke:`#5b6f8f`},debt:{...ce.debt,stroke:`#9a1b1b`},guarantee:{...ce.guarantee,stroke:`#2f5aa8`},kinship:{...ce.kinship,stroke:`#4b3a8c`},employment:{...ce.employment,stroke:`#1d6b6b`},agency:{...ce.agency,stroke:`#1d6b6b`},other:{...ce.other,stroke:`#8aa0c4`}},camp:[{fill:`#eaf0fb`,stroke:`#9fb6e0`,text:`#1f3f7f`},{fill:`#fbecec`,stroke:`#e3b4b4`,text:`#9a1b1b`},{fill:`#f4f7fc`,stroke:`#c7d2e4`,text:`#5b6f8f`}],group:{fill:`#f4f7fc`,stroke:`#c7d2e4`,title:`#2d4366`},campBox:{fill:`#f4f7fc`,stroke:`#c7d2e4`,width:1},flow:{outcome:he(de,{neutral:{stroke:`#2f5aa8`,fill:`#eef3fb`},positive:{stroke:`#1f3f7f`,fill:`#e3ecfa`},negative:{stroke:`#9a1b1b`,fill:`#fbecec`}}),start:{stroke:`#13233f`,fill:`#dbe5f5`},state:{warn:{stroke:`#a16207`,fill:`#fdf6e3`},stop:{stroke:`#9a1b1b`,fill:`#fbecec`},done:{stroke:`#1f6f43`,fill:`#e8f4ec`}},note:{stroke:`none`,fill:`#f4f7fc`,fold:`#8aa0c4`},stage:{fill:`#f4f7fc`,stroke:`#c7d2e4`,title:`#2d4366`},stageLit:{fill:`#eaf0fb`,stroke:`#1f3f7f`,title:`#1f3f7f`},link:he(fe,{main:{stroke:`#13233f`},plain:{stroke:`#2d4366`},back:{stroke:`#5b6f8f`}})},justify:{node:he(pe,{conclusion:{stroke:`#1f3f7f`,fill:`#e3ecfa`},norm:{stroke:`#4b3a8c`,fill:`#efecf8`},element:{stroke:`#2f5aa8`,fill:`#eef3fb`},fact:{stroke:`#8aa0c4`,fill:`#f8fafd`},inference:{stroke:`#1d6b6b`,fill:`#e8f4f4`},judgement:{stroke:`#13233f`,fill:`#dbe5f5`}}),stance:he(me,{for:{stroke:`#2d4366`},against:{stroke:`#9a1b1b`},basis:{stroke:`#4b3a8c`}})},pill:{colored:!0,border:`#c7d2e4`}}},_e=e=>Object.prototype.hasOwnProperty.call(ge,e),ve=new Map,ye=[`experimental`,`stable`,`deprecated`];function be(e,t){if(!e)throw Error(`registerKnowledge: type must not be empty`);if(!t?.validate)throw Error(`registerKnowledge: validate is required`);if(!t?.describe)throw Error(`registerKnowledge: describe is required (the agent-facing field table)`);if(!Number.isInteger(t.specVersion)||t.specVersion<1)throw Error(`registerKnowledge: specVersion is required, a whole number (the generation of this type's JSON format, core/specVersion.js)`);xe(e,t),ve.set(e,t)}function xe(e,t){let n=Object.keys(t.layouts??{}),r=Object.keys(t.diagrams??{});for(let t of n)if(!r.includes(t))throw Error(`registerKnowledge: ${e}/${t} has a layout but no entry in diagrams (version, status, since)`);for(let t of r)if(!n.includes(t))throw Error(`registerKnowledge: ${e}/${t} is in diagrams but has no layout`);for(let[n,r]of Object.entries(t.diagrams??{})){if(!Number.isInteger(r.version)||r.version<1)throw Error(`registerKnowledge: ${e}/${n}: version must be a whole number >= 1`);if(!ye.includes(r.status))throw Error(`registerKnowledge: ${e}/${n}: status must be one of ${ye.join(`, `)}`);if(!/^\d+\.\d+\.\d+$/.test(r.since??``))throw Error(`registerKnowledge: ${e}/${n}: since must be a release number such as 0.7.0`)}}function Se(e){let t=ve.get(e);return Object.entries(t?.diagrams??{}).map(([t,n])=>({type:e,kind:t,...n}))}function Ce(e){return ve.get(e)}function we(){return[...ve.entries()].map(([e,t])=>({type:e,labelKey:t.label??`graphType.${e}`}))}function Te(e){return ve.get(e)?.validate}function Ee(e,t){let n=ve.get(e)?.layouts;if(n)return t&&n[t]?n[t]:Object.values(n)[0]}function De(e){return Object.keys(ve.get(e)?.layouts??{})}var Oe=e=>({name:`specVersion`,req:`no`,ty:`integer`,note:`which generation of this format the file follows (now ${e}); omit = the current one. Write it: it is how an older file is recognised after a breaking change`});function ke(e,t){return e.specVersion===void 0?null:!Number.isInteger(e.specVersion)||e.specVersion<1?{key:`err.specVersionForm`,params:{value:JSON.stringify(e.specVersion)}}:Number.isInteger(t)&&e.specVersion>t?{key:`err.specVersionNewer`,params:{value:e.specVersion,known:t,type:e.type}}:null}var Ae={"common.none":`(none)`,"common.close":`Close`,"common.untitled":`Antu`,"fallback.invalidTitle":({n:e})=>`This data cannot be rendered (${e} problem${e===1?``:`s`})`,"fallback.noRendererTitle":({type:e})=>`No renderer registered for type = "${e}"`,"fallback.registered":({list:e})=>`Registered: ${e}`,"fallback.noInlineData":`No inline data found in this file. Something went wrong when it was generated; please regenerate the HTML.`,"fallback.devNoData":`The dev server received no data. Specify one with ?example=0 or ?spec=examples/some-file.json.`,"error.renderTitle":`Rendering failed`,"error.renderHint":`The data itself may be fine (validation passed); this rendering kind threw an error. Send the text below to the developer, or try another rendering kind.`,"info.span":({from:e,to:t})=>`${e} to ${t}`,"info.slots":({n:e})=>`${e} time slot${e===1?``:`s`}`,"info.actors":({n:e})=>`${e} part${e===1?`y`:`ies`}`,"info.sources":({n:e})=>`${e} source${e===1?``:`s`}`,"info.nodes":({n:e})=>`${e} node${e===1?``:`s`}`,"info.stages":({n:e})=>`${e} stage${e===1?``:`s`}`,"dock.actors":`Parties`,"dock.summary":`Summary`,"dock.sources":`Sources`,"dock.orientation":`Which way the levels run: vertical, top to bottom; horizontal, left to right.`,"dock.orientationCamps":`Which way the levels run: vertical, top to bottom; horizontal, left to right. With the camps boxed they stand across that way: side by side when vertical, one under the other when horizontal, so the picture can look the other way round.`,"dock.vertical":`Vertical`,"dock.horizontal":`Horizontal`,"dock.grid":`Grid`,"dock.stagger":`Stagger`,"dock.byParty":`Lane per party`,"dock.staggerHint":`Let cards in different columns overlap by half a row, so the diagram is shorter and its text larger`,"dock.exportImage":`Export image`,"dock.exporting":`Exporting…`,"dock.exportTitle":`Export the whole diagram as a PNG (2× resolution)`,"dock.lang":`Language`,"dock.fold":`Fold`,"dock.display":`Display`,"export.failed":({message:e})=>`Export failed: ${e}`,"dock.langEn":`EN`,"dock.langZh":`中文`,"card.sources":({n:e})=>`${e} source${e===1?``:`s`}`,"card.sourcesUnlisted":`No sources listed`,"card.sourcesList":({n:e,names:t})=>`${e} source${e===1?``:`s`}: ${t}`,"card.duration":({duration:e})=>`Duration ${e}`,"card.approxPrefix":`approx. `,"card.dateUnknown":`date unknown`,"card.unitDay":({n:e})=>`${e} day${e===1?``:`s`}`,"card.unitHour":({n:e})=>`${e} hour${e===1?``:`s`}`,"card.unitMinute":({n:e})=>`${e} min`,"card.unitSecond":({n:e})=>`${e} sec`,"card.ariaLabel":({label:e,date:t})=>t?`${e}, ${t}`:e,"card.dateNote":({note:e})=>`Time note: ${e}`,"card.previewHint":`Click a card to read the full text`,"flow.conditions":`Conditions`,"flow.detail":`Detail`,"flow.mainLine":`Main line`,"flow.states":`States`,"flow.stages":`Stages`,"flow.rules":`Rules`,"flow.linkStraight":`Straight`,"flow.linkCurved":`Curved`,"flow.linkStyle":`Link style`,"rule.tableTitle":`Rules`,"rule.tableNote":`What may happen along the way; not steps of the flow`,"rule.tableNoteContract":`What may happen while the contract runs; not steps of the flow`,"rule.colWhen":`If`,"rule.colThen":`Then`,"rule.colScope":`Stages`,"rule.groupEnd":({end:e})=>`May lead to “${e}”`,"rule.groupRest":`Other rules`,"rule.count":({n:e})=>`${e}`,"rule.anyOf":`Any of:`,"rule.tScopeAll":`Throughout`,"rule.tScopeRange":({from:e,to:t})=>`${e} → ${t}`,"flow.ruleBadge":({n:e})=>e===1?`1 rule`:`${e} rules`,"flow.noteTag":`Note`,"rule.if":`If`,"rule.or":`, or `,"flow.previewHint":`Click a node to read the full text`,"aria.nodeDefault":`Press enter or space to select this node.`,"aria.nodeKeyboardDisabled":`Press enter or space to select this node. Once selected, use the arrow keys to move it.`,"aria.nodeMoved":({x:e,y:t})=>`Node moved. New position: x ${e}, y ${t}`,"aria.edgeDefault":`Press enter or space to select this connection.`,"aria.controls":`Canvas controls`,"aria.zoomIn":`Zoom in`,"aria.zoomOut":`Zoom out`,"aria.fitView":`Fit view`,"aria.interactive":`Toggle interactivity`,"aria.minimap":`Minimap`,"aria.handle":`Connection point`,"sourceType.statute":`Statute`,"sourceType.case":`Case`,"sourceType.contract":`Contract`,"sourceType.evidence":`Evidence`,"sourceType.document":`Document`,"sourceType.web":`Web`,"sourceType.other":`Other`,"graphKind.timeline":`Timeline`,"graphKind.flow":`Flowchart`,"header.theme":`Theme`,"theme.document":`Document`,"theme.modern":`Modern`,"theme.legal":`Legal blue`,"header.kindOpen":({n:e})=>`All ${e} ways of drawing`,"header.kindPrev":`Previous way of drawing`,"header.kindNext":`Next way of drawing`,"header.kindGroup":`Way of drawing`,"header.fold":`Fold the card`,"header.unfold":`Show the card`,"graphKind.chronicle":`Chronicle`,"graphKind.scale":`Time scale`,"scale.segment":({n:e,unit:t,count:n})=>`Segment ${e} · ${t} · ${n} event${n===1?``:`s`}`,"scale.unit.year":`by year`,"scale.unit.month":`by month`,"scale.unit.day":`by day`,"scale.unit.hour":`by hour`,"scale.unit.minute":`by minute`,"scale.other":`Other`,"scale.events":`Events`,"scale.undated":`date unknown · placed by order`,"scale.coarse.day":`that day (time unknown)`,"scale.coarse.month":`that month (day unknown)`,"scale.coarse.year":`that year (month unknown)`,"scale.run":({n:e})=>`${e} events`,"scale.runListed":({n:e})=>`${e} events too close to show one by one:`,"chronicle.gapSeconds":({n:e})=>`+${e} s`,"chronicle.gapMinutes":({n:e})=>`+${e} min`,"chronicle.gapHours":({n:e})=>`+${e} h`,"chronicle.gapHoursMinutes":({h:e,m:t})=>`+${e} h ${t} min`,"chronicle.gapDays":({n:e})=>`${e} day${e===1?``:`s`} later`,"chronicle.gapMonths":({n:e})=>`${e} month${e===1?``:`s`} later`,"chronicle.gapYears":({n:e})=>`${e} year${e===1?``:`s`} later`,"chronicle.gapYearsMonths":({y:e,m:t})=>`${e} yr ${t} mo later`,"chronicle.dateUnknown":`Date unknown`,"graphType.fact":`Fact`,"graphType.relationship":`Relationship`,"graphType.procedure":`Procedure`,"graphType.justification":`Justification`,"err.notObject":({at:e})=>`${e}: must be an object`,"err.notArray":({at:e})=>`${e} must be an array`,"err.required":({at:e,field:t})=>`${e}: missing required field \`${t}\``,"err.mustBeString":({at:e,field:t})=>`${e}: \`${t}\` must be a string`,"err.duplicateId":({at:e,id:t})=>`${e}: duplicate id "${t}"`,"err.missingRef":({at:e,field:t,kind:n,id:r})=>`${e}: ${t} refers to a non-existent ${n} "${r}"`,"err.tooManyGroups":({at:e,max:t,actual:n})=>`${e}: at most ${t} groups (the axis has two sides plus the centre), got ${n}`,"err.slotsEmpty":"`slots` must not be empty","err.slotEventsEmpty":({at:e})=>`${e}.events must not be empty (an empty time slot carries no meaning)`,"err.slotEventEmptyShape":({at:e})=>`${e}: must be an object of the form { events: [ … ] }`,"err.oneEventPerCell":({at:e,a:t,b:n})=>`${e}: two events share the same lane in one time slot ("${t}" and "${n}"); one cell holds one event`,"err.badDate":({at:e,field:t,value:n})=>`${e}: \`${t}\` is not ISO 8601 (e.g. 2017-05-02T09:24:03), got "${n}"`,"err.dateEndNeedsDate":({at:e})=>`${e}: \`dateEnd\` is written but \`date\` is not; a span needs its start`,"err.dateEndBeforeDate":({at:e,end:t,start:n})=>`${e}: \`dateEnd\` (${t}) is earlier than \`date\` (${n}); a span cannot run backwards`,"err.summaryTooLong":({at:e,max:t,actual:n})=>`${e}: \`summary\` is too wide for one line (about ${n} full-width characters, limit ${t}); shorten it or move the text to detail`,"err.groupNeedsOneActor":({at:e,groupId:t,n})=>`${e}: a side group ("${t}") must name exactly one party (currently ${n}); events that involve no particular party belong in the centre group or should omit groupId`,"err.multiActorNeedsAxis":({at:e,n:t,groupId:n})=>`${e}: an event with ${t} parties belongs on the centre axis, but groupId points at a side group ("${n}"); the two contradict each other`,"err.viewsRemoved":"`views` is no longer part of the format (placement rules v1): delete it. A diagram has one placement: with 2 or more parties, write `groupId` on each party (its side); with 1 party, on the events","err.actorNeedsGroup":({at:e,n:t})=>`${e}: the diagram has ${t} parties, so each party says which side it is on: write \`groupId\` with the 1st or the 2nd of \`groups\` (add \`groups\` if there are none)`,"err.actorGroupNotSide":({at:e,groupId:t})=>`${e}: \`groupId\` "${t}" is the 3rd group, the axis; a party belongs to the 1st or the 2nd group (a side)`,"err.actorGroupOneParty":({at:e})=>`${e}: a party carries \`groupId\` only when the diagram has 2 or more parties; with one party the groups split the events, so write \`groupId\` on the events`,"err.eventGroupWithParties":({at:e})=>`${e}: the diagram has 2 or more parties, so the groups belong to the parties and an event is placed by its \`actorIds\`: delete the event's \`groupId\` (one party → that party's side; several or none → the axis)`,"err.specNotObject":`a spec must be a JSON object`,"err.envelopeTypeRequired":"missing required field `type` (the engine uses it to pick a renderer)","err.envelopeTypeString":"`type` must be a string","err.envelopeTypeUnknown":'`type` is "{type}", which is not a diagram type; expected one of {list}',"err.envelopeTypeIsKind":'`type` is "{type}", which is a way of drawing a {owner} diagram, not a type: write `"type": "{owner}"` (the way it is drawn is chosen on the page, not in the JSON)',"err.envelopeTitleString":"`title` must be a string","err.specVersionForm":"`specVersion` must be a whole number from 1 up, got {value}","err.specVersionNewer":'`specVersion` is {value}, newer than this engine knows for "{type}" ({known}): update the engine, or write the file for the older format',"err.slotNotArray":"`slots` must be an array (one slot = one time point)","err.slotShape":({at:e})=>`${e}: must be an object of the form { events: [ … ] }`,"err.eventsNotArray":({at:e})=>`${e}.events must be an array`,"rerr.entitiesEmpty":"`entities` must not be empty (a diagram needs at least two parties)","rerr.relationsEmpty":"`relations` must not be empty (the parties have to be related)","rerr.notArray":({field:e})=>`\`${e}\` must be an array`,"rerr.notObject":({at:e})=>`${e}: must be an object`,"rerr.required":({at:e,field:t})=>`${e}: missing required field \`${t}\``,"rerr.duplicateId":({at:e,id:t,what:n})=>`${e}: id "${t}" duplicates an earlier ${n}`,"rerr.badEntityKind":({at:e,value:t,allowed:n})=>`${e}: kind is "${t}", which is not one of: ${n}`,"rerr.badRelationKind":({at:e,value:t,allowed:n})=>`${e}: kind is "${t}", which is not one of: ${n}`,"rerr.badSourceType":({at:e,value:t,allowed:n})=>`${e}: \`type\` "${t}" is not one of ${n}`,"rerr.mustBeString":({at:e,field:t})=>`${e}: \`${t}\` must be a non-empty string`,"rerr.mustBeBoolean":({at:e,field:t})=>`${e}: \`${t}\` must be true or false`,"rerr.badRef":({at:e,field:t,kind:n,id:r})=>`${e}: \`${t}\` refers to a non-existent ${n} "${r}"`,"rerr.badEnd":({at:e,end:t,id:n})=>`${e}: \`${t}\` refers to a non-existent entity "${n}"`,"rerr.selfRelation":({at:e,id:t})=>`${e}: an entity cannot be related to itself ("${t}" on both ends)`,"rerr.duplicateRelation":({at:e,from:t,to:n,kind:r})=>`${e}: duplicate relation ${t} -> ${n} (${r}, same label); give the second one its own label, or drop it`,"rerr.fieldNotHere":({at:e,field:t,kinds:n})=>`${e}: \`${t}\` only belongs on a relation of kind ${n}`,"rerr.badShare":({at:e,value:t})=>`${e}: \`share\` must be a number from 0 to 100, got ${t}`,"rerr.badSecures":({at:e,id:t})=>`${e}: \`secures\` refers to a non-existent relation "${t}"`,"rerr.securesNotClaim":({at:e,id:t,kind:n,claims:r})=>`${e}: \`secures\` points at relation "${t}", which is a ${n}; a guarantee secures a claim (${r})`,"rerr.badAsOf":({value:e})=>`asOf: "${e}" is not an ISO date (YYYY, YYYY-MM or YYYY-MM-DD)`,"rhint.shareOver100":({id:e,label:t,total:n})=>`entities (${e}): the shares held in "${t}" add up to ${n}%, more than the whole; check the figures or the source`,"rhint.isolated":({id:e,label:t})=>`entities (${e}): "${t}" has no relation to anyone, so it will float beside the diagram; relate it or drop it`,"rhint.noSecures":({id:e})=>`relations (${e}): a guarantee that does not say which claim it secures; add \`secures\` with that relation's id`,"rhint.tooLarge":({n:e,limit:t})=>`${e} entities: past about ${t} the diagram gets hard to read on one screen; consider splitting it by group`,"rhint.tooManyRelations":({n:e,limit:t})=>`${e} relations: past about ${t} the graph can take several seconds to draw (each change of orientation or groups draws it again); consider splitting it by group, or use another way of drawing`,"rhint.equityCycle":({path:e})=>`shareholdings loop back (${e}); allowed, but check it is what the registry says`,"rel.kind.equity":`Equity`,"rel.kind.control":`Control`,"rel.kind.contract":`Contracts`,"rel.kind.debt":`Debts`,"rel.kind.guarantee":`Guarantees`,"rel.kind.kinship":`Family`,"rel.kind.employment":`Employment`,"rel.kind.agency":`Agency`,"rel.kind.other":`Other`,"rel.kindChipTitle":({n:e})=>e===1?`Show or hide this kind (1 relation)`:`Show or hide this kind (${e} relations)`,"rel.labels":`Labels`,"rel.groups":`Groups`,"rel.previewHint":`Click a party to read the full text`,"rel.auto.equity":({share:e})=>e===void 0?`Holds shares`:`Holds ${e}%`,"rel.auto.control":`Controls`,"rel.auto.contract":({amount:e})=>e?`Contract, ${e}`:`Contract`,"rel.auto.debt":({amount:e})=>e?`Claim, ${e}`:`Claim`,"rel.auto.guarantee":`Guarantee`,"rel.auto.kinship":`Family`,"rel.auto.employment":`Employment`,"rel.auto.agency":`Agency`,"rel.auto.other":`Related`,"info.entities":({n:e})=>`${e} part${e===1?`y`:`ies`}`,"info.relations":({n:e})=>`${e} relation${e===1?``:`s`}`,"info.links":({n:e})=>`${e} link${e===1?``:`s`}`,"jerr.nodesEmpty":"`nodes` must not be empty (a justification needs at least a conclusion and what supports it)","jerr.linksEmpty":"`links` must not be empty (the nodes have to support one another)","jerr.notArray":({field:e})=>`\`${e}\` must be an array`,"jerr.notObject":({at:e})=>`${e}: must be an object`,"jerr.required":({at:e,field:t})=>`${e}: missing required field \`${t}\``,"jerr.duplicateId":({at:e,id:t,what:n})=>`${e}: id "${t}" duplicates an earlier ${n}`,"jerr.mustBeString":({at:e,field:t})=>`${e}: \`${t}\` must be a non-empty string`,"jerr.badNodeKind":({at:e,value:t,allowed:n})=>`${e}: kind is "${t}", which is not one of: ${n}`,"jerr.badRef":({at:e,field:t,kind:n,id:r})=>`${e}: \`${t}\` refers to a non-existent ${n} "${r}"`,"jerr.badHolds":({at:e,value:t})=>`${e}: \`holds\` must be "yes" or "no", got "${t}"`,"jerr.holdsNotHere":({at:e,kind:t,kinds:n})=>`${e}: a ${t} does not hold or fail; \`holds\` only belongs on ${n}`,"jerr.badCombine":({at:e,value:t,allowed:n})=>`${e}: \`combine\` is "${t}", which is not one of: ${n}`,"jerr.combineNotHere":({at:e,kind:t,kinds:n})=>`${e}: a ${t} is not supported by other nodes; \`combine\` only belongs on ${n}`,"jerr.dateNotHere":({at:e,kind:t})=>`${e}: \`date\` only belongs on a fact, not on a ${t}`,"jerr.badDate":({at:e,value:t})=>`${e}: \`date\` "${t}" is not an ISO date (YYYY-MM-DD or YYYY-MM-DDTHH:MM)`,"jerr.badEnd":({at:e,end:t,id:n})=>`${e}: \`${t}\` refers to a non-existent node "${n}"`,"jerr.selfLink":({at:e,id:t})=>`${e}: a node cannot support itself ("${t}" on both ends)`,"jerr.badStance":({at:e,value:t,allowed:n})=>`${e}: stance is "${t}", which is not one of: ${n}`,"jerr.basisNotNorm":({at:e,kind:t})=>`${e}: stance "basis" can only start from a norm, not from a ${t}`,"jerr.duplicateLink":({at:e,stance:t})=>`${e}: duplicate link (same from, to and stance "${t}"); drop the second one`,"jerr.cycle":({path:e})=>`links form a cycle (${e}); a reasoning must not lead back to itself`,"jerr.leafHasInput":({at:e,kind:t})=>`${e}: a ${t} is a leaf; nothing may support it (an evidence layer is not part of v0)`,"jerr.noEnd":"no end conclusion: at least one `conclusion` must have no outgoing link (the conclusion the whole reasoning leads to)","jhint.severalEnds":({n:e,ids:t})=>`${e} conclusions end the diagram (${t}); is this one reasoning, or should it be split?`,"jhint.supportsNothing":({id:e,label:t})=>`nodes (${e}): "${t}" supports nothing; link it to what it supports, or drop it`,"jhint.factNoSource":({id:e,label:t})=>`nodes (${e}): the fact "${t}" has no source; where was it found?`,"jhint.normNoSource":({id:e,label:t})=>`nodes (${e}): the norm "${t}" has no source; which provision is it?`,"jhint.unsupported":({id:e,label:t})=>`nodes (${e}): nothing supports "${t}"; add a fact, an element or a norm that does (if it stands only because what argued against it was rejected, this note can be left as it is)`,"jhint.holdsOnRejected":({id:e,label:t})=>`nodes (${e}): "${t}" holds although everything that supports it is rejected; check the \`holds\` values`,"jhint.combineAlone":({id:e,label:t,combine:n})=>`nodes (${e}): "${t}" says \`combine: "${n}"\` but fewer than two links support it; there is nothing to combine`,"jhint.allNeedsAll":({id:e,label:t,other:n})=>`nodes (${e}): "${t}" needs all it rests on, but "${n}" is rejected; check the \`holds\` values`,"jhint.anyOneHolds":({id:e,label:t,other:n})=>`nodes (${e}): "${t}" is rejected although any one it rests on would do, and "${n}" holds; check the \`holds\` values`,"jhint.tooLarge":({n:e,limit:t})=>`${e} nodes: past about ${t} the tree gets hard to read on one screen; consider one diagram per issue`,"graphKind.graph":`Relationship graph`,"graphKind.focus":`Focus view`,"graphKind.matrix":`Relation matrix`,"graphKind.equity":`Equity tree`,"rel.matrix.ungrouped":`No camp`,"rel.equity.noShare":`not stated`,"rel.equity.cross":`cross-holding`,"rel.equity.noEquity":`No equity relations in this data`,"rel.equity.noEquityHint":`This view is built around shareholdings. For this case, switch to the relationship graph.`,"rel.equity.indirect":({n:e})=>`Held through others (${e})`,"rel.equity.notComputable":`cannot be worked out: a share on the way is not stated`,"rel.equity.moreRows":({n:e})=>`${e} more not listed`,"rel.equity.above":({n:e})=>`Above it (${e})`,"rel.company.label":`Company`,"rel.company.all":`All`,"rel.equity.sep":`, `,"rel.equity.colon":`: `,"graphKind.authority":`Control and employment`,"rel.authority.cycle":`cycle`,"rel.authority.none":`No control, employment or agency relations in this data`,"rel.authority.noneHint":`This view is built around who commands whom. For this case, switch to the relationship graph.`,"rel.authority.above":({n:e})=>`Above it (${e})`,"graphKind.related":`Related parties`,"rel.related.title":({name:e})=>`Related parties of ${e} (the centre)`,"rel.related.count":({n:e,m:t})=>`${e} related part${e===1?`y`:`ies`}, ${t} relation${t===1?``:`s`}`,"rel.related.colParty":`Related party`,"rel.related.colKind":`Category`,"rel.related.colText":`Relation`,"rel.related.colSource":`Source`,"rel.related.dirNone":({a:e,b:t})=>`${e} — ${t} (no direction)`,"rel.related.none":({name:e})=>`${e} has no relation in this data`,"rel.related.noneHint":`Pick another party in the box at the bottom, or switch to the relationship graph.`,"rel.related.centre":`Centre`,"graphKind.path":`Relation path`,"rel.path.from":`From`,"rel.path.to":`To`,"rel.path.swap":`Swap the two ends`,"rel.path.noChain":({a:e,b:t})=>`No chain of relations ties ${e} and ${t}`,"rel.path.noChainHint":`Pick two parties that are connected, or switch to the relationship graph.`,"rel.path.steps":({n:e})=>`${e} step${e===1?``:`s`}`,"rel.path.chains":({n:e})=>`Chains drawn (${e})`,"rel.path.more":({n:e,atLeast:t})=>`${t?`At least `:``}${e} more chain${e===1?``:`s`} not drawn; only the shortest are.`,"graphKind.route":`Route map`,"proc.route.labels":`Conditions`,"proc.route.more":({n:e})=>`… and ${e} more`,"rel.focus.open":`Centre the focus view on this party`,"rel.focus.centre":`Centre`,"rel.focus.hint":`Click to put this party in the middle`,"rel.focus.apart":`Not connected to the centre`,"rel.focus.reset":`Default centre`,"rel.focus.resetTitle":`Put the party with the most relations back in the middle`,"graphKind.tree":`Reasoning tree`,"jus.kind.conclusion":`Conclusion`,"jus.kind.norm":`Norm`,"jus.kind.element":`Element`,"jus.kind.fact":`Fact`,"jus.kind.inference":`Inference`,"jus.kind.judgement":`Judgement`,"jus.holds.yes":`✓ upheld`,"jus.holds.no":`✗ rejected`,"jus.copy":`shown again`,"jus.copies":({n:e})=>`The same node is drawn in ${e} issues`,"jus.grounds":`Rests on`,"jus.fold":`Fold this issue up`,"jus.unfold":`Open this issue`,"jus.folded":({n:e})=>`${e} folded`,"jus.foldAll":`Fold issues`,"jus.merge":`Merge repeats`,"jus.mergeTitle":`A fact (or a norm with many elements) used several times in one issue is drawn beside each use; merge draws each once, with longer lines`,"jus.foldAllTitle":`Fold every issue up to its conclusion, or open them all again`,"jus.combine.all":`all of`,"jus.combine.any":`any of`,"jus.combine.allLong":`All of what it rests on is needed`,"jus.combine.anyLong":`Any one of what it rests on is enough`,"jus.supports":`Leads to`,"jus.stance.for":`supports`,"jus.stance.against":`opposes`,"jus.stance.basis":`basis`,"jus.previewHint":`Click a node to read the full text and see what it rests on`,"perr.domainNotInEnum":({value:e,allowed:t})=>`\`domain\` is "${e}", not in the enum (${t})`,"perr.nodesEmpty":"`nodes` must not be empty (a flow needs at least a start and an end)","perr.edgesEmpty":"`edges` must not be empty (the nodes have to be connected)","perr.notObject":({at:e})=>`${e}: must be an object`,"perr.required":({at:e,field:t})=>`${e}: missing required field \`${t}\``,"perr.duplicateNodeId":({at:e,id:t})=>`${e}: id "${t}" duplicates an earlier node`,"perr.badKind":({at:e,value:t,allowed:n})=>`${e}: \`kind\` is "${t}", not in the vocabulary (${n})`,"perr.badOutcome":({at:e,value:t,allowed:n})=>`${e}: \`outcome\` is "${t}", not in the enum (${n})`,"perr.mustBeString":({at:e,field:t})=>`${e}: \`${t}\` must be a string`,"perr.badRef":({at:e,field:t,kind:n,id:r})=>`${e}: ${t} refers to a non-existent ${n} "${r}"`,"perr.badFrom":({at:e,id:t})=>`${e}: \`from\` refers to a non-existent node "${t}"`,"perr.badTo":({at:e,id:t})=>`${e}: \`to\` refers to a non-existent node "${t}"`,"perr.selfLoop":({at:e,id:t})=>`${e}: self-loop (from and to are both "${t}")`,"perr.duplicateEdge":({at:e,from:t,to:n})=>`${e}: duplicate edge ${t} -> ${n} (same condition); branches into one target each need their own condition`,"perr.noEntry":`no node has zero incoming edges (a flow needs a start)`,"perr.unreachable":({id:e})=>`nodes (${e}): unreachable from the start (it would be dropped silently and never appear)`,"perr.orphan":({id:e,label:t})=>`nodes (${e}): "${t}" has no incoming edge and is not a start, so nothing leads to it: it would float beside the flow. If it is a consequence (a breach, a resignation, a right to terminate), write it as a rule in \`rules\`; if it belongs to the flow, add the edge that leads to it`,"note.partyNoEvent":({at:e,id:t,name:n})=>`${e} (${t}): no event names "${n}" in its actorIds, so it is on no card and has no column. Name it in the actorIds of the events it took part in, or leave it out of actors if it did nothing in this diagram`,"note.dateOrder":({at:e,id:t,date:n,beforeAt:r,beforeId:i,beforeDate:a})=>`${e} ("${t}", ${n}) comes after ${r} ("${i}", ${a}) in the slots but its date is wholly earlier. The order of the slots is kept and nothing is reordered; check which of the two dates is wrong, or whether the slots are in the wrong order`,"perr.noEnd":'no node has `kind: "end"` (a flow needs an end)',"perr.deadEnd":({id:e,label:t})=>`nodes (${e}): "${t}" is a dead end: it is neither end nor note but has no outgoing edge. If it is the consequence of a breach, delay or right to terminate, write it as a rule in \`rules\` (it may fire at any time in its stages) instead of a node that has to lead somewhere`,"perr.decisionTooFewOut":({id:e,n:t})=>`nodes (${e}): kind is "decision" but only ${t} outgoing edge(s); a decision needs at least 2`,"perr.decisionNoCondition":({id:e,index:t,to:n})=>`nodes (${e}): kind is "decision" but edge edges[${t}] -> "${n}" has no condition. If it really is a decision, give every outgoing edge a condition (e.g. "yes / no"); if it is a step, change kind to "step" (a step may have several outgoing edges, one of them the main line)`,"perr.tooManyMain":({id:e,n:t})=>`nodes (${e}): ${t} outgoing edges are marked main; a path has exactly one`,"perr.mainBroken":({id:e})=>`the main line breaks at node "${e}": the edges marked main do not reach any end. Either add the missing main edge, or repair the chain`,"norm.mainRemarked":({problem:e,from:t,to:n})=>`the main line was marked again, starting at "${t}" and ending at "${n}", keeping to the edges already marked where it could. It was: ${e}`,"norm.mainSet":({at:e})=>`${e}: marked main`,"norm.mainCleared":({at:e})=>`${e}: no longer marked main`,"perr.rulesNotArray":"`rules` must be an array","perr.duplicateRuleId":({at:e,id:t})=>`${e}: id "${t}" is already used by another rule or node`,"perr.ruleWhen":({at:e})=>`${e}: \`when\` is required: a non-empty string, or an array of them (any one of them triggers the rule)`,"perr.ruleEndNotEnd":({at:e,id:t})=>`${e}: \`endId\` points at "${t}", which is not a node of kind "end"; a rule can only lead to an end`,"phint.stageBackwards":({from:e,fromStage:t,to:n,toStage:r})=>`stage runs backwards: ${e} (${t}) -> ${n} (${r}); back edges are normal, others need a second look`,"phint.decisionOnSpine":({id:e,label:t})=>`decision "${e}" (${t}) is on the main line but no outgoing edge is marked main; the breach path may end up drawn as the main line`,"phint.longLabel":({id:e,n:t})=>`node "${e}" has a label of ${t} characters; a node shows about two lines (20 Chinese characters) and cuts the rest, the popover has it all. Shorten the label and move the detail into \`detail\``,"phint.noteNoDetail":({id:e,label:t})=>`note "${e}" (${t}) has no detail; a note is an explanation, so write it as one full sentence (in detail) that says what it explains`,"phint.multipleEntries":({n:e,ids:t})=>`${e} entries (${t}), they will all sit in the first layer; a contract flow usually has a single entry, so check whether an upstream link is missing`},je={en:Ae,zh:{"common.none":`(无)`,"common.close":`关闭`,"common.untitled":`案图`,"fallback.invalidTitle":({n:e})=>`该数据未通过校验(${e} 处问题)`,"fallback.noRendererTitle":({type:e})=>`没有为 type = "${e}" 注册渲染器`,"fallback.registered":({list:e})=>`已注册:${e}`,"fallback.noInlineData":`这份文件里没有内联数据,生成时发生错误,请重新生成这份 HTML。`,"fallback.devNoData":`开发服务器未获取到数据:请用 ?example=0 或 ?spec=examples/某份.json 指定一份。`,"error.renderTitle":`渲染出错`,"error.renderHint":`数据本身可能没问题(校验已经通过),是这个画法在渲染时抛错了。请将下列信息提供给开发者,或改用其他画法。`,"info.span":({from:e,to:t})=>`${e} 至 ${t}`,"info.slots":({n:e})=>`${e} 个时间点`,"info.actors":({n:e})=>`${e} 个主体`,"info.sources":({n:e})=>`${e} 个来源`,"info.nodes":({n:e})=>`${e} 个节点`,"info.stages":({n:e})=>`${e} 个阶段`,"info.entities":({n:e})=>`${e} 个当事方`,"info.relations":({n:e})=>`${e} 条关系`,"info.links":({n:e})=>`${e} 条连线`,"dock.actors":`主体`,"dock.summary":`摘要`,"dock.sources":`来源`,"dock.orientation":`层的走向:竖向是从上往下,横向是从左往右。`,"dock.orientationCamps":`层的走向:竖向是从上往下,横向是从左往右。画了阵营框时,阵营沿垂直于层的方向排开:竖向时左右并排,横向时上下叠放,所以整张图看起来可能和按钮相反。`,"dock.vertical":`竖向`,"dock.horizontal":`横向`,"dock.grid":`格线`,"dock.stagger":`交错`,"dock.byParty":`按主体分泳道`,"dock.staggerHint":`让不同列的卡片上下错开半行,图更短、字更大`,"dock.exportImage":`导出图片`,"dock.exporting":`正在导出…`,"dock.exportTitle":`将整张图导出为 PNG(2 倍分辨率)`,"dock.lang":`语言`,"dock.fold":`收起`,"dock.display":`显示选项`,"export.failed":({message:e})=>`导出失败:${e}`,"dock.langEn":`EN`,"dock.langZh":`中文`,"flow.conditions":`条件`,"flow.detail":`详情`,"flow.mainLine":`主干`,"flow.states":`状态`,"flow.stages":`阶段`,"flow.rules":`条款`,"flow.linkStraight":`折线`,"flow.linkCurved":`曲线`,"flow.linkStyle":`连线样式`,"rule.tableTitle":`条款`,"rule.tableNote":`流程中可能出现的情形,不属于流程步骤`,"rule.tableNoteContract":`合同履行过程中可能出现的情形,不属于流程步骤`,"rule.colWhen":`情形`,"rule.colThen":`后果`,"rule.colScope":`适用阶段`,"rule.groupEnd":({end:e})=>`可导致「${e}」`,"rule.groupRest":`其他条款`,"rule.count":({n:e})=>`${e} 条`,"rule.anyOf":`下列任一:`,"rule.tScopeAll":`全程`,"rule.tScopeRange":({from:e,to:t})=>`${e} 至 ${t}`,"flow.ruleBadge":({n:e})=>`条款 ${e} 条`,"flow.noteTag":`注`,"rule.if":`若`,"rule.or":`,或`,"flow.previewHint":`点击节点查看全文`,"card.sources":({n:e})=>`来源 ${e} 个`,"card.sourcesUnlisted":`未列来源`,"card.sourcesList":({n:e,names:t})=>`来源 ${e} 个:${t}`,"card.duration":({duration:e})=>`持续 ${e}`,"card.approxPrefix":`约 `,"card.dateUnknown":`日期不详`,"card.unitDay":({n:e})=>`${e} 天`,"card.unitHour":({n:e})=>`${e} 小时`,"card.unitMinute":({n:e})=>`${e} 分`,"card.unitSecond":({n:e})=>`${e} 秒`,"card.ariaLabel":({label:e,date:t})=>t?`${e},${t}`:e,"card.dateNote":({note:e})=>`时间说明:${e}`,"card.previewHint":`点击卡片查看全文`,"aria.nodeDefault":`按回车或空格可选中此节点。`,"aria.nodeKeyboardDisabled":`按回车或空格可选中此节点。选中后可用方向键移动。`,"aria.nodeMoved":({x:e,y:t})=>`已移动节点。新位置:x ${e},y ${t}`,"aria.edgeDefault":`按回车或空格可选中此连线。`,"aria.controls":`画布控件`,"aria.zoomIn":`放大`,"aria.zoomOut":`缩小`,"aria.fitView":`适应视图`,"aria.interactive":`切换交互`,"aria.minimap":`缩略图`,"aria.handle":`连接点`,"sourceType.statute":`法条`,"sourceType.case":`判例`,"sourceType.contract":`合同`,"sourceType.evidence":`证据`,"sourceType.document":`文书`,"sourceType.web":`网页`,"sourceType.other":`其他`,"graphKind.timeline":`时间图`,"graphKind.flow":`流程图`,"header.theme":`主题`,"theme.document":`文书黑白`,"theme.modern":`现代简洁`,"theme.legal":`法律蓝`,"header.kindOpen":({n:e})=>`查看全部 ${e} 种画法`,"header.kindPrev":`上一种画法`,"header.kindNext":`下一种画法`,"header.kindGroup":`画法`,"header.fold":`收起标题卡`,"header.unfold":`展开标题卡`,"graphKind.chronicle":`大事记`,"graphKind.scale":`比例时间轴`,"scale.segment":({n:e,unit:t,count:n})=>`第 ${e} 段 · ${t} · ${n} 个事件`,"scale.unit.year":`按年`,"scale.unit.month":`按月`,"scale.unit.day":`按日`,"scale.unit.hour":`按小时`,"scale.unit.minute":`按分钟`,"scale.other":`其他`,"scale.events":`事件`,"scale.undated":`日期不详 · 按顺序放置`,"scale.coarse.day":`当日(时刻不详)`,"scale.coarse.month":`当月(日期不详)`,"scale.coarse.year":`当年(月份不详)`,"scale.run":({n:e})=>`${e} 个事件`,"scale.runListed":({n:e})=>`时间相近的 ${e} 个事件,列示如下:`,"chronicle.gapSeconds":({n:e})=>`+${e} 秒`,"chronicle.gapMinutes":({n:e})=>`+${e} 分钟`,"chronicle.gapHours":({n:e})=>`+${e} 小时`,"chronicle.gapHoursMinutes":({h:e,m:t})=>`+${e} 小时 ${t} 分`,"chronicle.gapDays":({n:e})=>`间隔 ${e} 天`,"chronicle.gapMonths":({n:e})=>`间隔 ${e} 个月`,"chronicle.gapYears":({n:e})=>`间隔 ${e} 年`,"chronicle.gapYearsMonths":({y:e,m:t})=>`间隔 ${e} 年 ${t} 个月`,"chronicle.dateUnknown":`日期不详`,"graphKind.graph":`关系图`,"graphKind.focus":`聚焦图`,"graphKind.matrix":`关系矩阵`,"graphKind.equity":`股权图`,"rel.matrix.ungrouped":`未归阵营`,"rel.equity.noShare":`比例未写明`,"rel.equity.cross":`交叉持股`,"rel.equity.noEquity":`这份数据里没有股权关系`,"rel.equity.noEquityHint":`这个视图围绕持股关系画。这类案件请切换到关系图。`,"rel.equity.indirect":({n:e})=>`间接持有(${e})`,"rel.equity.notComputable":`算不出:途中有一处持股比例没写明`,"rel.equity.moreRows":({n:e})=>`另有 ${e} 项未列出`,"rel.equity.above":({n:e})=>`在它上面的(${e})`,"rel.company.label":`公司`,"rel.company.all":`全部`,"rel.equity.sep":`、`,"rel.equity.colon":`:`,"graphKind.authority":`控制与任职图`,"rel.authority.cycle":`循环`,"rel.authority.none":`这份数据里没有控制、任职或代理关系`,"rel.authority.noneHint":`这个视图围绕谁管着谁画。这类案件请切换到关系图。`,"rel.authority.above":({n:e})=>`在它上面的(${e})`,"graphKind.related":`关联方清单`,"rel.related.title":({name:e})=>`关联方清单:${e}(中心方)`,"rel.related.count":({n:e,m:t})=>`共 ${e} 个关联方,${t} 条关系`,"rel.related.colParty":`关联方`,"rel.related.colKind":`关系类别`,"rel.related.colText":`关系内容`,"rel.related.colSource":`来源`,"rel.related.dirNone":({a:e,b:t})=>`${e} — ${t}(无方向)`,"rel.related.none":({name:e})=>`「${e}」在这份数据里没有任何关系`,"rel.related.noneHint":`在底部的框里换一方,或切换到关系图。`,"rel.related.centre":`中心方`,"graphKind.path":`关系路径图`,"rel.path.from":`起点`,"rel.path.to":`终点`,"rel.path.swap":`起点和终点对调`,"rel.path.noChain":({a:e,b:t})=>`没有任何关系链把「${e}」和「${t}」连起来`,"rel.path.noChainHint":`请选两个有关系相连的当事人,或切换到关系图。`,"rel.path.steps":({n:e})=>`${e} 步`,"rel.path.chains":({n:e})=>`画出的关系链(${e})`,"rel.path.more":({n:e,atLeast:t})=>`另有${t?`至少 `:` `}${e} 条关系链没有画;只画最短的几条。`,"graphKind.route":`路线图`,"proc.route.labels":`条件`,"proc.route.more":({n:e})=>`……还有 ${e} 步`,"rel.focus.open":`以这一方为中心看聚焦图`,"rel.focus.centre":`中心`,"rel.focus.hint":`点击,把这一方放到中间`,"rel.focus.apart":`与中心没有关系相连`,"rel.focus.reset":`默认中心`,"rel.focus.resetTitle":`把关系最多的那一方放回中间`,"graphKind.tree":`说理树`,"jus.kind.conclusion":`结论`,"jus.kind.norm":`规范`,"jus.kind.element":`要件`,"jus.kind.fact":`事实`,"jus.kind.inference":`推断`,"jus.kind.judgement":`评价`,"jus.holds.yes":`✓ 成立`,"jus.holds.no":`✗ 否定`,"jus.copy":`重复`,"jus.copies":({n:e})=>`同一节点出现在 ${e} 个争点中`,"jus.grounds":`依据`,"jus.fold":`收起这个争点`,"jus.unfold":`展开这个争点`,"jus.folded":({n:e})=>`已收起 ${e} 个`,"jus.foldAll":`收起争点`,"jus.merge":`合并重复`,"jus.mergeTitle":`同一争点里被多处用到的事实(或支持多个要件的规范)默认在每处使用点各列一份;合并后只列一份,连线会变长、更易交叉`,"jus.foldAllTitle":`把每个争点收起到只剩它的结论,或者全部展开`,"jus.combine.all":`且`,"jus.combine.any":`或`,"jus.combine.allLong":`它依据的须全部具备`,"jus.combine.anyLong":`它依据的具备任何一个即可`,"jus.supports":`指向`,"jus.stance.for":`支持`,"jus.stance.against":`反对`,"jus.stance.basis":`规范依据`,"jus.previewHint":`点击节点查看全文及其依据`,"graphType.fact":`事实图`,"graphType.relationship":`关系图`,"graphType.procedure":`程序图`,"graphType.justification":`证成图`,"rel.kind.equity":`股权`,"rel.kind.control":`控制`,"rel.kind.contract":`合同`,"rel.kind.debt":`债权债务`,"rel.kind.guarantee":`担保`,"rel.kind.kinship":`亲属`,"rel.kind.employment":`雇佣`,"rel.kind.agency":`代理`,"rel.kind.other":`其他`,"rel.kindChipTitle":({n:e})=>`显示或隐藏这一类(${e} 条关系)`,"rel.labels":`标签`,"rel.groups":`分组`,"rel.previewHint":`点击当事方查看全文`,"rel.auto.equity":({share:e})=>e===void 0?`持有股权`:`持股 ${e}%`,"rel.auto.control":`控制`,"rel.auto.contract":({amount:e})=>e?`合同,${e}`:`合同`,"rel.auto.debt":({amount:e})=>e?`债权,${e}`:`债权`,"rel.auto.guarantee":`担保`,"rel.auto.kinship":`亲属`,"rel.auto.employment":`雇佣`,"rel.auto.agency":`代理`,"rel.auto.other":`关联`,...Object.fromEntries(Object.keys(Ae).filter(e=>e.startsWith(`err.`)||e.startsWith(`perr.`)||e.startsWith(`phint.`)||e.startsWith(`note.`)||e.startsWith(`rerr.`)||e.startsWith(`rhint.`)||e.startsWith(`jerr.`)||e.startsWith(`jhint.`)||e.startsWith(`norm.`)).map(e=>[e,Ae[e]]))}};function Me(e){return!e||typeof e!=`string`?`en`:e.toLowerCase().split(`-`)[0]===`zh`?`zh`:`en`}function Ne(e,t,n){let r=(je[Me(e)]??je.en)[t]??je.en[t];return r===void 0?t:typeof r==`function`?r(n??{}):n?String(r).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`):r}var Pe=(e,t)=>Ne(`en`,e,t),Fe=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?)?)?$/;function Ie(e){let t=Fe.exec(typeof e==`string`?e.trim():``);if(!t)return null;let[n,r,i,a,o,s]=t.slice(1).map(e=>e===void 0?void 0:Number(e)),c=(e,t,n,r,i,a)=>Date.UTC(e,t,n,r,i,a),l,u;return r===void 0?(l=c(n,0,1,0,0,0),u=c(n+1,0,1,0,0,0)):i===void 0?(l=c(n,r-1,1,0,0,0),u=c(n,r,1,0,0,0)):a===void 0?(l=c(n,r-1,i,0,0,0),u=c(n,r-1,i+1,0,0,0)):s===void 0?(l=c(n,r-1,i,a,o,0),u=l+6e4):(l=c(n,r-1,i,a,o,s),u=l+1e3),Number.isNaN(l)?null:{from:l,to:u}}function Le(e){let t=Ie(e?.date);if(!t)return null;let{from:n,to:r}=t,i=e.dateEnd===void 0?null:Ie(e.dateEnd);if(i&&i.to>n&&(r=Math.max(r,i.to)),e.approx===!0){let e=t.to-t.from;n-=e,r+=e}return{from:n,to:r}}function Re(e){let t=[],n=null;return(Array.isArray(e?.slots)?e.slots:[]).forEach((e,r)=>{let i=(Array.isArray(e?.events)?e.events:[]).map((e,t)=>({event:e,ei:t,span:Le(e)})).filter(e=>e.span);if(i.length===0)return;let a={from:Math.min(...i.map(e=>e.span.from)),to:Math.max(...i.map(e=>e.span.to))};if(n&&a.to<=n.span.from){let e=i.find(e=>e.span.to<=n.span.from)??i[0];t.push(Pe(`note.dateOrder`,{at:`slots[${r}].events[${e.ei}]`,id:e.event.id,date:e.event.date,beforeAt:`slots[${n.si}].events[${n.ei}]`,beforeId:n.event.id,beforeDate:n.event.date}))}let o=i.reduce((e,t)=>t.span.to>e.span.to?t:e);n={span:a,si:r,ei:o.ei,event:o.event}}),t}function ze(e){let t=Array.isArray(e?.actors)?e.actors:[],n=new Set;for(let t of Array.isArray(e?.slots)?e.slots:[])for(let e of Array.isArray(t?.events)?t.events:[])for(let t of Array.isArray(e?.actorIds)?e.actorIds:[])n.add(t);return t.map((e,t)=>({a:e,i:t})).filter(({a:e})=>e&&typeof e.id==`string`&&!n.has(e.id)).map(({a:e,i:t})=>Pe(`note.partyNoEvent`,{at:`actors[${t}]`,id:e.id,name:e.name??e.id}))}var Be=19,Ve=2,He=18,Ue=6,We=16,Ge=11.5,Ke=1,eee=.55;function qe(e){let t=e.codePointAt(0);return t>=4352&&t<=4447||t>=11904&&t<=42191||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510?Ke:eee}function Je(e){let t=0;for(let n of String(e??``))t+=qe(n);return t}var Ye=(e,t)=>Je(e)*t,tee=262/13;262/Ge;function nee(e={},t=Ve,n=0){let r=22+Be*t+Ue+We;return e.summary&&(r+=24),e.actors&&n>0&&(r+=He*n+Ue),r}function Xe(e,t,n={}){let r=n.latin??1,i=n.cjk??1;return Ze(e,t,e=>{let t=0;for(let n of e)t+=qe(n)*(qe(n)===Ke?i:r);return t})}function Ze(e,t,n){let r=t,i=n,a=String(e??``);if(!a)return 0;let o=a.match(/[^\sᄀ-ᅟ⺀-가-힣豈-︰--⦆¢-₩]+|\s|./gu)||[],s=1,c=0;for(let e of o){let t=i(e);if(/^\s$/.test(e))c>0&&(c+=t);else if(c+t<=r)c+=t;else if(t<=r)s+=+(c>0),c=t;else{c>0&&(s+=1);let e=Math.ceil(t/r);s+=e-1,c=t-(e-1)*r}}return s}var Qe={SIDE1:`side1`,AXIS:`axis`,SIDE2:`side2`},$e=3;function et(e){let t=(Array.isArray(e?.actors)?e.actors:[]).filter(e=>rt(e)&&e.id);if(new Set(t.map(e=>e.id)).size<2)return e=>e?.groupId??null;let n=new Map(t.map(e=>[e.id,e.groupId])),r=(Array.isArray(e?.groups)?e.groups[2]?.id:null)??null;return e=>{let t=Array.isArray(e?.actorIds)?e.actorIds:[];return t.length===1&&n.get(t[0])||r}}var tt=/^\d{4}(-\d{2}(-\d{2}(T\d{2}(:\d{2}(:\d{2})?)?)?)?)?$/;function nt(e,t){if(typeof e!=`string`||typeof t!=`string`)return!1;let n=Math.min(e.length,t.length);return e.slice(0,n)<t.slice(0,n)}var ree=[Qe.SIDE1,Qe.SIDE2,Qe.AXIS];function rt(e){return e&&typeof e==`object`&&!Array.isArray(e)}function it(e){let t=[],n=Array.isArray(e?.actors)?e.actors:[],r=Array.isArray(e?.groups)?e.groups:[],i=Array.isArray(e?.sources)?e.sources:[],a=e?.slots,o={errors:t,byActor:!1,sideLabels:{[Qe.SIDE1]:``,[Qe.SIDE2]:``,[Qe.AXIS]:``},columns:[],rows:[],placements:new Map,axisColumnIndex:0,actorById:new Map,groupById:new Map,groupIndexById:new Map,sourceById:new Map,eventCount:0},s=new Map;n.forEach((e,n)=>{rt(e)?e.id?(s.has(e.id)&&t.push(Pe(`err.duplicateId`,{at:`actors[${n}]`,id:e.id})),s.set(e.id,e),e.name||t.push(Pe(`err.required`,{at:`actors[${n}] (${e.id})`,field:`name`}))):t.push(Pe(`err.required`,{at:`actors[${n}]`,field:`id`})):t.push(Pe(`err.notObject`,{at:`actors[${n}]`}))}),e?.views!==void 0&&t.push(Pe(`err.viewsRemoved`));let c=new Map,l=new Map;r.length>$e&&t.push(Pe(`err.tooManyGroups`,{at:`groups`,max:$e,actual:r.length})),r.forEach((e,n)=>{rt(e)?e.id?(l.has(e.id)&&t.push(Pe(`err.duplicateId`,{at:`groups[${n}]`,id:e.id})),c.set(e.id,e),l.set(e.id,n),e.label||t.push(Pe(`err.required`,{at:`groups[${n}] (${e.id})`,field:`label`}))):t.push(Pe(`err.required`,{at:`groups[${n}]`,field:`id`})):t.push(Pe(`err.notObject`,{at:`groups[${n}]`}))});let u=s.size>=2,d=new Map;n.forEach((e,n)=>{if(!rt(e)||!e.id)return;let r=`actors[${n}] (${e.id})`,i=e.groupId!==void 0&&e.groupId!==null&&e.groupId!==``;if(!u){i&&t.push(Pe(`err.actorGroupOneParty`,{at:r}));return}if(!i){t.push(Pe(`err.actorNeedsGroup`,{at:r,n:s.size}));return}if(!l.has(e.groupId)){t.push(Pe(`err.missingRef`,{at:r,field:`groupId`,kind:`group`,id:e.groupId}));return}let a=l.get(e.groupId);a>1?t.push(Pe(`err.actorGroupNotSide`,{at:r,groupId:e.groupId})):d.set(e.id,a===0?Qe.SIDE1:Qe.SIDE2)});let f=new Map;if(i.forEach((e,n)=>{rt(e)?e.id?(f.has(e.id)&&t.push(Pe(`err.duplicateId`,{at:`sources[${n}]`,id:e.id})),f.set(e.id,e),e.type||t.push(Pe(`err.required`,{at:`sources[${n}] (${e.id})`,field:`type`})),e.name||t.push(Pe(`err.required`,{at:`sources[${n}] (${e.id})`,field:`name`}))):t.push(Pe(`err.required`,{at:`sources[${n}]`,field:`id`})):t.push(Pe(`err.notObject`,{at:`sources[${n}]`}))}),!Array.isArray(a))return t.push(Pe(`err.slotNotArray`)),{...o,actorById:s,groupById:c,groupIndexById:l,sourceById:f};a.length===0&&t.push(Pe(`err.slotsEmpty`));let p=new Set,m={[Qe.SIDE1]:new Set,[Qe.SIDE2]:new Set},h=[];a.forEach((e,n)=>{let r=`slots[${n}]`;rt(e)?Array.isArray(e.events)?(e.events.length===0&&t.push(Pe(`err.slotEventsEmpty`,{at:r})),e.events.forEach((e,i)=>{let a=`${r}.events[${i}]${e?.id?` (${e.id})`:``}`;if(!rt(e)){t.push(Pe(`err.notObject`,{at:a}));return}e.id?p.has(e.id)?t.push(Pe(`err.duplicateId`,{at:a,id:e.id})):p.add(e.id):t.push(Pe(`err.required`,{at:a,field:`id`})),e.date&&!tt.test(e.date)&&t.push(Pe(`err.badDate`,{at:a,field:`date`,value:e.date})),e.label||t.push(Pe(`err.required`,{at:a,field:`label`})),e.dateEnd!==void 0&&e.dateEnd!==null&&(typeof e.dateEnd!=`string`||!tt.test(e.dateEnd)?t.push(Pe(`err.badDate`,{at:a,field:`dateEnd`,value:e.dateEnd})):e.date?nt(e.dateEnd,e.date)&&t.push(Pe(`err.dateEndBeforeDate`,{at:a,end:e.dateEnd,start:e.date})):t.push(Pe(`err.dateEndNeedsDate`,{at:a}))),e.summary!==void 0&&e.summary!==null&&(typeof e.summary==`string`?Je(e.summary)>22.782608695652176&&t.push(Pe(`err.summaryTooLong`,{at:a,max:22,actual:Math.ceil(Je(e.summary))})):t.push(Pe(`err.mustBeString`,{at:a,field:`summary`})));let o=Array.isArray(e.actorIds)?e.actorIds:[];o.forEach(e=>{s.has(e)||t.push(Pe(`err.missingRef`,{at:a,field:`actorIds`,kind:`actor`,id:e}))});let c=e.groupId!==void 0&&e.groupId!==null&&e.groupId!==``;u&&c?t.push(Pe(`err.eventGroupWithParties`,{at:a})):c&&!l.has(e.groupId)&&t.push(Pe(`err.missingRef`,{at:a,field:`groupId`,kind:`group`,id:e.groupId})),(Array.isArray(e.sourceIds)?e.sourceIds:[]).forEach(e=>{f.has(e)||t.push(Pe(`err.missingRef`,{at:a,field:`sourceIds`,kind:`source`,id:e}))});let g=c?l.get(e.groupId):void 0,_,v=null;if(u)o.length===1&&d.has(o[0])?(_=d.get(o[0]),v=o[0]):_=Qe.AXIS;else if(o.length>=2)_=Qe.AXIS,(g===0||g===1)&&t.push(Pe(`err.multiActorNeedsAxis`,{at:a,n:o.length,groupId:e.groupId}));else if(!c)_=Qe.AXIS;else if(g===void 0)return;else _=ree[g]??Qe.AXIS;!u&&_!==Qe.AXIS&&o.length!==1?t.push(Pe(`err.groupNeedsOneActor`,{at:a,groupId:e.groupId,n:o.length})):(!u&&_!==Qe.AXIS&&o.length===1&&(v=o[0]),v&&s.has(v)&&m[_].add(v),h.push({slotIndex:n,event:e,side:_,actorId:v}))})):t.push(Pe(`err.eventsNotArray`,{at:r})):t.push(Pe(`err.slotShape`,{at:r}))});let g=n.map(e=>rt(e)?e.id:null).filter(Boolean),_=e=>g.filter(t=>m[e].has(t)),v=e=>{let t=_(e),n=u&&g.filter(t=>d.get(t)===e).length>1;return t.length||!u?t.map(t=>({key:`${e}:${t}`,side:e,actorId:t,actorName:s.get(t)?.name,named:n})):[{key:e,side:e,actorId:null}]},y=[];y.push(...v(Qe.SIDE1).reverse());let b=y.length;y.push({key:Qe.AXIS,side:Qe.AXIS}),y.push(...v(Qe.SIDE2));let x=new Map(y.map((e,t)=>[e.key,t])),S=a.map((e,t)=>({index:t,cells:new Map})),C=new Map,ee=0;return h.forEach(({slotIndex:e,event:n,side:r,actorId:i})=>{let a=r===Qe.AXIS?Qe.AXIS:`${r}:${i}`,o=x.get(a);if(o===void 0)return;ee+=1;let s=S[e];if(s.cells.has(a)){let r=s.cells.get(a);t.push(Pe(`err.oneEventPerCell`,{at:`slots[${e}]`,a:r.id,b:n.id}))}else s.cells.set(a,n);C.set(n.id,{row:e,col:o,key:a})}),{errors:t,byActor:u,sideLabels:{[Qe.SIDE1]:r[0]?.label??``,[Qe.SIDE2]:r[1]?.label??``,[Qe.AXIS]:r[2]?.label??``},columns:y,rows:S,placements:C,axisColumnIndex:b,actorById:s,groupById:c,groupIndexById:l,sourceById:f,eventCount:ee}}function at(e){return e===Qe.SIDE1?0:e===Qe.SIDE2?1:2}function ot(e){let t=1;for(let n of e.rows)n.cells.forEach(e=>{let n=Je(e.label||``);t=Math.max(t,Math.min(2,Math.ceil(n/tee)))});return t}function st(e,t){if(!t.actors)return 0;let n=0;for(let t of e.rows)t.cells.forEach(t=>{let r=(Array.isArray(t.actorIds)?t.actorIds:[]).map(t=>e.actorById.get(t)?.name||t);if(r.length===0)return;let i=r.reduce((e,t)=>e+Ye(t,10)+14,0)+4*(r.length-1);n=Math.max(n,Math.ceil(i/262))});return n}function ct(e,t){let n=new Set;return e.cells.forEach((e,r)=>{let i=t.columns.findIndex(e=>e.key===r);i>=0&&n.add(i)}),n}var iee=.5;function aee(e,t){if(!t)return e.rows.map((e,t)=>t);let n=e.rows.map(t=>ct(t,e)),r=[];return n.forEach((e,t)=>{let i=t===0?0:r[t-1]+iee;for(let a=0;a<t;a++)[...e].some(e=>n[a].has(e))&&(i=Math.max(i,r[a]+1));r.push(i)}),r}function oee(e,t,n,r=!1){let i=e.columns.length,a=e.rows.length,o=ot(e),s=st(e,t),c=nee(t,o,s),l=c+28,u=n?316:l,d=n?l:316,f=new Set;e.rows.forEach(e=>e.cells.forEach((e,t)=>f.add(t)));let p=[],m=0;e.columns.forEach(e=>{let t=f.has(e.key)?d:n?52:104;p.push({start:m,size:t}),m+=t});let h=n?150:0,g=n?0:96,_=n?u:d,v=n?d:u,y=r&&!n,b=aee(e,y),x=a===0?0:(b[a-1]+1)*u,S=(e,t)=>n?{x:h+b[e]*u,y:p[t].start}:{x:p[t].start,y:g+b[e]*u},C=p[e.axisColumnIndex]??{start:0,size:d};return{isH:n,colCount:i,rowCount:a,labelLines:o,actorLines:s,cardH:c,cellH:l,slotExtent:u,laneExtent:d,lanes:p,originX:h,originY:g,cellBoxW:_,cellBoxH:v,cellAt:S,rowTops:b,timeSpan:x,staggered:y,axisCenter:C.start+C.size/2,contentW:n?h+x+6:m,contentH:n?m:g+x+6}}var lt={draggable:!1,selectable:!1,connectable:!1,focusable:!1};function see(e,t,n){let r=(Array.isArray(e.actorIds)?e.actorIds:[]).map(e=>t.actorById.get(e)?.name||e),i=(Array.isArray(e.sourceIds)?e.sourceIds:[]).map(e=>t.sourceById.get(e)).filter(Boolean);return{event:e,actorNames:r,sources:i,sourceCount:i.length,row:n}}function cee(e){return{id:`__cells__`,type:`cells`,position:{x:0,y:0},width:1,height:1,style:{pointerEvents:`none`},data:{cols:e.colCount,rows:e.rowCount,cellW:e.cellBoxW,cellH:e.cellBoxH,lanes:e.lanes,originX:e.originX,originY:e.originY,isH:e.isH},...lt}}function lee(e,t){let n=t=>e.columns.filter(e=>e.side===t).length,r=t=>e.columns.findIndex(e=>e.side===t),i=[];return e.columns.forEach((a,o)=>{let s=n(a.side),c=a.side!==Qe.AXIS&&(s>1||a.named),l=o===r(a.side),u={type:`colHeader`,...lt},d={isH:t.isH,side:a.side,groupIndex:at(a.side)};if(!c){i.push({...u,id:`__head__${a.key}`,position:t.isH?{x:0,y:t.lanes[o].start}:{x:t.lanes[o].start,y:0},data:{...d,width:t.isH?150:t.lanes[o].size,height:t.isH?t.lanes[o].size:null,sideTitle:e.sideLabels[a.side],colTitle:null}});return}if(t.isH){i.push({...u,id:`__head__${a.key}`,position:{x:0,y:t.lanes[o].start},data:{...d,width:150,height:t.lanes[o].size,sideTitle:l?e.sideLabels[a.side]:null,colTitle:a.actorName}});return}if(!l)return;let f=e.columns.slice(o,o+s);i.push({...u,id:`__head__${a.key}`,position:{x:t.lanes[o].start,y:0},data:{...d,width:t.lanes.slice(o,o+s).reduce((e,t)=>e+t.size,0),height:null,sideTitle:e.sideLabels[a.side],colTitle:null,actors:f.map(e=>e.actorName),laneWs:t.lanes.slice(o,o+s).map(e=>e.size)}})}),i}function uee(e,t){let n=e.rows.map(e=>t.rowTops[e.index]*t.slotExtent+t.slotExtent/2-5);return{id:`__axis__`,type:`axis`,position:t.isH?{x:t.originX,y:t.axisCenter-1}:{x:t.axisCenter-1,y:t.originY},data:{isH:t.isH,length:t.timeSpan,dotSize:10,dotOffsets:n},...lt}}function dee(e,t){return{id:`__links__`,type:`links`,position:{x:0,y:0},width:1,height:1,style:{pointerEvents:`none`},data:{segments:e,isH:t},...lt}}function fee(e,t,n,r,i,a){let o=i.cellAt(n,t),s=o.x+(i.cellBoxW-288)/2,c=o.y+(i.cellBoxH-i.cardH)/2,l=null;if(i.isH){let e=s+144;if(t<r.axisColumnIndex){let t=c+i.cardH;l={left:e,top:t,height:i.axisCenter-t}}else t>r.axisColumnIndex&&(l={left:e,top:i.axisCenter,height:c-i.axisCenter})}else{let e=c+i.cardH/2;if(t<r.axisColumnIndex){let t=s+288;l={left:t,top:e,width:i.axisCenter-t}}else t>r.axisColumnIndex&&(l={left:i.axisCenter,top:e,width:s-i.axisCenter})}return{node:{id:e.id,type:`card`,position:{x:s,y:c},data:{...see(e,r,n),groupIndex:at(r.columns[t].side),cardW:288,cardH:i.cardH,labelLines:i.labelLines,fields:a,isH:i.isH}},link:l}}function pee(e,t={},n,r=`vertical`,{stagger:i=!1}={}){let a=r===`horizontal`,o=it(e),s=oee(o,t,a,i),c=[cee(s),...lee(o,s)],l=[],u=[];return o.rows.forEach(e=>{e.cells.forEach((n,r)=>{let i=o.columns.findIndex(e=>e.key===r);if(i<0)return;let{node:a,link:c}=fee(n,i,e.index,o,s,t);l.push(a),c&&u.push(c)})}),u.length&&c.push(dee(u,a)),c.push(uee(o,s)),c.push(...l),{errors:o.errors,sideLabels:o.sideLabels,nodes:c,edges:[],grid:o,layout:`grid`,staggered:s.staggered,size:{width:s.contentW,height:s.contentH}}}function ut(e,t,n){let[r,i]=String(e).split(`T`),a=t?Ne(n,`card.approxPrefix`):``;if(!i)return a+r;let o=i.split(`:`);return`${a}${r} ${o.slice(0,2).join(`:`)}${o[2]?`:`+o[2]:``}`}function dt(e,t,n){let r=ut(t,!1,n);return String(e).split(`T`)[0]===String(t).split(`T`)[0]&&String(t).includes(`T`)?r.split(` `).pop():r}function mee(e,t){if(!e.date)return Ne(t,`card.dateUnknown`);let n=ut(e.date,e.approx,t);return e.dateEnd?`${n} - ${dt(e.date,e.dateEnd,t)}`:n}function ft(e,t,n=!1){if(!e.date)return[{text:Ne(t,`chronicle.dateUnknown`),strong:!1}];let[r,i]=String(e.date).split(`T`),a=[{text:(e.approx?Ne(t,`card.approxPrefix`):``)+r,strong:!0}],o=i?ut(e.date,!1,t).split(` `).pop():``;n&&o&&a.shift();let s=!a.length;if(!e.dateEnd)return o&&a.push({text:o,strong:s}),a;let c=dt(e.date,e.dateEnd,t);return o&&!c.includes(`-`)?a.push({text:`${o} – ${c}`,strong:s}):(o&&a.push({text:o,strong:s}),a.push({text:`– ${c}`,strong:!1})),a}var hee=12.5,gee=4,_ee=6,vee=10,yee=90,bee={latin:1.2,cjk:1.06},pt={latin:1.12,cjk:1.06},mt={sameSlot:10,none:22,short:38,long:70},ht=864e5,gt=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2})(?::(\d{2})(?::(\d{2}))?)?)?)?)?$/;function _t(e){let t=typeof e==`string`?gt.exec(e):null;if(!t)return null;let[,n,r,i,a,o,s]=t,c=a==null?i==null?r==null?`year`:`month`:`day`:`time`;return{y:+n,mo:r?+r:1,d:i?+i:1,h:a?+a:0,mi:o?+o:0,s:s?+s:0,prec:c}}var vt={year:0,month:1,day:2,time:3},yt=e=>Date.UTC(e.y,e.mo-1,e.d,e.h,e.mi,e.s);function xee(e,t,n=!1){let r=_t(e),i=_t(t);if(!r||!i)return null;let a=vt[r.prec]<=vt[i.prec]?r.prec:i.prec,o=(e,t,r)=>({key:e,vars:t,long:r,approx:!!n});if(a===`year`||a===`month`){let e=a===`year`?(i.y-r.y)*12:(i.y-r.y)*12+(i.mo-r.mo);return e<=0?null:xt(e,o)}if(a===`time`){let e=yt(i)-yt(r);if(e<=0)return null;if(e<ht){let t=Math.round(e/1e3);if(t<60)return o(`chronicle.gapSeconds`,{n:t},!1);if(t<3600)return o(`chronicle.gapMinutes`,{n:Math.round(t/60)},!1);let n=Math.floor(t/3600),r=Math.round((t-n*3600)/60);return r===60&&(n+=1,r=0),r?o(`chronicle.gapHoursMinutes`,{h:n,m:r},!1):o(`chronicle.gapHours`,{n},!1)}return bt(Math.floor(e/ht),o)}let s=Math.round((Date.UTC(i.y,i.mo-1,i.d)-Date.UTC(r.y,r.mo-1,r.d))/ht);return s<=0?null:bt(s,o)}function See(e){let t=(e,t,n)=>({key:e,vars:t,long:n,approx:!1});if(!(e>0))return null;if(e<ht){let n=Math.round(e/1e3);return n<60?t(`chronicle.gapSeconds`,{n},!1):n<3600?t(`chronicle.gapMinutes`,{n:Math.round(n/60)},!1):t(`chronicle.gapHours`,{n:Math.round(n/3600)},!1)}return bt(Math.round(e/ht),t)}function bt(e,t){return e<30?t(`chronicle.gapDays`,{n:e},!1):xt(Math.max(1,Math.round(e/30.44)),t)}function xt(e,t){let n=Math.floor(e/12),r=e%12;return n?r?t(`chronicle.gapYearsMonths`,{y:n,m:r},!0):t(`chronicle.gapYears`,{n},!0):t(`chronicle.gapMonths`,{n:r},!0)}var St=(e,t)=>e==null?t:t==null||e>t?e:t;function Cee(e){let t=Array.isArray(e?.slots)?e.slots:[],n=[],r=null,i=!1,a=!1;return t.forEach((e,t)=>{let o=(Array.isArray(e?.events)?e.events:[]).filter(e=>e&&typeof e==`object`);if(!o.length)return;let s=o.every(e=>typeof e.date==`string`&&e.date),c=s?[...o].sort((e,t)=>e.date<t.date?-1:+(e.date>t.date)):o,l=c.find(e=>e.date)?.date??null,u=c.some(e=>e.date&&e.approx);c.forEach((e,o)=>{let c=o===0,d=null,f=`sameSlot`;c&&(n.length?(d=a&&s?xee(r,l,i||u):null,f=d?d.long?`long`:`short`:`none`):f=`top`);let p=typeof e.date==`string`&&e.date.length>=10?e.date.slice(0,10):null,m=n.at(-1)?.event,h=!!(p&&m&&typeof m.date==`string`&&m.date.slice(0,10)===p&&!e.approx);n.push({event:e,slotIndex:t,first:c,gap:d,spacing:f,sameDay:h})}),a=s,r=null;for(let e of c)r=St(r,St(e.date,e.dateEnd));i=c.some(e=>e.approx)}),n}var Ct=[`circle`,`square`,`diamond`];function wt(e,t){let n=(Array.isArray(e?.groups)?e.groups:[]).findIndex(n=>n?.id===et(e)(t));return n<0?`none`:Ct[Math.min(n,2)]}function Tt(e,t){let n=(Array.isArray(e?.groups)?e.groups:[]).findIndex(n=>n?.id===et(e)(t));return n>=0&&n<3?n:2}function Et(e,t,n,r){let i=[];if(n.actors)for(let t of Array.isArray(e.actorIds)?e.actorIds:[])i.push(Ye(r.get(t)?.name||t,10)+14);if(n.sources&&i.push(yee),!i.length)return 0;let a=1,o=0;for(let e of i){let t=o?vee+e:e;o&&o+t>532?(a+=1,o=e):o+=t}return a}function Dt({titleLines:e,summaryLines:t,tagLines:n,whenLineCount:r=3}){let i=20+20*Math.max(1,e);return t&&(i+=gee+18*t),n&&(i+=_ee+20*n),Math.max(i,10+18*r)}function Ot(e,t,n){let r=(e,t,r,i)=>n?Ze(e,531,e=>n(e,t)):Xe(e,532/r,i);return{title:Math.max(1,r(e.label||``,`title`,14,bee)),summary:t.summary&&e.summary?r(e.summary,`summary`,hee,pt):0}}function kt(e,t={},{measure:n}={}){let r=new Map((e?.actors||[]).filter(Boolean).map(e=>[e.id,e])),i=new Map((e?.sources||[]).filter(Boolean).map(e=>[e.id,e])),a=(Array.isArray(e?.groups)?e.groups.slice(0,3):[]).map((e,t)=>({label:e?.label,groupIndex:t,shape:Ct[t]})).filter(e=>e.label),o=Cee(e),s=[],c=[],l=[],u=[],d=a.length?34:0,f=null;o.forEach((a,o)=>{let{event:p}=a;if(f!=null){let e=mt[a.spacing]??mt.none;a.gap&&(l.push({y:f+e/2,gap:a.gap}),a.gap.long&&u.push({y0:f,y1:f+e})),d=f+e}let{title:m,summary:h}=Ot(p,t,typeof n==`function`?n:null),g=Et(p,e,t,r),_=Dt({titleLines:m,summaryLines:h,tagLines:g,whenLineCount:ft(p,`en`,a.sameDay).length}),v=Tt(e,p),y=(Array.isArray(p.actorIds)?p.actorIds:[]).map(e=>r.get(e)?.name||e),b=(Array.isArray(p.sourceIds)?p.sourceIds:[]).map(e=>i.get(e)).filter(Boolean);s.push({id:p.id,type:`entry`,position:{x:0,y:d},width:758,height:_,draggable:!1,connectable:!1,data:{event:p,index:o,groupIndex:v,shape:wt(e,p),actorNames:y,sources:b,fields:t,lines:{title:m,summary:h,tags:g},sameDay:a.sameDay,cardH:_}}),c.push({y:d+20,groupIndex:v,shape:wt(e,p),hollow:!p.date}),f=d+_});let p=f??0,m=[];return o.length&&m.push({id:`__spine__`,type:`spine`,position:{x:0,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,style:{pointerEvents:`none`},data:{x:174,top:c[0].y,bottom:c[c.length-1].y,dots:c,pills:l,breaks:u,dotSize:13}}),a.length&&m.push({id:`__legend__`,type:`legend`,position:{x:198,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,data:{groups:a}}),m.push(...s),{errors:[],nodes:m,edges:[],items:o,eventCount:o.length,layout:`chronicle`,size:{width:758,height:p}}}var At=12,wee=40,jt=12.5,Tee={latin:1.2,cjk:1.06},Mt=(e,t=1)=>16+17*e+2+15*t,Eee=e=>e?.dateEnd&&Ye(mee(e,`en`),11)*1.05>176?2:1,Nt=Mt(2,2)+10,Dee=10,Pt=22,Ft=12,It=e=>Ft+Math.max(1,e)*Nt+Pt,Lt=14,Rt=864e5,zt=36e5;function Bt(e){let t=_t(e?.date);if(!t)return null;let n=e=>Date.UTC(e.y,e.mo-1,e.d,e.h,e.mi,e.s),r=e=>e.prec===`year`?Date.UTC(e.y+1,0,1):e.prec===`month`?Date.UTC(e.y,e.mo,1):e.prec===`day`?Date.UTC(e.y,e.mo-1,e.d+1):n(e),i=n(t),a=_t(e?.dateEnd);return a&&r(a)>i?{from:i,to:r(a),kind:`bar`,exact:!0}:t.prec===`time`?{from:i,to:i,kind:`dot`,exact:!0}:{from:i,to:r(t),kind:`band`,exact:!1,prec:t.prec}}var Vt=e=>{let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2};function Ht(e){let t=e.slice(1).map((t,n)=>t-e[n]),n=[],r=(e,n)=>{let r=[];for(let i=e+n;i>=0&&i<t.length&&r.length<3&&!(t[i]>=t[e]);i+=n)r.push(t[i]);return r};return t.forEach((e,t)=>{if(e<1728e5)return;let i=r(t,1);i.length||(i=r(t,-1)),i.length&&e/Math.max(Vt(i),6e4)>=20&&n.push({i:t,g:e})}),n.sort((e,t)=>t.g-e.g).slice(0,2).map(e=>e.i).sort((e,t)=>e-t)}function Ut(e){return e>730*Rt?`year`:e>60*Rt?`month`:e>2*Rt?`day`:e>3*zt?`hour`:`minute`}function Wt(e,t,n,r){let i=new Date(e),a=[],o={year:[1,2,5,10],month:[1,2,3,6],day:[1,2,7,14],hour:[1,2,3,6,12],minute:[1,2,5,10,15,30]}[n];for(let s of o){a.length=0;let o;o=n===`year`?Date.UTC(i.getUTCFullYear(),0,1):n===`month`?Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1):n===`day`?Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()):n===`hour`?Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours()):Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes());let c=0;for(;o<=t&&c++<2e3;){o>=e&&a.push(o);let t=new Date(o);n===`year`?o=Date.UTC(t.getUTCFullYear()+s,0,1):n===`month`?o=Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+s,1):o+=n===`day`?s*Rt:n===`hour`?s*zt:s*6e4}if(a.length<=r)break}return[...a]}function Oee(e,t,n){let r=new Date(e),i=e=>String(e).padStart(2,`0`),a=`${i(r.getUTCMonth()+1)}-${i(r.getUTCDate())}`;if(t===`year`)return String(r.getUTCFullYear());if(t===`month`)return`${r.getUTCFullYear()}-${i(r.getUTCMonth()+1)}`;if(t===`day`)return a;let o=`${i(r.getUTCHours())}:${i(r.getUTCMinutes())}`;return n==null||new Date(n).getUTCDate()!==r.getUTCDate()?`${a} ${o}`:o}function Gt(e,t){let n=new Map,r=(Array.isArray(e?.actors)?e.actors:[]).filter(e=>e?.id);if(!t||r.length<2)return n;for(let t of Array.isArray(e?.groups)?e.groups.slice(0,2):[]){let e=r.filter(e=>t?.id&&e.groupId===t.id);e.length>=2&&n.set(t.id,e)}return n}function Kt(e,{byParty:t=!1}={}){let n=et(e),r=Gt(e,t);return e=>{let t=n(e),i=Array.isArray(e?.actorIds)?e.actorIds:[];return i.length===1&&r.get(t)?.some(e=>e.id===i[0])?`actor:${i[0]}`:t}}function qt(e,t,{byParty:n=!1}={}){let r=Kt(e,{byParty:n}),i=Gt(e,n),a=(Array.isArray(e?.groups)?e.groups.slice(0,3):[]).filter(e=>e&&e.id),o=new Set(t.map(r)),s=a.flatMap((e,t)=>{let n=i.get(e.id)?.filter(e=>o.has(`actor:${e.id}`));return n?.length?n.map(n=>({key:`actor:${n.id}`,label:n.name??``,side:e.label??``,groupIndex:t})):[{key:e.id,label:e.label??``,groupIndex:t}]}),c=new Set(s.map(e=>e.key));return t.some(e=>!c.has(r(e)))&&s.push({key:`__other__`,label:null,groupIndex:2,other:!0}),s}function kee(e,{levels:t=3,width:n=196,gap:r=Dee}={}){let i=e.map(e=>({ids:[e.id],x:e.x,from:e.x,to:e.x}));for(;;){let e=Jt(i,t,n,r);if(e)return e;let a=-1,o=1/0;for(let e=0;e+1<i.length;e++){let t=i[e+1].x-i[e].x;t<o&&(o=t,a=e)}if(a<0)return Jt(i,t,n,r)??[];let s=i[a],c=i[a+1],l=[...s.ids,...c.ids],u=Math.min(s.from,c.from),d=Math.max(s.to,c.to);i.splice(a,2,{ids:l,x:(u+d)/2,from:u,to:d}),i=i.sort((e,t)=>e.x-t.x)}}function Jt(e,t,n,r){let i=Array(t).fill(-1/0),a=[];for(let t of e){let e=t.x-n/2,o=i.findIndex(t=>t+r<=e);if(o<0)return null;i[o]=t.x+n/2,a.push({...t,level:o})}return a}function Aee(e,t={},{measure:n,byParty:r=!1}={}){let i=new Map((e?.actors||[]).filter(Boolean).map(e=>[e.id,e])),a=new Map((e?.sources||[]).filter(Boolean).map(e=>[e.id,e])),o=[];(Array.isArray(e?.slots)?e.slots:[]).forEach((e,t)=>{for(let n of Array.isArray(e?.events)?e.events:[])n&&typeof n==`object`&&o.push({event:n,slotIndex:t})}),o.forEach(e=>e.time=Bt(e.event)),o.forEach(e=>{e.time?.exact&&(e.time.t=e.time.from)});let s=e=>({before:o.slice(0,e).reverse().find(e=>e.time?.exact),after:o.slice(e+1).find(e=>e.time?.exact)}),c=o.filter(e=>e.time?.exact).map(e=>e.time.t),l=c.length>1?Math.max(6e4,(Math.max(...c)-Math.min(...c))/20):zt,u=(e,t,n)=>{let{before:r,after:i}=s(e),a;return a=r&&i?(r.time.t+i.time.t)/2:r?r.time.t+l:i?i.time.t-l:t==null?e*zt:(t+n)/2,t==null?a:Math.min(Math.max(a,t),n-1)};o.forEach((e,t)=>{e.time&&!e.time.exact&&(e.time.t=u(t,e.time.from,e.time.to))}),o.forEach((e,t)=>{if(e.time)return;let n=o.slice(0,t).reverse().find(e=>e.time),r=o.slice(t+1).find(e=>e.time),i=n&&r?(n.time.t+r.time.t)/2:n?n.time.t+l:r?r.time.t-l:t*zt;e.time={t:i,from:i,to:i,kind:`dot`,undated:!0}});let d=[...new Set(o.map(e=>e.time.t))].sort((e,t)=>e-t),f=[...new Set(o.filter(e=>!e.time.undated).map(e=>e.time.t))].sort((e,t)=>e-t),p=f.length?f:d,m=Ht(p),h=[],g=0;for(let e of m)h.push([p[g],p[e]]),g=e+1;h.push([p[g],p[p.length-1]]),h[0][0]=Math.min(h[0][0],d[0]),h[h.length-1][1]=Math.max(h[h.length-1][1],d[d.length-1]);let _=e=>{let t=h.findIndex(([,t])=>e<=t);return t<0?h.length-1:t},v=h.map(([e,t],n)=>({index:n,from:e,to:t,count:o.filter(e=>_(e.time.t)===n).length,unit:t>e?Ut(t-e):`day`})),y=e=>Ye(e,At)*1.06,b=qt(e,o.map(e=>e.event),{byParty:r}).flatMap(e=>[e.label||``,e.side||``]),x=Math.round(Math.min(196,Math.max(132,...b.map(e=>y(e)+wee)))),S=x;v.forEach((e,t)=>{if(t>0){let n=e.from-v[t-1].to;e.breakBefore={x:S,w:64,gap:See(n)},S+=64}e.x0=S,e.w=Math.max(170,e.count*116),e.x1=S+e.w,S=e.x1});let C=S,ee=e=>{let t=v[_(e)],n=t.w-196;return t.to===t.from?t.x0+t.w/2:t.x0+98+(Math.min(Math.max(e,t.from),t.to)-t.from)/(t.to-t.from)*n},w=(e,t)=>Math.min(Math.max(e,v[t].from),v[t].to),te=qt(e,o.map(e=>e.event),{byParty:r}),ne=Kt(e,{byParty:r}),re=e=>{let t=te.findIndex(t=>t.key===ne(e));return t>=0?t:te.length-1},ie=[],ae=[],oe=e=>ie[e],se=e=>ie[e]+ae[e],ce=o.map((e,t)=>{let n=_(e.time.t),r=e.time.kind,i=ee(r===`dot`?e.time.t:w(e.time.from,n)),a=r===`dot`?i:ee(w(e.time.to,n)),o=r===`bar`?i:ee(e.time.t),s=v[n],c=r===`band`&&s.to>s.from&&e.time.to-e.time.from>s.to-s.from,l=r===`band`&&(c||a-i<8)?`dot`:r;return l===`dot`?i=a=o:a-i<6&&(a=i+6),{id:e.event.id,order:t,lane:re(e.event),kind:l,x:o,x0:i,x1:a,undated:!!e.time.undated,coarse:c,prec:e.time.prec,event:e.event}}),le=new Map;for(let e of ce){let t=`${e.lane}:${Math.round(e.x)}`;e.stack=le.get(t)??0,le.set(t,e.stack+1)}let ue=e=>Math.min(2,Math.max(1,n?Ze(e,173,e=>n(e,`title`)):Xe(e,176/jt,Tee))),de=[],fe=[],pe=te.map((e,t)=>{let n=ce.filter(e=>e.lane===t).sort((e,t)=>e.x-t.x||e.order-t.order),r=e=>Math.min(Math.max(e,x+4+98),C-98);return kee(n.map(e=>({id:e.id,x:r(e.x)})))}),me=0;pe.forEach((e,t)=>{ie[t]=me,ae[t]=e.length?It(Math.max(0,...e.map(e=>e.level))+1):34,me+=ae[t]}),pe.forEach((e,t)=>{let n=e=>{let t=e.ids.map(e=>ce.find(t=>t.id===e).x);return(Math.min(...t)+Math.max(...t))/2};for(let r of e){let e=r.x-98,i=r.ids.map(e=>ce.find(t=>t.id===e)).sort((e,t)=>e.order-t.order),a=i.length>1,o=a?1:ue(i[0].event.label||``),s=a?1:i[0].undated?Ye(Ne(`en`,`scale.undated`),11)*1.05>176?2:1:Eee(i[0].event),c=Mt(o,s),l=se(t)-Pt-r.level*Nt,u={id:a?`__run__${fe.length+1}`:i[0].id,lane:t,level:r.level,x:e,y:l-c,w:196,h:c,titleLines:o,timeLines:s,anchor:n(r),members:i};a&&(u.run=fe.length+1,u.span=[Math.min(...i.map(e=>e.x0)),Math.max(...i.map(e=>e.x1))],fe.push(u)),de.push(u)}});let he=ie.length?ie[ie.length-1]+ae[ae.length-1]:0,ge=he+14,_e=v.flatMap(e=>{let t=Math.max(2,Math.floor(e.w/84)),n=e.to>e.from?Wt(e.from,e.to,e.unit,t):[],r=e.unit;return n.length||(n=e.to>e.from?[e.from,e.to]:[e.from],r=e.to>e.from?`minute`:`day`),n.map((e,t)=>({x:ee(e),label:Oee(e,r,t?n[t-1]:null)}))}),ve=fe.reduce((e,t)=>e+1+t.members.length,0),ye=fe.length?Lt+ve*18:0,be=he+56+ye,xe=e=>te[re(e)].groupIndex,Se=[{id:`__scale__`,type:`scaleLayer`,position:{x:0,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,style:{pointerEvents:`none`},data:{width:C,labelW:x,lanesH:he,axisY:ge,lanes:te.map((e,t)=>({...e,top:oe(t),lineY:se(t)})),segments:v,ticks:_e,marks:ce.map(e=>({id:e.id,kind:e.kind,x:e.x,x0:e.x0,x1:e.x1,y:se(e.lane)-e.stack*12,undated:e.undated,coarse:e.coarse,prec:e.prec,approx:!!e.event.approx,groupIndex:te[e.lane].groupIndex})),leaders:de.map(e=>({x:Math.min(Math.max(e.anchor,e.x+8),e.x+e.w-8),y0:e.y+e.h,y1:se(e.lane)-6,run:!!e.run})),brackets:fe.map(e=>({x0:e.span[0],x1:e.span[1],y:se(e.lane)+9,run:e.run}))}}];for(let e of de)Se.push({id:e.id,type:e.run?`scaleRun`:`scaleCard`,position:{x:e.x,y:e.y},width:e.w,height:e.h,draggable:!1,connectable:!1,data:e.run?{run:e.run,events:e.members.map(e=>e.event),groupIndex:te[e.lane].groupIndex,cardH:e.h}:{event:e.members[0].event,undated:e.members[0].undated,groupIndex:xe(e.members[0].event),titleLines:e.titleLines,timeLines:e.timeLines,cardH:e.h,actorNames:(Array.isArray(e.members[0].event.actorIds)?e.members[0].event.actorIds:[]).map(e=>i.get(e)?.name||e),sources:(Array.isArray(e.members[0].event.sourceIds)?e.members[0].event.sourceIds:[]).map(e=>a.get(e)).filter(Boolean)}});return fe.length&&Se.push({id:`__runs__`,type:`scaleRunList`,position:{x,y:he+56+Lt},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,data:{runs:fe.map(e=>({run:e.run,events:e.members.map(e=>e.event)})),width:C-x,lh:18}}),{errors:[],nodes:Se,edges:[],layout:`scale`,eventCount:o.length,segments:v,gathered:fe.map(e=>({run:e.run,ids:e.members.map(e=>e.id)})),cards:de.map(e=>({id:e.id,lane:e.lane,level:e.level,x:e.x,y:e.y,w:e.w,h:e.h,ids:e.members.map(e=>e.id)})),undated:ce.filter(e=>e.undated).length,labelW:x,size:{width:C,height:be}}}function Yt(e,t){if(!e||!t||!e.width||!e.height)return 1;let n=t.width/(e.width*1.12),r=t.height/(e.height*1.12);return Math.min(n,r,1)}function jee(e,t){return!e||!t||!e.width?1:Math.min(t.width/(e.width*1.12),1)}var Xt={width:1600,height:900},Zt=(e,t)=>Math.round(e*Math.min(t,1)*10)/10;function Qt(e,t){let n=`Text on one screen (${e.canvas.width}×${e.canvas.height})`,r=Zt(e.font,e.open.fit),i=Zt(e.font,e.other.fit),a=e=>e.toFixed(1),o=[];e.open.fit>=1&&e.other.fit>=1?o.push(`${n}: full size (${e.font} px) either way.`):o.push(`${n}: ${a(r)} px as it opens (${e.open.name}), ${a(i)} px ${e.other.name}. Full size is ${e.font} px.`);let s=Math.max(r,i);if(s<9?o.push(`Note: the text is too small to read without zooming in (under 9 px). Consider ${t}; do not drop facts to make it fit.`):s<11&&o.push(`Note: the text is small (under 11 px); the reader can zoom in. ${t[0].toUpperCase()}${t.slice(1)} would make it easier to read.`),e.folded!==void 0&&s<11){let t=e.folded>=1?`full size (${e.font} px)`:`${a(Zt(e.font,e.folded))} px`;o.push(`With every issue folded the text is ${t}: the reader can fold issues ("Fold issues" in the bar) instead of your splitting it.`)}return o}var $t={envelope:[{name:`type`,req:`yes`,ty:`string`,note:`always "fact"`},Oe(2),{name:`title`,req:`yes`,ty:`string`,note:`diagram title, shown at the top left`}],actors:[{name:`id`,req:`yes`,ty:`string`,note:`unique within the diagram; events reference it via actorIds`},{name:`name`,req:`yes`,ty:`string`,note:`display name, e.g. "Huayuan Trading"`},{name:`role`,req:`no`,ty:`string`,note:`procedural standing, e.g. "plaintiff"`},{name:`groupId`,req:`*`,ty:`string`,note:`the side this party is on: the 1st or the 2nd group. Required with 2 or more parties; not written with one`}],groups:[{name:`id`,req:`yes`,ty:`string`,note:`parties (2 or more) or events (one party) reference it via groupId`},{name:`label`,req:`yes`,ty:`string`,note:`column heading, e.g. "Sun Hao's side" (parties) or "performance as agreed" (one party's acts)`},{name:``,req:``,ty:``,note:`at most 3: the 1st on the left (top) side, the 2nd on the right (bottom) side, the 3rd on the axis`},{name:``,req:``,ty:``,note:`2 or more parties: the groups split the parties. 0 or 1 party: they split the events by kind of act`}],sources:[{name:`id`,req:`yes`,ty:`string`,note:`events reference it via sourceIds`},{name:`type`,req:`yes`,ty:`string`,note:`contract / evidence / judgment / transcript, etc.`},{name:`name`,req:`yes`,ty:`string`,note:`material name, e.g. "corridor surveillance video"`},{name:`loc`,req:`no`,ty:`object`,note:`location, e.g. { file, page } or { file, timestamp }`},{name:`quote`,req:`no`,ty:`string`,note:`verbatim excerpt (several passages joined with ……), shown when the card is opened; a shortened or reworded version goes in detail`}],slots:[{name:`events`,req:`yes`,ty:`array`,note:`events at this time point; must not be empty`},{name:``,req:``,ty:``,note:`array order is chronological order; date is display-only and never reorders`}],events:[{name:`id`,req:`yes`,ty:`string`,note:`unique within the diagram`},{name:`date`,req:`no`,ty:`string`,note:`ISO 8601. Go to seconds when known, otherwise stop at the day. **Leave it out when the material gives no date: never make one up.** The card then says the date is unknown; the order is the order of slots, so nothing moves`},{name:`label`,req:`yes`,ty:`string`,note:`card title; about 20 characters per line, at most two lines`},{name:`dateEnd`,req:`no`,ty:`string`,note:`for a span, the end instant; needs date, and must not be earlier than it`},{name:`approx`,req:`no`,ty:`boolean`,note:`time is not exact (estimated or inferred); the diagram shows "approx."`},{name:`dateNote`,req:`no`,ty:`string`,note:`why the time is not exact, and how it was derived`},{name:`summary`,req:`no`,ty:`string`,note:`the line under the card title; about 22 characters`},{name:`detail`,req:`no`,ty:`string`,note:`full text revealed when the card is opened`},{name:`actorIds`,req:`no`,ty:`string[]`,note:`parties involved. One: that party's side and column. Two or more, or none: the centre axis`},{name:`groupId`,req:`*`,ty:`string`,note:`only when the diagram has 0 or 1 party: which side this event falls on. With 2 or more parties, leave it out`},{name:`sourceIds`,req:`no`,ty:`string[]`,note:`which materials it rests on`}]};function Mee(){let e=[`Fields of a fact spec. "yes" means required.`,``];for(let[t,n]of Object.entries($t)){e.push(`[${t}]`);for(let t of n)t.name?e.push(` ${t.name.padEnd(12)} ${t.req.padEnd(3)} ${t.ty.padEnd(15)} ${t.note}`):e.push(` · ${t.note}`);e.push(``)}return e.push(`"*": required or not depending on the number of parties, as the note says.`),e.push(`Cross-field rules (dangling references, a span running backwards, a party without a`),e.push(`side, two events in the same lane of one time slot) are not listed`),e.push(`above: call antu_validate after writing. It reports each problem with its field path.`),e.join(`
|
|
1426
|
+
import{execFileSync as e,spawn as t,spawnSync as n}from"node:child_process";import{existsSync as r,mkdtempSync as i,readFileSync as a,rmSync as o,statSync as s,writeFileSync as c}from"node:fs";import{tmpdir as l}from"node:os";import{basename as u,dirname as d,join as f,resolve as p}from"node:path";import{fileURLToPath as m,pathToFileURL as h}from"node:url";import{createHash as g}from"node:crypto";var _=Object.create,v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,x=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,C=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ee=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=b(t),a=0,o=i.length,s;a<o;a++)s=i[a],!S.call(e,s)&&s!==n&&v(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=y(t,s))||r.enumerable});return e},w=(e,t,n)=>(n=e==null?{}:_(x(e)),ee(t||!e||!e.__esModule||!S.call(e,`default`)?v(n,`default`,{value:e,enumerable:!0}):n,e)),te=(e,t=8)=>Math.ceil(e/t-1e-9)*t,ne={minH:40,minW:120,stepW:40,gap:24,levelGap:48,padX:12,padY:6},re={hair:.75,normal:1.1,strong:1.75,heavy:2.5},ie={solid:void 0,dashed:`6 4`,dotted:`2 3`,longDash:`10 4`,dashDot:`10 3 2 3`},ae=e=>Math.max(ne.minW,Math.ceil(e/ne.stepW-1e-9)*ne.stepW),oe=e=>Math.max(ne.minH,te(e)),se=[`document`,`modern`,`legal`,`dark`],ce={equity:{width:re.normal},control:{width:re.heavy},contract:{width:re.normal,dash:ie.longDash},debt:{width:re.strong,dash:ie.dashDot},guarantee:{width:re.normal,dash:ie.dashed},kinship:{width:3.6,double:!0},employment:{width:re.normal,dash:ie.dotted},agency:{width:re.strong,dash:`1 4`,round:!0},other:{width:re.hair,dash:`3 3`}},le={equity:{width:.85},control:{width:1.9},contract:{width:.85,dash:`5 3`},debt:{width:1.3,dash:`5 2 1.5 2`},guarantee:{width:.85,dash:`4 3`},kinship:{width:3.2,double:!0},employment:{width:.85,dash:ie.dotted},agency:{width:1.3,dash:`1 4`,round:!0},other:{width:.6,dash:`3 3`}},ue=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,{...n,stroke:t}])),de={neutral:{width:re.normal},positive:{width:re.strong},negative:{width:re.normal,dash:ie.dashed}},fe={main:{width:re.strong},plain:{width:re.normal},back:{width:re.normal,dash:ie.dashed}},pe={conclusion:{width:re.heavy},norm:{width:re.normal},element:{width:re.normal},fact:{width:re.hair},inference:{width:re.normal,dash:ie.dotted},judgement:{width:re.strong}},me={for:{width:re.normal},against:{width:re.strong,dash:ie.dashed},basis:{width:re.normal,dash:ie.dotted}},he=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,{...n,...t[e]}])),ge={document:{id:`document`,scheme:`light`,shadowRgb:`17, 17, 17`,chrome:{radius:2,capsule:2,chip:2,bg:`#ffffff`,bgPop:`#ffffff`,border:`1px solid #111111`,shadow:`none`,blur:`none`},labelKey:`theme.document`,font:{body:`"FangSong", "STFangsong", "FangSong_GB2312", "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif`,head:`"SimHei", "Heiti SC", "STHeiti", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#111111`,ink2:`#2b2b2b`,ink3:`#4d4d4d`,ink4:`#767676`,bg:`#ffffff`,canvas:`#ffffff`,frame:`#111111`,line:`#c9c9c9`,chip:`#f0f0f0`,side1:`#111111`,side2:`#555555`,axis:`#767676`,dots:`#e8ebef`,mini:`#cbd5e1`,miniGhost:`#eef1f5`,exportBg:`#ffffff`,labelBg:`rgba(255, 255, 255, 0.85)`},radius:{person:18,company:3,organization:3,government:3,other:3,pill:2,group:12},entity:{person:{stroke:`#111111`,fill:`#ffffff`,width:1.3},company:{stroke:`#111111`,fill:`#ffffff`,width:1.6},organization:{stroke:`#111111`,fill:`#ffffff`,width:1.3,dash:ie.dashed},government:{stroke:`#111111`,fill:`#ffffff`,width:1.3},other:{stroke:`#555555`,fill:`#ffffff`,width:1.1,dash:ie.dotted}},relation:ue(le,`#767676`),camp:[{fill:`#ffffff`,stroke:`#111111`,text:`#111111`},{fill:`#ececec`,stroke:`#111111`,text:`#111111`},{fill:`#f7f7f7`,stroke:`#8a8a8a`,text:`#4d4d4d`}],group:{fill:`#f5f5f5`,stroke:`#8a8a8a`,title:`#111111`},campBox:{fill:`none`,stroke:`#111111`,width:.75,dash:`2 3`},flow:{outcome:he(de,{neutral:{stroke:`#111111`,fill:`#ffffff`},positive:{stroke:`#111111`,fill:`#ffffff`},negative:{stroke:`#111111`,fill:`#ececec`}}),start:{stroke:`#111111`,fill:`#e2e2e2`},state:{warn:{stroke:`#a16207`,fill:`#fef3c7`},stop:{stroke:`#b91c1c`,fill:`#fee2e2`},done:{stroke:`#15803d`,fill:`#dcfce7`}},note:{stroke:`none`,fill:`#f5f5f5`,fold:`#767676`},stage:{fill:`#f5f5f5`,stroke:`#8a8a8a`,title:`#111111`},stageLit:{fill:`#e2e2e2`,stroke:`#111111`,title:`#111111`},link:he(fe,{main:{stroke:`#111111`},plain:{stroke:`#2b2b2b`},back:{stroke:`#4d4d4d`}})},justify:{node:he(pe,{conclusion:{stroke:`#111111`,fill:`#ffffff`},norm:{stroke:`#111111`,fill:`#ececec`},element:{stroke:`#111111`,fill:`#ffffff`},fact:{stroke:`#111111`,fill:`#ffffff`},inference:{stroke:`#111111`,fill:`#ffffff`},judgement:{stroke:`#111111`,fill:`#ececec`}}),stance:he(me,{for:{stroke:`#2b2b2b`},against:{stroke:`#111111`},basis:{stroke:`#4d4d4d`}})},pill:{colored:!1,border:`#111111`}},modern:{id:`modern`,scheme:`light`,shadowRgb:`15, 23, 42`,chrome:{radius:14,capsule:999,chip:999,bg:`rgba(255, 255, 255, 0.78)`,bgPop:`rgba(255, 255, 255, 0.94)`,border:`1px solid rgba(15, 23, 42, 0.07)`,shadow:`0 4px 18px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.06)`,blur:`blur(16px) saturate(1.8)`},labelKey:`theme.modern`,font:{body:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`,head:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#0f172a`,ink2:`#475569`,ink3:`#64748b`,ink4:`#94a3b8`,bg:`#fbfcfd`,canvas:`#fbfcfd`,frame:`#e2e8f0`,line:`#e8ebef`,chip:`#f1f4f8`,side1:`#475569`,side2:`#64748b`,axis:`#94a3b8`,dots:`#e8ebef`,mini:`#cbd5e1`,miniGhost:`#eef1f5`,exportBg:`#ffffff`,labelBg:`rgba(255, 255, 255, 0.85)`},radius:{person:14,company:8,organization:8,government:6,other:8,pill:12,group:12},entity:{person:{stroke:`#94a3b8`,fill:`#f1f5f9`,width:1},company:{stroke:`#334155`,fill:`#ffffff`,width:1.25},organization:{stroke:`#94a3b8`,fill:`#ffffff`,width:1,dash:ie.dashed},government:{stroke:`#64748b`,fill:`#f8fafc`,width:1},other:{stroke:`#94a3b8`,fill:`#f8fafc`,width:.9,dash:ie.dotted}},relation:ue(ce,`#475569`),camp:[{fill:`#f1f5f9`,stroke:`#94a3b8`,text:`#334155`},{fill:`#ffffff`,stroke:`#94a3b8`,text:`#334155`},{fill:`#f8fafc`,stroke:`#e2e8f0`,text:`#64748b`}],group:{fill:`#f8fafc`,stroke:`#e2e8f0`,title:`#475569`},campBox:{fill:`#f8fafc`,stroke:`#e2e8f0`,width:1},flow:{outcome:he(de,{neutral:{stroke:`#64748b`,fill:`#f8fafc`},positive:{stroke:`#334155`,fill:`#f1f5f9`},negative:{stroke:`#64748b`,fill:`#f1f5f9`}}),start:{stroke:`#334155`,fill:`#e2e8f0`},state:{warn:{stroke:`#b45309`,fill:`#fffbeb`},stop:{stroke:`#be123c`,fill:`#fff1f2`},done:{stroke:`#047857`,fill:`#ecfdf5`}},note:{stroke:`none`,fill:`#f1f5f9`,fold:`#94a3b8`},stage:{fill:`#f8fafc`,stroke:`#e2e8f0`,title:`#475569`},stageLit:{fill:`#f1f5f9`,stroke:`#64748b`,title:`#334155`},link:he(fe,{main:{stroke:`#0f172a`},plain:{stroke:`#475569`},back:{stroke:`#64748b`}})},justify:{node:he(pe,{conclusion:{stroke:`#0f172a`,fill:`#f1f5f9`},norm:{stroke:`#475569`,fill:`#e2e8f0`},element:{stroke:`#64748b`,fill:`#f8fafc`},fact:{stroke:`#94a3b8`,fill:`#ffffff`},inference:{stroke:`#64748b`,fill:`#f8fafc`},judgement:{stroke:`#334155`,fill:`#e2e8f0`}}),stance:he(me,{for:{stroke:`#475569`},against:{stroke:`#334155`},basis:{stroke:`#94a3b8`}})},pill:{colored:!1,border:`#cbd5e1`}},legal:{id:`legal`,scheme:`light`,shadowRgb:`19, 35, 63`,chrome:{radius:6,capsule:6,chip:4,bg:`#ffffff`,bgPop:`#ffffff`,border:`1px solid #c7d2e4`,shadow:`0 2px 10px rgba(19, 35, 63, 0.10)`,blur:`none`},labelKey:`theme.legal`,font:{body:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`,head:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#13233f`,ink2:`#2d4366`,ink3:`#5b6f8f`,ink4:`#8aa0c4`,bg:`#ffffff`,canvas:`#ffffff`,frame:`#c7d2e4`,line:`#dbe3f0`,chip:`#eef3fb`,side1:`#1f3f7f`,side2:`#9a1b1b`,axis:`#8aa0c4`,dots:`#e8ebef`,mini:`#cbd5e1`,miniGhost:`#eef1f5`,exportBg:`#ffffff`,labelBg:`rgba(255, 255, 255, 0.85)`},radius:{person:14,company:3,organization:4,government:3,other:4,pill:4,group:6},entity:{person:{stroke:`#2f5aa8`,fill:`#eef3fb`,width:1},company:{stroke:`#1f3f7f`,fill:`#e3ecfa`,width:1.5},organization:{stroke:`#2f5aa8`,fill:`#f4f7fc`,width:1,dash:ie.dashed},government:{stroke:`#13233f`,fill:`#eef3fb`,width:1.1},other:{stroke:`#8aa0c4`,fill:`#f8fafd`,width:.9,dash:ie.dotted}},relation:{equity:{...ce.equity,stroke:`#1f3f7f`},control:{...ce.control,stroke:`#13233f`},contract:{...ce.contract,stroke:`#5b6f8f`},debt:{...ce.debt,stroke:`#9a1b1b`},guarantee:{...ce.guarantee,stroke:`#2f5aa8`},kinship:{...ce.kinship,stroke:`#4b3a8c`},employment:{...ce.employment,stroke:`#1d6b6b`},agency:{...ce.agency,stroke:`#1d6b6b`},other:{...ce.other,stroke:`#8aa0c4`}},camp:[{fill:`#eaf0fb`,stroke:`#9fb6e0`,text:`#1f3f7f`},{fill:`#fbecec`,stroke:`#e3b4b4`,text:`#9a1b1b`},{fill:`#f4f7fc`,stroke:`#c7d2e4`,text:`#5b6f8f`}],group:{fill:`#f4f7fc`,stroke:`#c7d2e4`,title:`#2d4366`},campBox:{fill:`#f4f7fc`,stroke:`#c7d2e4`,width:1},flow:{outcome:he(de,{neutral:{stroke:`#2f5aa8`,fill:`#eef3fb`},positive:{stroke:`#1f3f7f`,fill:`#e3ecfa`},negative:{stroke:`#9a1b1b`,fill:`#fbecec`}}),start:{stroke:`#13233f`,fill:`#dbe5f5`},state:{warn:{stroke:`#a16207`,fill:`#fdf6e3`},stop:{stroke:`#9a1b1b`,fill:`#fbecec`},done:{stroke:`#1f6f43`,fill:`#e8f4ec`}},note:{stroke:`none`,fill:`#f4f7fc`,fold:`#8aa0c4`},stage:{fill:`#f4f7fc`,stroke:`#c7d2e4`,title:`#2d4366`},stageLit:{fill:`#eaf0fb`,stroke:`#1f3f7f`,title:`#1f3f7f`},link:he(fe,{main:{stroke:`#13233f`},plain:{stroke:`#2d4366`},back:{stroke:`#5b6f8f`}})},justify:{node:he(pe,{conclusion:{stroke:`#1f3f7f`,fill:`#e3ecfa`},norm:{stroke:`#4b3a8c`,fill:`#efecf8`},element:{stroke:`#2f5aa8`,fill:`#eef3fb`},fact:{stroke:`#8aa0c4`,fill:`#f8fafd`},inference:{stroke:`#1d6b6b`,fill:`#e8f4f4`},judgement:{stroke:`#13233f`,fill:`#dbe5f5`}}),stance:he(me,{for:{stroke:`#2d4366`},against:{stroke:`#9a1b1b`},basis:{stroke:`#4b3a8c`}})},pill:{colored:!0,border:`#c7d2e4`}},dark:{id:`dark`,scheme:`dark`,shadowRgb:`226, 232, 240`,chrome:{radius:14,capsule:999,chip:999,bg:`rgba(24, 29, 37, 0.82)`,bgPop:`rgba(28, 34, 43, 0.96)`,border:`1px solid rgba(255, 255, 255, 0.09)`,shadow:`0 4px 18px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3)`,blur:`blur(16px) saturate(1.4)`},labelKey:`theme.dark`,font:{body:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`,head:`system-ui, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif`},color:{ink:`#e6ebf2`,ink2:`#b6c0cf`,ink3:`#8b97a9`,ink4:`#6b778a`,bg:`#14181f`,canvas:`#14181f`,frame:`#2a3240`,line:`#262d38`,chip:`#1e2530`,side1:`#9fb3d1`,side2:`#7f8aa0`,axis:`#6b778a`,dots:`#232a35`,mini:`#4a5568`,miniGhost:`#232a35`,exportBg:`#14181f`,labelBg:`rgba(20, 24, 31, 0.85)`},radius:{person:14,company:8,organization:8,government:6,other:8,pill:12,group:12},entity:{person:{stroke:`#8b97a9`,fill:`#1f2733`,width:1},company:{stroke:`#cbd5e1`,fill:`#1a2029`,width:1.25},organization:{stroke:`#8b97a9`,fill:`#161b22`,width:1,dash:ie.dashed},government:{stroke:`#a3b0c4`,fill:`#1c2430`,width:1},other:{stroke:`#6b778a`,fill:`#171c24`,width:.9,dash:ie.dotted}},relation:ue(ce,`#a3b0c4`),camp:[{fill:`#1f2733`,stroke:`#6b778a`,text:`#d3dbe7`},{fill:`#161b22`,stroke:`#6b778a`,text:`#d3dbe7`},{fill:`#1a2029`,stroke:`#2f3846`,text:`#8b97a9`}],group:{fill:`#1a2029`,stroke:`#2f3846`,title:`#b6c0cf`},campBox:{fill:`#1a2029`,stroke:`#2f3846`,width:1},flow:{outcome:he(de,{neutral:{stroke:`#8b97a9`,fill:`#1a2029`},positive:{stroke:`#d3dbe7`,fill:`#1f2733`},negative:{stroke:`#8b97a9`,fill:`#1f2733`}}),start:{stroke:`#d3dbe7`,fill:`#2a3240`},state:{warn:{stroke:`#e0a63a`,fill:`#2e2410`},stop:{stroke:`#f0707a`,fill:`#33161a`},done:{stroke:`#4cc38a`,fill:`#10281d`}},note:{stroke:`none`,fill:`#1f2733`,fold:`#6b778a`},stage:{fill:`#1a2029`,stroke:`#2f3846`,title:`#b6c0cf`},stageLit:{fill:`#232c3a`,stroke:`#8b97a9`,title:`#e6ebf2`},link:he(fe,{main:{stroke:`#e6ebf2`},plain:{stroke:`#b6c0cf`},back:{stroke:`#8b97a9`}})},justify:{node:he(pe,{conclusion:{stroke:`#e6ebf2`,fill:`#1f2733`},norm:{stroke:`#b6c0cf`,fill:`#2a3240`},element:{stroke:`#8b97a9`,fill:`#1a2029`},fact:{stroke:`#6b778a`,fill:`#161b22`},inference:{stroke:`#8b97a9`,fill:`#1a2029`},judgement:{stroke:`#cbd5e1`,fill:`#2a3240`}}),stance:he(me,{for:{stroke:`#b6c0cf`},against:{stroke:`#e6ebf2`},basis:{stroke:`#6b778a`}})},pill:{colored:!1,border:`#3a4455`}}},_e=e=>Object.prototype.hasOwnProperty.call(ge,e),ve=new Map,ye=[`experimental`,`stable`,`deprecated`];function be(e,t){if(!e)throw Error(`registerKnowledge: type must not be empty`);if(!t?.validate)throw Error(`registerKnowledge: validate is required`);if(!t?.describe)throw Error(`registerKnowledge: describe is required (the agent-facing field table)`);if(!Number.isInteger(t.specVersion)||t.specVersion<1)throw Error(`registerKnowledge: specVersion is required, a whole number (the generation of this type's JSON format, core/specVersion.js)`);xe(e,t),ve.set(e,t)}function xe(e,t){let n=Object.keys(t.layouts??{}),r=Object.keys(t.diagrams??{});for(let t of n)if(!r.includes(t))throw Error(`registerKnowledge: ${e}/${t} has a layout but no entry in diagrams (version, status, since)`);for(let t of r)if(!n.includes(t))throw Error(`registerKnowledge: ${e}/${t} is in diagrams but has no layout`);for(let[n,r]of Object.entries(t.diagrams??{})){if(!Number.isInteger(r.version)||r.version<1)throw Error(`registerKnowledge: ${e}/${n}: version must be a whole number >= 1`);if(!ye.includes(r.status))throw Error(`registerKnowledge: ${e}/${n}: status must be one of ${ye.join(`, `)}`);if(!/^\d+\.\d+\.\d+$/.test(r.since??``))throw Error(`registerKnowledge: ${e}/${n}: since must be a release number such as 0.7.0`)}}function Se(e){let t=ve.get(e);return Object.entries(t?.diagrams??{}).map(([t,n])=>({type:e,kind:t,...n}))}function Ce(e){return ve.get(e)}function we(){return[...ve.entries()].map(([e,t])=>({type:e,labelKey:t.label??`graphType.${e}`}))}function Te(e){return ve.get(e)?.validate}function Ee(e,t){let n=ve.get(e)?.layouts;if(n)return t&&n[t]?n[t]:Object.values(n)[0]}function De(e){return Object.keys(ve.get(e)?.layouts??{})}var Oe=e=>({name:`specVersion`,req:`no`,ty:`integer`,note:`which generation of this format the file follows (now ${e}); omit = the current one. Write it: it is how an older file is recognised after a breaking change`});function ke(e,t){return e.specVersion===void 0?null:!Number.isInteger(e.specVersion)||e.specVersion<1?{key:`err.specVersionForm`,params:{value:JSON.stringify(e.specVersion)}}:Number.isInteger(t)&&e.specVersion>t?{key:`err.specVersionNewer`,params:{value:e.specVersion,known:t,type:e.type}}:null}var Ae={"common.none":`(none)`,"common.close":`Close`,"common.untitled":`Antu`,"fallback.invalidTitle":({n:e})=>`This data cannot be rendered (${e} problem${e===1?``:`s`})`,"fallback.noRendererTitle":({type:e})=>`No renderer registered for type = "${e}"`,"fallback.registered":({list:e})=>`Registered: ${e}`,"fallback.noInlineData":`No inline data found in this file. Something went wrong when it was generated; please regenerate the HTML.`,"fallback.devNoData":`The dev server received no data. Specify one with ?example=0 or ?spec=examples/some-file.json.`,"error.renderTitle":`Rendering failed`,"error.renderHint":`The data itself may be fine (validation passed); this rendering kind threw an error. Send the text below to the developer, or try another rendering kind.`,"info.span":({from:e,to:t})=>`${e} to ${t}`,"info.slots":({n:e})=>`${e} time slot${e===1?``:`s`}`,"info.actors":({n:e})=>`${e} part${e===1?`y`:`ies`}`,"info.sources":({n:e})=>`${e} source${e===1?``:`s`}`,"info.nodes":({n:e})=>`${e} node${e===1?``:`s`}`,"info.stages":({n:e})=>`${e} stage${e===1?``:`s`}`,"dock.actors":`Parties`,"dock.summary":`Summary`,"dock.sources":`Sources`,"dock.orientation":`Which way the levels run: vertical, top to bottom; horizontal, left to right.`,"dock.orientationCamps":`Which way the levels run: vertical, top to bottom; horizontal, left to right. With the camps boxed they stand across that way: side by side when vertical, one under the other when horizontal, so the picture can look the other way round.`,"dock.vertical":`Vertical`,"dock.horizontal":`Horizontal`,"dock.grid":`Grid`,"dock.stagger":`Stagger`,"dock.byParty":`Lane per party`,"dock.staggerHint":`Let cards in different columns overlap by half a row, so the diagram is shorter and its text larger`,"dock.exportImage":`Export image`,"dock.exporting":`Exporting…`,"dock.exportTitle":`Export the whole diagram as a PNG (2× resolution)`,"dock.lang":`Language`,"dock.fold":`Fold`,"dock.display":`Display`,"export.failed":({message:e})=>`Export failed: ${e}`,"dock.langEn":`EN`,"dock.langZh":`中文`,"card.sources":({n:e})=>`${e} source${e===1?``:`s`}`,"card.sourcesUnlisted":`No sources listed`,"card.sourcesList":({n:e,names:t})=>`${e} source${e===1?``:`s`}: ${t}`,"card.duration":({duration:e})=>`Duration ${e}`,"card.approxPrefix":`approx. `,"card.dateUnknown":`date unknown`,"card.unitDay":({n:e})=>`${e} day${e===1?``:`s`}`,"card.unitHour":({n:e})=>`${e} hour${e===1?``:`s`}`,"card.unitMinute":({n:e})=>`${e} min`,"card.unitSecond":({n:e})=>`${e} sec`,"card.ariaLabel":({label:e,date:t})=>t?`${e}, ${t}`:e,"card.dateNote":({note:e})=>`Time note: ${e}`,"card.previewHint":`Click a card to read the full text`,"flow.conditions":`Conditions`,"flow.detail":`Detail`,"flow.mainLine":`Main line`,"flow.states":`States`,"flow.stages":`Stages`,"flow.rules":`Rules`,"flow.linkStraight":`Straight`,"flow.linkCurved":`Curved`,"flow.linkStyle":`Link style`,"rule.tableTitle":`Rules`,"rule.tableNote":`What may happen along the way; not steps of the flow`,"rule.tableNoteContract":`What may happen while the contract runs; not steps of the flow`,"rule.colWhen":`If`,"rule.colThen":`Then`,"rule.colScope":`Stages`,"rule.groupEnd":({end:e})=>`May lead to “${e}”`,"rule.groupRest":`Other rules`,"rule.count":({n:e})=>`${e}`,"rule.anyOf":`Any of:`,"rule.tScopeAll":`Throughout`,"rule.tScopeRange":({from:e,to:t})=>`${e} → ${t}`,"flow.ruleBadge":({n:e})=>e===1?`1 rule`:`${e} rules`,"flow.noteTag":`Note`,"rule.if":`If`,"rule.or":`, or `,"flow.previewHint":`Click a node to read the full text`,"aria.nodeDefault":`Press enter or space to select this node.`,"aria.nodeKeyboardDisabled":`Press enter or space to select this node. Once selected, use the arrow keys to move it.`,"aria.nodeMoved":({x:e,y:t})=>`Node moved. New position: x ${e}, y ${t}`,"aria.edgeDefault":`Press enter or space to select this connection.`,"aria.controls":`Canvas controls`,"aria.zoomIn":`Zoom in`,"aria.zoomOut":`Zoom out`,"aria.fitView":`Fit view`,"aria.interactive":`Toggle interactivity`,"aria.minimap":`Minimap`,"aria.handle":`Connection point`,"sourceType.statute":`Statute`,"sourceType.case":`Case`,"sourceType.contract":`Contract`,"sourceType.evidence":`Evidence`,"sourceType.document":`Document`,"sourceType.web":`Web`,"sourceType.other":`Other`,"graphKind.timeline":`Timeline`,"graphKind.flow":`Flowchart`,"header.theme":`Theme`,"theme.document":`Document`,"theme.modern":`Modern`,"theme.legal":`Legal`,"theme.dark":`Dark`,"header.kindOpen":({n:e})=>`All ${e} ways of drawing`,"header.kindPrev":`Previous way of drawing`,"header.kindNext":`Next way of drawing`,"header.kindGroup":`Way of drawing`,"header.fold":`Fold the card`,"header.unfold":`Show the card`,"graphKind.chronicle":`Chronicle`,"graphKind.scale":`Time scale`,"scale.segment":({n:e,unit:t,count:n})=>`Segment ${e} · ${t} · ${n} event${n===1?``:`s`}`,"scale.unit.year":`by year`,"scale.unit.month":`by month`,"scale.unit.day":`by day`,"scale.unit.hour":`by hour`,"scale.unit.minute":`by minute`,"scale.other":`Other`,"scale.events":`Events`,"scale.undated":`date unknown · placed by order`,"scale.coarse.day":`that day (time unknown)`,"scale.coarse.month":`that month (day unknown)`,"scale.coarse.year":`that year (month unknown)`,"scale.run":({n:e})=>`${e} events`,"scale.runListed":({n:e})=>`${e} events too close to show one by one:`,"chronicle.gapSeconds":({n:e})=>`+${e} s`,"chronicle.gapMinutes":({n:e})=>`+${e} min`,"chronicle.gapHours":({n:e})=>`+${e} h`,"chronicle.gapHoursMinutes":({h:e,m:t})=>`+${e} h ${t} min`,"chronicle.gapDays":({n:e})=>`${e} day${e===1?``:`s`} later`,"chronicle.gapMonths":({n:e})=>`${e} month${e===1?``:`s`} later`,"chronicle.gapYears":({n:e})=>`${e} year${e===1?``:`s`} later`,"chronicle.gapYearsMonths":({y:e,m:t})=>`${e} yr ${t} mo later`,"chronicle.dateUnknown":`Date unknown`,"graphType.fact":`Fact`,"graphType.relationship":`Relationship`,"graphType.procedure":`Procedure`,"graphType.justification":`Justification`,"err.notObject":({at:e})=>`${e}: must be an object`,"err.notArray":({at:e})=>`${e} must be an array`,"err.required":({at:e,field:t})=>`${e}: missing required field \`${t}\``,"err.mustBeString":({at:e,field:t})=>`${e}: \`${t}\` must be a string`,"err.duplicateId":({at:e,id:t})=>`${e}: duplicate id "${t}"`,"err.missingRef":({at:e,field:t,kind:n,id:r})=>`${e}: ${t} refers to a non-existent ${n} "${r}"`,"err.tooManyGroups":({at:e,max:t,actual:n})=>`${e}: at most ${t} groups (the axis has two sides plus the centre), got ${n}`,"err.slotsEmpty":"`slots` must not be empty","err.slotEventsEmpty":({at:e})=>`${e}.events must not be empty (an empty time slot carries no meaning)`,"err.slotEventEmptyShape":({at:e})=>`${e}: must be an object of the form { events: [ … ] }`,"err.oneEventPerCell":({at:e,a:t,b:n})=>`${e}: two events share the same lane in one time slot ("${t}" and "${n}"); one cell holds one event`,"err.badDate":({at:e,field:t,value:n})=>`${e}: \`${t}\` is not ISO 8601 (e.g. 2017-05-02T09:24:03), got "${n}"`,"err.dateEndNeedsDate":({at:e})=>`${e}: \`dateEnd\` is written but \`date\` is not; a span needs its start`,"err.dateEndBeforeDate":({at:e,end:t,start:n})=>`${e}: \`dateEnd\` (${t}) is earlier than \`date\` (${n}); a span cannot run backwards`,"err.summaryTooLong":({at:e,max:t,actual:n})=>`${e}: \`summary\` is too wide for one line (about ${n} full-width characters, limit ${t}); shorten it or move the text to detail`,"err.groupNeedsOneActor":({at:e,groupId:t,n})=>`${e}: a side group ("${t}") must name exactly one party (currently ${n}); events that involve no particular party belong in the centre group or should omit groupId`,"err.multiActorNeedsAxis":({at:e,n:t,groupId:n})=>`${e}: an event with ${t} parties belongs on the centre axis, but groupId points at a side group ("${n}"); the two contradict each other`,"err.viewsRemoved":"`views` is no longer part of the format (placement rules v1): delete it. A diagram has one placement: with 2 or more parties, write `groupId` on each party (its side); with 1 party, on the events","err.actorNeedsGroup":({at:e,n:t})=>`${e}: the diagram has ${t} parties, so each party says which side it is on: write \`groupId\` with the 1st or the 2nd of \`groups\` (add \`groups\` if there are none)`,"err.actorGroupNotSide":({at:e,groupId:t})=>`${e}: \`groupId\` "${t}" is the 3rd group, the axis; a party belongs to the 1st or the 2nd group (a side)`,"err.actorGroupOneParty":({at:e})=>`${e}: a party carries \`groupId\` only when the diagram has 2 or more parties; with one party the groups split the events, so write \`groupId\` on the events`,"err.eventGroupWithParties":({at:e})=>`${e}: the diagram has 2 or more parties, so the groups belong to the parties and an event is placed by its \`actorIds\`: delete the event's \`groupId\` (one party → that party's side; several or none → the axis)`,"err.specNotObject":`a spec must be a JSON object`,"err.envelopeTypeRequired":"missing required field `type` (the engine uses it to pick a renderer)","err.envelopeTypeString":"`type` must be a string","err.envelopeTypeUnknown":'`type` is "{type}", which is not a diagram type; expected one of {list}',"err.envelopeTypeIsKind":'`type` is "{type}", which is a way of drawing a {owner} diagram, not a type: write `"type": "{owner}"` (the way it is drawn is chosen on the page, not in the JSON)',"err.envelopeTitleString":"`title` must be a string","err.specVersionForm":"`specVersion` must be a whole number from 1 up, got {value}","err.specVersionNewer":'`specVersion` is {value}, newer than this engine knows for "{type}" ({known}): update the engine, or write the file for the older format',"err.slotNotArray":"`slots` must be an array (one slot = one time point)","err.slotShape":({at:e})=>`${e}: must be an object of the form { events: [ … ] }`,"err.eventsNotArray":({at:e})=>`${e}.events must be an array`,"rerr.entitiesEmpty":"`entities` must not be empty (a diagram needs at least two parties)","rerr.relationsEmpty":"`relations` must not be empty (the parties have to be related)","rerr.notArray":({field:e})=>`\`${e}\` must be an array`,"rerr.notObject":({at:e})=>`${e}: must be an object`,"rerr.required":({at:e,field:t})=>`${e}: missing required field \`${t}\``,"rerr.duplicateId":({at:e,id:t,what:n})=>`${e}: id "${t}" duplicates an earlier ${n}`,"rerr.badEntityKind":({at:e,value:t,allowed:n})=>`${e}: kind is "${t}", which is not one of: ${n}`,"rerr.badRelationKind":({at:e,value:t,allowed:n})=>`${e}: kind is "${t}", which is not one of: ${n}`,"rerr.badSourceType":({at:e,value:t,allowed:n})=>`${e}: \`type\` "${t}" is not one of ${n}`,"rerr.mustBeString":({at:e,field:t})=>`${e}: \`${t}\` must be a non-empty string`,"rerr.mustBeBoolean":({at:e,field:t})=>`${e}: \`${t}\` must be true or false`,"rerr.badRef":({at:e,field:t,kind:n,id:r})=>`${e}: \`${t}\` refers to a non-existent ${n} "${r}"`,"rerr.badEnd":({at:e,end:t,id:n})=>`${e}: \`${t}\` refers to a non-existent entity "${n}"`,"rerr.selfRelation":({at:e,id:t})=>`${e}: an entity cannot be related to itself ("${t}" on both ends)`,"rerr.duplicateRelation":({at:e,from:t,to:n,kind:r})=>`${e}: duplicate relation ${t} -> ${n} (${r}, same label); give the second one its own label, or drop it`,"rerr.fieldNotHere":({at:e,field:t,kinds:n})=>`${e}: \`${t}\` only belongs on a relation of kind ${n}`,"rerr.badShare":({at:e,value:t})=>`${e}: \`share\` must be a number from 0 to 100, got ${t}`,"rerr.badSecures":({at:e,id:t})=>`${e}: \`secures\` refers to a non-existent relation "${t}"`,"rerr.securesNotClaim":({at:e,id:t,kind:n,claims:r})=>`${e}: \`secures\` points at relation "${t}", which is a ${n}; a guarantee secures a claim (${r})`,"rerr.badAsOf":({value:e})=>`asOf: "${e}" is not an ISO date (YYYY, YYYY-MM or YYYY-MM-DD)`,"rhint.shareOver100":({id:e,label:t,total:n})=>`entities (${e}): the shares held in "${t}" add up to ${n}%, more than the whole; check the figures or the source`,"rhint.isolated":({id:e,label:t})=>`entities (${e}): "${t}" has no relation to anyone, so it will float beside the diagram; relate it or drop it`,"rhint.noSecures":({id:e})=>`relations (${e}): a guarantee that does not say which claim it secures; add \`secures\` with that relation's id`,"rhint.tooLarge":({n:e,limit:t})=>`${e} entities: past about ${t} the diagram gets hard to read on one screen; consider splitting it by group`,"rhint.tooManyRelations":({n:e,limit:t})=>`${e} relations: past about ${t} the graph can take several seconds to draw (each change of orientation or groups draws it again); consider splitting it by group, or use another way of drawing`,"rhint.equityCycle":({path:e})=>`shareholdings loop back (${e}); allowed, but check it is what the registry says`,"rel.kind.equity":`Equity`,"rel.kind.control":`Control`,"rel.kind.contract":`Contracts`,"rel.kind.debt":`Debts`,"rel.kind.guarantee":`Guarantees`,"rel.kind.kinship":`Family`,"rel.kind.employment":`Employment`,"rel.kind.agency":`Agency`,"rel.kind.other":`Other`,"rel.kindChipTitle":({n:e})=>e===1?`Show or hide this kind (1 relation)`:`Show or hide this kind (${e} relations)`,"rel.labels":`Labels`,"rel.groups":`Groups`,"rel.previewHint":`Click a party to read the full text`,"rel.auto.equity":({share:e})=>e===void 0?`Holds shares`:`Holds ${e}%`,"rel.auto.control":`Controls`,"rel.auto.contract":({amount:e})=>e?`Contract, ${e}`:`Contract`,"rel.auto.debt":({amount:e})=>e?`Claim, ${e}`:`Claim`,"rel.auto.guarantee":`Guarantee`,"rel.auto.kinship":`Family`,"rel.auto.employment":`Employment`,"rel.auto.agency":`Agency`,"rel.auto.other":`Related`,"info.entities":({n:e})=>`${e} part${e===1?`y`:`ies`}`,"info.relations":({n:e})=>`${e} relation${e===1?``:`s`}`,"info.links":({n:e})=>`${e} link${e===1?``:`s`}`,"jerr.nodesEmpty":"`nodes` must not be empty (a justification needs at least a conclusion and what supports it)","jerr.linksEmpty":"`links` must not be empty (the nodes have to support one another)","jerr.notArray":({field:e})=>`\`${e}\` must be an array`,"jerr.notObject":({at:e})=>`${e}: must be an object`,"jerr.required":({at:e,field:t})=>`${e}: missing required field \`${t}\``,"jerr.duplicateId":({at:e,id:t,what:n})=>`${e}: id "${t}" duplicates an earlier ${n}`,"jerr.mustBeString":({at:e,field:t})=>`${e}: \`${t}\` must be a non-empty string`,"jerr.badNodeKind":({at:e,value:t,allowed:n})=>`${e}: kind is "${t}", which is not one of: ${n}`,"jerr.badRef":({at:e,field:t,kind:n,id:r})=>`${e}: \`${t}\` refers to a non-existent ${n} "${r}"`,"jerr.badHolds":({at:e,value:t})=>`${e}: \`holds\` must be "yes" or "no", got "${t}"`,"jerr.holdsNotHere":({at:e,kind:t,kinds:n})=>`${e}: a ${t} does not hold or fail; \`holds\` only belongs on ${n}`,"jerr.badCombine":({at:e,value:t,allowed:n})=>`${e}: \`combine\` is "${t}", which is not one of: ${n}`,"jerr.combineNotHere":({at:e,kind:t,kinds:n})=>`${e}: a ${t} is not supported by other nodes; \`combine\` only belongs on ${n}`,"jerr.dateNotHere":({at:e,kind:t})=>`${e}: \`date\` only belongs on a fact, not on a ${t}`,"jerr.badDate":({at:e,value:t})=>`${e}: \`date\` "${t}" is not an ISO date (YYYY-MM-DD or YYYY-MM-DDTHH:MM)`,"jerr.badEnd":({at:e,end:t,id:n})=>`${e}: \`${t}\` refers to a non-existent node "${n}"`,"jerr.selfLink":({at:e,id:t})=>`${e}: a node cannot support itself ("${t}" on both ends)`,"jerr.badStance":({at:e,value:t,allowed:n})=>`${e}: stance is "${t}", which is not one of: ${n}`,"jerr.basisNotNorm":({at:e,kind:t})=>`${e}: stance "basis" can only start from a norm, not from a ${t}`,"jerr.duplicateLink":({at:e,stance:t})=>`${e}: duplicate link (same from, to and stance "${t}"); drop the second one`,"jerr.cycle":({path:e})=>`links form a cycle (${e}); a reasoning must not lead back to itself`,"jerr.leafHasInput":({at:e,kind:t})=>`${e}: a ${t} is a leaf; nothing may support it (an evidence layer is not part of v0)`,"jerr.noEnd":"no end conclusion: at least one `conclusion` must have no outgoing link (the conclusion the whole reasoning leads to)","jhint.severalEnds":({n:e,ids:t})=>`${e} conclusions end the diagram (${t}); is this one reasoning, or should it be split?`,"jhint.supportsNothing":({id:e,label:t})=>`nodes (${e}): "${t}" supports nothing; link it to what it supports, or drop it`,"jhint.factNoSource":({id:e,label:t})=>`nodes (${e}): the fact "${t}" has no source; where was it found?`,"jhint.normNoSource":({id:e,label:t})=>`nodes (${e}): the norm "${t}" has no source; which provision is it?`,"jhint.unsupported":({id:e,label:t})=>`nodes (${e}): nothing supports "${t}"; add a fact, an element or a norm that does (if it stands only because what argued against it was rejected, this note can be left as it is)`,"jhint.holdsOnRejected":({id:e,label:t})=>`nodes (${e}): "${t}" holds although everything that supports it is rejected; check the \`holds\` values`,"jhint.combineAlone":({id:e,label:t,combine:n})=>`nodes (${e}): "${t}" says \`combine: "${n}"\` but fewer than two links support it; there is nothing to combine`,"jhint.allNeedsAll":({id:e,label:t,other:n})=>`nodes (${e}): "${t}" needs all it rests on, but "${n}" is rejected; check the \`holds\` values`,"jhint.anyOneHolds":({id:e,label:t,other:n})=>`nodes (${e}): "${t}" is rejected although any one it rests on would do, and "${n}" holds; check the \`holds\` values`,"jhint.tooLarge":({n:e,limit:t})=>`${e} nodes: past about ${t} the tree gets hard to read on one screen; consider one diagram per issue`,"graphKind.graph":`Relationship graph`,"graphKind.focus":`Focus view`,"graphKind.matrix":`Relation matrix`,"graphKind.equity":`Equity tree`,"rel.matrix.ungrouped":`No camp`,"rel.equity.noShare":`not stated`,"rel.equity.cross":`cross-holding`,"rel.equity.noEquity":`No equity relations in this data`,"rel.equity.noEquityHint":`This view is built around shareholdings. For this case, switch to the relationship graph.`,"rel.equity.indirect":({n:e})=>`Held through others (${e})`,"rel.equity.notComputable":`cannot be worked out: a share on the way is not stated`,"rel.equity.moreRows":({n:e})=>`${e} more not listed`,"rel.equity.above":({n:e})=>`Above it (${e})`,"rel.company.label":`Company`,"rel.company.all":`All`,"rel.equity.sep":`, `,"rel.equity.colon":`: `,"graphKind.authority":`Control and employment`,"rel.authority.cycle":`cycle`,"rel.authority.none":`No control, employment or agency relations in this data`,"rel.authority.noneHint":`This view is built around who commands whom. For this case, switch to the relationship graph.`,"rel.authority.above":({n:e})=>`Above it (${e})`,"graphKind.related":`Related parties`,"rel.related.title":({name:e})=>`Related parties of ${e} (the centre)`,"rel.related.count":({n:e,m:t})=>`${e} related part${e===1?`y`:`ies`}, ${t} relation${t===1?``:`s`}`,"rel.related.colParty":`Related party`,"rel.related.colKind":`Category`,"rel.related.colText":`Relation`,"rel.related.colSource":`Source`,"rel.related.dirNone":({a:e,b:t})=>`${e} — ${t} (no direction)`,"rel.related.none":({name:e})=>`${e} has no relation in this data`,"rel.related.noneHint":`Pick another party in the box at the bottom, or switch to the relationship graph.`,"rel.related.centre":`Centre`,"graphKind.path":`Relation path`,"rel.path.from":`From`,"rel.path.to":`To`,"rel.path.swap":`Swap the two ends`,"rel.path.noChain":({a:e,b:t})=>`No chain of relations ties ${e} and ${t}`,"rel.path.noChainHint":`Pick two parties that are connected, or switch to the relationship graph.`,"rel.path.steps":({n:e})=>`${e} step${e===1?``:`s`}`,"rel.path.chains":({n:e})=>`Chains drawn (${e})`,"rel.path.more":({n:e,atLeast:t})=>`${t?`At least `:``}${e} more chain${e===1?``:`s`} not drawn; only the shortest are.`,"graphKind.route":`Route map`,"proc.route.labels":`Conditions`,"proc.route.more":({n:e})=>`… and ${e} more`,"rel.focus.open":`Centre the focus view on this party`,"rel.focus.centre":`Centre`,"rel.focus.hint":`Click to put this party in the middle`,"rel.focus.apart":`Not connected to the centre`,"rel.focus.reset":`Default centre`,"rel.focus.resetTitle":`Put the party with the most relations back in the middle`,"graphKind.tree":`Reasoning tree`,"jus.kind.conclusion":`Conclusion`,"jus.kind.norm":`Norm`,"jus.kind.element":`Element`,"jus.kind.fact":`Fact`,"jus.kind.inference":`Inference`,"jus.kind.judgement":`Judgement`,"jus.holds.yes":`✓ upheld`,"jus.holds.no":`✗ rejected`,"jus.copy":`shown again`,"jus.copies":({n:e})=>`The same node is drawn in ${e} issues`,"jus.grounds":`Rests on`,"jus.fold":`Fold this issue up`,"jus.unfold":`Open this issue`,"jus.folded":({n:e})=>`${e} folded`,"jus.foldAll":`Fold issues`,"jus.merge":`Merge repeats`,"jus.mergeTitle":`A fact (or a norm with many elements) used several times in one issue is drawn beside each use; merge draws each once, with longer lines`,"jus.foldAllTitle":`Fold every issue up to its conclusion, or open them all again`,"jus.combine.all":`all of`,"jus.combine.any":`any of`,"jus.combine.allLong":`All of what it rests on is needed`,"jus.combine.anyLong":`Any one of what it rests on is enough`,"jus.supports":`Leads to`,"jus.stance.for":`supports`,"jus.stance.against":`opposes`,"jus.stance.basis":`basis`,"jus.previewHint":`Click a node to read the full text and see what it rests on`,"perr.domainNotInEnum":({value:e,allowed:t})=>`\`domain\` is "${e}", not in the enum (${t})`,"perr.nodesEmpty":"`nodes` must not be empty (a flow needs at least a start and an end)","perr.edgesEmpty":"`edges` must not be empty (the nodes have to be connected)","perr.notObject":({at:e})=>`${e}: must be an object`,"perr.required":({at:e,field:t})=>`${e}: missing required field \`${t}\``,"perr.duplicateNodeId":({at:e,id:t})=>`${e}: id "${t}" duplicates an earlier node`,"perr.badKind":({at:e,value:t,allowed:n})=>`${e}: \`kind\` is "${t}", not in the vocabulary (${n})`,"perr.badOutcome":({at:e,value:t,allowed:n})=>`${e}: \`outcome\` is "${t}", not in the enum (${n})`,"perr.mustBeString":({at:e,field:t})=>`${e}: \`${t}\` must be a string`,"perr.badRef":({at:e,field:t,kind:n,id:r})=>`${e}: ${t} refers to a non-existent ${n} "${r}"`,"perr.badFrom":({at:e,id:t})=>`${e}: \`from\` refers to a non-existent node "${t}"`,"perr.badTo":({at:e,id:t})=>`${e}: \`to\` refers to a non-existent node "${t}"`,"perr.selfLoop":({at:e,id:t})=>`${e}: self-loop (from and to are both "${t}")`,"perr.duplicateEdge":({at:e,from:t,to:n})=>`${e}: duplicate edge ${t} -> ${n} (same condition); branches into one target each need their own condition`,"perr.noEntry":`no node has zero incoming edges (a flow needs a start)`,"perr.unreachable":({id:e})=>`nodes (${e}): unreachable from the start (it would be dropped silently and never appear)`,"perr.orphan":({id:e,label:t})=>`nodes (${e}): "${t}" has no incoming edge and is not a start, so nothing leads to it: it would float beside the flow. If it is a consequence (a breach, a resignation, a right to terminate), write it as a rule in \`rules\`; if it belongs to the flow, add the edge that leads to it`,"note.partyNoEvent":({at:e,id:t,name:n})=>`${e} (${t}): no event names "${n}" in its actorIds, so it is on no card and has no column. Name it in the actorIds of the events it took part in, or leave it out of actors if it did nothing in this diagram`,"note.dateOrder":({at:e,id:t,date:n,beforeAt:r,beforeId:i,beforeDate:a})=>`${e} ("${t}", ${n}) comes after ${r} ("${i}", ${a}) in the slots but its date is wholly earlier. The order of the slots is kept and nothing is reordered; check which of the two dates is wrong, or whether the slots are in the wrong order`,"perr.noEnd":'no node has `kind: "end"` (a flow needs an end)',"perr.deadEnd":({id:e,label:t})=>`nodes (${e}): "${t}" is a dead end: it is neither end nor note but has no outgoing edge. If it is the consequence of a breach, delay or right to terminate, write it as a rule in \`rules\` (it may fire at any time in its stages) instead of a node that has to lead somewhere`,"perr.decisionTooFewOut":({id:e,n:t})=>`nodes (${e}): kind is "decision" but only ${t} outgoing edge(s); a decision needs at least 2`,"perr.decisionNoCondition":({id:e,index:t,to:n})=>`nodes (${e}): kind is "decision" but edge edges[${t}] -> "${n}" has no condition. If it really is a decision, give every outgoing edge a condition (e.g. "yes / no"); if it is a step, change kind to "step" (a step may have several outgoing edges, one of them the main line)`,"perr.tooManyMain":({id:e,n:t})=>`nodes (${e}): ${t} outgoing edges are marked main; a path has exactly one`,"perr.mainBroken":({id:e})=>`the main line breaks at node "${e}": the edges marked main do not reach any end. Either add the missing main edge, or repair the chain`,"norm.mainRemarked":({problem:e,from:t,to:n})=>`the main line was marked again, starting at "${t}" and ending at "${n}", keeping to the edges already marked where it could. It was: ${e}`,"norm.mainSet":({at:e})=>`${e}: marked main`,"norm.mainCleared":({at:e})=>`${e}: no longer marked main`,"perr.rulesNotArray":"`rules` must be an array","perr.duplicateRuleId":({at:e,id:t})=>`${e}: id "${t}" is already used by another rule or node`,"perr.ruleWhen":({at:e})=>`${e}: \`when\` is required: a non-empty string, or an array of them (any one of them triggers the rule)`,"perr.ruleEndNotEnd":({at:e,id:t})=>`${e}: \`endId\` points at "${t}", which is not a node of kind "end"; a rule can only lead to an end`,"phint.stageBackwards":({from:e,fromStage:t,to:n,toStage:r})=>`stage runs backwards: ${e} (${t}) -> ${n} (${r}); back edges are normal, others need a second look`,"phint.decisionOnSpine":({id:e,label:t})=>`decision "${e}" (${t}) is on the main line but no outgoing edge is marked main; the breach path may end up drawn as the main line`,"phint.longLabel":({id:e,n:t})=>`node "${e}" has a label of ${t} characters; a node shows about two lines (20 Chinese characters) and cuts the rest, the popover has it all. Shorten the label and move the detail into \`detail\``,"phint.noteNoDetail":({id:e,label:t})=>`note "${e}" (${t}) has no detail; a note is an explanation, so write it as one full sentence (in detail) that says what it explains`,"phint.multipleEntries":({n:e,ids:t})=>`${e} entries (${t}), they will all sit in the first layer; a contract flow usually has a single entry, so check whether an upstream link is missing`},je={en:Ae,zh:{"common.none":`(无)`,"common.close":`关闭`,"common.untitled":`案图`,"fallback.invalidTitle":({n:e})=>`该数据未通过校验(${e} 处问题)`,"fallback.noRendererTitle":({type:e})=>`没有为 type = "${e}" 注册渲染器`,"fallback.registered":({list:e})=>`已注册:${e}`,"fallback.noInlineData":`这份文件里没有内联数据,生成时发生错误,请重新生成这份 HTML。`,"fallback.devNoData":`开发服务器未获取到数据:请用 ?example=0 或 ?spec=examples/某份.json 指定一份。`,"error.renderTitle":`渲染出错`,"error.renderHint":`数据本身可能没问题(校验已经通过),是这个画法在渲染时抛错了。请将下列信息提供给开发者,或改用其他画法。`,"info.span":({from:e,to:t})=>`${e} 至 ${t}`,"info.slots":({n:e})=>`${e} 个时间点`,"info.actors":({n:e})=>`${e} 个主体`,"info.sources":({n:e})=>`${e} 个来源`,"info.nodes":({n:e})=>`${e} 个节点`,"info.stages":({n:e})=>`${e} 个阶段`,"info.entities":({n:e})=>`${e} 个当事方`,"info.relations":({n:e})=>`${e} 条关系`,"info.links":({n:e})=>`${e} 条连线`,"dock.actors":`主体`,"dock.summary":`摘要`,"dock.sources":`来源`,"dock.orientation":`层的走向:竖向是从上往下,横向是从左往右。`,"dock.orientationCamps":`层的走向:竖向是从上往下,横向是从左往右。画了阵营框时,阵营沿垂直于层的方向排开:竖向时左右并排,横向时上下叠放,所以整张图看起来可能和按钮相反。`,"dock.vertical":`竖向`,"dock.horizontal":`横向`,"dock.grid":`格线`,"dock.stagger":`交错`,"dock.byParty":`按主体分泳道`,"dock.staggerHint":`让不同列的卡片上下错开半行,图更短、字更大`,"dock.exportImage":`导出图片`,"dock.exporting":`正在导出…`,"dock.exportTitle":`将整张图导出为 PNG(2 倍分辨率)`,"dock.lang":`语言`,"dock.fold":`收起`,"dock.display":`显示选项`,"export.failed":({message:e})=>`导出失败:${e}`,"dock.langEn":`EN`,"dock.langZh":`中文`,"flow.conditions":`条件`,"flow.detail":`详情`,"flow.mainLine":`主干`,"flow.states":`状态`,"flow.stages":`阶段`,"flow.rules":`条款`,"flow.linkStraight":`折线`,"flow.linkCurved":`曲线`,"flow.linkStyle":`连线样式`,"rule.tableTitle":`条款`,"rule.tableNote":`流程中可能出现的情形,不属于流程步骤`,"rule.tableNoteContract":`合同履行过程中可能出现的情形,不属于流程步骤`,"rule.colWhen":`情形`,"rule.colThen":`后果`,"rule.colScope":`适用阶段`,"rule.groupEnd":({end:e})=>`可导致「${e}」`,"rule.groupRest":`其他条款`,"rule.count":({n:e})=>`${e} 条`,"rule.anyOf":`下列任一:`,"rule.tScopeAll":`全程`,"rule.tScopeRange":({from:e,to:t})=>`${e} 至 ${t}`,"flow.ruleBadge":({n:e})=>`条款 ${e} 条`,"flow.noteTag":`注`,"rule.if":`若`,"rule.or":`,或`,"flow.previewHint":`点击节点查看全文`,"card.sources":({n:e})=>`来源 ${e} 个`,"card.sourcesUnlisted":`未列来源`,"card.sourcesList":({n:e,names:t})=>`来源 ${e} 个:${t}`,"card.duration":({duration:e})=>`持续 ${e}`,"card.approxPrefix":`约 `,"card.dateUnknown":`日期不详`,"card.unitDay":({n:e})=>`${e} 天`,"card.unitHour":({n:e})=>`${e} 小时`,"card.unitMinute":({n:e})=>`${e} 分`,"card.unitSecond":({n:e})=>`${e} 秒`,"card.ariaLabel":({label:e,date:t})=>t?`${e},${t}`:e,"card.dateNote":({note:e})=>`时间说明:${e}`,"card.previewHint":`点击卡片查看全文`,"aria.nodeDefault":`按回车或空格可选中此节点。`,"aria.nodeKeyboardDisabled":`按回车或空格可选中此节点。选中后可用方向键移动。`,"aria.nodeMoved":({x:e,y:t})=>`已移动节点。新位置:x ${e},y ${t}`,"aria.edgeDefault":`按回车或空格可选中此连线。`,"aria.controls":`画布控件`,"aria.zoomIn":`放大`,"aria.zoomOut":`缩小`,"aria.fitView":`适应视图`,"aria.interactive":`切换交互`,"aria.minimap":`缩略图`,"aria.handle":`连接点`,"sourceType.statute":`法条`,"sourceType.case":`判例`,"sourceType.contract":`合同`,"sourceType.evidence":`证据`,"sourceType.document":`文书`,"sourceType.web":`网页`,"sourceType.other":`其他`,"graphKind.timeline":`时间图`,"graphKind.flow":`流程图`,"header.theme":`主题`,"theme.document":`文书`,"theme.modern":`现代`,"theme.legal":`法律`,"theme.dark":`深色`,"header.kindOpen":({n:e})=>`查看全部 ${e} 种画法`,"header.kindPrev":`上一种画法`,"header.kindNext":`下一种画法`,"header.kindGroup":`画法`,"header.fold":`收起标题卡`,"header.unfold":`展开标题卡`,"graphKind.chronicle":`大事记`,"graphKind.scale":`比例时间轴`,"scale.segment":({n:e,unit:t,count:n})=>`第 ${e} 段 · ${t} · ${n} 个事件`,"scale.unit.year":`按年`,"scale.unit.month":`按月`,"scale.unit.day":`按日`,"scale.unit.hour":`按小时`,"scale.unit.minute":`按分钟`,"scale.other":`其他`,"scale.events":`事件`,"scale.undated":`日期不详 · 按顺序放置`,"scale.coarse.day":`当日(时刻不详)`,"scale.coarse.month":`当月(日期不详)`,"scale.coarse.year":`当年(月份不详)`,"scale.run":({n:e})=>`${e} 个事件`,"scale.runListed":({n:e})=>`时间相近的 ${e} 个事件,列示如下:`,"chronicle.gapSeconds":({n:e})=>`+${e} 秒`,"chronicle.gapMinutes":({n:e})=>`+${e} 分钟`,"chronicle.gapHours":({n:e})=>`+${e} 小时`,"chronicle.gapHoursMinutes":({h:e,m:t})=>`+${e} 小时 ${t} 分`,"chronicle.gapDays":({n:e})=>`间隔 ${e} 天`,"chronicle.gapMonths":({n:e})=>`间隔 ${e} 个月`,"chronicle.gapYears":({n:e})=>`间隔 ${e} 年`,"chronicle.gapYearsMonths":({y:e,m:t})=>`间隔 ${e} 年 ${t} 个月`,"chronicle.dateUnknown":`日期不详`,"graphKind.graph":`关系图`,"graphKind.focus":`聚焦图`,"graphKind.matrix":`关系矩阵`,"graphKind.equity":`股权图`,"rel.matrix.ungrouped":`未归阵营`,"rel.equity.noShare":`比例未写明`,"rel.equity.cross":`交叉持股`,"rel.equity.noEquity":`这份数据里没有股权关系`,"rel.equity.noEquityHint":`这个视图围绕持股关系画。这类案件请切换到关系图。`,"rel.equity.indirect":({n:e})=>`间接持有(${e})`,"rel.equity.notComputable":`算不出:途中有一处持股比例没写明`,"rel.equity.moreRows":({n:e})=>`另有 ${e} 项未列出`,"rel.equity.above":({n:e})=>`在它上面的(${e})`,"rel.company.label":`公司`,"rel.company.all":`全部`,"rel.equity.sep":`、`,"rel.equity.colon":`:`,"graphKind.authority":`控制与任职图`,"rel.authority.cycle":`循环`,"rel.authority.none":`这份数据里没有控制、任职或代理关系`,"rel.authority.noneHint":`这个视图围绕谁管着谁画。这类案件请切换到关系图。`,"rel.authority.above":({n:e})=>`在它上面的(${e})`,"graphKind.related":`关联方清单`,"rel.related.title":({name:e})=>`关联方清单:${e}(中心方)`,"rel.related.count":({n:e,m:t})=>`共 ${e} 个关联方,${t} 条关系`,"rel.related.colParty":`关联方`,"rel.related.colKind":`关系类别`,"rel.related.colText":`关系内容`,"rel.related.colSource":`来源`,"rel.related.dirNone":({a:e,b:t})=>`${e} — ${t}(无方向)`,"rel.related.none":({name:e})=>`「${e}」在这份数据里没有任何关系`,"rel.related.noneHint":`在底部的框里换一方,或切换到关系图。`,"rel.related.centre":`中心方`,"graphKind.path":`关系路径图`,"rel.path.from":`起点`,"rel.path.to":`终点`,"rel.path.swap":`起点和终点对调`,"rel.path.noChain":({a:e,b:t})=>`没有任何关系链把「${e}」和「${t}」连起来`,"rel.path.noChainHint":`请选两个有关系相连的当事人,或切换到关系图。`,"rel.path.steps":({n:e})=>`${e} 步`,"rel.path.chains":({n:e})=>`画出的关系链(${e})`,"rel.path.more":({n:e,atLeast:t})=>`另有${t?`至少 `:` `}${e} 条关系链没有画;只画最短的几条。`,"graphKind.route":`路线图`,"proc.route.labels":`条件`,"proc.route.more":({n:e})=>`……还有 ${e} 步`,"rel.focus.open":`以这一方为中心看聚焦图`,"rel.focus.centre":`中心`,"rel.focus.hint":`点击,把这一方放到中间`,"rel.focus.apart":`与中心没有关系相连`,"rel.focus.reset":`默认中心`,"rel.focus.resetTitle":`把关系最多的那一方放回中间`,"graphKind.tree":`说理树`,"jus.kind.conclusion":`结论`,"jus.kind.norm":`规范`,"jus.kind.element":`要件`,"jus.kind.fact":`事实`,"jus.kind.inference":`推断`,"jus.kind.judgement":`评价`,"jus.holds.yes":`✓ 成立`,"jus.holds.no":`✗ 否定`,"jus.copy":`重复`,"jus.copies":({n:e})=>`同一节点出现在 ${e} 个争点中`,"jus.grounds":`依据`,"jus.fold":`收起这个争点`,"jus.unfold":`展开这个争点`,"jus.folded":({n:e})=>`已收起 ${e} 个`,"jus.foldAll":`收起争点`,"jus.merge":`合并重复`,"jus.mergeTitle":`同一争点里被多处用到的事实(或支持多个要件的规范)默认在每处使用点各列一份;合并后只列一份,连线会变长、更易交叉`,"jus.foldAllTitle":`把每个争点收起到只剩它的结论,或者全部展开`,"jus.combine.all":`且`,"jus.combine.any":`或`,"jus.combine.allLong":`它依据的须全部具备`,"jus.combine.anyLong":`它依据的具备任何一个即可`,"jus.supports":`指向`,"jus.stance.for":`支持`,"jus.stance.against":`反对`,"jus.stance.basis":`规范依据`,"jus.previewHint":`点击节点查看全文及其依据`,"graphType.fact":`事实图`,"graphType.relationship":`关系图`,"graphType.procedure":`程序图`,"graphType.justification":`证成图`,"rel.kind.equity":`股权`,"rel.kind.control":`控制`,"rel.kind.contract":`合同`,"rel.kind.debt":`债权债务`,"rel.kind.guarantee":`担保`,"rel.kind.kinship":`亲属`,"rel.kind.employment":`雇佣`,"rel.kind.agency":`代理`,"rel.kind.other":`其他`,"rel.kindChipTitle":({n:e})=>`显示或隐藏这一类(${e} 条关系)`,"rel.labels":`标签`,"rel.groups":`分组`,"rel.previewHint":`点击当事方查看全文`,"rel.auto.equity":({share:e})=>e===void 0?`持有股权`:`持股 ${e}%`,"rel.auto.control":`控制`,"rel.auto.contract":({amount:e})=>e?`合同,${e}`:`合同`,"rel.auto.debt":({amount:e})=>e?`债权,${e}`:`债权`,"rel.auto.guarantee":`担保`,"rel.auto.kinship":`亲属`,"rel.auto.employment":`雇佣`,"rel.auto.agency":`代理`,"rel.auto.other":`关联`,...Object.fromEntries(Object.keys(Ae).filter(e=>e.startsWith(`err.`)||e.startsWith(`perr.`)||e.startsWith(`phint.`)||e.startsWith(`note.`)||e.startsWith(`rerr.`)||e.startsWith(`rhint.`)||e.startsWith(`jerr.`)||e.startsWith(`jhint.`)||e.startsWith(`norm.`)).map(e=>[e,Ae[e]]))}};function Me(e){return!e||typeof e!=`string`?`en`:e.toLowerCase().split(`-`)[0]===`zh`?`zh`:`en`}function Ne(e,t,n){let r=(je[Me(e)]??je.en)[t]??je.en[t];return r===void 0?t:typeof r==`function`?r(n??{}):n?String(r).replace(/\{(\w+)\}/g,(e,t)=>n[t]??`{${t}}`):r}var Pe=(e,t)=>Ne(`en`,e,t),Fe=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?)?)?$/;function Ie(e){let t=Fe.exec(typeof e==`string`?e.trim():``);if(!t)return null;let[n,r,i,a,o,s]=t.slice(1).map(e=>e===void 0?void 0:Number(e)),c=(e,t,n,r,i,a)=>Date.UTC(e,t,n,r,i,a),l,u;return r===void 0?(l=c(n,0,1,0,0,0),u=c(n+1,0,1,0,0,0)):i===void 0?(l=c(n,r-1,1,0,0,0),u=c(n,r,1,0,0,0)):a===void 0?(l=c(n,r-1,i,0,0,0),u=c(n,r-1,i+1,0,0,0)):s===void 0?(l=c(n,r-1,i,a,o,0),u=l+6e4):(l=c(n,r-1,i,a,o,s),u=l+1e3),Number.isNaN(l)?null:{from:l,to:u}}function Le(e){let t=Ie(e?.date);if(!t)return null;let{from:n,to:r}=t,i=e.dateEnd===void 0?null:Ie(e.dateEnd);if(i&&i.to>n&&(r=Math.max(r,i.to)),e.approx===!0){let e=t.to-t.from;n-=e,r+=e}return{from:n,to:r}}function Re(e){let t=[],n=null;return(Array.isArray(e?.slots)?e.slots:[]).forEach((e,r)=>{let i=(Array.isArray(e?.events)?e.events:[]).map((e,t)=>({event:e,ei:t,span:Le(e)})).filter(e=>e.span);if(i.length===0)return;let a={from:Math.min(...i.map(e=>e.span.from)),to:Math.max(...i.map(e=>e.span.to))};if(n&&a.to<=n.span.from){let e=i.find(e=>e.span.to<=n.span.from)??i[0];t.push(Pe(`note.dateOrder`,{at:`slots[${r}].events[${e.ei}]`,id:e.event.id,date:e.event.date,beforeAt:`slots[${n.si}].events[${n.ei}]`,beforeId:n.event.id,beforeDate:n.event.date}))}let o=i.reduce((e,t)=>t.span.to>e.span.to?t:e);n={span:a,si:r,ei:o.ei,event:o.event}}),t}function ze(e){let t=Array.isArray(e?.actors)?e.actors:[],n=new Set;for(let t of Array.isArray(e?.slots)?e.slots:[])for(let e of Array.isArray(t?.events)?t.events:[])for(let t of Array.isArray(e?.actorIds)?e.actorIds:[])n.add(t);return t.map((e,t)=>({a:e,i:t})).filter(({a:e})=>e&&typeof e.id==`string`&&!n.has(e.id)).map(({a:e,i:t})=>Pe(`note.partyNoEvent`,{at:`actors[${t}]`,id:e.id,name:e.name??e.id}))}var Be=19,Ve=2,He=18,Ue=6,We=16,Ge=11.5,Ke=1,eee=.55;function qe(e){let t=e.codePointAt(0);return t>=4352&&t<=4447||t>=11904&&t<=42191||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510?Ke:eee}function Je(e){let t=0;for(let n of String(e??``))t+=qe(n);return t}var Ye=(e,t)=>Je(e)*t,tee=262/13;262/Ge;function nee(e={},t=Ve,n=0){let r=22+Be*t+Ue+We;return e.summary&&(r+=24),e.actors&&n>0&&(r+=He*n+Ue),r}function Xe(e,t,n={}){let r=n.latin??1,i=n.cjk??1;return Ze(e,t,e=>{let t=0;for(let n of e)t+=qe(n)*(qe(n)===Ke?i:r);return t})}function Ze(e,t,n){let r=t,i=n,a=String(e??``);if(!a)return 0;let o=a.match(/[^\sᄀ-ᅟ⺀-가-힣豈-︰--⦆¢-₩]+|\s|./gu)||[],s=1,c=0;for(let e of o){let t=i(e);if(/^\s$/.test(e))c>0&&(c+=t);else if(c+t<=r)c+=t;else if(t<=r)s+=+(c>0),c=t;else{c>0&&(s+=1);let e=Math.ceil(t/r);s+=e-1,c=t-(e-1)*r}}return s}var Qe={SIDE1:`side1`,AXIS:`axis`,SIDE2:`side2`},$e=3;function et(e){let t=(Array.isArray(e?.actors)?e.actors:[]).filter(e=>rt(e)&&e.id);if(new Set(t.map(e=>e.id)).size<2)return e=>e?.groupId??null;let n=new Map(t.map(e=>[e.id,e.groupId])),r=(Array.isArray(e?.groups)?e.groups[2]?.id:null)??null;return e=>{let t=Array.isArray(e?.actorIds)?e.actorIds:[];return t.length===1&&n.get(t[0])||r}}var tt=/^\d{4}(-\d{2}(-\d{2}(T\d{2}(:\d{2}(:\d{2})?)?)?)?)?$/;function nt(e,t){if(typeof e!=`string`||typeof t!=`string`)return!1;let n=Math.min(e.length,t.length);return e.slice(0,n)<t.slice(0,n)}var ree=[Qe.SIDE1,Qe.SIDE2,Qe.AXIS];function rt(e){return e&&typeof e==`object`&&!Array.isArray(e)}function it(e){let t=[],n=Array.isArray(e?.actors)?e.actors:[],r=Array.isArray(e?.groups)?e.groups:[],i=Array.isArray(e?.sources)?e.sources:[],a=e?.slots,o={errors:t,byActor:!1,sideLabels:{[Qe.SIDE1]:``,[Qe.SIDE2]:``,[Qe.AXIS]:``},columns:[],rows:[],placements:new Map,axisColumnIndex:0,actorById:new Map,groupById:new Map,groupIndexById:new Map,sourceById:new Map,eventCount:0},s=new Map;n.forEach((e,n)=>{rt(e)?e.id?(s.has(e.id)&&t.push(Pe(`err.duplicateId`,{at:`actors[${n}]`,id:e.id})),s.set(e.id,e),e.name||t.push(Pe(`err.required`,{at:`actors[${n}] (${e.id})`,field:`name`}))):t.push(Pe(`err.required`,{at:`actors[${n}]`,field:`id`})):t.push(Pe(`err.notObject`,{at:`actors[${n}]`}))}),e?.views!==void 0&&t.push(Pe(`err.viewsRemoved`));let c=new Map,l=new Map;r.length>$e&&t.push(Pe(`err.tooManyGroups`,{at:`groups`,max:$e,actual:r.length})),r.forEach((e,n)=>{rt(e)?e.id?(l.has(e.id)&&t.push(Pe(`err.duplicateId`,{at:`groups[${n}]`,id:e.id})),c.set(e.id,e),l.set(e.id,n),e.label||t.push(Pe(`err.required`,{at:`groups[${n}] (${e.id})`,field:`label`}))):t.push(Pe(`err.required`,{at:`groups[${n}]`,field:`id`})):t.push(Pe(`err.notObject`,{at:`groups[${n}]`}))});let u=s.size>=2,d=new Map;n.forEach((e,n)=>{if(!rt(e)||!e.id)return;let r=`actors[${n}] (${e.id})`,i=e.groupId!==void 0&&e.groupId!==null&&e.groupId!==``;if(!u){i&&t.push(Pe(`err.actorGroupOneParty`,{at:r}));return}if(!i){t.push(Pe(`err.actorNeedsGroup`,{at:r,n:s.size}));return}if(!l.has(e.groupId)){t.push(Pe(`err.missingRef`,{at:r,field:`groupId`,kind:`group`,id:e.groupId}));return}let a=l.get(e.groupId);a>1?t.push(Pe(`err.actorGroupNotSide`,{at:r,groupId:e.groupId})):d.set(e.id,a===0?Qe.SIDE1:Qe.SIDE2)});let f=new Map;if(i.forEach((e,n)=>{rt(e)?e.id?(f.has(e.id)&&t.push(Pe(`err.duplicateId`,{at:`sources[${n}]`,id:e.id})),f.set(e.id,e),e.type||t.push(Pe(`err.required`,{at:`sources[${n}] (${e.id})`,field:`type`})),e.name||t.push(Pe(`err.required`,{at:`sources[${n}] (${e.id})`,field:`name`}))):t.push(Pe(`err.required`,{at:`sources[${n}]`,field:`id`})):t.push(Pe(`err.notObject`,{at:`sources[${n}]`}))}),!Array.isArray(a))return t.push(Pe(`err.slotNotArray`)),{...o,actorById:s,groupById:c,groupIndexById:l,sourceById:f};a.length===0&&t.push(Pe(`err.slotsEmpty`));let p=new Set,m={[Qe.SIDE1]:new Set,[Qe.SIDE2]:new Set},h=[];a.forEach((e,n)=>{let r=`slots[${n}]`;rt(e)?Array.isArray(e.events)?(e.events.length===0&&t.push(Pe(`err.slotEventsEmpty`,{at:r})),e.events.forEach((e,i)=>{let a=`${r}.events[${i}]${e?.id?` (${e.id})`:``}`;if(!rt(e)){t.push(Pe(`err.notObject`,{at:a}));return}e.id?p.has(e.id)?t.push(Pe(`err.duplicateId`,{at:a,id:e.id})):p.add(e.id):t.push(Pe(`err.required`,{at:a,field:`id`})),e.date&&!tt.test(e.date)&&t.push(Pe(`err.badDate`,{at:a,field:`date`,value:e.date})),e.label||t.push(Pe(`err.required`,{at:a,field:`label`})),e.dateEnd!==void 0&&e.dateEnd!==null&&(typeof e.dateEnd!=`string`||!tt.test(e.dateEnd)?t.push(Pe(`err.badDate`,{at:a,field:`dateEnd`,value:e.dateEnd})):e.date?nt(e.dateEnd,e.date)&&t.push(Pe(`err.dateEndBeforeDate`,{at:a,end:e.dateEnd,start:e.date})):t.push(Pe(`err.dateEndNeedsDate`,{at:a}))),e.summary!==void 0&&e.summary!==null&&(typeof e.summary==`string`?Je(e.summary)>22.782608695652176&&t.push(Pe(`err.summaryTooLong`,{at:a,max:22,actual:Math.ceil(Je(e.summary))})):t.push(Pe(`err.mustBeString`,{at:a,field:`summary`})));let o=Array.isArray(e.actorIds)?e.actorIds:[];o.forEach(e=>{s.has(e)||t.push(Pe(`err.missingRef`,{at:a,field:`actorIds`,kind:`actor`,id:e}))});let c=e.groupId!==void 0&&e.groupId!==null&&e.groupId!==``;u&&c?t.push(Pe(`err.eventGroupWithParties`,{at:a})):c&&!l.has(e.groupId)&&t.push(Pe(`err.missingRef`,{at:a,field:`groupId`,kind:`group`,id:e.groupId})),(Array.isArray(e.sourceIds)?e.sourceIds:[]).forEach(e=>{f.has(e)||t.push(Pe(`err.missingRef`,{at:a,field:`sourceIds`,kind:`source`,id:e}))});let g=c?l.get(e.groupId):void 0,_,v=null;if(u)o.length===1&&d.has(o[0])?(_=d.get(o[0]),v=o[0]):_=Qe.AXIS;else if(o.length>=2)_=Qe.AXIS,(g===0||g===1)&&t.push(Pe(`err.multiActorNeedsAxis`,{at:a,n:o.length,groupId:e.groupId}));else if(!c)_=Qe.AXIS;else if(g===void 0)return;else _=ree[g]??Qe.AXIS;!u&&_!==Qe.AXIS&&o.length!==1?t.push(Pe(`err.groupNeedsOneActor`,{at:a,groupId:e.groupId,n:o.length})):(!u&&_!==Qe.AXIS&&o.length===1&&(v=o[0]),v&&s.has(v)&&m[_].add(v),h.push({slotIndex:n,event:e,side:_,actorId:v}))})):t.push(Pe(`err.eventsNotArray`,{at:r})):t.push(Pe(`err.slotShape`,{at:r}))});let g=n.map(e=>rt(e)?e.id:null).filter(Boolean),_=e=>g.filter(t=>m[e].has(t)),v=e=>{let t=_(e),n=u&&g.filter(t=>d.get(t)===e).length>1;return t.length||!u?t.map(t=>({key:`${e}:${t}`,side:e,actorId:t,actorName:s.get(t)?.name,named:n})):[{key:e,side:e,actorId:null}]},y=[];y.push(...v(Qe.SIDE1).reverse());let b=y.length;y.push({key:Qe.AXIS,side:Qe.AXIS}),y.push(...v(Qe.SIDE2));let x=new Map(y.map((e,t)=>[e.key,t])),S=a.map((e,t)=>({index:t,cells:new Map})),C=new Map,ee=0;return h.forEach(({slotIndex:e,event:n,side:r,actorId:i})=>{let a=r===Qe.AXIS?Qe.AXIS:`${r}:${i}`,o=x.get(a);if(o===void 0)return;ee+=1;let s=S[e];if(s.cells.has(a)){let r=s.cells.get(a);t.push(Pe(`err.oneEventPerCell`,{at:`slots[${e}]`,a:r.id,b:n.id}))}else s.cells.set(a,n);C.set(n.id,{row:e,col:o,key:a})}),{errors:t,byActor:u,sideLabels:{[Qe.SIDE1]:r[0]?.label??``,[Qe.SIDE2]:r[1]?.label??``,[Qe.AXIS]:r[2]?.label??``},columns:y,rows:S,placements:C,axisColumnIndex:b,actorById:s,groupById:c,groupIndexById:l,sourceById:f,eventCount:ee}}function at(e){return e===Qe.SIDE1?0:e===Qe.SIDE2?1:2}function ot(e){let t=1;for(let n of e.rows)n.cells.forEach(e=>{let n=Je(e.label||``);t=Math.max(t,Math.min(2,Math.ceil(n/tee)))});return t}function st(e,t){if(!t.actors)return 0;let n=0;for(let t of e.rows)t.cells.forEach(t=>{let r=(Array.isArray(t.actorIds)?t.actorIds:[]).map(t=>e.actorById.get(t)?.name||t);if(r.length===0)return;let i=r.reduce((e,t)=>e+Ye(t,10)+14,0)+4*(r.length-1);n=Math.max(n,Math.ceil(i/262))});return n}function ct(e,t){let n=new Set;return e.cells.forEach((e,r)=>{let i=t.columns.findIndex(e=>e.key===r);i>=0&&n.add(i)}),n}var iee=.5;function aee(e,t){if(!t)return e.rows.map((e,t)=>t);let n=e.rows.map(t=>ct(t,e)),r=[];return n.forEach((e,t)=>{let i=t===0?0:r[t-1]+iee;for(let a=0;a<t;a++)[...e].some(e=>n[a].has(e))&&(i=Math.max(i,r[a]+1));r.push(i)}),r}function oee(e,t,n,r=!1){let i=e.columns.length,a=e.rows.length,o=ot(e),s=st(e,t),c=nee(t,o,s),l=c+28,u=n?316:l,d=n?l:316,f=new Set;e.rows.forEach(e=>e.cells.forEach((e,t)=>f.add(t)));let p=[],m=0;e.columns.forEach(e=>{let t=f.has(e.key)?d:n?52:104;p.push({start:m,size:t}),m+=t});let h=n?150:0,g=n?0:96,_=n?u:d,v=n?d:u,y=r&&!n,b=aee(e,y),x=a===0?0:(b[a-1]+1)*u,S=(e,t)=>n?{x:h+b[e]*u,y:p[t].start}:{x:p[t].start,y:g+b[e]*u},C=p[e.axisColumnIndex]??{start:0,size:d};return{isH:n,colCount:i,rowCount:a,labelLines:o,actorLines:s,cardH:c,cellH:l,slotExtent:u,laneExtent:d,lanes:p,originX:h,originY:g,cellBoxW:_,cellBoxH:v,cellAt:S,rowTops:b,timeSpan:x,staggered:y,axisCenter:C.start+C.size/2,contentW:n?h+x+6:m,contentH:n?m:g+x+6}}var lt={draggable:!1,selectable:!1,connectable:!1,focusable:!1};function see(e,t,n){let r=(Array.isArray(e.actorIds)?e.actorIds:[]).map(e=>t.actorById.get(e)?.name||e),i=(Array.isArray(e.sourceIds)?e.sourceIds:[]).map(e=>t.sourceById.get(e)).filter(Boolean);return{event:e,actorNames:r,sources:i,sourceCount:i.length,row:n}}function cee(e){return{id:`__cells__`,type:`cells`,position:{x:0,y:0},width:1,height:1,style:{pointerEvents:`none`},data:{cols:e.colCount,rows:e.rowCount,cellW:e.cellBoxW,cellH:e.cellBoxH,lanes:e.lanes,originX:e.originX,originY:e.originY,isH:e.isH},...lt}}function lee(e,t){let n=t=>e.columns.filter(e=>e.side===t).length,r=t=>e.columns.findIndex(e=>e.side===t),i=[];return e.columns.forEach((a,o)=>{let s=n(a.side),c=a.side!==Qe.AXIS&&(s>1||a.named),l=o===r(a.side),u={type:`colHeader`,...lt},d={isH:t.isH,side:a.side,groupIndex:at(a.side)};if(!c){i.push({...u,id:`__head__${a.key}`,position:t.isH?{x:0,y:t.lanes[o].start}:{x:t.lanes[o].start,y:0},data:{...d,width:t.isH?150:t.lanes[o].size,height:t.isH?t.lanes[o].size:null,sideTitle:e.sideLabels[a.side],colTitle:null}});return}if(t.isH){i.push({...u,id:`__head__${a.key}`,position:{x:0,y:t.lanes[o].start},data:{...d,width:150,height:t.lanes[o].size,sideTitle:l?e.sideLabels[a.side]:null,colTitle:a.actorName}});return}if(!l)return;let f=e.columns.slice(o,o+s);i.push({...u,id:`__head__${a.key}`,position:{x:t.lanes[o].start,y:0},data:{...d,width:t.lanes.slice(o,o+s).reduce((e,t)=>e+t.size,0),height:null,sideTitle:e.sideLabels[a.side],colTitle:null,actors:f.map(e=>e.actorName),laneWs:t.lanes.slice(o,o+s).map(e=>e.size)}})}),i}function uee(e,t){let n=e.rows.map(e=>t.rowTops[e.index]*t.slotExtent+t.slotExtent/2-5);return{id:`__axis__`,type:`axis`,position:t.isH?{x:t.originX,y:t.axisCenter-1}:{x:t.axisCenter-1,y:t.originY},data:{isH:t.isH,length:t.timeSpan,dotSize:10,dotOffsets:n},...lt}}function dee(e,t){return{id:`__links__`,type:`links`,position:{x:0,y:0},width:1,height:1,style:{pointerEvents:`none`},data:{segments:e,isH:t},...lt}}function fee(e,t,n,r,i,a){let o=i.cellAt(n,t),s=o.x+(i.cellBoxW-288)/2,c=o.y+(i.cellBoxH-i.cardH)/2,l=null;if(i.isH){let e=s+144;if(t<r.axisColumnIndex){let t=c+i.cardH;l={left:e,top:t,height:i.axisCenter-t}}else t>r.axisColumnIndex&&(l={left:e,top:i.axisCenter,height:c-i.axisCenter})}else{let e=c+i.cardH/2;if(t<r.axisColumnIndex){let t=s+288;l={left:t,top:e,width:i.axisCenter-t}}else t>r.axisColumnIndex&&(l={left:i.axisCenter,top:e,width:s-i.axisCenter})}return{node:{id:e.id,type:`card`,position:{x:s,y:c},data:{...see(e,r,n),groupIndex:at(r.columns[t].side),cardW:288,cardH:i.cardH,labelLines:i.labelLines,fields:a,isH:i.isH}},link:l}}function pee(e,t={},n,r=`vertical`,{stagger:i=!1}={}){let a=r===`horizontal`,o=it(e),s=oee(o,t,a,i),c=[cee(s),...lee(o,s)],l=[],u=[];return o.rows.forEach(e=>{e.cells.forEach((n,r)=>{let i=o.columns.findIndex(e=>e.key===r);if(i<0)return;let{node:a,link:c}=fee(n,i,e.index,o,s,t);l.push(a),c&&u.push(c)})}),u.length&&c.push(dee(u,a)),c.push(uee(o,s)),c.push(...l),{errors:o.errors,sideLabels:o.sideLabels,nodes:c,edges:[],grid:o,layout:`grid`,staggered:s.staggered,size:{width:s.contentW,height:s.contentH}}}function ut(e,t,n){let[r,i]=String(e).split(`T`),a=t?Ne(n,`card.approxPrefix`):``;if(!i)return a+r;let o=i.split(`:`);return`${a}${r} ${o.slice(0,2).join(`:`)}${o[2]?`:`+o[2]:``}`}function dt(e,t,n){let r=ut(t,!1,n);return String(e).split(`T`)[0]===String(t).split(`T`)[0]&&String(t).includes(`T`)?r.split(` `).pop():r}function mee(e,t){if(!e.date)return Ne(t,`card.dateUnknown`);let n=ut(e.date,e.approx,t);return e.dateEnd?`${n} - ${dt(e.date,e.dateEnd,t)}`:n}function ft(e,t,n=!1){if(!e.date)return[{text:Ne(t,`chronicle.dateUnknown`),strong:!1}];let[r,i]=String(e.date).split(`T`),a=[{text:(e.approx?Ne(t,`card.approxPrefix`):``)+r,strong:!0}],o=i?ut(e.date,!1,t).split(` `).pop():``;n&&o&&a.shift();let s=!a.length;if(!e.dateEnd)return o&&a.push({text:o,strong:s}),a;let c=dt(e.date,e.dateEnd,t);return o&&!c.includes(`-`)?a.push({text:`${o} – ${c}`,strong:s}):(o&&a.push({text:o,strong:s}),a.push({text:`– ${c}`,strong:!1})),a}var hee=12.5,gee=4,_ee=6,vee=10,yee=90,bee={latin:1.2,cjk:1.06},pt={latin:1.12,cjk:1.06},mt={sameSlot:10,none:22,short:38,long:70},ht=864e5,gt=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2})(?::(\d{2})(?::(\d{2}))?)?)?)?)?$/;function _t(e){let t=typeof e==`string`?gt.exec(e):null;if(!t)return null;let[,n,r,i,a,o,s]=t,c=a==null?i==null?r==null?`year`:`month`:`day`:`time`;return{y:+n,mo:r?+r:1,d:i?+i:1,h:a?+a:0,mi:o?+o:0,s:s?+s:0,prec:c}}var vt={year:0,month:1,day:2,time:3},yt=e=>Date.UTC(e.y,e.mo-1,e.d,e.h,e.mi,e.s);function xee(e,t,n=!1){let r=_t(e),i=_t(t);if(!r||!i)return null;let a=vt[r.prec]<=vt[i.prec]?r.prec:i.prec,o=(e,t,r)=>({key:e,vars:t,long:r,approx:!!n});if(a===`year`||a===`month`){let e=a===`year`?(i.y-r.y)*12:(i.y-r.y)*12+(i.mo-r.mo);return e<=0?null:xt(e,o)}if(a===`time`){let e=yt(i)-yt(r);if(e<=0)return null;if(e<ht){let t=Math.round(e/1e3);if(t<60)return o(`chronicle.gapSeconds`,{n:t},!1);if(t<3600)return o(`chronicle.gapMinutes`,{n:Math.round(t/60)},!1);let n=Math.floor(t/3600),r=Math.round((t-n*3600)/60);return r===60&&(n+=1,r=0),r?o(`chronicle.gapHoursMinutes`,{h:n,m:r},!1):o(`chronicle.gapHours`,{n},!1)}return bt(Math.floor(e/ht),o)}let s=Math.round((Date.UTC(i.y,i.mo-1,i.d)-Date.UTC(r.y,r.mo-1,r.d))/ht);return s<=0?null:bt(s,o)}function See(e){let t=(e,t,n)=>({key:e,vars:t,long:n,approx:!1});if(!(e>0))return null;if(e<ht){let n=Math.round(e/1e3);return n<60?t(`chronicle.gapSeconds`,{n},!1):n<3600?t(`chronicle.gapMinutes`,{n:Math.round(n/60)},!1):t(`chronicle.gapHours`,{n:Math.round(n/3600)},!1)}return bt(Math.round(e/ht),t)}function bt(e,t){return e<30?t(`chronicle.gapDays`,{n:e},!1):xt(Math.max(1,Math.round(e/30.44)),t)}function xt(e,t){let n=Math.floor(e/12),r=e%12;return n?r?t(`chronicle.gapYearsMonths`,{y:n,m:r},!0):t(`chronicle.gapYears`,{n},!0):t(`chronicle.gapMonths`,{n:r},!0)}var St=(e,t)=>e==null?t:t==null||e>t?e:t;function Cee(e){let t=Array.isArray(e?.slots)?e.slots:[],n=[],r=null,i=!1,a=!1;return t.forEach((e,t)=>{let o=(Array.isArray(e?.events)?e.events:[]).filter(e=>e&&typeof e==`object`);if(!o.length)return;let s=o.every(e=>typeof e.date==`string`&&e.date),c=s?[...o].sort((e,t)=>e.date<t.date?-1:+(e.date>t.date)):o,l=c.find(e=>e.date)?.date??null,u=c.some(e=>e.date&&e.approx);c.forEach((e,o)=>{let c=o===0,d=null,f=`sameSlot`;c&&(n.length?(d=a&&s?xee(r,l,i||u):null,f=d?d.long?`long`:`short`:`none`):f=`top`);let p=typeof e.date==`string`&&e.date.length>=10?e.date.slice(0,10):null,m=n.at(-1)?.event,h=!!(p&&m&&typeof m.date==`string`&&m.date.slice(0,10)===p&&!e.approx);n.push({event:e,slotIndex:t,first:c,gap:d,spacing:f,sameDay:h})}),a=s,r=null;for(let e of c)r=St(r,St(e.date,e.dateEnd));i=c.some(e=>e.approx)}),n}var Ct=[`circle`,`square`,`diamond`];function wt(e,t){let n=(Array.isArray(e?.groups)?e.groups:[]).findIndex(n=>n?.id===et(e)(t));return n<0?`none`:Ct[Math.min(n,2)]}function Tt(e,t){let n=(Array.isArray(e?.groups)?e.groups:[]).findIndex(n=>n?.id===et(e)(t));return n>=0&&n<3?n:2}function Et(e,t,n,r){let i=[];if(n.actors)for(let t of Array.isArray(e.actorIds)?e.actorIds:[])i.push(Ye(r.get(t)?.name||t,10)+14);if(n.sources&&i.push(yee),!i.length)return 0;let a=1,o=0;for(let e of i){let t=o?vee+e:e;o&&o+t>532?(a+=1,o=e):o+=t}return a}function Dt({titleLines:e,summaryLines:t,tagLines:n,whenLineCount:r=3}){let i=20+20*Math.max(1,e);return t&&(i+=gee+18*t),n&&(i+=_ee+20*n),Math.max(i,10+18*r)}function Ot(e,t,n){let r=(e,t,r,i)=>n?Ze(e,531,e=>n(e,t)):Xe(e,532/r,i);return{title:Math.max(1,r(e.label||``,`title`,14,bee)),summary:t.summary&&e.summary?r(e.summary,`summary`,hee,pt):0}}function kt(e,t={},{measure:n}={}){let r=new Map((e?.actors||[]).filter(Boolean).map(e=>[e.id,e])),i=new Map((e?.sources||[]).filter(Boolean).map(e=>[e.id,e])),a=(Array.isArray(e?.groups)?e.groups.slice(0,3):[]).map((e,t)=>({label:e?.label,groupIndex:t,shape:Ct[t]})).filter(e=>e.label),o=Cee(e),s=[],c=[],l=[],u=[],d=a.length?34:0,f=null;o.forEach((a,o)=>{let{event:p}=a;if(f!=null){let e=mt[a.spacing]??mt.none;a.gap&&(l.push({y:f+e/2,gap:a.gap}),a.gap.long&&u.push({y0:f,y1:f+e})),d=f+e}let{title:m,summary:h}=Ot(p,t,typeof n==`function`?n:null),g=Et(p,e,t,r),_=Dt({titleLines:m,summaryLines:h,tagLines:g,whenLineCount:ft(p,`en`,a.sameDay).length}),v=Tt(e,p),y=(Array.isArray(p.actorIds)?p.actorIds:[]).map(e=>r.get(e)?.name||e),b=(Array.isArray(p.sourceIds)?p.sourceIds:[]).map(e=>i.get(e)).filter(Boolean);s.push({id:p.id,type:`entry`,position:{x:0,y:d},width:758,height:_,draggable:!1,connectable:!1,data:{event:p,index:o,groupIndex:v,shape:wt(e,p),actorNames:y,sources:b,fields:t,lines:{title:m,summary:h,tags:g},sameDay:a.sameDay,cardH:_}}),c.push({y:d+20,groupIndex:v,shape:wt(e,p),hollow:!p.date}),f=d+_});let p=f??0,m=[];return o.length&&m.push({id:`__spine__`,type:`spine`,position:{x:0,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,style:{pointerEvents:`none`},data:{x:174,top:c[0].y,bottom:c[c.length-1].y,dots:c,pills:l,breaks:u,dotSize:13}}),a.length&&m.push({id:`__legend__`,type:`legend`,position:{x:198,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,data:{groups:a}}),m.push(...s),{errors:[],nodes:m,edges:[],items:o,eventCount:o.length,layout:`chronicle`,size:{width:758,height:p}}}var At=12,wee=40,jt=12.5,Tee={latin:1.2,cjk:1.06},Mt=(e,t=1)=>16+17*e+2+15*t,Eee=e=>e?.dateEnd&&Ye(mee(e,`en`),11)*1.05>176?2:1,Nt=Mt(2,2)+10,Dee=10,Pt=22,Ft=12,It=e=>Ft+Math.max(1,e)*Nt+Pt,Lt=14,Rt=864e5,zt=36e5;function Bt(e){let t=_t(e?.date);if(!t)return null;let n=e=>Date.UTC(e.y,e.mo-1,e.d,e.h,e.mi,e.s),r=e=>e.prec===`year`?Date.UTC(e.y+1,0,1):e.prec===`month`?Date.UTC(e.y,e.mo,1):e.prec===`day`?Date.UTC(e.y,e.mo-1,e.d+1):n(e),i=n(t),a=_t(e?.dateEnd);return a&&r(a)>i?{from:i,to:r(a),kind:`bar`,exact:!0}:t.prec===`time`?{from:i,to:i,kind:`dot`,exact:!0}:{from:i,to:r(t),kind:`band`,exact:!1,prec:t.prec}}var Vt=e=>{let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2};function Ht(e){let t=e.slice(1).map((t,n)=>t-e[n]),n=[],r=(e,n)=>{let r=[];for(let i=e+n;i>=0&&i<t.length&&r.length<3&&!(t[i]>=t[e]);i+=n)r.push(t[i]);return r};return t.forEach((e,t)=>{if(e<1728e5)return;let i=r(t,1);i.length||(i=r(t,-1)),i.length&&e/Math.max(Vt(i),6e4)>=20&&n.push({i:t,g:e})}),n.sort((e,t)=>t.g-e.g).slice(0,2).map(e=>e.i).sort((e,t)=>e-t)}function Ut(e){return e>730*Rt?`year`:e>60*Rt?`month`:e>2*Rt?`day`:e>3*zt?`hour`:`minute`}function Wt(e,t,n,r){let i=new Date(e),a=[],o={year:[1,2,5,10],month:[1,2,3,6],day:[1,2,7,14],hour:[1,2,3,6,12],minute:[1,2,5,10,15,30]}[n];for(let s of o){a.length=0;let o;o=n===`year`?Date.UTC(i.getUTCFullYear(),0,1):n===`month`?Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1):n===`day`?Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()):n===`hour`?Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours()):Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes());let c=0;for(;o<=t&&c++<2e3;){o>=e&&a.push(o);let t=new Date(o);n===`year`?o=Date.UTC(t.getUTCFullYear()+s,0,1):n===`month`?o=Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+s,1):o+=n===`day`?s*Rt:n===`hour`?s*zt:s*6e4}if(a.length<=r)break}return[...a]}function Oee(e,t,n){let r=new Date(e),i=e=>String(e).padStart(2,`0`),a=`${i(r.getUTCMonth()+1)}-${i(r.getUTCDate())}`;if(t===`year`)return String(r.getUTCFullYear());if(t===`month`)return`${r.getUTCFullYear()}-${i(r.getUTCMonth()+1)}`;if(t===`day`)return a;let o=`${i(r.getUTCHours())}:${i(r.getUTCMinutes())}`;return n==null||new Date(n).getUTCDate()!==r.getUTCDate()?`${a} ${o}`:o}function Gt(e,t){let n=new Map,r=(Array.isArray(e?.actors)?e.actors:[]).filter(e=>e?.id);if(!t||r.length<2)return n;for(let t of Array.isArray(e?.groups)?e.groups.slice(0,2):[]){let e=r.filter(e=>t?.id&&e.groupId===t.id);e.length>=2&&n.set(t.id,e)}return n}function Kt(e,{byParty:t=!1}={}){let n=et(e),r=Gt(e,t);return e=>{let t=n(e),i=Array.isArray(e?.actorIds)?e.actorIds:[];return i.length===1&&r.get(t)?.some(e=>e.id===i[0])?`actor:${i[0]}`:t}}function qt(e,t,{byParty:n=!1}={}){let r=Kt(e,{byParty:n}),i=Gt(e,n),a=(Array.isArray(e?.groups)?e.groups.slice(0,3):[]).filter(e=>e&&e.id),o=new Set(t.map(r)),s=a.flatMap((e,t)=>{let n=i.get(e.id)?.filter(e=>o.has(`actor:${e.id}`));return n?.length?n.map(n=>({key:`actor:${n.id}`,label:n.name??``,side:e.label??``,groupIndex:t})):[{key:e.id,label:e.label??``,groupIndex:t}]}),c=new Set(s.map(e=>e.key));return t.some(e=>!c.has(r(e)))&&s.push({key:`__other__`,label:null,groupIndex:2,other:!0}),s}function kee(e,{levels:t=3,width:n=196,gap:r=Dee}={}){let i=e.map(e=>({ids:[e.id],x:e.x,from:e.x,to:e.x}));for(;;){let e=Jt(i,t,n,r);if(e)return e;let a=-1,o=1/0;for(let e=0;e+1<i.length;e++){let t=i[e+1].x-i[e].x;t<o&&(o=t,a=e)}if(a<0)return Jt(i,t,n,r)??[];let s=i[a],c=i[a+1],l=[...s.ids,...c.ids],u=Math.min(s.from,c.from),d=Math.max(s.to,c.to);i.splice(a,2,{ids:l,x:(u+d)/2,from:u,to:d}),i=i.sort((e,t)=>e.x-t.x)}}function Jt(e,t,n,r){let i=Array(t).fill(-1/0),a=[];for(let t of e){let e=t.x-n/2,o=i.findIndex(t=>t+r<=e);if(o<0)return null;i[o]=t.x+n/2,a.push({...t,level:o})}return a}function Aee(e,t={},{measure:n,byParty:r=!1}={}){let i=new Map((e?.actors||[]).filter(Boolean).map(e=>[e.id,e])),a=new Map((e?.sources||[]).filter(Boolean).map(e=>[e.id,e])),o=[];(Array.isArray(e?.slots)?e.slots:[]).forEach((e,t)=>{for(let n of Array.isArray(e?.events)?e.events:[])n&&typeof n==`object`&&o.push({event:n,slotIndex:t})}),o.forEach(e=>e.time=Bt(e.event)),o.forEach(e=>{e.time?.exact&&(e.time.t=e.time.from)});let s=e=>({before:o.slice(0,e).reverse().find(e=>e.time?.exact),after:o.slice(e+1).find(e=>e.time?.exact)}),c=o.filter(e=>e.time?.exact).map(e=>e.time.t),l=c.length>1?Math.max(6e4,(Math.max(...c)-Math.min(...c))/20):zt,u=(e,t,n)=>{let{before:r,after:i}=s(e),a;return a=r&&i?(r.time.t+i.time.t)/2:r?r.time.t+l:i?i.time.t-l:t==null?e*zt:(t+n)/2,t==null?a:Math.min(Math.max(a,t),n-1)};o.forEach((e,t)=>{e.time&&!e.time.exact&&(e.time.t=u(t,e.time.from,e.time.to))}),o.forEach((e,t)=>{if(e.time)return;let n=o.slice(0,t).reverse().find(e=>e.time),r=o.slice(t+1).find(e=>e.time),i=n&&r?(n.time.t+r.time.t)/2:n?n.time.t+l:r?r.time.t-l:t*zt;e.time={t:i,from:i,to:i,kind:`dot`,undated:!0}});let d=[...new Set(o.map(e=>e.time.t))].sort((e,t)=>e-t),f=[...new Set(o.filter(e=>!e.time.undated).map(e=>e.time.t))].sort((e,t)=>e-t),p=f.length?f:d,m=Ht(p),h=[],g=0;for(let e of m)h.push([p[g],p[e]]),g=e+1;h.push([p[g],p[p.length-1]]),h[0][0]=Math.min(h[0][0],d[0]),h[h.length-1][1]=Math.max(h[h.length-1][1],d[d.length-1]);let _=e=>{let t=h.findIndex(([,t])=>e<=t);return t<0?h.length-1:t},v=h.map(([e,t],n)=>({index:n,from:e,to:t,count:o.filter(e=>_(e.time.t)===n).length,unit:t>e?Ut(t-e):`day`})),y=e=>Ye(e,At)*1.06,b=qt(e,o.map(e=>e.event),{byParty:r}).flatMap(e=>[e.label||``,e.side||``]),x=Math.round(Math.min(196,Math.max(132,...b.map(e=>y(e)+wee)))),S=x;v.forEach((e,t)=>{if(t>0){let n=e.from-v[t-1].to;e.breakBefore={x:S,w:64,gap:See(n)},S+=64}e.x0=S,e.w=Math.max(170,e.count*116),e.x1=S+e.w,S=e.x1});let C=S,ee=e=>{let t=v[_(e)],n=t.w-196;return t.to===t.from?t.x0+t.w/2:t.x0+98+(Math.min(Math.max(e,t.from),t.to)-t.from)/(t.to-t.from)*n},w=(e,t)=>Math.min(Math.max(e,v[t].from),v[t].to),te=qt(e,o.map(e=>e.event),{byParty:r}),ne=Kt(e,{byParty:r}),re=e=>{let t=te.findIndex(t=>t.key===ne(e));return t>=0?t:te.length-1},ie=[],ae=[],oe=e=>ie[e],se=e=>ie[e]+ae[e],ce=o.map((e,t)=>{let n=_(e.time.t),r=e.time.kind,i=ee(r===`dot`?e.time.t:w(e.time.from,n)),a=r===`dot`?i:ee(w(e.time.to,n)),o=r===`bar`?i:ee(e.time.t),s=v[n],c=r===`band`&&s.to>s.from&&e.time.to-e.time.from>s.to-s.from,l=r===`band`&&(c||a-i<8)?`dot`:r;return l===`dot`?i=a=o:a-i<6&&(a=i+6),{id:e.event.id,order:t,lane:re(e.event),kind:l,x:o,x0:i,x1:a,undated:!!e.time.undated,coarse:c,prec:e.time.prec,event:e.event}}),le=new Map;for(let e of ce){let t=`${e.lane}:${Math.round(e.x)}`;e.stack=le.get(t)??0,le.set(t,e.stack+1)}let ue=e=>Math.min(2,Math.max(1,n?Ze(e,173,e=>n(e,`title`)):Xe(e,176/jt,Tee))),de=[],fe=[],pe=te.map((e,t)=>{let n=ce.filter(e=>e.lane===t).sort((e,t)=>e.x-t.x||e.order-t.order),r=e=>Math.min(Math.max(e,x+4+98),C-98);return kee(n.map(e=>({id:e.id,x:r(e.x)})))}),me=0;pe.forEach((e,t)=>{ie[t]=me,ae[t]=e.length?It(Math.max(0,...e.map(e=>e.level))+1):34,me+=ae[t]}),pe.forEach((e,t)=>{let n=e=>{let t=e.ids.map(e=>ce.find(t=>t.id===e).x);return(Math.min(...t)+Math.max(...t))/2};for(let r of e){let e=r.x-98,i=r.ids.map(e=>ce.find(t=>t.id===e)).sort((e,t)=>e.order-t.order),a=i.length>1,o=a?1:ue(i[0].event.label||``),s=a?1:i[0].undated?Ye(Ne(`en`,`scale.undated`),11)*1.05>176?2:1:Eee(i[0].event),c=Mt(o,s),l=se(t)-Pt-r.level*Nt,u={id:a?`__run__${fe.length+1}`:i[0].id,lane:t,level:r.level,x:e,y:l-c,w:196,h:c,titleLines:o,timeLines:s,anchor:n(r),members:i};a&&(u.run=fe.length+1,u.span=[Math.min(...i.map(e=>e.x0)),Math.max(...i.map(e=>e.x1))],fe.push(u)),de.push(u)}});let he=ie.length?ie[ie.length-1]+ae[ae.length-1]:0,ge=he+14,_e=v.flatMap(e=>{let t=Math.max(2,Math.floor(e.w/84)),n=e.to>e.from?Wt(e.from,e.to,e.unit,t):[],r=e.unit;return n.length||(n=e.to>e.from?[e.from,e.to]:[e.from],r=e.to>e.from?`minute`:`day`),n.map((e,t)=>({x:ee(e),label:Oee(e,r,t?n[t-1]:null)}))}),ve=fe.reduce((e,t)=>e+1+t.members.length,0),ye=fe.length?Lt+ve*18:0,be=he+56+ye,xe=e=>te[re(e)].groupIndex,Se=[{id:`__scale__`,type:`scaleLayer`,position:{x:0,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,style:{pointerEvents:`none`},data:{width:C,labelW:x,lanesH:he,axisY:ge,lanes:te.map((e,t)=>({...e,top:oe(t),lineY:se(t)})),segments:v,ticks:_e,marks:ce.map(e=>({id:e.id,kind:e.kind,x:e.x,x0:e.x0,x1:e.x1,y:se(e.lane)-e.stack*12,undated:e.undated,coarse:e.coarse,prec:e.prec,approx:!!e.event.approx,groupIndex:te[e.lane].groupIndex})),leaders:de.map(e=>({x:Math.min(Math.max(e.anchor,e.x+8),e.x+e.w-8),y0:e.y+e.h,y1:se(e.lane)-6,run:!!e.run})),brackets:fe.map(e=>({x0:e.span[0],x1:e.span[1],y:se(e.lane)+9,run:e.run}))}}];for(let e of de)Se.push({id:e.id,type:e.run?`scaleRun`:`scaleCard`,position:{x:e.x,y:e.y},width:e.w,height:e.h,draggable:!1,connectable:!1,data:e.run?{run:e.run,events:e.members.map(e=>e.event),groupIndex:te[e.lane].groupIndex,cardH:e.h}:{event:e.members[0].event,undated:e.members[0].undated,groupIndex:xe(e.members[0].event),titleLines:e.titleLines,timeLines:e.timeLines,cardH:e.h,actorNames:(Array.isArray(e.members[0].event.actorIds)?e.members[0].event.actorIds:[]).map(e=>i.get(e)?.name||e),sources:(Array.isArray(e.members[0].event.sourceIds)?e.members[0].event.sourceIds:[]).map(e=>a.get(e)).filter(Boolean)}});return fe.length&&Se.push({id:`__runs__`,type:`scaleRunList`,position:{x,y:he+56+Lt},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,data:{runs:fe.map(e=>({run:e.run,events:e.members.map(e=>e.event)})),width:C-x,lh:18}}),{errors:[],nodes:Se,edges:[],layout:`scale`,eventCount:o.length,segments:v,gathered:fe.map(e=>({run:e.run,ids:e.members.map(e=>e.id)})),cards:de.map(e=>({id:e.id,lane:e.lane,level:e.level,x:e.x,y:e.y,w:e.w,h:e.h,ids:e.members.map(e=>e.id)})),undated:ce.filter(e=>e.undated).length,labelW:x,size:{width:C,height:be}}}function Yt(e,t){if(!e||!t||!e.width||!e.height)return 1;let n=t.width/(e.width*1.12),r=t.height/(e.height*1.12);return Math.min(n,r,1)}function jee(e,t){return!e||!t||!e.width?1:Math.min(t.width/(e.width*1.12),1)}var Xt={width:1600,height:900},Zt=(e,t)=>Math.round(e*Math.min(t,1)*10)/10;function Qt(e,t){let n=`Text on one screen (${e.canvas.width}×${e.canvas.height})`,r=Zt(e.font,e.open.fit),i=Zt(e.font,e.other.fit),a=e=>e.toFixed(1),o=[];e.open.fit>=1&&e.other.fit>=1?o.push(`${n}: full size (${e.font} px) either way.`):o.push(`${n}: ${a(r)} px as it opens (${e.open.name}), ${a(i)} px ${e.other.name}. Full size is ${e.font} px.`);let s=Math.max(r,i);if(s<9?o.push(`Note: the text is too small to read without zooming in (under 9 px). Consider ${t}; do not drop facts to make it fit.`):s<11&&o.push(`Note: the text is small (under 11 px); the reader can zoom in. ${t[0].toUpperCase()}${t.slice(1)} would make it easier to read.`),e.folded!==void 0&&s<11){let t=e.folded>=1?`full size (${e.font} px)`:`${a(Zt(e.font,e.folded))} px`;o.push(`With every issue folded the text is ${t}: the reader can fold issues ("Fold issues" in the bar) instead of your splitting it.`)}return o}var $t={envelope:[{name:`type`,req:`yes`,ty:`string`,note:`always "fact"`},Oe(2),{name:`title`,req:`yes`,ty:`string`,note:`diagram title, shown at the top left`}],actors:[{name:`id`,req:`yes`,ty:`string`,note:`unique within the diagram; events reference it via actorIds`},{name:`name`,req:`yes`,ty:`string`,note:`display name, e.g. "Huayuan Trading"`},{name:`role`,req:`no`,ty:`string`,note:`procedural standing, e.g. "plaintiff"`},{name:`groupId`,req:`*`,ty:`string`,note:`the side this party is on: the 1st or the 2nd group. Required with 2 or more parties; not written with one`}],groups:[{name:`id`,req:`yes`,ty:`string`,note:`parties (2 or more) or events (one party) reference it via groupId`},{name:`label`,req:`yes`,ty:`string`,note:`column heading, e.g. "Sun Hao's side" (parties) or "performance as agreed" (one party's acts)`},{name:``,req:``,ty:``,note:`at most 3: the 1st on the left (top) side, the 2nd on the right (bottom) side, the 3rd on the axis`},{name:``,req:``,ty:``,note:`2 or more parties: the groups split the parties. 0 or 1 party: they split the events by kind of act`}],sources:[{name:`id`,req:`yes`,ty:`string`,note:`events reference it via sourceIds`},{name:`type`,req:`yes`,ty:`string`,note:`contract / evidence / judgment / transcript, etc.`},{name:`name`,req:`yes`,ty:`string`,note:`material name, e.g. "corridor surveillance video"`},{name:`loc`,req:`no`,ty:`object`,note:`location, e.g. { file, page } or { file, timestamp }`},{name:`quote`,req:`no`,ty:`string`,note:`verbatim excerpt (several passages joined with ……), shown when the card is opened; a shortened or reworded version goes in detail`}],slots:[{name:`events`,req:`yes`,ty:`array`,note:`events at this time point; must not be empty`},{name:``,req:``,ty:``,note:`array order is chronological order; date is display-only and never reorders`}],events:[{name:`id`,req:`yes`,ty:`string`,note:`unique within the diagram`},{name:`date`,req:`no`,ty:`string`,note:`ISO 8601. Go to seconds when known, otherwise stop at the day. **Leave it out when the material gives no date: never make one up.** The card then says the date is unknown; the order is the order of slots, so nothing moves`},{name:`label`,req:`yes`,ty:`string`,note:`card title; about 20 characters per line, at most two lines`},{name:`dateEnd`,req:`no`,ty:`string`,note:`for a span, the end instant; needs date, and must not be earlier than it`},{name:`approx`,req:`no`,ty:`boolean`,note:`time is not exact (estimated or inferred); the diagram shows "approx."`},{name:`dateNote`,req:`no`,ty:`string`,note:`why the time is not exact, and how it was derived`},{name:`summary`,req:`no`,ty:`string`,note:`the line under the card title; about 22 characters`},{name:`detail`,req:`no`,ty:`string`,note:`full text revealed when the card is opened`},{name:`actorIds`,req:`no`,ty:`string[]`,note:`parties involved. One: that party's side and column. Two or more, or none: the centre axis`},{name:`groupId`,req:`*`,ty:`string`,note:`only when the diagram has 0 or 1 party: which side this event falls on. With 2 or more parties, leave it out`},{name:`sourceIds`,req:`no`,ty:`string[]`,note:`which materials it rests on`}]};function Mee(){let e=[`Fields of a fact spec. "yes" means required.`,``];for(let[t,n]of Object.entries($t)){e.push(`[${t}]`);for(let t of n)t.name?e.push(` ${t.name.padEnd(12)} ${t.req.padEnd(3)} ${t.ty.padEnd(15)} ${t.note}`):e.push(` · ${t.note}`);e.push(``)}return e.push(`"*": required or not depending on the number of parties, as the note says.`),e.push(`Cross-field rules (dangling references, a span running backwards, a party without a`),e.push(`side, two events in the same lane of one time slot) are not listed`),e.push(`above: call antu_validate after writing. It reports each problem with its field path.`),e.join(`
|
|
1427
1427
|
`)}function Nee(e,t,{fields:n,canvas:r}){let i=t(e,n),a=Number(jee(i.size,r).toFixed(3)),o=Number(Yt(i.size,r).toFixed(3)),s=Math.max(1,Math.round(i.size.height*a/r.height*10)/10),c=i.items.filter(e=>e.gap);return{text:{font:14,canvas:r,open:{name:`fitted to width`,fit:a},other:{name:`whole column`,fit:o}},counts:{slots:Array.isArray(e.slots)?e.slots.length:0,events:i.items.length,actors:e.actors?.length??0,sources:e.sources?.length??0},size:i.size,screens:s,gaps:{short:c.filter(e=>!e.gap.long).length,long:c.filter(e=>e.gap.long).length},undated:i.items.filter(e=>!e.event.date).length}}function Pee(e){let t=[];return t.push(`Kind: chronicle (every event in one column, in slot order; orientation does not apply)`),t.push(`Data: ${e.counts.events} events / ${e.counts.slots} time slots / ${e.counts.actors} parties / ${e.counts.sources} sources`),t.push(`Content ${e.size.width}×${e.size.height}; it opens fitted to its width, about ${e.screens} screen(s) tall`),t.push(`Gaps written between time points: ${e.gaps.short} short, ${e.gaps.long} of 30 days or more (marked)`),e.undated&&t.push(`${e.undated} event(s) without a date: shown in slot order with a hollow dot, and no gap on either side`),t.push(...Qt(e.text,`splitting the case into periods, one diagram each`)),t.join(`
|
|
1428
1428
|
`)}function Fee(e,t,{canvas:n}){let r=t(e,{}),i=Number(Yt(r.size,n).toFixed(3));return{text:{font:jt,canvas:n,open:{name:`fitted whole`,fit:i},other:{name:`fitted whole`,fit:i}},counts:{events:r.eventCount,actors:e.actors?.length??0,sources:e.sources?.length??0},size:r.size,segments:r.segments.map(e=>({unit:e.unit,count:e.count})),gathered:r.gathered.map(e=>e.ids.length),undated:r.undated}}function Iee(e){let t=[];return t.push(`Kind: scale (distance on the axis is real time; orientation does not apply)`),t.push(`Data: ${e.counts.events} events / ${e.counts.actors} parties / ${e.counts.sources} sources`),t.push(`Content ${e.size.width}×${e.size.height}`),t.push(e.segments.length>1?`The axis breaks into ${e.segments.length} segments: ${e.segments.map((e,t)=>`${t+1}. by ${e.unit}, ${e.count} event(s)`).join(`; `)}`:`One segment, by ${e.segments[0]?.unit??`day`}`),e.gathered.length&&t.push(`${e.gathered.length} run(s) of events too close to show one by one are gathered (${e.gathered.join(`, `)} events); they are listed in full under the diagram`),e.undated&&t.push(`${e.undated} event(s) without a date: placed between their neighbours in data order, with a hollow dot`),t.push(...Qt(e.text,`splitting the case into periods, one diagram each`)),t.join(`
|
|
1429
1429
|
`)}var Lee={specVersion:2,label:`graphType.fact`,fields:$t,describe:Mee,validate:e=>it(e).errors,notes:e=>[...Re(e),...ze(e)],info:(e,t,n)=>{let r=Array.isArray(e.slots)?e.slots:[],i=r.flatMap(e=>(e?.events||[]).map(e=>e?.date)).filter(e=>typeof e==`string`&&e).sort(),a=t(`info.slots`,{n:n(r.length)});if(i.length>0){let e=i[0].slice(0,10),n=i[i.length-1].slice(0,10);a+=e===n?` · ${e}`:` · ${t(`info.span`,{from:e,to:n})}`}return[a,t(`info.actors`,{n:n(e.actors?.length||0)}),t(`info.sources`,{n:n(e.sources?.length||0)})]},report:(e,t,{orientation:n,fields:r={summary:!0},kind:i,canvas:a})=>{if(i===`chronicle`)return Nee(e,t,{fields:r,canvas:a});if(i===`scale`)return Fee(e,t,{canvas:a});let o=t(e,r,void 0,n??`vertical`),s=it(e),c={side1:0,axis:0,side2:0};s.columns.forEach(e=>{c[e.side]+=1});let l={events:o.eventCount??s.eventCount??0,columns:c,blocked:o.errors.length>0?o.errors[0]:null},u={};for(let n of[`vertical`,`horizontal`]){let i=t(e,r,void 0,n,{stagger:!0});u[n]={size:i.size,fit:Number(Yt(i.size,a).toFixed(3))}}let d=t(e,r,void 0,`vertical`,{stagger:!1}),f={size:d.size,fit:Number(Yt(d.size,a).toFixed(3))},p=Array.isArray(e.slots)?e.slots.length:0,m=n??(p>=5?`vertical`:`horizontal`),h=m===`vertical`?`horizontal`:`vertical`;return{text:{font:13,canvas:a,open:{name:m,fit:u[m].fit},other:{name:h,fit:u[h].fit}},unstaggered:f,counts:{slots:p,events:(e.slots??[]).reduce((e,t)=>e+(t?.events?.length||0),0),actors:e.actors?.length??0,sources:e.sources?.length??0},byOrientation:u,suggestedOrientation:p>=5?`vertical`:`horizontal`,placement:l}},formatReport:e=>{if(e.kind===`chronicle`)return Pee(e);if(e.kind===`scale`)return Iee(e);let t=[];t.push(`Data: ${e.counts.events} events / ${e.counts.slots} time slots / ${e.counts.actors} parties / ${e.counts.sources} sources`);let n=e.byOrientation.vertical,r=e.byOrientation.horizontal,i=e.unstaggered,a=i&&(i.size.height!==n.size.height||i.size.width!==n.size.width)?` (rows staggered, the page's default; with "Stagger" off ${i.size.width}×${i.size.height}, fit zoom ${i.fit})`:``;t.push(`Vertical: content ${n.size.width}×${n.size.height}, fit zoom ${n.fit}${a}`),t.push(`Horizontal: content ${r.size.width}×${r.size.height}, fit zoom ${r.fit}`),t.push(e.suggestedOrientation===`vertical`?`Suggested orientation: vertical (by the slot-count rule, ${e.counts.slots} slots >= 5)`:`Suggested orientation: horizontal (by the slot-count rule, ${e.counts.slots} slots < 5)`),t.push(...Qt(e.text,`splitting the timeline into periods, one diagram each`));let o=e.placement;return t.push(`Columns: side1 ${o.columns.side1} / axis ${o.columns.axis} / side2 ${o.columns.side2}, ${o.events} events`),o.blocked&&(t.push(`Does not fit: ${o.blocked}`),t.push(`Common cause: two or more events of one time slot fall in the same lane (the grid is one event per cell).`),t.push(`How to fix: split that time slot into two finer time points, or check the parties of the events so they land in different lanes.`)),t.join(`
|
|
@@ -1480,7 +1480,7 @@ import{execFileSync as e,spawn as t,spawnSync as n}from"node:child_process";impo
|
|
|
1480
1480
|
})()`);if(!r)throw Error(`Cannot hover element: ${e}`);let{x:i,y:a}=JSON.parse(r);await _.send(`Input.dispatchMouseEvent`,{type:`mouseMoved`,x:i+t,y:a+n})},get requests(){return v.slice()},get errors(){return y.slice()},async close(){_.close(),await No(p),await Fo(h)}};return b}async function nre(e,{width:t=1600,height:n=900,settleMs:r=800}={}){let i=Date.now(),a=await tre({width:t,height:n});try{await a.open(h(e).href,{settleMs:r});let o=await a.eval(`document.querySelectorAll(${JSON.stringify(Eo)}).length`);return{data:await a.screenshotData(),mimeType:`image/png`,width:t,height:n,cards:o,ms:Date.now()-i}}finally{await a.close()}}var Io=`@zh-xx/antu`,rre=`https://registry.npmjs.org/${Io.replace(/\//g,`%2f`)}/latest`,ire=1500;function Lo(e,t){let n=e=>/^(\d+)\.(\d+)\.(\d+)$/.exec(String(e))?.slice(1).map(Number),r=n(e),i=n(t);if(!r||!i)return null;for(let e=0;e<3;e+=1)if(r[e]!==i[e])return r[e]<i[e]?-1:1;return 0}function are(e=m(import.meta.url)){let t=d(e);return u(t)===`scripts`&&r(f(t,`..`,`SKILL.md`))?`skill`:e.split(/[\\/]/).includes(`node_modules`)?`npm`:`source`}function ore({current:e,latest:t,where:n}){return Lo(e,t)===-1?n===`skill`?[`Notice: Antu ${t} is out; this skill is ${e}.`,`When the request is done, tell the user in a sentence or two that the skill can be updated with:`,` npx skills update antu -g`,`Do not run it unless the user agrees.`].join(`
|
|
1481
1481
|
`):n===`npm`?[`Notice: Antu ${t} is out; this is ${e}.`,`When the request is done, tell the user in a sentence or two that it can be updated with:`,` npm update -g ${Io} (or run it with: npx -y ${Io}@latest)`,`Do not run it unless the user agrees.`].join(`
|
|
1482
1482
|
`):``:``}async function Ro({url:e,cacheFile:t,now:n}){try{let e=JSON.parse(a(t,`utf8`));if(typeof e.latest==`string`&&n-e.checkedAt<864e5)return e.latest}catch{}let r=new AbortController,i=setTimeout(()=>r.abort(),ire);try{let i=await fetch(e,{signal:r.signal,headers:{accept:`application/json`}});if(!i.ok)return null;let a=(await i.json())?.version;if(typeof a!=`string`)return null;try{c(t,JSON.stringify({checkedAt:n,latest:a}))}catch{}return a}catch{return null}finally{clearTimeout(i)}}async function zo({current:e,where:t=are(),env:n=process.env,now:r=Date.now()}={}){try{if(n.ANTU_NO_UPDATE_NOTIFIER||t===`source`||Lo(e,e)===null)return``;let i=n.ANTU_REGISTRY_URL||rre,a=await Ro({url:i,cacheFile:f(l(),`antu-update-check-${g(`sha1`).update(i).digest(`hex`).slice(0,16)}.json`),now:r});return a?ore({current:e,latest:a,where:t}):``}catch{return``}}function sre(e,t){return{release:e,types:we().map(e=>e.type).filter(e=>!t||e===t).map(e=>({type:e,specVersion:Ce(e).specVersion,diagrams:Se(e).map(({kind:e,version:t,status:n,since:r})=>({kind:e,version:t,status:n,since:r}))}))}}function cre(e){let t=[`Antu ${e.release}`,``];for(let n of e.types){t.push(`${n.type}: format generation ${n.specVersion}`);let e=Math.max(...n.diagrams.map(e=>e.kind.length));n.diagrams.forEach((n,r)=>t.push(` ${n.kind.padEnd(e)} v${n.version} ${n.status} since ${n.since}${r===0?` (default)`:``}`))}return t.join(`
|
|
1483
|
-
`)}var Bo=`0.
|
|
1483
|
+
`)}var Bo=`0.16.1`,Vo=`Antu ${Bo}: check and draw an Antu diagram (JSON)
|
|
1484
1484
|
|
|
1485
1485
|
node antu.mjs validate <spec.json> is the JSON valid? (each problem, with its field path)
|
|
1486
1486
|
node antu.mjs layout <spec.json> [--orientation vertical|horizontal] [--kind K]
|
package/embed/antu-embed.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface AntuSpec {
|
|
|
9
9
|
[field: string]: unknown
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export type AntuTheme = 'document' | 'modern' | 'legal'
|
|
12
|
+
export type AntuTheme = 'document' | 'modern' | 'legal' | 'dark'
|
|
13
13
|
export type AntuLang = 'zh' | 'en'
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -61,6 +61,7 @@ export type AntuEvent =
|
|
|
61
61
|
sources: AntuSource[]
|
|
62
62
|
}
|
|
63
63
|
| { type: 'kindchange'; kind: string }
|
|
64
|
+
| { type: 'themechange'; theme: AntuTheme }
|
|
64
65
|
| { type: 'invalid'; errors: string[] }
|
|
65
66
|
|
|
66
67
|
export interface AntuPrefsStore {
|
|
@@ -147,3 +148,12 @@ export function normalize(spec: unknown): { spec: unknown; changes: string[] }
|
|
|
147
148
|
|
|
148
149
|
/** The kinds a type can be drawn in, the first being the one it opens in */
|
|
149
150
|
export function kindsOf(type: string): string[]
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* A small sketch of a kind as one `<svg viewBox="0 0 80 48">` string, for a host that draws its own picker. Its colours are CSS
|
|
154
|
+
* variables to set where the markup goes: `--antu-text-3` (ink), `--antu-line` (the tint of the boxes) and `--antu-bg` (the ground it sits on: a few sketches paint with it and it falls back to white, so a dark host must set it). `null` for a kind with no sketch.
|
|
155
|
+
*/
|
|
156
|
+
export function kindIcon(kind: string): string | null
|
|
157
|
+
|
|
158
|
+
/** The name of a kind as the page's picker shows it, in `zh` or `en` (anything else gives English); `null` for an unknown kind */
|
|
159
|
+
export function kindLabel(kind: string, lang?: AntuLang): string | null
|