@zh-xx/antu 0.16.2 → 0.16.4

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.
@@ -1,4 +1,4 @@
1
- // Antu 0.16.2
1
+ // Antu 0.16.4
2
2
  // Copyright (C) 2026 Ji Cheng
3
3
  //
4
4
  // Antu is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
@@ -12,9 +12,9 @@
12
12
  // publish them, or sell them on any terms you like. This licence covers Antu's code in the page, and the notices in
13
13
  // the page must stay with it.
14
14
  //
15
- // Corresponding Source of this version: https://github.com/zh-xx/Antu/tree/v0.16.2
16
- // The licence: https://github.com/zh-xx/Antu/blob/v0.16.2/LICENSE
17
- // Third-party notices: https://github.com/zh-xx/Antu/blob/v0.16.2/skills/antu/THIRD-PARTY-NOTICES.md
15
+ // Corresponding Source of this version: https://github.com/zh-xx/Antu/tree/v0.16.4
16
+ // The licence: https://github.com/zh-xx/Antu/blob/v0.16.4/LICENSE
17
+ // Third-party notices: https://github.com/zh-xx/Antu/blob/v0.16.4/skills/antu/THIRD-PARTY-NOTICES.md
18
18
  //
19
19
  // === The licence of Antu ===
20
20
  //
@@ -1422,7 +1422,7 @@
1422
1422
  // SOFTWARE.
1423
1423
  // ````
1424
1424
  //
1425
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=new Map,u=[`experimental`,`stable`,`deprecated`];function d(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)`);f(e,t),l.set(e,t)}function f(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(!u.includes(r.status))throw Error(`registerKnowledge: ${e}/${n}: status must be one of ${u.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 p(e){let t=l.get(e);return Object.entries(t?.diagrams??{}).map(([t,n])=>({type:e,kind:t,...n}))}function m(e){return l.get(e)}function h(){return[...l.entries()].map(([e,t])=>({type:e,labelKey:t.label??`graphType.${e}`}))}function g(e){return l.get(e)?.validate}function _(e,t){let n=l.get(e)?.layouts;if(n)return t&&n[t]?n[t]:Object.values(n)[0]}function v(e){return Object.keys(l.get(e)?.layouts??{})}var y=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 b(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 x={"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`},S={en:x,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(x).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,x[e]]))}};function C(e){return!e||typeof e!=`string`?`en`:e.toLowerCase().split(`-`)[0]===`zh`?`zh`:`en`}function ee(e,t,n){let r=(S[C(e)]??S.en)[t]??S.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 w=(e,t)=>ee(`en`,e,t),te=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?)?)?$/;function ne(e){let t=te.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 re(e){let t=ne(e?.date);if(!t)return null;let{from:n,to:r}=t,i=e.dateEnd===void 0?null:ne(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 ie(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:re(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(w(`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 ae(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})=>w(`note.partyNoEvent`,{at:`actors[${t}]`,id:e.id,name:e.name??e.id}))}var oe=19,se=2,ce=18,le=6,ue=16,de=11.5,fe=1,pe=.55;function me(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?fe:pe}function he(e){let t=0;for(let n of String(e??``))t+=me(n);return t}var ge=(e,t)=>he(e)*t,_e=262/13;262/de;function ve(e={},t=se,n=0){let r=22+oe*t+le+ue;return e.summary&&(r+=24),e.actors&&n>0&&(r+=ce*n+le),r}function ye(e,t,n={}){let r=n.latin??1,i=n.cjk??1;return be(e,t,e=>{let t=0;for(let n of e)t+=me(n)*(me(n)===fe?i:r);return t})}function be(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 xe={SIDE1:`side1`,AXIS:`axis`,SIDE2:`side2`},Se=3;function Ce(e){let t=(Array.isArray(e?.actors)?e.actors:[]).filter(e=>De(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 we=/^\d{4}(-\d{2}(-\d{2}(T\d{2}(:\d{2}(:\d{2})?)?)?)?)?$/;function Te(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 Ee=[xe.SIDE1,xe.SIDE2,xe.AXIS];function De(e){return e&&typeof e==`object`&&!Array.isArray(e)}function Oe(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:{[xe.SIDE1]:``,[xe.SIDE2]:``,[xe.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)=>{De(e)?e.id?(s.has(e.id)&&t.push(w(`err.duplicateId`,{at:`actors[${n}]`,id:e.id})),s.set(e.id,e),e.name||t.push(w(`err.required`,{at:`actors[${n}] (${e.id})`,field:`name`}))):t.push(w(`err.required`,{at:`actors[${n}]`,field:`id`})):t.push(w(`err.notObject`,{at:`actors[${n}]`}))}),e?.views!==void 0&&t.push(w(`err.viewsRemoved`));let c=new Map,l=new Map;r.length>Se&&t.push(w(`err.tooManyGroups`,{at:`groups`,max:Se,actual:r.length})),r.forEach((e,n)=>{De(e)?e.id?(l.has(e.id)&&t.push(w(`err.duplicateId`,{at:`groups[${n}]`,id:e.id})),c.set(e.id,e),l.set(e.id,n),e.label||t.push(w(`err.required`,{at:`groups[${n}] (${e.id})`,field:`label`}))):t.push(w(`err.required`,{at:`groups[${n}]`,field:`id`})):t.push(w(`err.notObject`,{at:`groups[${n}]`}))});let u=s.size>=2,d=new Map;n.forEach((e,n)=>{if(!De(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(w(`err.actorGroupOneParty`,{at:r}));return}if(!i){t.push(w(`err.actorNeedsGroup`,{at:r,n:s.size}));return}if(!l.has(e.groupId)){t.push(w(`err.missingRef`,{at:r,field:`groupId`,kind:`group`,id:e.groupId}));return}let a=l.get(e.groupId);a>1?t.push(w(`err.actorGroupNotSide`,{at:r,groupId:e.groupId})):d.set(e.id,a===0?xe.SIDE1:xe.SIDE2)});let f=new Map;if(i.forEach((e,n)=>{De(e)?e.id?(f.has(e.id)&&t.push(w(`err.duplicateId`,{at:`sources[${n}]`,id:e.id})),f.set(e.id,e),e.type||t.push(w(`err.required`,{at:`sources[${n}] (${e.id})`,field:`type`})),e.name||t.push(w(`err.required`,{at:`sources[${n}] (${e.id})`,field:`name`}))):t.push(w(`err.required`,{at:`sources[${n}]`,field:`id`})):t.push(w(`err.notObject`,{at:`sources[${n}]`}))}),!Array.isArray(a))return t.push(w(`err.slotNotArray`)),{...o,actorById:s,groupById:c,groupIndexById:l,sourceById:f};a.length===0&&t.push(w(`err.slotsEmpty`));let p=new Set,m={[xe.SIDE1]:new Set,[xe.SIDE2]:new Set},h=[];a.forEach((e,n)=>{let r=`slots[${n}]`;De(e)?Array.isArray(e.events)?(e.events.length===0&&t.push(w(`err.slotEventsEmpty`,{at:r})),e.events.forEach((e,i)=>{let a=`${r}.events[${i}]${e?.id?` (${e.id})`:``}`;if(!De(e)){t.push(w(`err.notObject`,{at:a}));return}e.id?p.has(e.id)?t.push(w(`err.duplicateId`,{at:a,id:e.id})):p.add(e.id):t.push(w(`err.required`,{at:a,field:`id`})),e.date&&!we.test(e.date)&&t.push(w(`err.badDate`,{at:a,field:`date`,value:e.date})),e.label||t.push(w(`err.required`,{at:a,field:`label`})),e.dateEnd!==void 0&&e.dateEnd!==null&&(typeof e.dateEnd!=`string`||!we.test(e.dateEnd)?t.push(w(`err.badDate`,{at:a,field:`dateEnd`,value:e.dateEnd})):e.date?Te(e.dateEnd,e.date)&&t.push(w(`err.dateEndBeforeDate`,{at:a,end:e.dateEnd,start:e.date})):t.push(w(`err.dateEndNeedsDate`,{at:a}))),e.summary!==void 0&&e.summary!==null&&(typeof e.summary==`string`?he(e.summary)>22.782608695652176&&t.push(w(`err.summaryTooLong`,{at:a,max:22,actual:Math.ceil(he(e.summary))})):t.push(w(`err.mustBeString`,{at:a,field:`summary`})));let o=Array.isArray(e.actorIds)?e.actorIds:[];o.forEach(e=>{s.has(e)||t.push(w(`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(w(`err.eventGroupWithParties`,{at:a})):c&&!l.has(e.groupId)&&t.push(w(`err.missingRef`,{at:a,field:`groupId`,kind:`group`,id:e.groupId})),(Array.isArray(e.sourceIds)?e.sourceIds:[]).forEach(e=>{f.has(e)||t.push(w(`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]):_=xe.AXIS;else if(o.length>=2)_=xe.AXIS,(g===0||g===1)&&t.push(w(`err.multiActorNeedsAxis`,{at:a,n:o.length,groupId:e.groupId}));else if(!c)_=xe.AXIS;else if(g===void 0)return;else _=Ee[g]??xe.AXIS;!u&&_!==xe.AXIS&&o.length!==1?t.push(w(`err.groupNeedsOneActor`,{at:a,groupId:e.groupId,n:o.length})):(!u&&_!==xe.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(w(`err.eventsNotArray`,{at:r})):t.push(w(`err.slotShape`,{at:r}))});let g=n.map(e=>De(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(xe.SIDE1).reverse());let b=y.length;y.push({key:xe.AXIS,side:xe.AXIS}),y.push(...v(xe.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===xe.AXIS?xe.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(w(`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:{[xe.SIDE1]:r[0]?.label??``,[xe.SIDE2]:r[1]?.label??``,[xe.AXIS]:r[2]?.label??``},columns:y,rows:S,placements:C,axisColumnIndex:b,actorById:s,groupById:c,groupIndexById:l,sourceById:f,eventCount:ee}}function ke(e){return e===xe.SIDE1?0:e===xe.SIDE2?1:2}function Ae(e){let t=1;for(let n of e.rows)n.cells.forEach(e=>{let n=he(e.label||``);t=Math.max(t,Math.min(2,Math.ceil(n/_e)))});return t}function je(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+ge(t,10)+14,0)+4*(r.length-1);n=Math.max(n,Math.ceil(i/262))});return n}function Me(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 Ne=.5;function Pe(e,t){if(!t)return e.rows.map((e,t)=>t);let n=e.rows.map(t=>Me(t,e)),r=[];return n.forEach((e,t)=>{let i=t===0?0:r[t-1]+Ne;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 Fe(e,t,n,r=!1){let i=e.columns.length,a=e.rows.length,o=Ae(e),s=je(e,t),c=ve(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=Pe(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 Ie={draggable:!1,selectable:!1,connectable:!1,focusable:!1};function Le(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 Re(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},...Ie}}function ze(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!==xe.AXIS&&(s>1||a.named),l=o===r(a.side),u={type:`colHeader`,...Ie},d={isH:t.isH,side:a.side,groupIndex:ke(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 Be(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},...Ie}}function Ve(e,t){return{id:`__links__`,type:`links`,position:{x:0,y:0},width:1,height:1,style:{pointerEvents:`none`},data:{segments:e,isH:t},...Ie}}function He(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:{...Le(e,r,n),groupIndex:ke(r.columns[t].side),cardW:288,cardH:i.cardH,labelLines:i.labelLines,fields:a,isH:i.isH}},link:l}}function Ue(e,t={},n,r=`vertical`,{stagger:i=!1}={}){let a=r===`horizontal`,o=Oe(e),s=Fe(o,t,a,i),c=[Re(s),...ze(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}=He(n,i,e.index,o,s,t);l.push(a),c&&u.push(c)})}),u.length&&c.push(Ve(u,a)),c.push(Be(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 We(e,t,n){let[r,i]=String(e).split(`T`),a=t?ee(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 Ge(e,t,n){let r=We(t,!1,n);return String(e).split(`T`)[0]===String(t).split(`T`)[0]&&String(t).includes(`T`)?r.split(` `).pop():r}function Ke(e,t){if(!e.date)return ee(t,`card.dateUnknown`);let n=We(e.date,e.approx,t);return e.dateEnd?`${n} - ${Ge(e.date,e.dateEnd,t)}`:n}function eee(e,t,n=!1){if(!e.date)return[{text:ee(t,`chronicle.dateUnknown`),strong:!1}];let[r,i]=String(e.date).split(`T`),a=[{text:(e.approx?ee(t,`card.approxPrefix`):``)+r,strong:!0}],o=i?We(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=Ge(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 tee=12.5,qe=4,nee=6,Je=10,Ye=90,ree={latin:1.2,cjk:1.06},iee={latin:1.12,cjk:1.06},Xe={sameSlot:10,none:22,short:38,long:70},Ze=864e5,Qe=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2})(?::(\d{2})(?::(\d{2}))?)?)?)?)?$/;function $e(e){let t=typeof e==`string`?Qe.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 et={year:0,month:1,day:2,time:3},tt=e=>Date.UTC(e.y,e.mo-1,e.d,e.h,e.mi,e.s);function nt(e,t,n=!1){let r=$e(e),i=$e(t);if(!r||!i)return null;let a=et[r.prec]<=et[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:it(e,o)}if(a===`time`){let e=tt(i)-tt(r);if(e<=0)return null;if(e<Ze){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 rt(Math.floor(e/Ze),o)}let s=Math.round((Date.UTC(i.y,i.mo-1,i.d)-Date.UTC(r.y,r.mo-1,r.d))/Ze);return s<=0?null:rt(s,o)}function aee(e){let t=(e,t,n)=>({key:e,vars:t,long:n,approx:!1});if(!(e>0))return null;if(e<Ze){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 rt(Math.round(e/Ze),t)}function rt(e,t){return e<30?t(`chronicle.gapDays`,{n:e},!1):it(Math.max(1,Math.round(e/30.44)),t)}function it(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 at=(e,t)=>e==null?t:t==null||e>t?e:t;function ot(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?nt(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=at(r,at(e.date,e.dateEnd));i=c.some(e=>e.approx)}),n}var st=[`circle`,`square`,`diamond`];function ct(e,t){let n=(Array.isArray(e?.groups)?e.groups:[]).findIndex(n=>n?.id===Ce(e)(t));return n<0?`none`:st[Math.min(n,2)]}function oee(e,t){let n=(Array.isArray(e?.groups)?e.groups:[]).findIndex(n=>n?.id===Ce(e)(t));return n>=0&&n<3?n:2}function see(e,t,n,r){let i=[];if(n.actors)for(let t of Array.isArray(e.actorIds)?e.actorIds:[])i.push(ge(r.get(t)?.name||t,10)+14);if(n.sources&&i.push(Ye),!i.length)return 0;let a=1,o=0;for(let e of i){let t=o?Je+e:e;o&&o+t>532?(a+=1,o=e):o+=t}return a}function lt({titleLines:e,summaryLines:t,tagLines:n,whenLineCount:r=3}){let i=20+20*Math.max(1,e);return t&&(i+=qe+18*t),n&&(i+=nee+20*n),Math.max(i,10+18*r)}function ut(e,t,n){let r=(e,t,r,i)=>n?be(e,531,e=>n(e,t)):ye(e,532/r,i);return{title:Math.max(1,r(e.label||``,`title`,14,ree)),summary:t.summary&&e.summary?r(e.summary,`summary`,tee,iee):0}}function cee(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:st[t]})).filter(e=>e.label),o=ot(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=Xe[a.spacing]??Xe.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}=ut(p,t,typeof n==`function`?n:null),g=see(p,e,t,r),_=lt({titleLines:m,summaryLines:h,tagLines:g,whenLineCount:eee(p,`en`,a.sameDay).length}),v=oee(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:ct(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:ct(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 lee=12,uee=40,dt=12.5,dee={latin:1.2,cjk:1.06},ft=(e,t=1)=>16+17*e+2+15*t,pt=e=>e?.dateEnd&&ge(Ke(e,`en`),11)*1.05>176?2:1,mt=ft(2,2)+10,ht=10,gt=22,fee=12,_t=e=>fee+Math.max(1,e)*mt+gt,vt=14,yt=864e5,bt=36e5;function xt(e){let t=$e(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=$e(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 St=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 pee(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(St(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 mee(e){return e>730*yt?`year`:e>60*yt?`month`:e>2*yt?`day`:e>3*bt?`hour`:`minute`}function hee(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*yt:n===`hour`?s*bt:s*6e4}if(a.length<=r)break}return[...a]}function gee(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 Ct(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 wt(e,{byParty:t=!1}={}){let n=Ce(e),r=Ct(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 Tt(e,t,{byParty:n=!1}={}){let r=wt(e,{byParty:n}),i=Ct(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 _ee(e,{levels:t=3,width:n=196,gap:r=ht}={}){let i=e.map(e=>({ids:[e.id],x:e.x,from:e.x,to:e.x}));for(;;){let e=Et(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 Et(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 Et(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 Dt(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=xt(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):bt,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*bt:(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*bt;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=pee(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?mee(t-e):`day`})),y=e=>ge(e,lee)*1.06,b=Tt(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)+uee)))),S=x;v.forEach((e,t)=>{if(t>0){let n=e.from-v[t-1].to;e.breakBefore={x:S,w:64,gap:aee(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,w=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},te=(e,t)=>Math.min(Math.max(e,v[t].from),v[t].to),ne=Tt(e,o.map(e=>e.event),{byParty:r}),re=wt(e,{byParty:r}),ie=e=>{let t=ne.findIndex(t=>t.key===re(e));return t>=0?t:ne.length-1},ae=[],oe=[],se=e=>ae[e],ce=e=>ae[e]+oe[e],le=o.map((e,t)=>{let n=_(e.time.t),r=e.time.kind,i=w(r===`dot`?e.time.t:te(e.time.from,n)),a=r===`dot`?i:w(te(e.time.to,n)),o=r===`bar`?i:w(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:ie(e.event),kind:l,x:o,x0:i,x1:a,undated:!!e.time.undated,coarse:c,prec:e.time.prec,event:e.event}}),ue=new Map;for(let e of le){let t=`${e.lane}:${Math.round(e.x)}`;e.stack=ue.get(t)??0,ue.set(t,e.stack+1)}let de=e=>Math.min(2,Math.max(1,n?be(e,173,e=>n(e,`title`)):ye(e,176/dt,dee))),fe=[],pe=[],me=ne.map((e,t)=>{let n=le.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 _ee(n.map(e=>({id:e.id,x:r(e.x)})))}),he=0;me.forEach((e,t)=>{ae[t]=he,oe[t]=e.length?_t(Math.max(0,...e.map(e=>e.level))+1):34,he+=oe[t]}),me.forEach((e,t)=>{let n=e=>{let t=e.ids.map(e=>le.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=>le.find(t=>t.id===e)).sort((e,t)=>e.order-t.order),a=i.length>1,o=a?1:de(i[0].event.label||``),s=a?1:i[0].undated?ge(ee(`en`,`scale.undated`),11)*1.05>176?2:1:pt(i[0].event),c=ft(o,s),l=ce(t)-gt-r.level*mt,u={id:a?`__run__${pe.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=pe.length+1,u.span=[Math.min(...i.map(e=>e.x0)),Math.max(...i.map(e=>e.x1))],pe.push(u)),fe.push(u)}});let _e=ae.length?ae[ae.length-1]+oe[oe.length-1]:0,ve=_e+14,xe=v.flatMap(e=>{let t=Math.max(2,Math.floor(e.w/84)),n=e.to>e.from?hee(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:w(e),label:gee(e,r,t?n[t-1]:null)}))}),Se=pe.reduce((e,t)=>e+1+t.members.length,0),Ce=pe.length?vt+Se*18:0,we=_e+56+Ce,Te=e=>ne[ie(e)].groupIndex,Ee=[{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:_e,axisY:ve,lanes:ne.map((e,t)=>({...e,top:se(t),lineY:ce(t)})),segments:v,ticks:xe,marks:le.map(e=>({id:e.id,kind:e.kind,x:e.x,x0:e.x0,x1:e.x1,y:ce(e.lane)-e.stack*12,undated:e.undated,coarse:e.coarse,prec:e.prec,approx:!!e.event.approx,groupIndex:ne[e.lane].groupIndex})),leaders:fe.map(e=>({x:Math.min(Math.max(e.anchor,e.x+8),e.x+e.w-8),y0:e.y+e.h,y1:ce(e.lane)-6,run:!!e.run})),brackets:pe.map(e=>({x0:e.span[0],x1:e.span[1],y:ce(e.lane)+9,run:e.run}))}}];for(let e of fe)Ee.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:ne[e.lane].groupIndex,cardH:e.h}:{event:e.members[0].event,undated:e.members[0].undated,groupIndex:Te(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 pe.length&&Ee.push({id:`__runs__`,type:`scaleRunList`,position:{x,y:_e+56+vt},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,data:{runs:pe.map(e=>({run:e.run,events:e.members.map(e=>e.event)})),width:C-x,lh:18}}),{errors:[],nodes:Ee,edges:[],layout:`scale`,eventCount:o.length,segments:v,gathered:pe.map(e=>({run:e.run,ids:e.members.map(e=>e.id)})),cards:fe.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:le.filter(e=>e.undated).length,labelW:x,size:{width:C,height:we}}}function Ot(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 vee(e,t){return!e||!t||!e.width?1:Math.min(t.width/(e.width*1.12),1)}var kt={width:1600,height:900},At=(e,t)=>Math.round(e*Math.min(t,1)*10)/10;function jt(e,t){let n=`Text on one screen (${e.canvas.width}×${e.canvas.height})`,r=At(e.font,e.open.fit),i=At(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(At(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 Mt={envelope:[{name:`type`,req:`yes`,ty:`string`,note:`always "fact"`},y(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 yee(){let e=[`Fields of a fact spec. "yes" means required.`,``];for(let[t,n]of Object.entries(Mt)){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(`
1425
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=new Map,u=[`experimental`,`stable`,`deprecated`];function d(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)`);f(e,t),l.set(e,t)}function f(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(!u.includes(r.status))throw Error(`registerKnowledge: ${e}/${n}: status must be one of ${u.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 p(e){let t=l.get(e);return Object.entries(t?.diagrams??{}).map(([t,n])=>({type:e,kind:t,...n}))}function m(e){return l.get(e)}function h(){return[...l.entries()].map(([e,t])=>({type:e,labelKey:t.label??`graphType.${e}`}))}function g(e){return l.get(e)?.validate}function _(e,t){let n=l.get(e)?.layouts;if(n)return t&&n[t]?n[t]:Object.values(n)[0]}function v(e){return Object.keys(l.get(e)?.layouts??{})}var y=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 b(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 x={"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`,"dock.restore":`Restore this diagram's defaults`,"dock.restoreTitle":`Clear this diagram's remembered choices and open it with the built-in defaults; the theme and the language are not changed.`,"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`},S={en:x,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":`显示选项`,"dock.restore":`恢复本图默认`,"dock.restoreTitle":`清除这张图记住的选择,按内置默认值重新打开;主题和语言不变。`,"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(x).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,x[e]]))}};function C(e){return!e||typeof e!=`string`?`en`:e.toLowerCase().split(`-`)[0]===`zh`?`zh`:`en`}function ee(e,t,n){let r=(S[C(e)]??S.en)[t]??S.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 w=(e,t)=>ee(`en`,e,t),te=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?)?)?$/;function ne(e){let t=te.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 re(e){let t=ne(e?.date);if(!t)return null;let{from:n,to:r}=t,i=e.dateEnd===void 0?null:ne(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 ie(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:re(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(w(`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 ae(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})=>w(`note.partyNoEvent`,{at:`actors[${t}]`,id:e.id,name:e.name??e.id}))}var oe=19,se=2,ce=18,le=6,ue=16,de=11.5,fe=1,pe=.55;function me(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?fe:pe}function he(e){let t=0;for(let n of String(e??``))t+=me(n);return t}var ge=(e,t)=>he(e)*t,_e=262/13;262/de;function ve(e={},t=se,n=0){let r=22+oe*t+le+ue;return e.summary&&(r+=24),e.actors&&n>0&&(r+=ce*n+le),r}function ye(e,t,n={}){let r=n.latin??1,i=n.cjk??1;return be(e,t,e=>{let t=0;for(let n of e)t+=me(n)*(me(n)===fe?i:r);return t})}function be(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 xe={SIDE1:`side1`,AXIS:`axis`,SIDE2:`side2`},Se=3;function Ce(e){let t=(Array.isArray(e?.actors)?e.actors:[]).filter(e=>De(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 we=/^\d{4}(-\d{2}(-\d{2}(T\d{2}(:\d{2}(:\d{2})?)?)?)?)?$/;function Te(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 Ee=[xe.SIDE1,xe.SIDE2,xe.AXIS];function De(e){return e&&typeof e==`object`&&!Array.isArray(e)}function Oe(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:{[xe.SIDE1]:``,[xe.SIDE2]:``,[xe.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)=>{De(e)?e.id?(s.has(e.id)&&t.push(w(`err.duplicateId`,{at:`actors[${n}]`,id:e.id})),s.set(e.id,e),e.name||t.push(w(`err.required`,{at:`actors[${n}] (${e.id})`,field:`name`}))):t.push(w(`err.required`,{at:`actors[${n}]`,field:`id`})):t.push(w(`err.notObject`,{at:`actors[${n}]`}))}),e?.views!==void 0&&t.push(w(`err.viewsRemoved`));let c=new Map,l=new Map;r.length>Se&&t.push(w(`err.tooManyGroups`,{at:`groups`,max:Se,actual:r.length})),r.forEach((e,n)=>{De(e)?e.id?(l.has(e.id)&&t.push(w(`err.duplicateId`,{at:`groups[${n}]`,id:e.id})),c.set(e.id,e),l.set(e.id,n),e.label||t.push(w(`err.required`,{at:`groups[${n}] (${e.id})`,field:`label`}))):t.push(w(`err.required`,{at:`groups[${n}]`,field:`id`})):t.push(w(`err.notObject`,{at:`groups[${n}]`}))});let u=s.size>=2,d=new Map;n.forEach((e,n)=>{if(!De(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(w(`err.actorGroupOneParty`,{at:r}));return}if(!i){t.push(w(`err.actorNeedsGroup`,{at:r,n:s.size}));return}if(!l.has(e.groupId)){t.push(w(`err.missingRef`,{at:r,field:`groupId`,kind:`group`,id:e.groupId}));return}let a=l.get(e.groupId);a>1?t.push(w(`err.actorGroupNotSide`,{at:r,groupId:e.groupId})):d.set(e.id,a===0?xe.SIDE1:xe.SIDE2)});let f=new Map;if(i.forEach((e,n)=>{De(e)?e.id?(f.has(e.id)&&t.push(w(`err.duplicateId`,{at:`sources[${n}]`,id:e.id})),f.set(e.id,e),e.type||t.push(w(`err.required`,{at:`sources[${n}] (${e.id})`,field:`type`})),e.name||t.push(w(`err.required`,{at:`sources[${n}] (${e.id})`,field:`name`}))):t.push(w(`err.required`,{at:`sources[${n}]`,field:`id`})):t.push(w(`err.notObject`,{at:`sources[${n}]`}))}),!Array.isArray(a))return t.push(w(`err.slotNotArray`)),{...o,actorById:s,groupById:c,groupIndexById:l,sourceById:f};a.length===0&&t.push(w(`err.slotsEmpty`));let p=new Set,m={[xe.SIDE1]:new Set,[xe.SIDE2]:new Set},h=[];a.forEach((e,n)=>{let r=`slots[${n}]`;De(e)?Array.isArray(e.events)?(e.events.length===0&&t.push(w(`err.slotEventsEmpty`,{at:r})),e.events.forEach((e,i)=>{let a=`${r}.events[${i}]${e?.id?` (${e.id})`:``}`;if(!De(e)){t.push(w(`err.notObject`,{at:a}));return}e.id?p.has(e.id)?t.push(w(`err.duplicateId`,{at:a,id:e.id})):p.add(e.id):t.push(w(`err.required`,{at:a,field:`id`})),e.date&&!we.test(e.date)&&t.push(w(`err.badDate`,{at:a,field:`date`,value:e.date})),e.label||t.push(w(`err.required`,{at:a,field:`label`})),e.dateEnd!==void 0&&e.dateEnd!==null&&(typeof e.dateEnd!=`string`||!we.test(e.dateEnd)?t.push(w(`err.badDate`,{at:a,field:`dateEnd`,value:e.dateEnd})):e.date?Te(e.dateEnd,e.date)&&t.push(w(`err.dateEndBeforeDate`,{at:a,end:e.dateEnd,start:e.date})):t.push(w(`err.dateEndNeedsDate`,{at:a}))),e.summary!==void 0&&e.summary!==null&&(typeof e.summary==`string`?he(e.summary)>22.782608695652176&&t.push(w(`err.summaryTooLong`,{at:a,max:22,actual:Math.ceil(he(e.summary))})):t.push(w(`err.mustBeString`,{at:a,field:`summary`})));let o=Array.isArray(e.actorIds)?e.actorIds:[];o.forEach(e=>{s.has(e)||t.push(w(`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(w(`err.eventGroupWithParties`,{at:a})):c&&!l.has(e.groupId)&&t.push(w(`err.missingRef`,{at:a,field:`groupId`,kind:`group`,id:e.groupId})),(Array.isArray(e.sourceIds)?e.sourceIds:[]).forEach(e=>{f.has(e)||t.push(w(`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]):_=xe.AXIS;else if(o.length>=2)_=xe.AXIS,(g===0||g===1)&&t.push(w(`err.multiActorNeedsAxis`,{at:a,n:o.length,groupId:e.groupId}));else if(!c)_=xe.AXIS;else if(g===void 0)return;else _=Ee[g]??xe.AXIS;!u&&_!==xe.AXIS&&o.length!==1?t.push(w(`err.groupNeedsOneActor`,{at:a,groupId:e.groupId,n:o.length})):(!u&&_!==xe.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(w(`err.eventsNotArray`,{at:r})):t.push(w(`err.slotShape`,{at:r}))});let g=n.map(e=>De(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(xe.SIDE1).reverse());let b=y.length;y.push({key:xe.AXIS,side:xe.AXIS}),y.push(...v(xe.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===xe.AXIS?xe.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(w(`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:{[xe.SIDE1]:r[0]?.label??``,[xe.SIDE2]:r[1]?.label??``,[xe.AXIS]:r[2]?.label??``},columns:y,rows:S,placements:C,axisColumnIndex:b,actorById:s,groupById:c,groupIndexById:l,sourceById:f,eventCount:ee}}function ke(e){return e===xe.SIDE1?0:e===xe.SIDE2?1:2}function Ae(e){let t=1;for(let n of e.rows)n.cells.forEach(e=>{let n=he(e.label||``);t=Math.max(t,Math.min(2,Math.ceil(n/_e)))});return t}function je(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+ge(t,10)+14,0)+4*(r.length-1);n=Math.max(n,Math.ceil(i/262))});return n}function Me(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 Ne=.5;function Pe(e,t){if(!t)return e.rows.map((e,t)=>t);let n=e.rows.map(t=>Me(t,e)),r=[];return n.forEach((e,t)=>{let i=t===0?0:r[t-1]+Ne;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 Fe(e,t,n,r=!1){let i=e.columns.length,a=e.rows.length,o=Ae(e),s=je(e,t),c=ve(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=Pe(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 Ie={draggable:!1,selectable:!1,connectable:!1,focusable:!1};function Le(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 Re(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},...Ie}}function ze(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!==xe.AXIS&&(s>1||a.named),l=o===r(a.side),u={type:`colHeader`,...Ie},d={isH:t.isH,side:a.side,groupIndex:ke(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 Be(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},...Ie}}function Ve(e,t){return{id:`__links__`,type:`links`,position:{x:0,y:0},width:1,height:1,style:{pointerEvents:`none`},data:{segments:e,isH:t},...Ie}}function He(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:{...Le(e,r,n),groupIndex:ke(r.columns[t].side),cardW:288,cardH:i.cardH,labelLines:i.labelLines,fields:a,isH:i.isH}},link:l}}function Ue(e,t={},n,r=`vertical`,{stagger:i=!1}={}){let a=r===`horizontal`,o=Oe(e),s=Fe(o,t,a,i),c=[Re(s),...ze(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}=He(n,i,e.index,o,s,t);l.push(a),c&&u.push(c)})}),u.length&&c.push(Ve(u,a)),c.push(Be(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 We(e,t,n){let[r,i]=String(e).split(`T`),a=t?ee(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 Ge(e,t,n){let r=We(t,!1,n);return String(e).split(`T`)[0]===String(t).split(`T`)[0]&&String(t).includes(`T`)?r.split(` `).pop():r}function Ke(e,t){if(!e.date)return ee(t,`card.dateUnknown`);let n=We(e.date,e.approx,t);return e.dateEnd?`${n} - ${Ge(e.date,e.dateEnd,t)}`:n}function eee(e,t,n=!1){if(!e.date)return[{text:ee(t,`chronicle.dateUnknown`),strong:!1}];let[r,i]=String(e.date).split(`T`),a=[{text:(e.approx?ee(t,`card.approxPrefix`):``)+r,strong:!0}],o=i?We(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=Ge(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 tee=12.5,qe=4,nee=6,Je=10,Ye=90,ree={latin:1.2,cjk:1.06},iee={latin:1.12,cjk:1.06},Xe={sameSlot:10,none:22,short:38,long:70},Ze=864e5,Qe=/^(\d{4})(?:-(\d{2})(?:-(\d{2})(?:T(\d{2})(?::(\d{2})(?::(\d{2}))?)?)?)?)?$/;function $e(e){let t=typeof e==`string`?Qe.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 et={year:0,month:1,day:2,time:3},tt=e=>Date.UTC(e.y,e.mo-1,e.d,e.h,e.mi,e.s);function nt(e,t,n=!1){let r=$e(e),i=$e(t);if(!r||!i)return null;let a=et[r.prec]<=et[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:it(e,o)}if(a===`time`){let e=tt(i)-tt(r);if(e<=0)return null;if(e<Ze){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 rt(Math.floor(e/Ze),o)}let s=Math.round((Date.UTC(i.y,i.mo-1,i.d)-Date.UTC(r.y,r.mo-1,r.d))/Ze);return s<=0?null:rt(s,o)}function aee(e){let t=(e,t,n)=>({key:e,vars:t,long:n,approx:!1});if(!(e>0))return null;if(e<Ze){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 rt(Math.round(e/Ze),t)}function rt(e,t){return e<30?t(`chronicle.gapDays`,{n:e},!1):it(Math.max(1,Math.round(e/30.44)),t)}function it(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 at=(e,t)=>e==null?t:t==null||e>t?e:t;function ot(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?nt(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=at(r,at(e.date,e.dateEnd));i=c.some(e=>e.approx)}),n}var st=[`circle`,`square`,`diamond`];function ct(e,t){let n=(Array.isArray(e?.groups)?e.groups:[]).findIndex(n=>n?.id===Ce(e)(t));return n<0?`none`:st[Math.min(n,2)]}function oee(e,t){let n=(Array.isArray(e?.groups)?e.groups:[]).findIndex(n=>n?.id===Ce(e)(t));return n>=0&&n<3?n:2}function see(e,t,n,r){let i=[];if(n.actors)for(let t of Array.isArray(e.actorIds)?e.actorIds:[])i.push(ge(r.get(t)?.name||t,10)+14);if(n.sources&&i.push(Ye),!i.length)return 0;let a=1,o=0;for(let e of i){let t=o?Je+e:e;o&&o+t>532?(a+=1,o=e):o+=t}return a}function lt({titleLines:e,summaryLines:t,tagLines:n,whenLineCount:r=3}){let i=20+20*Math.max(1,e);return t&&(i+=qe+18*t),n&&(i+=nee+20*n),Math.max(i,10+18*r)}function ut(e,t,n){let r=(e,t,r,i)=>n?be(e,531,e=>n(e,t)):ye(e,532/r,i);return{title:Math.max(1,r(e.label||``,`title`,14,ree)),summary:t.summary&&e.summary?r(e.summary,`summary`,tee,iee):0}}function cee(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:st[t]})).filter(e=>e.label),o=ot(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=Xe[a.spacing]??Xe.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}=ut(p,t,typeof n==`function`?n:null),g=see(p,e,t,r),_=lt({titleLines:m,summaryLines:h,tagLines:g,whenLineCount:eee(p,`en`,a.sameDay).length}),v=oee(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:ct(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:ct(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 lee=12,uee=40,dt=12.5,dee={latin:1.2,cjk:1.06},ft=(e,t=1)=>16+17*e+2+15*t,pt=e=>e?.dateEnd&&ge(Ke(e,`en`),11)*1.05>176?2:1,mt=ft(2,2)+10,ht=10,gt=22,fee=12,_t=e=>fee+Math.max(1,e)*mt+gt,vt=14,yt=864e5,bt=36e5;function xt(e){let t=$e(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=$e(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 St=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 pee(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(St(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 mee(e){return e>730*yt?`year`:e>60*yt?`month`:e>2*yt?`day`:e>3*bt?`hour`:`minute`}function hee(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*yt:n===`hour`?s*bt:s*6e4}if(a.length<=r)break}return[...a]}function gee(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 Ct(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 wt(e,{byParty:t=!1}={}){let n=Ce(e),r=Ct(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 Tt(e,t,{byParty:n=!1}={}){let r=wt(e,{byParty:n}),i=Ct(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 _ee(e,{levels:t=3,width:n=196,gap:r=ht}={}){let i=e.map(e=>({ids:[e.id],x:e.x,from:e.x,to:e.x}));for(;;){let e=Et(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 Et(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 Et(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 Dt(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=xt(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):bt,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*bt:(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*bt;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=pee(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?mee(t-e):`day`})),y=e=>ge(e,lee)*1.06,b=Tt(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)+uee)))),S=x;v.forEach((e,t)=>{if(t>0){let n=e.from-v[t-1].to;e.breakBefore={x:S,w:64,gap:aee(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,w=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},te=(e,t)=>Math.min(Math.max(e,v[t].from),v[t].to),ne=Tt(e,o.map(e=>e.event),{byParty:r}),re=wt(e,{byParty:r}),ie=e=>{let t=ne.findIndex(t=>t.key===re(e));return t>=0?t:ne.length-1},ae=[],oe=[],se=e=>ae[e],ce=e=>ae[e]+oe[e],le=o.map((e,t)=>{let n=_(e.time.t),r=e.time.kind,i=w(r===`dot`?e.time.t:te(e.time.from,n)),a=r===`dot`?i:w(te(e.time.to,n)),o=r===`bar`?i:w(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:ie(e.event),kind:l,x:o,x0:i,x1:a,undated:!!e.time.undated,coarse:c,prec:e.time.prec,event:e.event}}),ue=new Map;for(let e of le){let t=`${e.lane}:${Math.round(e.x)}`;e.stack=ue.get(t)??0,ue.set(t,e.stack+1)}let de=e=>Math.min(2,Math.max(1,n?be(e,173,e=>n(e,`title`)):ye(e,176/dt,dee))),fe=[],pe=[],me=ne.map((e,t)=>{let n=le.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 _ee(n.map(e=>({id:e.id,x:r(e.x)})))}),he=0;me.forEach((e,t)=>{ae[t]=he,oe[t]=e.length?_t(Math.max(0,...e.map(e=>e.level))+1):34,he+=oe[t]}),me.forEach((e,t)=>{let n=e=>{let t=e.ids.map(e=>le.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=>le.find(t=>t.id===e)).sort((e,t)=>e.order-t.order),a=i.length>1,o=a?1:de(i[0].event.label||``),s=a?1:i[0].undated?ge(ee(`en`,`scale.undated`),11)*1.05>176?2:1:pt(i[0].event),c=ft(o,s),l=ce(t)-gt-r.level*mt,u={id:a?`__run__${pe.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=pe.length+1,u.span=[Math.min(...i.map(e=>e.x0)),Math.max(...i.map(e=>e.x1))],pe.push(u)),fe.push(u)}});let _e=ae.length?ae[ae.length-1]+oe[oe.length-1]:0,ve=_e+14,xe=v.flatMap(e=>{let t=Math.max(2,Math.floor(e.w/84)),n=e.to>e.from?hee(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:w(e),label:gee(e,r,t?n[t-1]:null)}))}),Se=pe.reduce((e,t)=>e+1+t.members.length,0),Ce=pe.length?vt+Se*18:0,we=_e+56+Ce,Te=e=>ne[ie(e)].groupIndex,Ee=[{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:_e,axisY:ve,lanes:ne.map((e,t)=>({...e,top:se(t),lineY:ce(t)})),segments:v,ticks:xe,marks:le.map(e=>({id:e.id,kind:e.kind,x:e.x,x0:e.x0,x1:e.x1,y:ce(e.lane)-e.stack*12,undated:e.undated,coarse:e.coarse,prec:e.prec,approx:!!e.event.approx,groupIndex:ne[e.lane].groupIndex})),leaders:fe.map(e=>({x:Math.min(Math.max(e.anchor,e.x+8),e.x+e.w-8),y0:e.y+e.h,y1:ce(e.lane)-6,run:!!e.run})),brackets:pe.map(e=>({x0:e.span[0],x1:e.span[1],y:ce(e.lane)+9,run:e.run}))}}];for(let e of fe)Ee.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:ne[e.lane].groupIndex,cardH:e.h}:{event:e.members[0].event,undated:e.members[0].undated,groupIndex:Te(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 pe.length&&Ee.push({id:`__runs__`,type:`scaleRunList`,position:{x,y:_e+56+vt},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,data:{runs:pe.map(e=>({run:e.run,events:e.members.map(e=>e.event)})),width:C-x,lh:18}}),{errors:[],nodes:Ee,edges:[],layout:`scale`,eventCount:o.length,segments:v,gathered:pe.map(e=>({run:e.run,ids:e.members.map(e=>e.id)})),cards:fe.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:le.filter(e=>e.undated).length,labelW:x,size:{width:C,height:we}}}function Ot(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 vee(e,t){return!e||!t||!e.width?1:Math.min(t.width/(e.width*1.12),1)}var kt={width:1600,height:900},At=(e,t)=>Math.round(e*Math.min(t,1)*10)/10;function jt(e,t){let n=`Text on one screen (${e.canvas.width}×${e.canvas.height})`,r=At(e.font,e.open.fit),i=At(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(At(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 Mt={envelope:[{name:`type`,req:`yes`,ty:`string`,note:`always "fact"`},y(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 yee(){let e=[`Fields of a fact spec. "yes" means required.`,``];for(let[t,n]of Object.entries(Mt)){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
1426
  `)}function bee(e,t,{fields:n,canvas:r}){let i=t(e,n),a=Number(vee(i.size,r).toFixed(3)),o=Number(Ot(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 xee(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(...jt(e.text,`splitting the case into periods, one diagram each`)),t.join(`
1427
1427
  `)}function See(e,t,{canvas:n}){let r=t(e,{}),i=Number(Ot(r.size,n).toFixed(3));return{text:{font:dt,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 Cee(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(...jt(e.text,`splitting the case into periods, one diagram each`)),t.join(`
1428
1428
  `)}var wee={specVersion:2,label:`graphType.fact`,fields:Mt,describe:yee,validate:e=>Oe(e).errors,notes:e=>[...ie(e),...ae(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 bee(e,t,{fields:r,canvas:a});if(i===`scale`)return See(e,t,{canvas:a});let o=t(e,r,void 0,n??`vertical`),s=Oe(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(Ot(i.size,a).toFixed(3))}}let d=t(e,r,void 0,`vertical`,{stagger:!1}),f={size:d.size,fit:Number(Ot(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 xee(e);if(e.kind===`scale`)return Cee(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(...jt(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(`
@@ -1452,7 +1452,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
1452
1452
  `),i.length!=2)throw E(new fc(`Exactly two numbers are expected, `+i.length+` were found.`));try{this.a=XM(hN(i[0])),this.b=XM(hN(i[1]))}catch(e){throw e=tD(e),j(e,131)?(n=e,E(new fc(Dht+n))):E(e)}},Q.Ib=function(){return`(`+this.a+`,`+this.b+`)`},Q.a=0,Q.b=0;var V3=L(_V,`KVector`,8);q(79,66,{3:1,4:1,20:1,31:1,56:1,18:1,66:1,16:1,79:1,414:1},Ls,il,dSe),Q.Nc=function(){return iJe(this)},Q.ag=function(e){var t,n,r=uI(e,`,|;|\\(|\\)|\\[|\\]|\\{|\\}| | |
1453
1453
  `),i,a,o;Ly(this);try{for(n=0,a=0,i=0,o=0;n<r.length;)r[n]!=null&&hN(r[n]).length>0&&(a%2==0?i=XM(r[n]):o=XM(r[n]),a>0&&a%2!=0&&Mg(this,new k(i,o)),++a),++n}catch(e){throw e=tD(e),j(e,131)?(t=e,E(new fc(`The given string does not match the expected format for vectors.`+t))):E(e)}},Q.Ib=function(){for(var e=new jm(`(`),t=GA(this,0),n;t.b!=t.d.c;)n=P(Lx(t),8),Kf(e,n.a+`,`+n.b),t.b!=t.d.c&&(e.a+=`; `);return(e.a+=`)`,e).a};var bLt=L(_V,`KVectorChain`,79);q(256,24,{3:1,35:1,24:1,256:1},of);var H3,U3,W3,G3,K3,q3,xLt=eT(aW,`Alignment`,256,gq,YBe,wEe),SLt;q(976,1,OB,Roe),Q.tf=function(e){xot(e)};var CLt,J3,wLt,TLt,ELt,DLt,OLt,kLt,ALt,jLt,MLt,NLt;L(aW,`BoxLayouterOptions`,976),q(977,1,{},rre),Q.uf=function(){return new ore},Q.vf=function(e){},L(aW,`BoxLayouterOptions/BoxFactory`,977),q(299,24,{3:1,35:1,24:1,299:1},sf);var Y3,X3,Z3,Q3,$3,e6,t6=eT(aW,`ContentAlignment`,299,gq,QBe,TEe),PLt;q(689,1,OB,Loe),Q.tf=function(e){Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,Xvt),``),`Layout Algorithm`),`Select a specific layout algorithm.`),(cN(),z3)),eJ),Nk((UA(),A3))))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,Zvt),``),`Resolved Layout Algorithm`),`Meta data associated with the selected algorithm.`),R3),mLt),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,i_t),``),`Alignment`),`Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm.`),ILt),F3),xLt),Nk(k3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,FB),``),`Aspect Ratio`),`The desired aspect ratio of the drawing, that is the quotient of width by height.`),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,Qvt),``),`Bend Points`),`A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points.`),R3),bLt),Nk(D3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,GH),``),`Content Alignment`),`Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option.`),VLt),I3),t6),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,UH),``),`Debug Mode`),`Whether additional debug information shall be generated.`),(Lm(),!1)),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,WH),``),`Direction`),`Overall direction of edges: horizontal (right / left) or vertical (down / up).`),HLt),F3),t8),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,IH),``),`Edge Routing`),`What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline.`),GLt),F3),d8),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Jvt),``),`Expand Nodes`),`If active, nodes are expanded to fill the area of their parent.`),!1),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,FH),``),`Hierarchy Handling`),"Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`."),YLt),F3),lzt),d_(A3,U(O(M3,1),Z,160,0,[k3]))))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,RB),``),`Padding`),`The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately.`),lRt),R3),pwt),d_(A3,U(O(M3,1),Z,160,0,[k3]))))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,zB),``),`Interactive`),`Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible.`),!1),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,YH),``),`interactive Layout`),`Whether the graph should be changeable interactively and by setting constraints`),!1),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,HB),``),`Omit Node Micro Layout`),`Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout.`),!1),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,BB),``),`Port Constraints`),`Defines constraints of the position of the ports of a node.`),_Rt),F3),vzt),Nk(k3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,JH),``),`Position`),`The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position.`),R3),V3),d_(k3,U(O(M3,1),Z,160,0,[j3,O3]))))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,MB),``),`Priority`),`Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used.`),L3),Wq),d_(k3,U(O(M3,1),Z,160,0,[D3]))))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,IB),``),`Randomization Seed`),`Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time).`),L3),Wq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,LB),``),`Separate Connected Components`),`Whether each connected component should be processed separately.`),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,h_t),``),`Junction Points`),`This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order.`),tRt),R3),bLt),Nk(D3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,y_t),``),`Comment Box`),`Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related.`),!1),N3),Lq),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,b_t),``),`Hypernode`),`Whether the node should be handled as a hypernode.`),!1),N3),Lq),Nk(k3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,$vt),``),`Label Manager`),`Label managers can shorten labels upon a layout algorithm's request.`),R3),oHt),d_(A3,U(O(M3,1),Z,160,0,[O3]))))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,eyt),``),`Softwrapping Fuzziness`),`Determines the amount of fuzziness to be used when performing softwrapping on labels. The value expresses the percent of overhang that is permitted for each line. If the next line would take up less space than this threshold, it is appended to the current line instead of being placed in a new line.`),0),P3),Hq),Nk(O3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,S_t),``),`Margins`),`Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels.`),nRt),R3),dwt),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,n_t),``),`No Layout`),`No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node.`),!1),N3),Lq),d_(k3,U(O(M3,1),Z,160,0,[D3,j3,O3]))))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,tyt),``),`Scale Factor`),`The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set.`),1),P3),Hq),Nk(k3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,nyt),``),`Child Area Width`),`The width of the area occupied by the laid out children of a node.`),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,ryt),``),`Child Area Height`),`The height of the area occupied by the laid out children of a node.`),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,JB),``),Hvt),`Turns topdown layout on and off. If this option is enabled, hierarchical layout will be computed first for the root node and then for its children recursively. Layouts are then scaled down to fit the area provided by their parents. Graphs must follow a certain structure for topdown layout to work properly. {@link TopdownNodeTypes.PARALLEL_NODE} nodes must have children of type {@link TopdownNodeTypes.HIERARCHICAL_NODE} and must define {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} for their children. Furthermore they need to be laid out using an algorithm that is a {@link TopdownLayoutProvider}. Hierarchical nodes can also be parents of other hierarchical nodes and can optionally use a {@link TopdownSizeApproximator} to dynamically set sizes during topdown layout. In this case {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} should be set on the node itself rather than the parent. The values are then used by the size approximator as base values. Hierarchical nodes require the layout option {@link nodeSize.fixedGraphSize} to be true to prevent the algorithm used there from resizing the hierarchical node. This option is not supported if 'Hierarchy Handling' is set to 'INCLUDE_CHILDREN'`),!1),N3),Lq),Nk(A3)))),Sx(e,JB,QB,null),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,iyt),``),`Animate`),`Whether the shift from the old layout to the new computed layout shall be animated.`),!0),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,ayt),``),`Animation Time Factor`),`Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'.`),G(100)),L3),Wq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,oyt),``),`Layout Ancestors`),`Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process.`),!1),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,syt),``),`Maximal Animation Time`),`The maximal time for animations, in milliseconds.`),G(4e3)),L3),Wq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,cyt),``),`Minimal Animation Time`),`The minimal time for animations, in milliseconds.`),G(400)),L3),Wq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,lyt),``),`Progress Bar`),`Whether a progress bar shall be displayed during layout computations.`),!1),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,uyt),``),`Validate Graph`),`Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user.`),!1),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,dyt),``),`Validate Options`),`Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user.`),!0),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,fyt),``),`Zoom to Fit`),`Whether the zoom level shall be set to view the whole diagram after layout.`),!1),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Yvt),`box`),`Box Layout Mode`),`Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better.`),zLt),F3),Uzt),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,pyt),`json`),`Shape Coords`),`For layouts transferred into JSON graphs, specify the coordinate system to be used for nodes, ports, and labels of nodes and ports.`),eRt),F3),Ozt),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,myt),`json`),`Edge Coords`),`For layouts transferred into JSON graphs, specify the coordinate system to be used for edge route points and edge labels.`),QLt),F3),GRt),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Wgt),LH),`Comment Comment Spacing`),`Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing.`),10),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Ggt),LH),`Comment Node Spacing`),`Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing.`),10),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Kgt),LH),`Components Spacing`),`Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated.`),20),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,qgt),LH),`Edge Spacing`),`Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines.`),10),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,PB),LH),`Edge Label Spacing`),`The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option.`),2),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,HH),LH),`Edge Node Spacing`),`Spacing to be preserved between nodes and edges.`),10),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Jgt),LH),`Label Spacing`),`Determines the amount of space to be left between two labels of the same graph element.`),0),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Zgt),LH),`Label Node Spacing`),`Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option.`),5),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Ygt),LH),`Horizontal spacing between Label and Port`),`Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option.`),1),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Xgt),LH),`Vertical spacing between Label and Port`),`Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option.`),1),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,NB),LH),`Node Spacing`),`The minimal distance to be preserved between each two nodes.`),20),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,Qgt),LH),`Node Self Loop Spacing`),`Spacing to be preserved between a node and its self loops.`),10),P3),Hq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,$gt),LH),`Port Spacing`),`Spacing between pairs of ports of the same node.`),10),P3),Hq),d_(A3,U(O(M3,1),Z,160,0,[k3]))))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,e_t),LH),`Individual Spacing`),`Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent.`),R3),Gzt),d_(k3,U(O(M3,1),Z,160,0,[D3,j3,O3]))))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,C_t),LH),`Additional Port Space`),`Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border.`),NRt),R3),dwt),Nk(A3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,qH),byt),`Layout Partition`),`Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction).`),L3),Wq),d_(A3,U(O(M3,1),Z,160,0,[k3]))))),Sx(e,qH,KH,pRt),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,KH),byt),`Layout Partitioning`),`Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle.`),dRt),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,s_t),xyt),`Node Label Padding`),`Define padding for node labels that are placed inside of a node.`),iRt),R3),pwt),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,KB),xyt),`Node Label Placement`),`Hints for where node labels are to be placed; if empty, the node label's position is not modified.`),aRt),I3),A8),d_(k3,U(O(M3,1),Z,160,0,[O3]))))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,u_t),lW),`Port Alignment`),`Defines the default port distribution for a node. May be overridden for each side individually.`),hRt),F3),P8),Nk(k3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,d_t),lW),`Port Alignment (North)`),`Defines how ports on the northern side are placed, overriding the node's general port alignment.`),F3),P8),Nk(k3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,f_t),lW),`Port Alignment (South)`),`Defines how ports on the southern side are placed, overriding the node's general port alignment.`),F3),P8),Nk(k3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,p_t),lW),`Port Alignment (West)`),`Defines how ports on the western side are placed, overriding the node's general port alignment.`),F3),P8),Nk(k3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,m_t),lW),`Port Alignment (East)`),`Defines how ports on the eastern side are placed, overriding the node's general port alignment.`),F3),P8),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,GB),uW),`Node Size Constraints`),`What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed.`),oRt),I3),S5),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,WB),uW),`Node Size Options`),`Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications.`),cRt),I3),jzt),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,eV),uW),`Node Size Minimum`),`The minimal size to which a node can be reduced.`),sRt),R3),V3),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,UB),uW),`Fixed Graph Size`),`By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so.`),!1),N3),Lq),Nk(A3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,__t),zH),`Edge Label Placement`),`Gives a hint on where to put edge labels.`),ULt),F3),qRt),Nk(O3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,VB),zH),`Inline Edge Labels`),`If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible.`),!1),N3),Lq),Nk(O3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,hyt),`font`),`Font Name`),`Font name used for a label.`),z3),eJ),Nk(O3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,gyt),`font`),`Font Size`),`Font size used for a label.`),L3),Wq),Nk(O3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,x_t),dW),`Port Anchor Offset`),`The offset to the port position where connections shall be attached.`),R3),V3),Nk(j3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,v_t),dW),`Port Index`),`The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case.`),L3),Wq),Nk(j3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,r_t),dW),`Port Side`),`The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports.`),bRt),F3),h5),Nk(j3)))),Lk(e,new sN(tl(el(nl(Yc($c(Zc(Qc(new za,t_t),dW),`Port Border Offset`),`The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border.`),P3),Hq),Nk(j3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,qB),Syt),`Port Label Placement`),`Decides on a placement method for port labels; if empty, the node label's position is not modified.`),vRt),I3),q8),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,c_t),Syt),`Port Labels Next to Port`),`Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE.`),!1),N3),Lq),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,l_t),Syt),`Treat Port Labels as Group`),`If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port.`),!0),N3),Lq),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,sW),fW),`Number of size categories`),`Defines the number of categories to use for the FIXED_INTEGER_RATIO_BOXES size approximator.`),G(3)),L3),Wq),Nk(A3)))),Sx(e,sW,cW,BRt),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,_yt),fW),`Weight of a node containing children for determining the graph size`),`When determining the graph size for the size categorisation, this value determines how many times a node containing children is weighted more than a simple node. For example setting this value to four would result in a graph containing a simple node and a hierarchical node to be counted as having a size of five.`),G(4)),L3),Wq),Nk(A3)))),Sx(e,_yt,sW,null),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,YB),fW),`Topdown Scale Factor`),`The scaling factor to be applied to the nodes laid out within the node in recursive topdown layout. The difference to 'Scale Factor' is that the node itself is not scaled. This value has to be set on hierarchical nodes.`),1),P3),Hq),Nk(A3)))),Sx(e,YB,QB,LRt),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,cW),fW),`Topdown Size Approximator`),`The size approximator to be used to set sizes of hierarchical nodes during topdown layout. The default value is null, which results in nodes keeping whatever size is defined for them e.g. through parent parallel node or by manually setting the size.`),null),R3),dzt),Nk(k3)))),Sx(e,cW,QB,RRt),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,XB),fW),`Topdown Hierarchical Node Width`),`The fixed size of a hierarchical node when using topdown layout. If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself.`),150),P3),Hq),d_(A3,U(O(M3,1),Z,160,0,[k3]))))),Sx(e,XB,QB,null),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,ZB),fW),`Topdown Hierarchical Node Aspect Ratio`),`The fixed aspect ratio of a hierarchical node when using topdown layout. Default is 1/sqrt(2). If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself.`),1.414),P3),Hq),d_(A3,U(O(M3,1),Z,160,0,[k3]))))),Sx(e,ZB,QB,null),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,QB),fW),`Topdown Node Type`),`The different node types used for topdown layout. If the node type is set to {@link TopdownNodeTypes.PARALLEL_NODE} the algorithm must be set to a {@link TopdownLayoutProvider} such as {@link TopdownPacking}. The {@link nodeSize.fixedGraphSize} option is technically only required for hierarchical nodes.`),null),F3),Pzt),Nk(k3)))),Sx(e,QB,UB,null),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,vyt),fW),`Topdown Scale Cap`),`Determines the upper limit for the topdown scale factor. The default value is 1.0 which ensures that nested children never end up appearing larger than their parents in terms of unit sizes such as the font size. If the limit is larger, nodes will fully utilize the available space, but it is counteriniuitive for inner nodes to have a larger scale than outer nodes.`),1),P3),Hq),Nk(A3)))),Sx(e,vyt,QB,IRt),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,a_t),Cyt),`Activate Inside Self Loops`),`Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports.`),!1),N3),Lq),Nk(k3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,o_t),Cyt),`Inside Self Loop`),`Whether a self loop should be routed inside a node instead of around that node.`),!1),N3),Lq),Nk(D3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,g_t),`edge`),`Edge Thickness`),`The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it.`),1),P3),Hq),Nk(D3)))),Lk(e,new sN(tl(el(nl(Xc(Yc($c(Zc(Qc(new za,yyt),`edge`),`Edge Type`),`The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations.`),qLt),F3),tzt),Nk(D3)))),fu(e,new Gb(Kc(Jc(qc(new Oa,bz),`Layered`),`The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.`))),fu(e,new Gb(Kc(Jc(qc(new Oa,`org.eclipse.elk.orthogonal`),`Orthogonal`),`Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia '86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.`))),fu(e,new Gb(Kc(Jc(qc(new Oa,jB),`Force`),`Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984.`))),fu(e,new Gb(Kc(Jc(qc(new Oa,`org.eclipse.elk.circle`),`Circle`),`Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph.`))),fu(e,new Gb(Kc(Jc(qc(new Oa,q_t),`Tree`),`Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type.`))),fu(e,new Gb(Kc(Jc(qc(new Oa,`org.eclipse.elk.planar`),`Planar`),`Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable.`))),fu(e,new Gb(Kc(Jc(qc(new Oa,NU),`Radial`),`Radial layout algorithms usually position the nodes of the graph on concentric circles.`))),fat((new zoe,e)),xot((new Roe,e)),Zrt((new Boe,e))};var n6,FLt,ILt,r6,LLt,RLt,zLt,i6,a6,BLt,o6,VLt,s6,c6,HLt,l6,u6,ULt,WLt,GLt,KLt,qLt,JLt,d6,YLt,XLt,f6,p6,m6,h6,ZLt,QLt,$Lt,eRt,g6,tRt,_6,nRt,rRt,iRt,v6,aRt,y6,oRt,b6,x6,sRt,S6,cRt,C6,w6,T6,lRt,uRt,dRt,fRt,pRt,mRt,hRt,E6,D6,O6,k6,gRt,A6,j6,_Rt,M6,N6,P6,vRt,yRt,F6,bRt,I6,L6,R6,z6,xRt,B6,SRt,CRt,wRt,TRt,ERt,DRt,V6,ORt,H6,kRt,ARt,U6,jRt,MRt,NRt,PRt,W6,G6,K6,q6,FRt,IRt,J6,LRt,Y6,RRt,zRt,BRt,VRt;L(aW,`CoreOptions`,689),q(86,24,{3:1,35:1,24:1,86:1},cf);var X6,Z6,Q6,$6,e8,t8=eT(aW,`Direction`,86,gq,IRe,EEe),HRt;q(278,24,{3:1,35:1,24:1,278:1},lf);var n8,r8,URt,WRt,GRt=eT(aW,`EdgeCoords`,278,gq,ALe,DEe),KRt;q(279,24,{3:1,35:1,24:1,279:1},uf);var i8,a8,o8,qRt=eT(aW,`EdgeLabelPlacement`,279,gq,CFe,OEe),JRt;q(222,24,{3:1,35:1,24:1,222:1},df);var s8,c8,l8,u8,d8=eT(aW,`EdgeRouting`,222,gq,NLe,kEe),YRt;q(328,24,{3:1,35:1,24:1,328:1},ff);var XRt,ZRt,QRt,$Rt,f8,ezt,tzt=eT(aW,`EdgeType`,328,gq,$Be,AEe),nzt;q(974,1,OB,zoe),Q.tf=function(e){fat(e)};var rzt,izt,azt,ozt,szt,czt,p8;L(aW,`FixedLayouterOptions`,974),q(975,1,{},ire),Q.uf=function(){return new lre},Q.vf=function(e){},L(aW,`FixedLayouterOptions/FixedFactory`,975),q(347,24,{3:1,35:1,24:1,347:1},pf);var m8,h8,g8,lzt=eT(aW,`HierarchyHandling`,347,gq,wFe,jEe),uzt,dzt=Jg(aW,`ITopdownSizeApproximator`);q(292,24,{3:1,35:1,24:1,292:1},mf);var _8,v8,y8,b8,fzt=eT(aW,`LabelSide`,292,gq,PLe,MEe),pzt;q(96,24,{3:1,35:1,24:1,96:1},hf);var x8,S8,C8,w8,T8,E8,D8,O8,k8,A8=eT(aW,`NodeLabelPlacement`,96,gq,UUe,NEe),mzt;q(257,24,{3:1,35:1,24:1,257:1},gf);var hzt,j8,M8,gzt,N8,P8=eT(aW,`PortAlignment`,257,gq,ize,PEe),_zt;q(102,24,{3:1,35:1,24:1,102:1},_f);var F8,I8,L8,R8,z8,B8,vzt=eT(aW,`PortConstraints`,102,gq,XBe,FEe),yzt;q(280,24,{3:1,35:1,24:1,280:1},vf);var V8,H8,U8,W8,G8,K8,q8=eT(aW,`PortLabelPlacement`,280,gq,ZBe,IEe),bzt;q(64,24,{3:1,35:1,24:1,64:1},bf);var J8,Y8,X8,Z8,Q8,$8,e5,t5,n5,r5,i5,a5,o5,s5,c5,l5,u5,d5,f5,p5,m5,h5=eT(aW,`PortSide`,64,gq,LRe,LEe),xzt;q(978,1,OB,Boe),Q.tf=function(e){Zrt(e)};var Szt,Czt,wzt,Tzt,Ezt;L(aW,`RandomLayouterOptions`,978),q(979,1,{},are),Q.uf=function(){return new gre},Q.vf=function(e){},L(aW,`RandomLayouterOptions/RandomFactory`,979),q(300,24,{3:1,35:1,24:1,300:1},yf);var g5,_5,Dzt,Ozt=eT(aW,`ShapeCoords`,300,gq,TFe,REe),kzt;q(380,24,{3:1,35:1,24:1,380:1},xf);var v5,y5,b5,x5,S5=eT(aW,`SizeConstraint`,380,gq,MLe,zEe),Azt;q(266,24,{3:1,35:1,24:1,266:1},Sf);var C5,w5,T5,E5,D5,O5,k5,A5,j5,jzt=eT(aW,`SizeOptions`,266,gq,vWe,BEe),Mzt;q(281,24,{3:1,35:1,24:1,281:1},Cf);var M5,Nzt,N5,Pzt=eT(aW,`TopdownNodeTypes`,281,gq,EFe,VEe),Fzt;q(288,24,hW);var Izt,P5,Lzt,Rzt,F5=eT(aW,`TopdownSizeApproximator`,288,gq,jLe,HEe);q(970,288,hW,hOe),Q.Sg=function(e){return N$e(e)},eT(aW,`TopdownSizeApproximator/1`,970,F5,null,null),q(971,288,hW,Ske),Q.Sg=function(e){var t=P(J(e,(wL(),z6)),144),r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C=(ol(),m=new Fs,m),ee,w,te;for(jP(C,e),ee=new $o,o=new gm((!e.a&&(e.a=new F(e7,e,10,11)),e.a));o.e!=o.i.gc();)i=P(JA(o),26),y=(p=new Fs,p),AP(y,C),jP(y,i),te=N$e(i),_p(y,n.Math.max(i.g,te.a),n.Math.max(i.f,te.b)),vN(ee.f,i,y);for(a=new gm((!e.a&&(e.a=new F(e7,e,10,11)),e.a));a.e!=a.i.gc();)for(i=P(JA(a),26),d=new gm((!i.e&&(i.e=new qh(W5,i,7,4)),i.e));d.e!=d.i.gc();)u=P(JA(d),85),x=P(Ff(h_(ee.f,i)),26),S=P(Nv(ee,H((!u.c&&(u.c=new qh(U5,u,5,8)),u.c),0)),26),b=(f=new Ha,f),lC((!b.b&&(b.b=new qh(U5,b,4,7)),b.b),x),lC((!b.c&&(b.c=new qh(U5,b,5,8)),b.c),S),DP(b,jb(x)),jP(b,u);g=P(sb(t.f),214);try{g.kf(C,new Va),jje(t.f,g)}catch(e){throw e=tD(e),j(e,101)?(h=e,E(h)):E(e)}return rC(C,a6)||rC(C,i6)||hL(C),l=D(N(J(C,a6))),c=D(N(J(C,i6))),s=l/c,r=D(N(J(C,G6)))*n.Math.sqrt((!C.a&&(C.a=new F(e7,C,10,11)),C.a).i),w=P(J(C,T6),104),v=w.b+w.c+1,_=w.d+w.a+1,new k(n.Math.max(v,r),n.Math.max(_,r/s))},eT(aW,`TopdownSizeApproximator/2`,971,F5,null,null),q(972,288,hW,VNe),Q.Sg=function(e){var t,n=D(N(J(e,(wL(),G6)))),r,i,a,o;return t=n/D(N(J(e,W6))),r=pst(e),a=P(J(e,T6),104),i=D(N(qA(U6))),jb(e)&&(i=D(N(J(jb(e),U6)))),o=sm(new k(n,t),r),Uh(o,new k(-(a.b+a.c)-i,-(a.d+a.a)-i))},eT(aW,`TopdownSizeApproximator/3`,972,F5,null,null),q(973,288,hW,Yke),Q.Sg=function(e){for(var t,r,i,a,o,s=new gm((!e.a&&(e.a=new F(e7,e,10,11)),e.a)),c,l,u,d;s.e!=s.i.gc();)o=P(JA(s),26),J(o,(wL(),Y6))!=null&&(!o.a&&(o.a=new F(e7,o,10,11)),o.a)&&(!o.a&&(o.a=new F(e7,o,10,11)),o.a).i>0?(r=P(J(o,Y6),522),d=r.Sg(o),u=P(J(o,T6),104),_p(o,n.Math.max(o.g,d.a+u.b+u.c),n.Math.max(o.f,d.b+u.d+u.a))):(!o.a&&(o.a=new F(e7,o,10,11)),o.a).i!=0&&_p(o,D(N(J(o,G6))),D(N(J(o,G6)))/D(N(J(o,W6))));t=P(J(e,(wL(),z6)),144),l=P(sb(t.f),214);try{l.kf(e,new Va),jje(t.f,l)}catch(e){throw e=tD(e),j(e,101)?(c=e,E(c)):E(e)}return nj(e,n6,pW),sRe(e),hL(e),a=D(N(J(e,a6))),i=D(N(J(e,i6))),new k(a,i)},eT(aW,`TopdownSizeApproximator/4`,973,F5,null,null);var zzt;q(345,1,{853:1},Ks),Q.Tg=function(e,t){return _3e(this,e,t)},Q.Ug=function(){t8e(this)},Q.Vg=function(){return this.q},Q.Wg=function(){return this.f?Gy(this.f):null},Q.Xg=function(){return Gy(this.a)},Q.Yg=function(){return this.p},Q.Zg=function(){return!1},Q.$g=function(){return this.n},Q._g=function(){return this.p!=null&&!this.b},Q.ah=function(e){var t;this.n&&(t=e,M(this.f,t))},Q.bh=function(e,t){var n,r;this.n&&e&&XFe(this,(n=new MAe,r=XF(n,e),pdt(n),r),(QD(),L5))},Q.dh=function(e){var t;return this.b?null:(t=rUe(this,this.g),Mg(this.a,t),t.i=this,this.d=e,t)},Q.eh=function(e){e>0&&!this.b&&bT(this,e)},Q.b=!1,Q.c=0,Q.d=-1,Q.e=null,Q.f=null,Q.g=-1,Q.j=!1,Q.k=!1,Q.n=!1,Q.o=0,Q.q=0,Q.r=0,L(XH,`BasicProgressMonitor`,345),q(706,214,yB,ore),Q.kf=function(e,t){lst(e,t)},L(XH,`BoxLayoutProvider`,706),q(966,1,$z,$ue),Q.Le=function(e,t){return $tt(this,P(e,26),P(t,26))},Q.Fb=function(e){return this===e},Q.Me=function(){return new ko(this)},Q.a=!1,L(XH,`BoxLayoutProvider/1`,966),q(167,1,{167:1},Ow,uSe),Q.Ib=function(){return this.c?TF(this.c):KM(this.b)},L(XH,`BoxLayoutProvider/Group`,167),q(327,24,{3:1,35:1,24:1,327:1},Tf);var Bzt,Vzt,Hzt,I5,Uzt=eT(XH,`BoxLayoutProvider/PackingMode`,327,gq,FLe,UEe),Wzt;q(967,1,$z,dre),Q.Le=function(e,t){return RMe(P(e,167),P(t,167))},Q.Fb=function(e){return this===e},Q.Me=function(){return new ko(this)},L(XH,`BoxLayoutProvider/lambda$0$Type`,967),q(968,1,$z,fre),Q.Le=function(e,t){return yMe(P(e,167),P(t,167))},Q.Fb=function(e){return this===e},Q.Me=function(){return new ko(this)},L(XH,`BoxLayoutProvider/lambda$1$Type`,968),q(969,1,$z,pre),Q.Le=function(e,t){return bMe(P(e,167),P(t,167))},Q.Fb=function(e){return this===e},Q.Me=function(){return new ko(this)},L(XH,`BoxLayoutProvider/lambda$2$Type`,969),q(1339,1,{830:1},mre),Q.Lg=function(e,t){return au(),!j(t,174)||ghe((uD(),P(e,174)),t)},L(XH,`ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type`,1339),q(1340,1,aR,ede),Q.Ad=function(e){hJe(this.a,P(e,147))},L(XH,`ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type`,1340),q(1341,1,aR,hre),Q.Ad=function(e){P(e,105),au()},L(XH,`ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type`,1341),q(1345,1,aR,tde),Q.Ad=function(e){GWe(this.a,P(e,105))},L(XH,`ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type`,1345),q(1343,1,CR,ive),Q.Mb=function(e){return Pqe(this.a,this.b,P(e,147))},L(XH,`ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type`,1343),q(1342,1,CR,ave),Q.Mb=function(e){return nSe(this.a,this.b,P(e,830))},L(XH,`ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type`,1342),q(1344,1,aR,ove),Q.Ad=function(e){zke(this.a,this.b,P(e,147))},L(XH,`ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type`,1344),q(931,1,{},cre),Q.Kb=function(e){return jye(e)},Q.Fb=function(e){return this===e},L(XH,`ElkUtil/lambda$0$Type`,931),q(932,1,aR,sve),Q.Ad=function(e){F7e(this.a,this.b,P(e,85))},Q.a=0,Q.b=0,L(XH,`ElkUtil/lambda$1$Type`,932),q(933,1,aR,cve),Q.Ad=function(e){Ape(this.a,this.b,P(e,170))},Q.a=0,Q.b=0,L(XH,`ElkUtil/lambda$2$Type`,933),q(934,1,aR,lve),Q.Ad=function(e){Zye(this.a,this.b,P(e,157))},Q.a=0,Q.b=0,L(XH,`ElkUtil/lambda$3$Type`,934),q(935,1,aR,nde),Q.Ad=function(e){dOe(this.a,P(e,372))},L(XH,`ElkUtil/lambda$4$Type`,935),q(331,1,{35:1,331:1},Zo),Q.Dd=function(e){return Wbe(this,P(e,242))},Q.Fb=function(e){var t;return j(e,331)?(t=P(e,331),this.a==t.a):!1},Q.Hb=function(){return mb(this.a)},Q.Ib=function(){return this.a+` (exclusive)`},Q.a=0,L(XH,`ExclusiveBounds/ExclusiveLowerBound`,331),q(1089,214,yB,lre),Q.kf=function(e,t){var r,i,a,o,s,c,l,u,f,p,m,h,g,_,v,y,b,x,S,C,ee,w,te;for(t.Tg(`Fixed Layout`,1),o=P(J(e,(wL(),WLt)),222),p=0,m=0,b=new gm((!e.a&&(e.a=new F(e7,e,10,11)),e.a));b.e!=b.i.gc();){for(v=P(JA(b),26),te=P(J(v,(qD(),p8)),8),te&&(vp(v,te.a,te.b),P(J(v,izt),182).Gc((hA(),v5))&&(h=P(J(v,ozt),8),h.a>0&&h.b>0&&uL(v,h.a,h.b,!0,!0))),p=n.Math.max(p,v.i+v.g),m=n.Math.max(m,v.j+v.f),u=new gm((!v.n&&(v.n=new F($5,v,1,7)),v.n));u.e!=u.i.gc();)c=P(JA(u),157),te=P(J(c,p8),8),te&&vp(c,te.a,te.b),p=n.Math.max(p,v.i+c.i+c.g),m=n.Math.max(m,v.j+c.j+c.f);for(C=new gm((!v.c&&(v.c=new F(t7,v,9,9)),v.c));C.e!=C.i.gc();)for(S=P(JA(C),125),te=P(J(S,p8),8),te&&vp(S,te.a,te.b),ee=v.i+S.i,w=v.j+S.j,p=n.Math.max(p,ee+S.g),m=n.Math.max(m,w+S.f),l=new gm((!S.n&&(S.n=new F($5,S,1,7)),S.n));l.e!=l.i.gc();)c=P(JA(l),157),te=P(J(c,p8),8),te&&vp(c,te.a,te.b),p=n.Math.max(p,ee+c.i+c.g),m=n.Math.max(m,w+c.j+c.f);for(a=new A_(Em(xP(v).a.Jc(),new d));rP(a);)r=P(kS(a),85),f=yft(r),p=n.Math.max(p,f.a),m=n.Math.max(m,f.b);for(i=new A_(Em(bP(v).a.Jc(),new d));rP(i);)r=P(kS(i),85),jb(GM(r))!=e&&(f=yft(r),p=n.Math.max(p,f.a),m=n.Math.max(m,f.b))}if(o==(ck(),s8))for(y=new gm((!e.a&&(e.a=new F(e7,e,10,11)),e.a));y.e!=y.i.gc();)for(v=P(JA(y),26),i=new A_(Em(xP(v).a.Jc(),new d));rP(i);)r=P(kS(i),85),s=Fot(r),s.b==0?nj(r,g6,null):nj(r,g6,s);hc(xh(J(e,(qD(),azt))))||(x=P(J(e,szt),104),_=p+x.b+x.c,g=m+x.d+x.a,uL(e,_,g,!0,!0)),t.Ug()},L(XH,`FixedLayoutProvider`,1089),q(379,150,{3:1,414:1,379:1,105:1,150:1},Ba,hHe),Q.ag=function(e){var t,n,r,i,a,o,s,c,l;if(e)try{for(c=uI(e,`;,;`),a=c,o=0,s=a.length;o<s;++o){if(i=a[o],n=uI(i,`\\:`),r=fut(iT(),n[0]),!r)throw E(new fc(`Invalid option id: `+n[0]));if(l=Zlt(r,n[1]),l==null)throw E(new fc(`Invalid option value: `+n[1]));l==null?(!this.q&&(this.q=new $o),LS(this.q,r)):(!this.q&&(this.q=new $o),ry(this.q,r,l))}}catch(e){throw e=tD(e),j(e,101)?(t=e,E(new lJe(t))):E(e)}},Q.Ib=function(){return Sh(fS(yy((this.q?this.q:(Py(),Py(),gJ)).vc().Mc(),new sre),tHe(new NDe,new Ce,new _e,new be,U(O(RJ,1),Z,130,0,[]))))};var Gzt=L(XH,`IndividualSpacings`,379);q(965,1,{},sre),Q.Kb=function(e){return LMe(P(e,45))},L(XH,`IndividualSpacings/lambda$0$Type`,965),q(708,1,{},qOe),Q.c=0,L(XH,`InstancePool`,708),q(1819,1,{},ure),L(XH,`LoggedGraph`,1819),q(407,24,{3:1,35:1,24:1,407:1},Df);var Kzt,L5,qzt,Jzt,Yzt=eT(XH,`LoggedGraph/Type`,407,gq,ILe,WEe),Xzt;q(615,1,{853:1},Va),Q.Tg=function(e,t){return!1},Q.Ug=function(){},Q.Vg=function(){return 0},Q.Wg=function(){return null},Q.Xg=function(){return null},Q.Yg=function(){return null},Q.Zg=function(){return!1},Q.$g=function(){return!1},Q._g=function(){return!1},Q.ah=function(e){},Q.bh=function(e,t){},Q.dh=function(e){return this},Q.eh=function(e){},L(XH,`NullElkProgressMonitor`,615),q(49,1,{20:1,49:1},Ef),Q.Ic=function(e){vS(this,e)},Q.Fb=function(e){var t,n,r;return j(e,49)?(n=P(e,49),t=this.a==null?n.a==null:UO(this.a,n.a),r=this.b==null?n.b==null:UO(this.b,n.b),t&&r):!1},Q.Hb=function(){var e,t,n=this.a==null?0:YT(this.a),r,i,a;return e=n&IR,t=n&-65536,a=this.b==null?0:YT(this.b),r=a&IR,i=a&-65536,e^i>>16&IR|t^r<<16},Q.Jc=function(){return new rde(this)},Q.Ib=function(){return this.a==null&&this.b==null?`pair(null,null)`:this.a==null?`pair(null,`+zk(this.b)+`)`:this.b==null?`pair(`+zk(this.a)+`,null)`:`pair(`+zk(this.a)+`,`+zk(this.b)+`)`},L(XH,`Pair`,49),q(980,1,qL,rde),Q.Nb=function(e){ev(this,e)},Q.Ob=function(){return!this.c&&(!this.b&&this.a.a!=null||this.a.b!=null)},Q.Pb=function(){if(!this.c&&!this.b&&this.a.a!=null)return this.b=!0,this.a.a;if(!this.c&&this.a.b!=null)return this.c=!0,this.a.b;throw E(new ms)},Q.Qb=function(){throw this.c&&this.a.b!=null?this.a.b=null:this.b&&this.a.a!=null&&(this.a.a=null),E(new ds)},Q.b=!1,Q.c=!1,L(XH,`Pair/1`,980),q(1079,214,yB,gre),Q.kf=function(e,t){var n,r,i,a,o;t.Tg(`Random Layout`,1),(!e.a&&(e.a=new F(e7,e,10,11)),e.a).i==0||(a=P(J(e,(yZe(),Tzt)),15),i=a&&a.a!=0?new dS(a.a):new Fk,n=gc(N(J(e,Szt))),o=gc(N(J(e,Ezt))),r=P(J(e,Czt),104),Vdt(e,i,n,o,r)),t.Ug()},L(XH,`RandomLayoutProvider`,1079),q(240,1,{240:1},gg),Q.Fb=function(e){return iy(this.a,P(e,240).a)&&iy(this.b,P(e,240).b)&&iy(this.c,P(e,240).c)},Q.Hb=function(){return lO(U(O(aq,1),BL,1,5,[this.a,this.b,this.c]))},Q.Ib=function(){return`(`+this.a+zL+this.b+zL+this.c+`)`},L(XH,`Triple`,240);var Zzt;q(551,1,{}),Q.Jf=function(){return new k(this.f.i,this.f.j)},Q.mf=function(e){return lNe(e,(wL(),A6))?J(this.f,Qzt):J(this.f,e)},Q.Kf=function(){return new k(this.f.g,this.f.f)},Q.Lf=function(){return this.g},Q.nf=function(e){return rC(this.f,e)},Q.Mf=function(e){Ww(this.f,e.a),Gw(this.f,e.b)},Q.Nf=function(e){Uw(this.f,e.a),Rw(this.f,e.b)},Q.Of=function(e){this.g=e},Q.g=0;var Qzt;L(gW,`ElkGraphAdapters/AbstractElkGraphElementAdapter`,551),q(553,1,{838:1},Vo),Q.Pf=function(){var e,t;if(!this.b)for(this.b=wx(cy(this.a).i),t=new gm(cy(this.a));t.e!=t.i.gc();)e=P(JA(t),157),M(this.b,new lc(e));return this.b},Q.b=null,L(gW,`ElkGraphAdapters/ElkEdgeAdapter`,553),q(260,551,{},uc),Q.Qf=function(){return I1e(this)},Q.a=null,L(gW,`ElkGraphAdapters/ElkGraphAdapter`,260),q(631,551,{187:1},lc),L(gW,`ElkGraphAdapters/ElkLabelAdapter`,631),q(552,551,{685:1},Ym),Q.Pf=function(){return P1e(this)},Q.Tf=function(){var e=P(J(this.f,(wL(),_6)),140);return!e&&(e=new js),e},Q.Vf=function(){return F1e(this)},Q.Xf=function(e){var t=new lg(e);nj(this.f,(wL(),_6),t)},Q.Yf=function(e){nj(this.f,(wL(),T6),new Zwe(e))},Q.Rf=function(){return this.d},Q.Sf=function(){var e,t;if(!this.a)for(this.a=new Qo,t=new A_(Em(bP(P(this.f,26)).a.Jc(),new d));rP(t);)e=P(kS(t),85),M(this.a,new Vo(e));return this.a},Q.Uf=function(){var e,t;if(!this.c)for(this.c=new Qo,t=new A_(Em(xP(P(this.f,26)).a.Jc(),new d));rP(t);)e=P(kS(t),85),M(this.c,new Vo(e));return this.c},Q.Wf=function(){return Hy(P(this.f,26)).i!=0||hc(xh(P(this.f,26).mf((wL(),f6))))},Q.Zf=function(){uHe(this,(mu(),Zzt))},Q.a=null,Q.b=null,Q.c=null,Q.d=null,Q.e=null,L(gW,`ElkGraphAdapters/ElkNodeAdapter`,552),q(1251,551,{837:1},jde),Q.Pf=function(){return q1e(this)},Q.Sf=function(){var e,t;if(!this.a)for(this.a=nh(P(this.f,125).gh().i),t=new gm(P(this.f,125).gh());t.e!=t.i.gc();)e=P(JA(t),85),M(this.a,new Vo(e));return this.a},Q.Uf=function(){var e,t;if(!this.c)for(this.c=nh(P(this.f,125).hh().i),t=new gm(P(this.f,125).hh());t.e!=t.i.gc();)e=P(JA(t),85),M(this.c,new Vo(e));return this.c},Q.$f=function(){return P(P(this.f,125).mf((wL(),F6)),64)},Q._f=function(){var e,t,n,r=wb(P(this.f,125)),i,a,o,s;for(n=new gm(P(this.f,125).hh());n.e!=n.i.gc();)for(e=P(JA(n),85),s=new gm((!e.c&&(e.c=new qh(U5,e,5,8)),e.c));s.e!=s.i.gc();)if(o=P(JA(s),84),Cw(AM(o),r)||AM(o)==r&&hc(xh(J(e,(wL(),p6)))))return!0;for(t=new gm(P(this.f,125).gh());t.e!=t.i.gc();)for(e=P(JA(t),85),a=new gm((!e.b&&(e.b=new qh(U5,e,4,7)),e.b));a.e!=a.i.gc();)if(i=P(JA(a),84),Cw(AM(i),r))return!0;return!1},Q.a=null,Q.b=null,Q.c=null,L(gW,`ElkGraphAdapters/ElkPortAdapter`,1251),q(1252,1,$z,_re),Q.Le=function(e,t){return Git(P(e,125),P(t,125))},Q.Fb=function(e){return this===e},Q.Me=function(){return new ko(this)},L(gW,`ElkGraphAdapters/PortComparator`,1252);var R5=Jg(_W,`EObject`),z5=Jg(vW,Dyt),B5=Jg(vW,Oyt),V5=Jg(vW,kyt),H5=Jg(vW,`ElkShape`),U5=Jg(vW,Ayt),W5=Jg(vW,yW),G5=Jg(vW,jyt),K5=Jg(_W,Myt),q5=Jg(_W,`EFactory`),$zt,J5=Jg(_W,Nyt),Y5=Jg(_W,`EPackage`),X5,eBt,tBt,nBt,Z5,rBt,iBt,aBt,oBt,Q5,sBt,cBt,$5=Jg(vW,bW),e7=Jg(vW,xW),t7=Jg(vW,SW);q(93,1,Pyt),Q.qh=function(){return this.rh(),null},Q.rh=function(){return null},Q.sh=function(){return this.rh(),!1},Q.th=function(){return!1},Q.uh=function(e){CE(this,e)},L(CW,`BasicNotifierImpl`,93),q(100,93,Ryt),Q.Vh=function(){return fp(this)},Q.vh=function(e,t){return e},Q.wh=function(){throw E(new ps)},Q.xh=function(e){var t=vj(P(gw(this.Ah(),this.Ch()),19));return this.Mh().Qh(this,t.n,t.f,e)},Q.yh=function(e,t){throw E(new ps)},Q.zh=function(e,t,n){return tI(this,e,t,n)},Q.Ah=function(){var e;return this.wh()&&(e=this.wh().Lk(),e)?e:this.fi()},Q.Bh=function(){return QN(this)},Q.Ch=function(){throw E(new ps)},Q.Dh=function(){var e,t=this.Xh().Mk();return!t&&this.wh().Rk(t=(yu(),e=LNe(pI(this.Ah())),e==null?i9:new Xm(this,e))),t},Q.Eh=function(e,t){return e},Q.Fh=function(e){return e.nk()?e.Jj():$k(this.Ah(),e)},Q.Gh=function(){var e=this.wh();return e?e.Ok():null},Q.Hh=function(){return this.wh()?this.wh().Lk():null},Q.Ih=function(e,t,n){return aj(this,e,t,n)},Q.Jh=function(e){return vC(this,e)},Q.Kh=function(e,t){return MS(this,e,t)},Q.Lh=function(){var e=this.wh();return!!e&&e.Pk()},Q.Mh=function(){throw E(new ps)},Q.Nh=function(){return MA(this)},Q.Oh=function(e,t,n,r){return tj(this,e,t,r)},Q.Ph=function(e,t,n){return P(gw(this.Ah(),t),69).uk().xk(this,this.ei(),t-this.gi(),e,n)},Q.Qh=function(e,t,n,r){return ob(this,e,t,r)},Q.Rh=function(e,t,n){return P(gw(this.Ah(),t),69).uk().yk(this,this.ei(),t-this.gi(),e,n)},Q.Sh=function(){return!!this.wh()&&!!this.wh().Nk()},Q.Th=function(e){return KA(this,e)},Q.Uh=function(e){return lPe(this,e)},Q.Wh=function(e){return edt(this,e)},Q.Xh=function(){throw E(new ps)},Q.Yh=function(){return this.wh()?this.wh().Nk():null},Q.Zh=function(){return MA(this)},Q.$h=function(e,t){bN(this,e,t)},Q._h=function(e){this.Xh().Qk(e)},Q.ai=function(e){this.Xh().Tk(e)},Q.bi=function(e){this.Xh().Sk(e)},Q.ci=function(e,t){var n,r,i,a=this.Gh();return a&&e&&(t=ij(a.Cl(),this,t),a.Gl(this)),r=this.Mh(),r&&((FF(this,this.Mh(),this.Ch()).Bb&xz)==0?(t=(n=this.Ch(),n>=0?this.xh(t):this.Mh().Qh(this,-1-n,null,t)),t=this.zh(null,-1,t)):(i=r.Nh(),i&&(e?!a&&i.Gl(this):i.Fl(this)))),this.ai(e),t},Q.di=function(e){var t,n=this.Ah(),r,i,a=$k(n,e),o,s,c;if(t=this.gi(),a>=t)return P(e,69).uk().Bk(this,this.ei(),a-t);if(a<=-1){if(o=YI((uN(),l9),n,e),o){if(Su(),P(o,69).vk()||(o=ox(BC(l9,o))),i=(r=this.Fh(o),P(r>=0?this.Ih(r,!0,!0):zN(this,o,!0),163)),c=o.Gk(),c>1||c==-1)return P(P(i,219).Ql(e,!1),78)}else throw E(new fc(wW+e.ve()+EW))}else if(e.Hk())return r=this.Fh(e),P(r>=0?this.Ih(r,!1,!0):zN(this,e,!1),78);return s=new Ove(this,e),s},Q.ei=function(){return cHe(this)},Q.fi=function(){return(bv(),z7).S},Q.gi=function(){return xv(this.fi())},Q.hi=function(e){oN(this,e)},Q.Ib=function(){return pP(this)},L(OW,`BasicEObjectImpl`,100);var lBt;q(117,100,{109:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1}),Q.ii=function(e){return lHe(this)[e]},Q.ji=function(e,t){Mv(lHe(this),e,t)},Q.ki=function(e){Mv(lHe(this),e,null)},Q.qh=function(){return P(jE(this,4),129)},Q.rh=function(){throw E(new ps)},Q.sh=function(){return!!(this.Db&4)},Q.wh=function(){throw E(new ps)},Q.li=function(e){OA(this,2,e)},Q.yh=function(e,t){this.Db=t<<16|this.Db&255,this.li(e)},Q.Ah=function(){return ib(this)},Q.Ch=function(){return this.Db>>16},Q.Dh=function(){var e,t;return yu(),t=LNe(pI((e=P(jE(this,16),29),e||this.fi()))),t==null?i9:new Xm(this,t)},Q.th=function(){return!(this.Db&1)},Q.Gh=function(){return P(jE(this,128),1999)},Q.Hh=function(){return P(jE(this,16),29)},Q.Lh=function(){return!!(this.Db&32)},Q.Mh=function(){return P(jE(this,2),52)},Q.Sh=function(){return!!(this.Db&64)},Q.Xh=function(){throw E(new ps)},Q.Yh=function(){return P(jE(this,64),290)},Q._h=function(e){OA(this,16,e)},Q.ai=function(e){OA(this,128,e)},Q.bi=function(e){OA(this,64,e)},Q.ei=function(){return DA(this)},Q.Db=0,L(OW,`MinimalEObjectImpl`,117),q(118,117,{109:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),Q.li=function(e){this.Cb=e},Q.Mh=function(){return this.Cb},L(OW,`MinimalEObjectImpl/Container`,118),q(kW,118,{109:1,343:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),Q.Ih=function(e,t,n){return Y1e(this,e,t,n)},Q.Rh=function(e,t,n){return C6e(this,e,t,n)},Q.Th=function(e){return nIe(this,e)},Q.$h=function(e,t){OD(this,e,t)},Q.fi=function(){return gL(),cBt},Q.hi=function(e){JKe(this,e)},Q.lf=function(){return KQe(this)},Q.fh=function(){return!this.o&&(this.o=new pC((gL(),Q5),r7,this,0)),this.o},Q.mf=function(e){return J(this,e)},Q.nf=function(e){return rC(this,e)},Q.of=function(e,t){return nj(this,e,t)},L(AW,`EMapPropertyHolderImpl`,kW),q(559,118,{109:1,372:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},Ua),Q.Ih=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return aj(this,e,t,n)},Q.Th=function(e){switch(e){case 0:return this.a!=0;case 1:return this.b!=0}return KA(this,e)},Q.$h=function(e,t){switch(e){case 0:zw(this,D(N(t)));return;case 1:Bw(this,D(N(t)));return}bN(this,e,t)},Q.fi=function(){return gL(),eBt},Q.hi=function(e){switch(e){case 0:zw(this,0);return;case 1:Bw(this,0);return}oN(this,e)},Q.Ib=function(){var e;return this.Db&64?pP(this):(e=new Am(pP(this)),e.a+=` (x: `,ll(e,this.a),e.a+=`, y: `,ll(e,this.b),e.a+=`)`,e.a)},Q.a=0,Q.b=0,L(AW,`ElkBendPointImpl`,559),q(727,kW,{109:1,343:1,174:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),Q.Ih=function(e,t,n){return GO(this,e,t,n)},Q.Ph=function(e,t,n){return NM(this,e,t,n)},Q.Rh=function(e,t,n){return ZE(this,e,t,n)},Q.Th=function(e){return oKe(this,e)},Q.$h=function(e,t){K2e(this,e,t)},Q.fi=function(){return gL(),rBt},Q.hi=function(e){MO(this,e)},Q.ih=function(){return this.k},Q.jh=function(){return cy(this)},Q.Ib=function(){return Ck(this)},Q.k=null,L(AW,`ElkGraphElementImpl`,727),q(728,727,{109:1,343:1,174:1,276:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),Q.Ih=function(e,t,n){return mXe(this,e,t,n)},Q.Th=function(e){return PXe(this,e)},Q.$h=function(e,t){q2e(this,e,t)},Q.fi=function(){return gL(),sBt},Q.hi=function(e){eZe(this,e)},Q.kh=function(){return this.f},Q.lh=function(){return this.g},Q.mh=function(){return this.i},Q.nh=function(){return this.j},Q.oh=function(e,t){_p(this,e,t)},Q.ph=function(e,t){vp(this,e,t)},Q.Ib=function(){return QM(this)},Q.f=0,Q.g=0,Q.i=0,Q.j=0,L(AW,`ElkShapeImpl`,728),q(729,728,{109:1,343:1,84:1,174:1,276:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),Q.Ih=function(e,t,n){return U$e(this,e,t,n)},Q.Ph=function(e,t,n){return w2e(this,e,t,n)},Q.Rh=function(e,t,n){return T2e(this,e,t,n)},Q.Th=function(e){return TD(this,e)},Q.$h=function(e,t){sP(this,e,t)},Q.fi=function(){return gL(),tBt},Q.hi=function(e){s$e(this,e)},Q.gh=function(){return!this.d&&(this.d=new qh(W5,this,8,5)),this.d},Q.hh=function(){return!this.e&&(this.e=new qh(W5,this,7,4)),this.e},L(AW,`ElkConnectableShapeImpl`,729),q(271,727,{109:1,343:1,85:1,174:1,271:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},Ha),Q.xh=function(e){return N0e(this,e)},Q.Ih=function(e,t,n){switch(e){case 3:return Cb(this);case 4:return!this.b&&(this.b=new qh(U5,this,4,7)),this.b;case 5:return!this.c&&(this.c=new qh(U5,this,5,8)),this.c;case 6:return!this.a&&(this.a=new F(G5,this,6,6)),this.a;case 7:return Lm(),!this.b&&(this.b=new qh(U5,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new qh(U5,this,5,8)),this.c.i<=1));case 8:return Lm(),!!XN(this);case 9:return Lm(),!!FN(this);case 10:return Lm(),!this.b&&(this.b=new qh(U5,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new qh(U5,this,5,8)),this.c.i!=0)}return GO(this,e,t,n)},Q.Ph=function(e,t,n){var r;switch(t){case 3:return this.Cb&&(n=(r=this.Db>>16,r>=0?N0e(this,n):this.Cb.Qh(this,-1-r,null,n))),tCe(this,P(e,26),n);case 4:return!this.b&&(this.b=new qh(U5,this,4,7)),oA(this.b,e,n);case 5:return!this.c&&(this.c=new qh(U5,this,5,8)),oA(this.c,e,n);case 6:return!this.a&&(this.a=new F(G5,this,6,6)),oA(this.a,e,n)}return NM(this,e,t,n)},Q.Rh=function(e,t,n){switch(t){case 3:return tCe(this,null,n);case 4:return!this.b&&(this.b=new qh(U5,this,4,7)),ij(this.b,e,n);case 5:return!this.c&&(this.c=new qh(U5,this,5,8)),ij(this.c,e,n);case 6:return!this.a&&(this.a=new F(G5,this,6,6)),ij(this.a,e,n)}return ZE(this,e,t,n)},Q.Th=function(e){switch(e){case 3:return!!Cb(this);case 4:return!!this.b&&this.b.i!=0;case 5:return!!this.c&&this.c.i!=0;case 6:return!!this.a&&this.a.i!=0;case 7:return!this.b&&(this.b=new qh(U5,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new qh(U5,this,5,8)),this.c.i<=1));case 8:return XN(this);case 9:return FN(this);case 10:return!this.b&&(this.b=new qh(U5,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new qh(U5,this,5,8)),this.c.i!=0)}return oKe(this,e)},Q.$h=function(e,t){switch(e){case 3:DP(this,P(t,26));return;case 4:!this.b&&(this.b=new qh(U5,this,4,7)),GI(this.b),!this.b&&(this.b=new qh(U5,this,4,7)),Sv(this.b,P(t,18));return;case 5:!this.c&&(this.c=new qh(U5,this,5,8)),GI(this.c),!this.c&&(this.c=new qh(U5,this,5,8)),Sv(this.c,P(t,18));return;case 6:!this.a&&(this.a=new F(G5,this,6,6)),GI(this.a),!this.a&&(this.a=new F(G5,this,6,6)),Sv(this.a,P(t,18));return}K2e(this,e,t)},Q.fi=function(){return gL(),nBt},Q.hi=function(e){switch(e){case 3:DP(this,null);return;case 4:!this.b&&(this.b=new qh(U5,this,4,7)),GI(this.b);return;case 5:!this.c&&(this.c=new qh(U5,this,5,8)),GI(this.c);return;case 6:!this.a&&(this.a=new F(G5,this,6,6)),GI(this.a);return}MO(this,e)},Q.Ib=function(){return yct(this)},L(AW,`ElkEdgeImpl`,271),q(443,kW,{109:1,343:1,170:1,443:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},Wa),Q.xh=function(e){return D0e(this,e)},Q.Ih=function(e,t,n){switch(e){case 1:return this.j;case 2:return this.k;case 3:return this.b;case 4:return this.c;case 5:return!this.a&&(this.a=new um(B5,this,5)),this.a;case 6:return cPe(this);case 7:return t?_j(this):this.i;case 8:return t?gj(this):this.f;case 9:return!this.g&&(this.g=new qh(G5,this,9,10)),this.g;case 10:return!this.e&&(this.e=new qh(G5,this,10,9)),this.e;case 11:return this.d}return Y1e(this,e,t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?D0e(this,n):this.Cb.Qh(this,-1-i,null,n))),nCe(this,P(e,85),n);case 9:return!this.g&&(this.g=new qh(G5,this,9,10)),oA(this.g,e,n);case 10:return!this.e&&(this.e=new qh(G5,this,10,9)),oA(this.e,e,n)}return a=P(gw((r=P(jE(this,16),29),r||(gL(),Z5)),t),69),a.uk().xk(this,DA(this),t-xv((gL(),Z5)),e,n)},Q.Rh=function(e,t,n){switch(t){case 5:return!this.a&&(this.a=new um(B5,this,5)),ij(this.a,e,n);case 6:return nCe(this,null,n);case 9:return!this.g&&(this.g=new qh(G5,this,9,10)),ij(this.g,e,n);case 10:return!this.e&&(this.e=new qh(G5,this,10,9)),ij(this.e,e,n)}return C6e(this,e,t,n)},Q.Th=function(e){switch(e){case 1:return this.j!=0;case 2:return this.k!=0;case 3:return this.b!=0;case 4:return this.c!=0;case 5:return!!this.a&&this.a.i!=0;case 6:return!!cPe(this);case 7:return!!this.i;case 8:return!!this.f;case 9:return!!this.g&&this.g.i!=0;case 10:return!!this.e&&this.e.i!=0;case 11:return this.d!=null}return nIe(this,e)},Q.$h=function(e,t){switch(e){case 1:Kw(this,D(N(t)));return;case 2:qw(this,D(N(t)));return;case 3:Vw(this,D(N(t)));return;case 4:Hw(this,D(N(t)));return;case 5:!this.a&&(this.a=new um(B5,this,5)),GI(this.a),!this.a&&(this.a=new um(B5,this,5)),Sv(this.a,P(t,18));return;case 6:Ptt(this,P(t,85));return;case 7:OT(this,P(t,84));return;case 8:DT(this,P(t,84));return;case 9:!this.g&&(this.g=new qh(G5,this,9,10)),GI(this.g),!this.g&&(this.g=new qh(G5,this,9,10)),Sv(this.g,P(t,18));return;case 10:!this.e&&(this.e=new qh(G5,this,10,9)),GI(this.e),!this.e&&(this.e=new qh(G5,this,10,9)),Sv(this.e,P(t,18));return;case 11:MT(this,Sh(t));return}OD(this,e,t)},Q.fi=function(){return gL(),Z5},Q.hi=function(e){switch(e){case 1:Kw(this,0);return;case 2:qw(this,0);return;case 3:Vw(this,0);return;case 4:Hw(this,0);return;case 5:!this.a&&(this.a=new um(B5,this,5)),GI(this.a);return;case 6:Ptt(this,null);return;case 7:OT(this,null);return;case 8:DT(this,null);return;case 9:!this.g&&(this.g=new qh(G5,this,9,10)),GI(this.g);return;case 10:!this.e&&(this.e=new qh(G5,this,10,9)),GI(this.e);return;case 11:MT(this,null);return}JKe(this,e)},Q.Ib=function(){return l9e(this)},Q.b=0,Q.c=0,Q.d=null,Q.j=0,Q.k=0,L(AW,`ElkEdgeSectionImpl`,443),q(161,118,{109:1,94:1,93:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1}),Q.Ih=function(e,t,n){var r;return e==0?(!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab):SC(this,e-xv(this.fi()),gw((r=P(jE(this,16),29),r||this.fi()),e),t,n)},Q.Ph=function(e,t,n){var r,i;return t==0?(!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n)):(i=P(gw((r=P(jE(this,16),29),r||this.fi()),t),69),i.uk().xk(this,DA(this),t-xv(this.fi()),e,n))},Q.Rh=function(e,t,n){var r,i;return t==0?(!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n)):(i=P(gw((r=P(jE(this,16),29),r||this.fi()),t),69),i.uk().yk(this,DA(this),t-xv(this.fi()),e,n))},Q.Th=function(e){var t;return e==0?!!this.Ab&&this.Ab.i!=0:Ux(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.Wh=function(e){return pft(this,e)},Q.$h=function(e,t){var n;e===0?(!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18))):Rk(this,e-xv(this.fi()),gw((n=P(jE(this,16),29),n||this.fi()),e),t)},Q.ai=function(e){OA(this,128,e)},Q.fi=function(){return OL(),UBt},Q.hi=function(e){var t;e===0?(!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab)):KO(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.mi=function(){this.Bb|=1},Q.ni=function(e){return nI(this,e)},Q.Bb=0,L(OW,`EModelElementImpl`,161),q(710,161,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1},Voe),Q.oi=function(e,t){return Iut(this,e,t)},Q.pi=function(e){var t,n,r,i,a;if(this.a!=Pw(e)||e.Bb&256)throw E(new fc(IW+e.zb+NW));for(r=rb(e);tS(r.a).i!=0;){if(n=P(QI(r,0,(t=P(H(tS(r.a),0),87),a=t.c,j(a,88)?P(a,29):(OL(),J7))),29),Rj(n))return i=Pw(n).ti().pi(n),P(i,52)._h(e),i;r=rb(n)}return(e.D==null?e.B:e.D)==`java.util.Map$Entry`?new mOe(e):new FDe(e)},Q.qi=function(e,t){return _L(this,e,t)},Q.Ih=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.a}return SC(this,e-xv((OL(),G7)),gw((r=P(jE(this,16),29),r||G7),e),t,n)},Q.Ph=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 1:return this.a&&(n=P(this.a,52).Qh(this,4,Y5,n)),OO(this,P(e,241),n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),G7)),t),69),i.uk().xk(this,DA(this),t-xv((OL(),G7)),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 1:return OO(this,null,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),G7)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),G7)),e,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return!!this.a}return Ux(this,e-xv((OL(),G7)),gw((t=P(jE(this,16),29),t||G7),e))},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:c6e(this,P(t,241));return}Rk(this,e-xv((OL(),G7)),gw((n=P(jE(this,16),29),n||G7),e),t)},Q.fi=function(){return OL(),G7},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:c6e(this,null);return}KO(this,e-xv((OL(),G7)),gw((t=P(jE(this,16),29),t||G7),e))};var n7,uBt,dBt;L(OW,`EFactoryImpl`,710),q(1019,710,{109:1,2078:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1},yre),Q.oi=function(e,t){switch(e.fk()){case 12:return P(t,147).Og();case 13:return zk(t);default:throw E(new fc(MW+e.ve()+NW))}},Q.pi=function(e){var t,n,r,i,a,o,s,c;switch(e.G==-1&&(e.G=(t=Pw(e),t?dj(t.si(),e):-1)),e.G){case 4:return a=new bre,a;case 6:return o=new Fs,o;case 7:return s=new Is,s;case 8:return r=new Ha,r;case 9:return n=new Ua,n;case 10:return i=new Wa,i;case 11:return c=new xre,c;default:throw E(new fc(IW+e.zb+NW))}},Q.qi=function(e,t){switch(e.fk()){case 13:case 12:return null;default:throw E(new fc(MW+e.ve()+NW))}},L(AW,`ElkGraphFactoryImpl`,1019),q(439,161,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1}),Q.Dh=function(){var e,t=(e=P(jE(this,16),29),LNe(pI(e||this.fi())));return t==null?(yu(),yu(),i9):new pSe(this,t)},Q.Ih=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.ve()}return SC(this,e-xv(this.fi()),gw((r=P(jE(this,16),29),r||this.fi()),e),t,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null}return Ux(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:this.ri(Sh(t));return}Rk(this,e-xv(this.fi()),gw((n=P(jE(this,16),29),n||this.fi()),e),t)},Q.fi=function(){return OL(),WBt},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:this.ri(null);return}KO(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.ve=function(){return this.zb},Q.ri=function(e){ZT(this,e)},Q.Ib=function(){return RO(this)},Q.zb=null,L(OW,`ENamedElementImpl`,439),q(184,439,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1},HMe),Q.xh=function(e){return j0e(this,e)},Q.Ih=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.yb;case 3:return this.xb;case 4:return this.sb;case 5:return!this.rb&&(this.rb=new H_(this,D7,this)),this.rb;case 6:return!this.vb&&(this.vb=new Gh(Y5,this,6,7)),this.vb;case 7:return t?this.Db>>16==7?P(this.Cb,241):null:bPe(this)}return SC(this,e-xv((OL(),X7)),gw((r=P(jE(this,16),29),r||X7),e),t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 4:return this.sb&&(n=P(this.sb,52).Qh(this,1,q5,n)),LO(this,P(e,469),n);case 5:return!this.rb&&(this.rb=new H_(this,D7,this)),oA(this.rb,e,n);case 6:return!this.vb&&(this.vb=new Gh(Y5,this,6,7)),oA(this.vb,e,n);case 7:return this.Cb&&(n=(i=this.Db>>16,i>=0?j0e(this,n):this.Cb.Qh(this,-1-i,null,n))),tI(this,e,7,n)}return a=P(gw((r=P(jE(this,16),29),r||(OL(),X7)),t),69),a.uk().xk(this,DA(this),t-xv((OL(),X7)),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 4:return LO(this,null,n);case 5:return!this.rb&&(this.rb=new H_(this,D7,this)),ij(this.rb,e,n);case 6:return!this.vb&&(this.vb=new Gh(Y5,this,6,7)),ij(this.vb,e,n);case 7:return tI(this,null,7,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),X7)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),X7)),e,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.yb!=null;case 3:return this.xb!=null;case 4:return!!this.sb;case 5:return!!this.rb&&this.rb.i!=0;case 6:return!!this.vb&&this.vb.i!=0;case 7:return!!bPe(this)}return Ux(this,e-xv((OL(),X7)),gw((t=P(jE(this,16),29),t||X7),e))},Q.Wh=function(e){return hnt(this,e)||pft(this,e)},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:ZT(this,Sh(t));return;case 2:tE(this,Sh(t));return;case 3:eE(this,Sh(t));return;case 4:YM(this,P(t,469));return;case 5:!this.rb&&(this.rb=new H_(this,D7,this)),GI(this.rb),!this.rb&&(this.rb=new H_(this,D7,this)),Sv(this.rb,P(t,18));return;case 6:!this.vb&&(this.vb=new Gh(Y5,this,6,7)),GI(this.vb),!this.vb&&(this.vb=new Gh(Y5,this,6,7)),Sv(this.vb,P(t,18));return}Rk(this,e-xv((OL(),X7)),gw((n=P(jE(this,16),29),n||X7),e),t)},Q.bi=function(e){var t,n;if(e&&this.rb)for(n=new gm(this.rb);n.e!=n.i.gc();)t=JA(n),j(t,360)&&(P(t,360).w=null);OA(this,64,e)},Q.fi=function(){return OL(),X7},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:ZT(this,null);return;case 2:tE(this,null);return;case 3:eE(this,null);return;case 4:YM(this,null);return;case 5:!this.rb&&(this.rb=new H_(this,D7,this)),GI(this.rb);return;case 6:!this.vb&&(this.vb=new Gh(Y5,this,6,7)),GI(this.vb);return}KO(this,e-xv((OL(),X7)),gw((t=P(jE(this,16),29),t||X7),e))},Q.mi=function(){Wj(this)},Q.si=function(){return!this.rb&&(this.rb=new H_(this,D7,this)),this.rb},Q.ti=function(){return this.sb},Q.ui=function(){return this.ub},Q.vi=function(){return this.xb},Q.wi=function(){return this.yb},Q.xi=function(e){this.ub=e},Q.Ib=function(){var e;return this.Db&64?RO(this):(e=new Am(RO(this)),e.a+=` (nsURI: `,Uf(e,this.yb),e.a+=`, nsPrefix: `,Uf(e,this.xb),e.a+=`)`,e.a)},Q.xb=null,Q.yb=null;var fBt;L(OW,`EPackageImpl`,184),q(556,184,{109:1,2080:1,556:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1},E9e),Q.q=!1,Q.r=!1;var pBt=!1;L(AW,`ElkGraphPackageImpl`,556),q(362,728,{109:1,343:1,174:1,157:1,276:1,362:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},bre),Q.xh=function(e){return O0e(this,e)},Q.Ih=function(e,t,n){switch(e){case 7:return Ab(this);case 8:return this.a}return mXe(this,e,t,n)},Q.Ph=function(e,t,n){var r;return t===7?(this.Cb&&(n=(r=this.Db>>16,r>=0?O0e(this,n):this.Cb.Qh(this,-1-r,null,n))),oke(this,P(e,174),n)):NM(this,e,t,n)},Q.Rh=function(e,t,n){return t==7?oke(this,null,n):ZE(this,e,t,n)},Q.Th=function(e){switch(e){case 7:return!!Ab(this);case 8:return!Yh(``,this.a)}return PXe(this,e)},Q.$h=function(e,t){switch(e){case 7:pnt(this,P(t,174));return;case 8:kT(this,Sh(t));return}q2e(this,e,t)},Q.fi=function(){return gL(),iBt},Q.hi=function(e){switch(e){case 7:pnt(this,null);return;case 8:kT(this,``);return}eZe(this,e)},Q.Ib=function(){return y8e(this)},Q.a=``,L(AW,`ElkLabelImpl`,362),q(206,729,{109:1,343:1,84:1,174:1,26:1,276:1,206:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},Fs),Q.xh=function(e){return q0e(this,e)},Q.Ih=function(e,t,n){switch(e){case 9:return!this.c&&(this.c=new F(t7,this,9,9)),this.c;case 10:return!this.a&&(this.a=new F(e7,this,10,11)),this.a;case 11:return jb(this);case 12:return!this.b&&(this.b=new F(W5,this,12,3)),this.b;case 13:return Lm(),!this.a&&(this.a=new F(e7,this,10,11)),this.a.i>0}return U$e(this,e,t,n)},Q.Ph=function(e,t,n){var r;switch(t){case 9:return!this.c&&(this.c=new F(t7,this,9,9)),oA(this.c,e,n);case 10:return!this.a&&(this.a=new F(e7,this,10,11)),oA(this.a,e,n);case 11:return this.Cb&&(n=(r=this.Db>>16,r>=0?q0e(this,n):this.Cb.Qh(this,-1-r,null,n))),RCe(this,P(e,26),n);case 12:return!this.b&&(this.b=new F(W5,this,12,3)),oA(this.b,e,n)}return w2e(this,e,t,n)},Q.Rh=function(e,t,n){switch(t){case 9:return!this.c&&(this.c=new F(t7,this,9,9)),ij(this.c,e,n);case 10:return!this.a&&(this.a=new F(e7,this,10,11)),ij(this.a,e,n);case 11:return RCe(this,null,n);case 12:return!this.b&&(this.b=new F(W5,this,12,3)),ij(this.b,e,n)}return T2e(this,e,t,n)},Q.Th=function(e){switch(e){case 9:return!!this.c&&this.c.i!=0;case 10:return!!this.a&&this.a.i!=0;case 11:return!!jb(this);case 12:return!!this.b&&this.b.i!=0;case 13:return!this.a&&(this.a=new F(e7,this,10,11)),this.a.i>0}return TD(this,e)},Q.$h=function(e,t){switch(e){case 9:!this.c&&(this.c=new F(t7,this,9,9)),GI(this.c),!this.c&&(this.c=new F(t7,this,9,9)),Sv(this.c,P(t,18));return;case 10:!this.a&&(this.a=new F(e7,this,10,11)),GI(this.a),!this.a&&(this.a=new F(e7,this,10,11)),Sv(this.a,P(t,18));return;case 11:AP(this,P(t,26));return;case 12:!this.b&&(this.b=new F(W5,this,12,3)),GI(this.b),!this.b&&(this.b=new F(W5,this,12,3)),Sv(this.b,P(t,18));return}sP(this,e,t)},Q.fi=function(){return gL(),aBt},Q.hi=function(e){switch(e){case 9:!this.c&&(this.c=new F(t7,this,9,9)),GI(this.c);return;case 10:!this.a&&(this.a=new F(e7,this,10,11)),GI(this.a);return;case 11:AP(this,null);return;case 12:!this.b&&(this.b=new F(W5,this,12,3)),GI(this.b);return}s$e(this,e)},Q.Ib=function(){return TF(this)},L(AW,`ElkNodeImpl`,206),q(193,729,{109:1,343:1,84:1,174:1,125:1,276:1,193:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},Is),Q.xh=function(e){return k0e(this,e)},Q.Ih=function(e,t,n){return e==9?wb(this):U$e(this,e,t,n)},Q.Ph=function(e,t,n){var r;return t===9?(this.Cb&&(n=(r=this.Db>>16,r>=0?k0e(this,n):this.Cb.Qh(this,-1-r,null,n))),rCe(this,P(e,26),n)):w2e(this,e,t,n)},Q.Rh=function(e,t,n){return t==9?rCe(this,null,n):T2e(this,e,t,n)},Q.Th=function(e){return e==9?!!wb(this):TD(this,e)},Q.$h=function(e,t){e===9?Ftt(this,P(t,26)):sP(this,e,t)},Q.fi=function(){return gL(),oBt},Q.hi=function(e){e===9?Ftt(this,null):s$e(this,e)},Q.Ib=function(){return Kit(this)},L(AW,`ElkPortImpl`,193);var mBt=Jg(eG,`BasicEMap/Entry`);q(1092,118,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1,117:1,118:1},xre),Q.Fb=function(e){return this===e},Q.jd=function(){return this.b},Q.Hb=function(){return Hm(this)},Q.Ai=function(e){AT(this,P(e,147))},Q.Ih=function(e,t,n){switch(e){case 0:return this.b;case 1:return this.c}return aj(this,e,t,n)},Q.Th=function(e){switch(e){case 0:return!!this.b;case 1:return this.c!=null}return KA(this,e)},Q.$h=function(e,t){switch(e){case 0:AT(this,P(t,147));return;case 1:xT(this,t);return}bN(this,e,t)},Q.fi=function(){return gL(),Q5},Q.hi=function(e){switch(e){case 0:AT(this,null);return;case 1:xT(this,null);return}oN(this,e)},Q.yi=function(){var e;return this.a==-1&&(e=this.b,this.a=e?YT(e):0),this.a},Q.kd=function(){return this.c},Q.zi=function(e){this.a=e},Q.ld=function(e){var t=this.c;return xT(this,e),t},Q.Ib=function(){var e;return this.Db&64?pP(this):(e=new Fc,Kf(Kf(Kf(e,this.b?this.b.Og():HL),mV),km(this.c)),e.a)},Q.a=-1,Q.c=null;var r7=L(AW,`ElkPropertyToValueMapEntryImpl`,1092);q(981,1,{},Sre),L(rG,`JsonAdapter`,981),q(215,63,DR,wc),L(rG,`JsonImportException`,215),q(851,1,{},p9e),L(rG,`JsonImporter`,851),q(885,1,{},uve),Q.Bi=function(e){E2e(this.a,this.b,P(e,139))},L(rG,`JsonImporter/lambda$0$Type`,885),q(886,1,{},dve),Q.Bi=function(e){w7e(this.a,this.b,P(e,139))},L(rG,`JsonImporter/lambda$1$Type`,886),q(894,1,{},ide),Q.Bi=function(e){Kje(this.a,P(e,149))},L(rG,`JsonImporter/lambda$10$Type`,894),q(896,1,{},fve),Q.Bi=function(e){q5e(this.a,this.b,P(e,139))},L(rG,`JsonImporter/lambda$11$Type`,896),q(897,1,{},pve),Q.Bi=function(e){J5e(this.a,this.b,P(e,139))},L(rG,`JsonImporter/lambda$12$Type`,897),q(903,1,{},mMe),Q.Bi=function(e){r8e(this.a,this.b,this.c,this.d,P(e,139))},L(rG,`JsonImporter/lambda$13$Type`,903),q(902,1,{},hMe),Q.Bi=function(e){mot(this.a,this.b,this.c,this.d,P(e,149))},L(rG,`JsonImporter/lambda$14$Type`,902),q(898,1,{},mve),Q.Bi=function(e){zCe(this.a,this.b,Sh(e))},L(rG,`JsonImporter/lambda$15$Type`,898),q(899,1,{},hve),Q.Bi=function(e){BCe(this.a,this.b,Sh(e))},L(rG,`JsonImporter/lambda$16$Type`,899),q(900,1,{},gve),Q.Bi=function(e){c0e(this.b,this.a,P(e,139))},L(rG,`JsonImporter/lambda$17$Type`,900),q(901,1,{},_ve),Q.Bi=function(e){l0e(this.b,this.a,P(e,139))},L(rG,`JsonImporter/lambda$18$Type`,901),q(906,1,{},ade),Q.Bi=function(e){T6e(this.a,P(e,149))},L(rG,`JsonImporter/lambda$19$Type`,906),q(887,1,{},ode),Q.Bi=function(e){X0e(this.a,P(e,139))},L(rG,`JsonImporter/lambda$2$Type`,887),q(904,1,{},sde),Q.Bi=function(e){Kw(this.a,D(N(e)))},L(rG,`JsonImporter/lambda$20$Type`,904),q(905,1,{},cde),Q.Bi=function(e){qw(this.a,D(N(e)))},L(rG,`JsonImporter/lambda$21$Type`,905),q(909,1,{},lde),Q.Bi=function(e){w6e(this.a,P(e,149))},L(rG,`JsonImporter/lambda$22$Type`,909),q(907,1,{},ude),Q.Bi=function(e){Vw(this.a,D(N(e)))},L(rG,`JsonImporter/lambda$23$Type`,907),q(908,1,{},dde),Q.Bi=function(e){Hw(this.a,D(N(e)))},L(rG,`JsonImporter/lambda$24$Type`,908),q(911,1,{},fde),Q.Bi=function(e){w4e(this.a,P(e,139))},L(rG,`JsonImporter/lambda$25$Type`,911),q(910,1,{},pde),Q.Bi=function(e){qje(this.a,P(e,149))},L(rG,`JsonImporter/lambda$26$Type`,910),q(912,1,aR,vve),Q.Ad=function(e){aVe(this.b,this.a,Sh(e))},L(rG,`JsonImporter/lambda$27$Type`,912),q(913,1,aR,yve),Q.Ad=function(e){oVe(this.b,this.a,Sh(e))},L(rG,`JsonImporter/lambda$28$Type`,913),q(914,1,{},bve),Q.Bi=function(e){$9e(this.a,this.b,P(e,139))},L(rG,`JsonImporter/lambda$29$Type`,914),q(890,1,{},mde),Q.Bi=function(e){YXe(this.a,P(e,149))},L(rG,`JsonImporter/lambda$3$Type`,890),q(915,1,{},xve),Q.Bi=function(e){Stt(this.a,this.b,P(e,139))},L(rG,`JsonImporter/lambda$30$Type`,915),q(916,1,{},hde),Q.Bi=function(e){dHe(this.a,N(e))},L(rG,`JsonImporter/lambda$31$Type`,916),q(917,1,{},gde),Q.Bi=function(e){mHe(this.a,N(e))},L(rG,`JsonImporter/lambda$32$Type`,917),q(918,1,{},_de),Q.Bi=function(e){fHe(this.a,N(e))},L(rG,`JsonImporter/lambda$33$Type`,918),q(919,1,{},vde),Q.Bi=function(e){pHe(this.a,N(e))},L(rG,`JsonImporter/lambda$34$Type`,919),q(920,1,{},yde),Q.Bi=function(e){n6e(this.a,P(e,57))},L(rG,`JsonImporter/lambda$35$Type`,920),q(921,1,{},bde),Q.Bi=function(e){r6e(this.a,P(e,57))},L(rG,`JsonImporter/lambda$36$Type`,921),q(925,1,{},pMe),L(rG,`JsonImporter/lambda$37$Type`,925),q(922,1,aR,qEe),Q.Ad=function(e){uGe(this.a,this.c,this.b,P(e,372))},L(rG,`JsonImporter/lambda$38$Type`,922),q(923,1,aR,Sve),Q.Ad=function(e){Bve(this.a,this.b,P(e,170))},L(rG,`JsonImporter/lambda$39$Type`,923),q(888,1,{},xde),Q.Bi=function(e){Kw(this.a,D(N(e)))},L(rG,`JsonImporter/lambda$4$Type`,888),q(924,1,aR,Cve),Q.Ad=function(e){Vve(this.a,this.b,P(e,170))},L(rG,`JsonImporter/lambda$40$Type`,924),q(926,1,aR,JEe),Q.Ad=function(e){dGe(this.a,this.b,this.c,P(e,8))},L(rG,`JsonImporter/lambda$41$Type`,926),q(889,1,{},Sde),Q.Bi=function(e){qw(this.a,D(N(e)))},L(rG,`JsonImporter/lambda$5$Type`,889),q(893,1,{},Cde),Q.Bi=function(e){XXe(this.a,P(e,149))},L(rG,`JsonImporter/lambda$6$Type`,893),q(891,1,{},wde),Q.Bi=function(e){Vw(this.a,D(N(e)))},L(rG,`JsonImporter/lambda$7$Type`,891),q(892,1,{},Tde),Q.Bi=function(e){Hw(this.a,D(N(e)))},L(rG,`JsonImporter/lambda$8$Type`,892),q(895,1,{},Ede),Q.Bi=function(e){T4e(this.a,P(e,139))},L(rG,`JsonImporter/lambda$9$Type`,895),q(945,1,aR,Dde),Q.Ad=function(e){Lv(this.a,new Rv(Sh(e)))},L(rG,`JsonMetaDataConverter/lambda$0$Type`,945),q(946,1,aR,Ode),Q.Ad=function(e){DAe(this.a,P(e,244))},L(rG,`JsonMetaDataConverter/lambda$1$Type`,946),q(947,1,aR,kde),Q.Ad=function(e){YPe(this.a,P(e,144))},L(rG,`JsonMetaDataConverter/lambda$2$Type`,947),q(948,1,aR,Ade),Q.Ad=function(e){OAe(this.a,P(e,160))},L(rG,`JsonMetaDataConverter/lambda$3$Type`,948),q(244,24,{3:1,35:1,24:1,244:1},Of);var i7,a7,o7,s7,c7,l7,u7,d7,f7=eT(xB,`GraphFeature`,244,gq,$He,sDe),hBt;q(11,1,{35:1,147:1},Uo,zh,Zf,Op),Q.Dd=function(e){return Gbe(this,P(e,147))},Q.Fb=function(e){return lNe(this,e)},Q.Rg=function(){return qA(this)},Q.Og=function(){return this.b},Q.Hb=function(){return MD(this.b)},Q.Ib=function(){return this.b},L(xB,`Property`,11),q(657,1,$z,Ho),Q.Le=function(e,t){return WYe(this,P(e,105),P(t,105))},Q.Fb=function(e){return this===e},Q.Me=function(){return new ko(this)},L(xB,`PropertyHolderComparator`,657),q(698,1,qL,Wo),Q.Nb=function(e){ev(this,e)},Q.Pb=function(){return lVe(this)},Q.Qb=function(){nhe()},Q.Ob=function(){return!!this.a},L(lG,`ElkGraphUtil/AncestorIterator`,698);var gBt=Jg(eG,`EList`);q(71,56,{20:1,31:1,56:1,18:1,16:1,71:1,61:1}),Q._c=function(e,t){ek(this,e,t)},Q.Ec=function(e){return lC(this,e)},Q.ad=function(e,t){return nqe(this,e,t)},Q.Fc=function(e){return Sv(this,e)},Q.Gi=function(){return new $m(this)},Q.Hi=function(){return new eh(this)},Q.Ii=function(e){return cT(this,e)},Q.Ji=function(){return!0},Q.Ki=function(e,t){},Q.Li=function(){},Q.Mi=function(e,t){nC(this,e,t)},Q.Ni=function(e,t,n){},Q.Oi=function(e,t){},Q.Pi=function(e,t,n){},Q.Fb=function(e){return ait(this,e)},Q.Hb=function(){return FKe(this)},Q.Qi=function(){return!1},Q.Jc=function(){return new gm(this)},Q.cd=function(){return new Qm(this)},Q.dd=function(e){var t=this.gc();if(e<0||e>t)throw E(new Jh(e,t));return new pv(this,e)},Q.Si=function(e,t){this.Ri(e,this.bd(t))},Q.Kc=function(e){return QC(this,e)},Q.Ui=function(e,t){return t},Q.fd=function(e,t){return uj(this,e,t)},Q.Ib=function(){return OXe(this)},Q.Wi=function(){return!0},Q.Xi=function(e,t){return FD(this,t)},L(eG,`AbstractEList`,71),q(67,71,mG,Ga,Sw,AGe),Q.Ci=function(e,t){return PM(this,e,t)},Q.Di=function(e){return o1e(this,e)},Q.Ei=function(e,t){VO(this,e,t)},Q.Fi=function(e){IS(this,e)},Q.Yi=function(e){return mVe(this,e)},Q.$b=function(){FS(this)},Q.Gc=function(e){return uM(this,e)},Q.Xb=function(e){return H(this,e)},Q.Zi=function(e){var t,n,r;++this.j,n=this.g==null?0:this.g.length,e>n&&(r=this.g,t=n+(n/2|0)+4,t<e&&(t=e),this.g=this.$i(t),r!=null&&lI(r,0,this.g,0,this.i))},Q.bd=function(e){return g0e(this,e)},Q.dc=function(){return this.i==0},Q.Ri=function(e,t){return IN(this,e,t)},Q.$i=function(e){return V(aq,BL,1,e,5,1)},Q.Ti=function(e){return this.g[e]},Q.ed=function(e){return Jj(this,e)},Q.Vi=function(e,t){return ZC(this,e,t)},Q.gc=function(){return this.i},Q.Nc=function(){return Wx(this)},Q.Oc=function(e){return rZe(this,e)},Q.i=0;var _Bt=L(eG,`BasicEList`,67),vBt=Jg(eG,`TreeIterator`);q(697,67,hG),Q.Nb=function(e){ev(this,e)},Q.Ob=function(){return this.g==null&&!this.c?Ob(this):this.g==null||this.i!=0&&P(this.g[this.i-1],50).Ob()},Q.Pb=function(){return _P(this)},Q.Qb=function(){if(!this.e)throw E(new pc(`There is no valid object to remove.`));this.e.Qb()},Q.c=!1,L(eG,`AbstractTreeIterator`,697),q(605,697,hG,Sp),Q._i=function(e){var t=P(e,57).Dh().Jc();return j(t,287)&&P(t,287).ul(new Cre),t},L(lG,`ElkGraphUtil/PropertiesSkippingTreeIterator`,605),q(949,1,{},Cre),L(lG,`ElkGraphUtil/PropertiesSkippingTreeIterator/1`,949);var p7,m7,h7=L(lG,`ElkReflect`,null);q(883,1,tW,wre),Q.Qg=function(e){return Vb(),LFe(P(e,182))},L(lG,`ElkReflect/lambda$0$Type`,883);var g7;Jg(eG,`ResourceLocator`),q(1046,1,{}),L(eG,`DelegatingResourceLocator`,1046),q(1047,1046,{}),L(`org.eclipse.emf.common`,`EMFPlugin`,1047);var _7=Jg(Sbt,`Adapter`),yBt=Jg(Sbt,`Notification`);q(1144,1,jG),Q.aj=function(){return this.d},Q.bj=function(e){},Q.cj=function(e){this.d=e},Q.dj=function(e){this.d==e&&(this.d=null)},Q.d=null,L(CW,`AdapterImpl`,1144),q(2058,71,Cbt),Q.Ci=function(e,t){return KXe(this,e,t)},Q.Di=function(e){var t,n,r;if(++this.j,e.dc())return!1;for(t=this.Cj(),r=e.Jc();r.Ob();)n=r.Pb(),this.pj(this.Xi(t,n)),++t;return!0},Q.Ei=function(e,t){iCe(this,e,t)},Q.Fi=function(e){ZAe(this,e)},Q.nj=function(){return this.qj()},Q.$b=function(){Oh(this,this.Cj(),this.Dj())},Q.Gc=function(e){return this.sj(e)},Q.Hc=function(e){return this.tj(e)},Q.oj=function(e,t){this.zj().Sm()},Q.pj=function(e){this.zj().Sm()},Q.qj=function(){return this.zj()},Q.rj=function(){this.zj().Sm()},Q.sj=function(e){return this.zj().Sm()},Q.tj=function(e){return this.zj().Sm()},Q.uj=function(e){return this.zj().Sm()},Q.vj=function(e){return this.zj().Sm()},Q.wj=function(){return this.zj().Sm()},Q.xj=function(e){return this.zj().Sm()},Q.yj=function(){return this.zj().Sm()},Q.Aj=function(e){return this.zj().Sm()},Q.Bj=function(e,t){return this.zj().Sm()},Q.Cj=function(){return this.zj().Sm()},Q.Dj=function(){return this.zj().Sm()},Q.Ej=function(e){return this.zj().Sm()},Q.Fj=function(){return this.zj().Sm()},Q.Fb=function(e){return this.uj(e)},Q.Xb=function(e){return this.Ui(e,this.vj(e))},Q.Hb=function(){return this.wj()},Q.bd=function(e){return this.xj(e)},Q.dc=function(){return this.yj()},Q.Ri=function(e,t){return a6e(this,e,t)},Q.Ti=function(e){return this.vj(e)},Q.ed=function(e){return Vg(this,e)},Q.Kc=function(e){var t=this.bd(e);return t>=0&&(this.ed(t),!0)},Q.Vi=function(e,t){return this.Bj(e,this.Xi(e,t))},Q.gc=function(){return this.Cj()},Q.Nc=function(){return this.Dj()},Q.Oc=function(e){return this.Ej(e)},Q.Ib=function(){return this.Fj()},L(eG,`DelegatingEList`,2058),q(2059,2058,Cbt),Q.Ci=function(e,t){return Lot(this,e,t)},Q.Di=function(e){return this.Ci(this.Cj(),e)},Q.Ei=function(e,t){D9e(this,e,t)},Q.Fi=function(e){o9e(this,e)},Q.Ji=function(){return!this.Kj()},Q.$b=function(){KI(this)},Q.Gj=function(e,t,n,r,i){return new sNe(this,e,t,n,r,i)},Q.Hj=function(e){CE(this.hj(),e)},Q.Ij=function(){return null},Q.Jj=function(){return-1},Q.hj=function(){return null},Q.Kj=function(){return!1},Q.Lj=function(e,t){return t},Q.Mj=function(e,t){return t},Q.Nj=function(){return!1},Q.Oj=function(){return!this.yj()},Q.Ri=function(e,t){var n,r;return this.Nj()?(r=this.Oj(),n=a6e(this,e,t),this.Hj(this.Gj(7,G(t),n,e,r)),n):a6e(this,e,t)},Q.ed=function(e){var t,n,r,i;return this.Nj()?(n=null,r=this.Oj(),t=this.Gj(4,i=Vg(this,e),null,e,r),this.Kj()&&i&&(n=this.Mj(i,n)),n?(n.lj(t),n.mj()):this.Hj(t),i):(i=Vg(this,e),this.Kj()&&i&&(n=this.Mj(i,null),n&&n.mj()),i)},Q.Vi=function(e,t){return Rot(this,e,t)},L(CW,`DelegatingNotifyingListImpl`,2059),q(151,1,MG),Q.lj=function(e){return j4e(this,e)},Q.mj=function(){jC(this)},Q.ej=function(){return this.d},Q.Ij=function(){return null},Q.Pj=function(){return null},Q.fj=function(e){return-1},Q.gj=function(){return lrt(this)},Q.hj=function(){return null},Q.ij=function(){return YP(this)},Q.jj=function(){return this.o<0?this.o<-2?-2-this.o-1:-1:this.o},Q.Qj=function(){return!1},Q.kj=function(e){var t,n,r,i,a,o,s,c,l,u,d;switch(this.d){case 1:case 2:switch(i=e.ej(),i){case 1:case 2:if(a=e.hj(),A(a)===A(this.hj())&&this.fj(null)==e.fj(null))return this.g=e.gj(),e.ej()==1&&(this.d=1),!0}case 4:if(i=e.ej(),i===4&&(a=e.hj(),A(a)===A(this.hj())&&this.fj(null)==e.fj(null)))return l=Qlt(this),c=this.o<0?this.o<-2?-2-this.o-1:-1:this.o,o=e.jj(),this.d=6,d=new Sw(2),c<=o?(lC(d,this.n),lC(d,e.ij()),this.g=U(O(q9,1),XR,30,15,[this.o=c,o+1])):(lC(d,e.ij()),lC(d,this.n),this.g=U(O(q9,1),XR,30,15,[this.o=o,c])),this.n=d,l||(this.o=-2-this.o-1),!0;break;case 6:if(i=e.ej(),i===4&&(a=e.hj(),A(a)===A(this.hj())&&this.fj(null)==e.fj(null))){for(l=Qlt(this),o=e.jj(),u=P(this.g,54),r=V(q9,XR,30,u.length+1,15,1),t=0;t<u.length&&(s=u[t],s<=o);)r[t++]=s,++o;for(n=P(this.n,16),n._c(t,e.ij()),r[t]=o;++t<r.length;)r[t]=u[t-1];return this.g=r,l||(this.o=-2-r[0]),!0}}return!1},Q.Ib=function(){var e,t,n,r=new Am(pl(this.Pm)+`@`+(t=YT(this)>>>0,t.toString(16)));switch(r.a+=` (eventType: `,this.d){case 1:r.a+=`SET`;break;case 2:r.a+=`UNSET`;break;case 3:r.a+=`ADD`;break;case 5:r.a+=`ADD_MANY`;break;case 4:r.a+=`REMOVE`;break;case 6:r.a+=`REMOVE_MANY`;break;case 7:r.a+=`MOVE`;break;case 8:r.a+=`REMOVING_ADAPTER`;break;case 9:r.a+=`RESOLVE`;break;default:ul(r,this.d)}if(cat(this)&&(r.a+=`, touch: true`),r.a+=`, position: `,ul(r,this.o<0?this.o<-2?-2-this.o-1:-1:this.o),r.a+=`, notifier: `,Hf(r,this.hj()),r.a+=`, feature: `,Hf(r,this.Ij()),r.a+=`, oldValue: `,Hf(r,YP(this)),r.a+=`, newValue: `,this.d==6&&j(this.g,54)){for(n=P(this.g,54),r.a+=`[`,e=0;e<n.length;)r.a+=n[e],++e<n.length&&(r.a+=zL);r.a+=`]`}else Hf(r,lrt(this));return r.a+=`, isTouch: `,dl(r,cat(this)),r.a+=`, wasSet: `,dl(r,Qlt(this)),r.a+=`)`,r.a},Q.d=0,Q.e=0,Q.f=0,Q.j=0,Q.k=0,Q.o=0,Q.p=0,L(CW,`NotificationImpl`,151),q(1158,151,MG,sNe),Q.Ij=function(){return this.a.Ij()},Q.fj=function(e){return this.a.Jj()},Q.hj=function(){return this.a.hj()},L(CW,`DelegatingNotifyingListImpl/1`,1158),q(252,67,mG,Tre,al),Q.Ec=function(e){return qXe(this,P(e,373))},Q.lj=function(e){return qXe(this,e)},Q.mj=function(){for(var e=0,t,n;e<this.i;++e)t=P(this.g[e],373),n=t.hj(),n!=null&&t.ej()!=-1&&P(n,94).uh(t)},Q.$i=function(e){return V(yBt,BL,373,e,0,1)},L(CW,`NotificationChainImpl`,252),q(1486,93,Pyt),Q.rh=function(){return this.e},Q.th=function(){return!!(this.f&1)},Q.f=1,L(CW,`NotifierImpl`,1486),q(2056,67,mG),Q.Ci=function(e,t){return cI(this,e,t)},Q.Di=function(e){return this.Ci(this.i,e)},Q.Ei=function(e,t){GN(this,e,t)},Q.Fi=function(e){ZN(this,e)},Q.Ji=function(){return!this.Kj()},Q.$b=function(){GI(this)},Q.Gj=function(e,t,n,r,i){return new cNe(this,e,t,n,r,i)},Q.Hj=function(e){CE(this.hj(),e)},Q.Ij=function(){return null},Q.Jj=function(){return-1},Q.hj=function(){return null},Q.Kj=function(){return!1},Q.Rj=function(){return!1},Q.Lj=function(e,t){return t},Q.Mj=function(e,t){return t},Q.Nj=function(){return!1},Q.Oj=function(){return this.i!=0},Q.Ri=function(e,t){return dk(this,e,t)},Q.ed=function(e){return eF(this,e)},Q.Vi=function(e,t){return Rst(this,e,t)},Q.Sj=function(e,t){return t},Q.Tj=function(e,t){return t},Q.Uj=function(e,t,n){return n},L(CW,`NotifyingListImpl`,2056),q(1157,151,MG,cNe),Q.Ij=function(){return this.a.Ij()},Q.fj=function(e){return this.a.Jj()},Q.hj=function(){return this.a.hj()},L(CW,`NotifyingListImpl/1`,1157),q(950,67,mG,oCe),Q.Gc=function(e){return this.i>10?((!this.b||this.c.j!=this.a)&&(this.b=new Zg(this),this.a=this.j),Pl(this.b,e)):uM(this,e)},Q.Wi=function(){return!0},Q.a=0,L(eG,`AbstractEList/1`,950),q(306,99,hz,Jh),L(eG,`AbstractEList/BasicIndexOutOfBoundsException`,306),q(42,1,qL,gm),Q.Nb=function(e){ev(this,e)},Q.Vj=function(){if(this.i.j!=this.f)throw E(new ls)},Q.Wj=function(){return JA(this)},Q.Ob=function(){return this.e!=this.i.gc()},Q.Pb=function(){return this.Wj()},Q.Qb=function(){gM(this)},Q.e=0,Q.f=0,Q.g=-1,L(eG,`AbstractEList/EIterator`,42),q(286,42,tR,Qm,pv),Q.Qb=function(){gM(this)},Q.Rb=function(e){vZe(this,e)},Q.Xj=function(){var e;try{return e=this.d.Xb(--this.e),this.Vj(),this.g=this.e,e}catch(e){throw e=tD(e),j(e,99)?(this.Vj(),E(new ms)):E(e)}},Q.Yj=function(e){g1e(this,e)},Q.Sb=function(){return this.e!=0},Q.Tb=function(){return this.e},Q.Ub=function(){return this.Xj()},Q.Vb=function(){return this.e-1},Q.Wb=function(e){this.Yj(e)},L(eG,`AbstractEList/EListIterator`,286),q(355,42,qL,$m),Q.Wj=function(){return YA(this)},Q.Qb=function(){throw E(new ps)},L(eG,`AbstractEList/NonResolvingEIterator`,355),q(391,286,tR,eh,vwe),Q.Rb=function(e){throw E(new ps)},Q.Wj=function(){var e;try{return e=this.c.Ti(this.e),this.Vj(),this.g=this.e++,e}catch(e){throw e=tD(e),j(e,99)?(this.Vj(),E(new ms)):E(e)}},Q.Xj=function(){var e;try{return e=this.c.Ti(--this.e),this.Vj(),this.g=this.e,e}catch(e){throw e=tD(e),j(e,99)?(this.Vj(),E(new ms)):E(e)}},Q.Qb=function(){throw E(new ps)},Q.Wb=function(e){throw E(new ps)},L(eG,`AbstractEList/NonResolvingEListIterator`,391),q(2045,71,wbt),Q.Ci=function(e,t){var n,r,i=t.gc(),a,o,s,c,l,u,d,f;if(i!=0){for(l=P(jE(this.a,4),129),u=l==null?0:l.length,f=u+i,r=WD(this,f),d=u-e,d>0&&lI(l,e,r,e+i,d),c=t.Jc(),o=0;o<i;++o)s=c.Pb(),n=e+o,kp(r,n,FD(this,s));for(QA(this,r),a=0;a<i;++a)s=r[e],this.Ki(e,s),++e;return!0}return++this.j,!1},Q.Di=function(e){var t,n,r=e.gc(),i,a,o,s,c,l;if(r!=0){for(c=(n=P(jE(this.a,4),129),n==null?0:n.length),l=c+r,t=WD(this,l),s=e.Jc(),a=c;a<l;++a)o=s.Pb(),kp(t,a,FD(this,o));for(QA(this,t),i=c;i<l;++i)o=t[i],this.Ki(i,o);return!0}return++this.j,!1},Q.Ei=function(e,t){var n,r=P(jE(this.a,4),129),i=r==null?0:r.length,a;n=WD(this,i+1),a=FD(this,t),e!=i&&lI(r,e,n,e+1,i-e),Mv(n,e,a),QA(this,n),this.Ki(e,t)},Q.Fi=function(e){var t,n,r=(n=P(jE(this.a,4),129),n==null?0:n.length);t=WD(this,r+1),kp(t,r,FD(this,e)),QA(this,t),this.Ki(r,e)},Q.Gi=function(){return new lze(this)},Q.Hi=function(){return new qke(this)},Q.Ii=function(e){var t,n=(t=P(jE(this.a,4),129),t==null?0:t.length);if(e<0||e>n)throw E(new Jh(e,n));return new Dje(this,e)},Q.$b=function(){var e,t;++this.j,e=P(jE(this.a,4),129),t=e==null?0:e.length,QA(this,null),nC(this,t,e)},Q.Gc=function(e){var t=P(jE(this.a,4),129),n,r,i,a;if(t!=null){if(e!=null){for(r=t,i=0,a=r.length;i<a;++i)if(n=r[i],UO(e,n))return!0}else for(r=t,i=0,a=r.length;i<a;++i)if(n=r[i],A(n)===A(e))return!0}return!1},Q.Xb=function(e){var t=P(jE(this.a,4),129),n=t==null?0:t.length;if(e>=n)throw E(new Jh(e,n));return t[e]},Q.bd=function(e){var t=P(jE(this.a,4),129),n,r;if(t!=null){if(e!=null){for(n=0,r=t.length;n<r;++n)if(UO(e,t[n]))return n}else for(n=0,r=t.length;n<r;++n)if(A(t[n])===A(e))return n}return-1},Q.dc=function(){return P(jE(this.a,4),129)==null},Q.Jc=function(){return new cze(this)},Q.cd=function(){return new Kke(this)},Q.dd=function(e){var t,n=(t=P(jE(this.a,4),129),t==null?0:t.length);if(e<0||e>n)throw E(new Jh(e,n));return new Eje(this,e)},Q.Ri=function(e,t){var n=MZe(this),r,i=n==null?0:n.length;if(e>=i)throw E(new oc(dG+e+fG+i));if(t>=i)throw E(new oc(pG+t+fG+i));return r=n[t],e!=t&&(e<t?lI(n,e,n,e+1,t-e):lI(n,t+1,n,t,e-t),Mv(n,e,r),QA(this,n)),r},Q.Ti=function(e){return P(jE(this.a,4),129)[e]},Q.ed=function(e){return Y7e(this,e)},Q.Vi=function(e,t){var n=MZe(this),r=n[e];return kp(n,e,FD(this,t)),QA(this,n),r},Q.gc=function(){var e=P(jE(this.a,4),129);return e==null?0:e.length},Q.Nc=function(){var e=P(jE(this.a,4),129),t,n=e==null?0:e.length;return t=V(_7,PG,415,n,0,1),n>0&&lI(e,0,t,0,n),t},Q.Oc=function(e){var t=P(jE(this.a,4),129),n,r=t==null?0:t.length;return r>0&&(e.length<r&&(n=Qw(GD(e).c,r),e=n),lI(t,0,e,0,r)),e.length>r&&Mv(e,r,null),e};var bBt;L(eG,`ArrayDelegatingEList`,2045),q(1033,42,qL,cze),Q.Vj=function(){if(this.b.j!=this.f||A(P(jE(this.b.a,4),129))!==A(this.a))throw E(new ls)},Q.Qb=function(){gM(this),this.a=P(jE(this.b.a,4),129)},L(eG,`ArrayDelegatingEList/EIterator`,1033),q(712,286,tR,Kke,Eje),Q.Vj=function(){if(this.b.j!=this.f||A(P(jE(this.b.a,4),129))!==A(this.a))throw E(new ls)},Q.Yj=function(e){g1e(this,e),this.a=P(jE(this.b.a,4),129)},Q.Qb=function(){gM(this),this.a=P(jE(this.b.a,4),129)},L(eG,`ArrayDelegatingEList/EListIterator`,712),q(1034,355,qL,lze),Q.Vj=function(){if(this.b.j!=this.f||A(P(jE(this.b.a,4),129))!==A(this.a))throw E(new ls)},L(eG,`ArrayDelegatingEList/NonResolvingEIterator`,1034),q(713,391,tR,qke,Dje),Q.Vj=function(){if(this.b.j!=this.f||A(P(jE(this.b.a,4),129))!==A(this.a))throw E(new ls)},L(eG,`ArrayDelegatingEList/NonResolvingEListIterator`,713),q(606,306,hz,Qf),L(eG,`BasicEList/BasicIndexOutOfBoundsException`,606),q(699,67,mG,kve),Q._c=function(e,t){throw E(new ps)},Q.Ec=function(e){throw E(new ps)},Q.ad=function(e,t){throw E(new ps)},Q.Fc=function(e){throw E(new ps)},Q.$b=function(){throw E(new ps)},Q.Zi=function(e){throw E(new ps)},Q.Jc=function(){return this.Gi()},Q.cd=function(){return this.Hi()},Q.dd=function(e){return this.Ii(e)},Q.Ri=function(e,t){throw E(new ps)},Q.Si=function(e,t){throw E(new ps)},Q.ed=function(e){throw E(new ps)},Q.Kc=function(e){throw E(new ps)},Q.fd=function(e,t){throw E(new ps)},L(eG,`BasicEList/UnmodifiableEList`,699),q(711,1,{3:1,20:1,18:1,16:1,61:1,587:1}),Q._c=function(e,t){Obe(this,e,P(t,45))},Q.Ec=function(e){return _Se(this,P(e,45))},Q.Ic=function(e){vS(this,e)},Q.Xb=function(e){return P(H(this.c,e),136)},Q.Ri=function(e,t){return P(this.c.Ri(e,t),45)},Q.Si=function(e,t){kbe(this,e,P(t,45))},Q.ed=function(e){return P(this.c.ed(e),45)},Q.fd=function(e,t){return wAe(this,e,P(t,45))},Q.gd=function(e){nE(this,e)},Q.Lc=function(){return new ex(this,16)},Q.Mc=function(){return new Qg(null,new ex(this,16))},Q.ad=function(e,t){return this.c.ad(e,t)},Q.Fc=function(e){return this.c.Fc(e)},Q.$b=function(){this.c.$b()},Q.Gc=function(e){return this.c.Gc(e)},Q.Hc=function(e){return eD(this.c,e)},Q.Zj=function(){var e,t,n;if(this.d==null){for(this.d=V(_Bt,FG,67,2*this.f+1,0,1),n=this.e,this.f=0,t=this.c.Jc();t.e!=t.i.gc();)e=P(t.Wj(),136),yj(this,e);this.e=n}},Q.Fb=function(e){return Awe(this,e)},Q.Hb=function(){return FKe(this.c)},Q.bd=function(e){return this.c.bd(e)},Q.$j=function(){this.c=new Mde(this)},Q.dc=function(){return this.f==0},Q.Jc=function(){return this.c.Jc()},Q.cd=function(){return this.c.cd()},Q.dd=function(e){return this.c.dd(e)},Q._j=function(){return eC(this)},Q.ak=function(e,t,n){return new ZEe(e,t,n)},Q.bk=function(){return new Dre},Q.Kc=function(e){return oWe(this,e)},Q.gc=function(){return this.f},Q.hd=function(e,t){return new $b(this.c,e,t)},Q.Nc=function(){return this.c.Nc()},Q.Oc=function(e){return this.c.Oc(e)},Q.Ib=function(){return OXe(this.c)},Q.e=0,Q.f=0,L(eG,`BasicEMap`,711),q(1028,67,mG,Mde),Q.Ki=function(e,t){Cfe(this,P(t,136))},Q.Ni=function(e,t,n){var r;++(r=this,P(t,136),r).a.e},Q.Oi=function(e,t){wfe(this,P(t,136))},Q.Pi=function(e,t,n){Fxe(this,P(t,136),P(n,136))},Q.Mi=function(e,t){ZGe(this.a)},L(eG,`BasicEMap/1`,1028),q(1029,67,mG,Dre),Q.$i=function(e){return V(xBt,Tbt,612,e,0,1)},L(eG,`BasicEMap/2`,1029),q(1030,ZL,QL,Nde),Q.$b=function(){this.a.c.$b()},Q.Gc=function(e){return rA(this.a,e)},Q.Jc=function(){return this.a.f==0?(Ah(),v7.a):new Hme(this.a)},Q.Kc=function(e){var t=this.a.f;return TA(this.a,e),this.a.f!=t},Q.gc=function(){return this.a.f},L(eG,`BasicEMap/3`,1030),q(1031,31,XL,Pde),Q.$b=function(){this.a.c.$b()},Q.Gc=function(e){return oit(this.a,e)},Q.Jc=function(){return this.a.f==0?(Ah(),v7.a):new Ume(this.a)},Q.gc=function(){return this.a.f},L(eG,`BasicEMap/4`,1031),q(1032,ZL,QL,Fde),Q.$b=function(){this.a.c.$b()},Q.Gc=function(e){var t,n,r,i,a,o,s,c,l;if(this.a.f>0&&j(e,45)&&(this.a.Zj(),c=P(e,45),s=c.jd(),i=s==null?0:YT(s),a=mCe(this.a,i),t=this.a.d[a],t)){for(n=P(t.g,374),l=t.i,o=0;o<l;++o)if(r=n[o],r.yi()==i&&r.Fb(c))return!0}return!1},Q.Jc=function(){return this.a.f==0?(Ah(),v7.a):new jy(this.a)},Q.Kc=function(e){return L9e(this,e)},Q.gc=function(){return this.a.f},L(eG,`BasicEMap/5`,1032),q(613,1,qL,jy),Q.Nb=function(e){ev(this,e)},Q.Ob=function(){return this.b!=-1},Q.Pb=function(){var e;if(this.f.e!=this.c)throw E(new ls);if(this.b==-1)throw E(new ms);return this.d=this.a,this.e=this.b,y2e(this),e=P(this.f.d[this.d].g[this.e],136),this.ck(e)},Q.Qb=function(){if(this.f.e!=this.c)throw E(new ls);if(this.e==-1)throw E(new ds);this.f.c.Kc(H(this.f.d[this.d],this.e)),this.c=this.f.e,this.e=-1,this.a==this.d&&this.b!=-1&&--this.b},Q.ck=function(e){return e},Q.a=0,Q.b=-1,Q.c=0,Q.d=0,Q.e=0,L(eG,`BasicEMap/BasicEMapIterator`,613),q(1026,613,qL,Hme),Q.ck=function(e){return e.jd()},L(eG,`BasicEMap/BasicEMapKeyIterator`,1026),q(1027,613,qL,Ume),Q.ck=function(e){return e.kd()},L(eG,`BasicEMap/BasicEMapValueIterator`,1027),q(1025,1,YL,Ide),Q.wc=function(e){vE(this,e)},Q.$b=function(){this.a.c.$b()},Q._b=function(e){return Lve(this,e)},Q.uc=function(e){return oit(this.a,e)},Q.vc=function(){return kBe(this.a)},Q.Fb=function(e){return Awe(this.a,e)},Q.xc=function(e){return sA(this.a,e)},Q.Hb=function(){return FKe(this.a.c)},Q.dc=function(){return this.a.f==0},Q.ec=function(){return ABe(this.a)},Q.yc=function(e,t){return lM(this.a,e,t)},Q.Ac=function(e){return TA(this.a,e)},Q.gc=function(){return this.a.f},Q.Ib=function(){return OXe(this.a.c)},Q.Bc=function(){return jBe(this.a)},L(eG,`BasicEMap/DelegatingMap`,1025),q(612,1,{45:1,136:1,612:1},ZEe),Q.Fb=function(e){var t;return j(e,45)?(t=P(e,45),(this.b==null?A(this.b)===A(t.jd()):UO(this.b,t.jd()))&&(this.c==null?A(this.c)===A(t.kd()):UO(this.c,t.kd()))):!1},Q.yi=function(){return this.a},Q.jd=function(){return this.b},Q.kd=function(){return this.c},Q.Hb=function(){return this.a^(this.c==null?0:YT(this.c))},Q.zi=function(e){this.a=e},Q.Ai=function(e){throw E(new rs)},Q.ld=function(e){var t=this.c;return this.c=e,t},Q.Ib=function(){return this.b+`->`+this.c},Q.a=0;var xBt=L(eG,`BasicEMap/EntryImpl`,612);q(535,1,{},Ka),L(eG,`BasicEMap/View`,535);var v7;q(770,1,{}),Q.Fb=function(e){return cP((Py(),hJ),e)},Q.Hb=function(){return SD((Py(),hJ))},Q.Ib=function(){return KM((Py(),hJ))},L(eG,`ECollections/BasicEmptyUnmodifiableEList`,770),q(1303,1,tR,Ere),Q.Nb=function(e){ev(this,e)},Q.Rb=function(e){throw E(new ps)},Q.Ob=function(){return!1},Q.Sb=function(){return!1},Q.Pb=function(){throw E(new ms)},Q.Tb=function(){return 0},Q.Ub=function(){throw E(new ms)},Q.Vb=function(){return-1},Q.Qb=function(){throw E(new ps)},Q.Wb=function(e){throw E(new ps)},L(eG,`ECollections/BasicEmptyUnmodifiableEList/1`,1303),q(1301,770,{20:1,18:1,16:1,61:1},Zfe),Q._c=function(e,t){whe()},Q.Ec=function(e){return Che()},Q.ad=function(e,t){return The()},Q.Fc=function(e){return Ehe()},Q.$b=function(){Dhe()},Q.Gc=function(e){return!1},Q.Hc=function(e){return!1},Q.Ic=function(e){vS(this,e)},Q.Xb=function(e){return qve((Py(),e)),null},Q.bd=function(e){return-1},Q.dc=function(){return!0},Q.Jc=function(){return this.a},Q.cd=function(){return this.a},Q.dd=function(e){return this.a},Q.Ri=function(e,t){return Ohe()},Q.Si=function(e,t){khe()},Q.ed=function(e){return Ahe()},Q.Kc=function(e){return jhe()},Q.fd=function(e,t){return Mhe()},Q.gc=function(){return 0},Q.gd=function(e){nE(this,e)},Q.Lc=function(){return new ex(this,16)},Q.Mc=function(){return new Qg(null,new ex(this,16))},Q.hd=function(e,t){return Py(),new $b(hJ,e,t)},Q.Nc=function(){return bke((Py(),hJ))},Q.Oc=function(e){return Py(),kj(hJ,e)},L(eG,`ECollections/EmptyUnmodifiableEList`,1301),q(1302,770,{20:1,18:1,16:1,61:1,587:1},Qfe),Q._c=function(e,t){whe()},Q.Ec=function(e){return Che()},Q.ad=function(e,t){return The()},Q.Fc=function(e){return Ehe()},Q.$b=function(){Dhe()},Q.Gc=function(e){return!1},Q.Hc=function(e){return!1},Q.Ic=function(e){vS(this,e)},Q.Xb=function(e){return qve((Py(),e)),null},Q.bd=function(e){return-1},Q.dc=function(){return!0},Q.Jc=function(){return this.a},Q.cd=function(){return this.a},Q.dd=function(e){return this.a},Q.Ri=function(e,t){return Ohe()},Q.Si=function(e,t){khe()},Q.ed=function(e){return Ahe()},Q.Kc=function(e){return jhe()},Q.fd=function(e,t){return Mhe()},Q.gc=function(){return 0},Q.gd=function(e){nE(this,e)},Q.Lc=function(){return new ex(this,16)},Q.Mc=function(){return new Qg(null,new ex(this,16))},Q.hd=function(e,t){return Py(),new $b(hJ,e,t)},Q.Nc=function(){return bke((Py(),hJ))},Q.Oc=function(e){return Py(),kj(hJ,e)},Q._j=function(){return Py(),Py(),gJ},L(eG,`ECollections/EmptyUnmodifiableEMap`,1302);var SBt=Jg(eG,`Enumerator`),y7;q(290,1,{290:1},mF),Q.Fb=function(e){var t;return this===e?!0:j(e,290)?(t=P(e,290),this.f==t.f&&KOe(this.i,t.i)&&n_(this.a,this.f&256?t.f&256?t.a:null:t.f&256?null:t.a)&&n_(this.d,t.d)&&n_(this.g,t.g)&&n_(this.e,t.e)&&r$e(this,t)):!1},Q.Hb=function(){return this.f},Q.Ib=function(){return sot(this)},Q.f=0;var CBt=0,wBt=0,TBt=0,EBt=0,DBt=0,OBt=0,kBt=0,ABt=0,jBt=0,MBt,b7=0,x7=0,NBt=0,PBt=0,S7,FBt;L(eG,`URI`,290),q(1091,44,jz,$fe),Q.yc=function(e,t){return P(Rb(this,Sh(e),P(t,290)),290)},L(eG,`URI/URICache`,1091),q(492,67,mG,Ore,o_),Q.Qi=function(){return!0},L(eG,`UniqueEList`,492),q(579,63,DR,GC),L(eG,`WrappedException`,579);var C7=Jg(_W,Obt),w7=Jg(_W,kbt),T7=Jg(_W,Abt),E7=Jg(_W,jbt),D7=Jg(_W,Mbt),O7=Jg(_W,`EClass`),k7=Jg(_W,`EDataType`),IBt;q(1199,44,jz,epe),Q.xc=function(e){return Nf(e)?pb(this,e):Ff(h_(this.f,e))},L(_W,`EDataType/Internal/ConversionDelegate/Factory/Registry/Impl`,1199);var A7=Jg(_W,`EEnum`),j7=Jg(_W,Nbt),M7=Jg(_W,Pbt),N7=Jg(_W,Fbt),P7,F7=Jg(_W,Ibt),I7=Jg(_W,Lbt);q(IG,1,{},kre),Q.Ib=function(){return`NIL`},L(_W,`EStructuralFeature/Internal/DynamicValueHolder/1`,IG);var LBt;q(1023,44,jz,tpe),Q.xc=function(e){return Nf(e)?pb(this,e):Ff(h_(this.f,e))},L(_W,`EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl`,1023);var L7=Jg(_W,Rbt),R7=Jg(_W,`EValidator/PatternMatcher`),RBt,zBt,z7,B7,V7,H7,BBt,VBt,HBt,U7,W7,G7,K7,q7,UBt,WBt,J7,Y7,GBt,X7,Z7,Q7,$7,KBt,qBt,e9,t9=Jg(LG,`FeatureMap/Entry`);q(534,1,{75:1},kf),Q.Jk=function(){return this.a},Q.kd=function(){return this.b},L(OW,`BasicEObjectImpl/1`,534),q(1022,1,RG,Ove),Q.Dk=function(e){return MS(this.a,this.b,e)},Q.Oj=function(){return lPe(this.a,this.b)},Q.Wb=function(e){vb(this.a,this.b,e)},Q.Ek=function(){hje(this.a,this.b)},L(OW,`BasicEObjectImpl/4`,1022),q(2046,1,{114:1}),Q.Kk=function(e){this.e=e==0?JBt:V(aq,BL,1,e,5,1)},Q.ii=function(e){return this.e[e]},Q.ji=function(e,t){this.e[e]=t},Q.ki=function(e){this.e[e]=null},Q.Lk=function(){return this.c},Q.Mk=function(){throw E(new ps)},Q.Nk=function(){throw E(new ps)},Q.Ok=function(){return this.d},Q.Pk=function(){return this.e!=null},Q.Qk=function(e){this.c=e},Q.Rk=function(e){throw E(new ps)},Q.Sk=function(e){throw E(new ps)},Q.Tk=function(e){this.d=e};var JBt;L(OW,`BasicEObjectImpl/EPropertiesHolderBaseImpl`,2046),q(192,2046,{114:1},Qa),Q.Mk=function(){return this.a},Q.Nk=function(){return this.b},Q.Rk=function(e){this.a=e},Q.Sk=function(e){this.b=e},L(OW,`BasicEObjectImpl/EPropertiesHolderImpl`,192),q(502,100,Ryt,qa),Q.rh=function(){return this.f},Q.wh=function(){return this.k},Q.yh=function(e,t){this.g=e,this.i=t},Q.Ah=function(){return this.j&2?this.Xh().Lk():this.fi()},Q.Ch=function(){return this.i},Q.th=function(){return!!(this.j&1)},Q.Mh=function(){return this.g},Q.Sh=function(){return!!(this.j&4)},Q.Xh=function(){return!this.k&&(this.k=new Qa),this.k},Q._h=function(e){this.Xh().Qk(e),e?this.j|=2:this.j&=-3},Q.bi=function(e){this.Xh().Sk(e),e?this.j|=4:this.j&=-5},Q.fi=function(){return(bv(),z7).S},Q.i=0,Q.j=1,L(OW,`EObjectImpl`,502),q(786,502,{109:1,94:1,93:1,57:1,114:1,52:1,100:1},FDe),Q.ii=function(e){return this.e[e]},Q.ji=function(e,t){this.e[e]=t},Q.ki=function(e){this.e[e]=null},Q.Ah=function(){return this.d},Q.Fh=function(e){return $k(this.d,e)},Q.Hh=function(){return this.d},Q.Lh=function(){return this.e!=null},Q.Xh=function(){return!this.k&&(this.k=new Are),this.k},Q._h=function(e){this.d=e},Q.ei=function(){var e;return this.e??=(e=xv(this.d),e==0?YBt:V(aq,BL,1,e,5,1)),this},Q.gi=function(){return 0};var YBt;L(OW,`DynamicEObjectImpl`,786),q(1484,786,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1},mOe),Q.Fb=function(e){return this===e},Q.Hb=function(){return Hm(this)},Q._h=function(e){this.d=e,this.b=FP(e,`key`),this.c=FP(e,zW)},Q.yi=function(){var e;return this.a==-1&&(e=XC(this,this.b),this.a=e==null?0:YT(e)),this.a},Q.jd=function(){return XC(this,this.b)},Q.kd=function(){return XC(this,this.c)},Q.zi=function(e){this.a=e},Q.Ai=function(e){vb(this,this.b,e)},Q.ld=function(e){var t=XC(this,this.c);return vb(this,this.c,e),t},Q.a=0,L(OW,`DynamicEObjectImpl/BasicEMapEntry`,1484),q(1485,1,{114:1},Are),Q.Kk=function(e){throw E(new ps)},Q.ii=function(e){throw E(new ps)},Q.ji=function(e,t){throw E(new ps)},Q.ki=function(e){throw E(new ps)},Q.Lk=function(){throw E(new ps)},Q.Mk=function(){return this.a},Q.Nk=function(){return this.b},Q.Ok=function(){return this.c},Q.Pk=function(){throw E(new ps)},Q.Qk=function(e){throw E(new ps)},Q.Rk=function(e){this.a=e},Q.Sk=function(e){this.b=e},Q.Tk=function(e){this.c=e},L(OW,`DynamicEObjectImpl/DynamicEPropertiesHolderImpl`,1485),q(505,161,{109:1,94:1,93:1,588:1,158:1,57:1,114:1,52:1,100:1,505:1,161:1,117:1,118:1},jre),Q.xh=function(e){return M0e(this,e)},Q.Ih=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.d;case 2:return n?(!this.b&&(this.b=new _h((OL(),$7),o9,this)),this.b):(!this.b&&(this.b=new _h((OL(),$7),o9,this)),eC(this.b));case 3:return xPe(this);case 4:return!this.a&&(this.a=new um(R5,this,4)),this.a;case 5:return!this.c&&(this.c=new mm(R5,this,5)),this.c}return SC(this,e-xv((OL(),B7)),gw((r=P(jE(this,16),29),r||B7),e),t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 3:return this.Cb&&(n=(i=this.Db>>16,i>=0?M0e(this,n):this.Cb.Qh(this,-1-i,null,n))),ske(this,P(e,158),n)}return a=P(gw((r=P(jE(this,16),29),r||(OL(),B7)),t),69),a.uk().xk(this,DA(this),t-xv((OL(),B7)),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 2:return!this.b&&(this.b=new _h((OL(),$7),o9,this)),Zh(this.b,e,n);case 3:return ske(this,null,n);case 4:return!this.a&&(this.a=new um(R5,this,4)),ij(this.a,e,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),B7)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),B7)),e,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.d!=null;case 2:return!!this.b&&this.b.f!=0;case 3:return!!xPe(this);case 4:return!!this.a&&this.a.i!=0;case 5:return!!this.c&&this.c.i!=0}return Ux(this,e-xv((OL(),B7)),gw((t=P(jE(this,16),29),t||B7),e))},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:wOe(this,Sh(t));return;case 2:!this.b&&(this.b=new _h((OL(),$7),o9,this)),_E(this.b,t);return;case 3:mnt(this,P(t,158));return;case 4:!this.a&&(this.a=new um(R5,this,4)),GI(this.a),!this.a&&(this.a=new um(R5,this,4)),Sv(this.a,P(t,18));return;case 5:!this.c&&(this.c=new mm(R5,this,5)),GI(this.c),!this.c&&(this.c=new mm(R5,this,5)),Sv(this.c,P(t,18));return}Rk(this,e-xv((OL(),B7)),gw((n=P(jE(this,16),29),n||B7),e),t)},Q.fi=function(){return OL(),B7},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:wT(this,null);return;case 2:!this.b&&(this.b=new _h((OL(),$7),o9,this)),this.b.c.$b();return;case 3:mnt(this,null);return;case 4:!this.a&&(this.a=new um(R5,this,4)),GI(this.a);return;case 5:!this.c&&(this.c=new mm(R5,this,5)),GI(this.c);return}KO(this,e-xv((OL(),B7)),gw((t=P(jE(this,16),29),t||B7),e))},Q.Ib=function(){return mYe(this)},Q.d=null,L(OW,`EAnnotationImpl`,505),q(142,711,zG,pC),Q.Ei=function(e,t){$ye(this,e,P(t,45))},Q.Uk=function(e,t){return Twe(this,P(e,45),t)},Q.Yi=function(e){return P(P(this.c,72).Yi(e),136)},Q.Gi=function(){return P(this.c,72).Gi()},Q.Hi=function(){return P(this.c,72).Hi()},Q.Ii=function(e){return P(this.c,72).Ii(e)},Q.Vk=function(e,t){return Zh(this,e,t)},Q.Dk=function(e){return P(this.c,78).Dk(e)},Q.$j=function(){},Q.Oj=function(){return P(this.c,78).Oj()},Q.ak=function(e,t,n){var r=P(Pw(this.b).ti().pi(this.b),136);return r.zi(e),r.Ai(t),r.ld(n),r},Q.bk=function(){return new Kde(this)},Q.Wb=function(e){_E(this,e)},Q.Ek=function(){P(this.c,78).Ek()},L(LG,`EcoreEMap`,142),q(169,142,zG,_h),Q.Zj=function(){var e,t,n,r,i,a;if(this.d==null){for(a=V(_Bt,FG,67,2*this.f+1,0,1),n=this.c.Jc();n.e!=n.i.gc();)t=P(n.Wj(),136),r=t.yi(),i=(r&FL)%a.length,e=a[i],!e&&(e=a[i]=new Kde(this)),e.Ec(t);this.d=a}},L(OW,`EAnnotationImpl/1`,169),q(293,439,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,470:1,52:1,100:1,161:1,293:1,117:1,118:1}),Q.Ih=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Lm(),!!(this.Bb&256);case 3:return Lm(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return Lm(),!!this.Hk();case 7:return Lm(),i=this.s,i>=1;case 8:return t?rM(this):this.r;case 9:return this.q}return SC(this,e-xv(this.fi()),gw((r=P(jE(this,16),29),r||this.fi()),e),t,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 9:return Cv(this,n)}return i=P(gw((r=P(jE(this,16),29),r||this.fi()),t),69),i.uk().yk(this,DA(this),t-xv(this.fi()),e,n)},Q.Th=function(e){var t,n;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Hk();case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&zv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&zv(this.q).i==0)}return Ux(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.$h=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:this.ri(Sh(t));return;case 2:qO(this,hc(xh(t)));return;case 3:JO(this,hc(xh(t)));return;case 4:Yw(this,P(t,15).a);return;case 5:this.Xk(P(t,15).a);return;case 8:mO(this,P(t,143));return;case 9:r=FM(this,P(t,87),null),r&&r.mj();return}Rk(this,e-xv(this.fi()),gw((n=P(jE(this,16),29),n||this.fi()),e),t)},Q.fi=function(){return OL(),qBt},Q.hi=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:this.ri(null);return;case 2:qO(this,!0);return;case 3:JO(this,!0);return;case 4:Yw(this,0);return;case 5:this.Xk(1);return;case 8:mO(this,null);return;case 9:n=FM(this,null,null),n&&n.mj();return}KO(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.mi=function(){rM(this),this.Bb|=1},Q.Fk=function(){return rM(this)},Q.Gk=function(){return this.t},Q.Hk=function(){var e=this.t;return e>1||e==-1},Q.Qi=function(){return!!(this.Bb&512)},Q.Wk=function(e,t){return zO(this,e,t)},Q.Xk=function(e){Xw(this,e)},Q.Ib=function(){return qN(this)},Q.s=0,Q.t=1,L(OW,`ETypedElementImpl`,293),q(451,293,{109:1,94:1,93:1,158:1,197:1,57:1,179:1,69:1,114:1,470:1,52:1,100:1,161:1,451:1,293:1,117:1,118:1,682:1}),Q.xh=function(e){return t0e(this,e)},Q.Ih=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Lm(),!!(this.Bb&256);case 3:return Lm(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return Lm(),!!this.Hk();case 7:return Lm(),i=this.s,i>=1;case 8:return t?rM(this):this.r;case 9:return this.q;case 10:return Lm(),(this.Bb&IG)!=0;case 11:return Lm(),(this.Bb&kW)!=0;case 12:return Lm(),(this.Bb&yz)!=0;case 13:return this.j;case 14:return OP(this);case 15:return Lm(),(this.Bb&BG)!=0;case 16:return Lm(),(this.Bb&rR)!=0;case 17:return Mb(this)}return SC(this,e-xv(this.fi()),gw((r=P(jE(this,16),29),r||this.fi()),e),t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 17:return this.Cb&&(n=(i=this.Db>>16,i>=0?t0e(this,n):this.Cb.Qh(this,-1-i,null,n))),tI(this,e,17,n)}return a=P(gw((r=P(jE(this,16),29),r||this.fi()),t),69),a.uk().xk(this,DA(this),t-xv(this.fi()),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 9:return Cv(this,n);case 17:return tI(this,null,17,n)}return i=P(gw((r=P(jE(this,16),29),r||this.fi()),t),69),i.uk().yk(this,DA(this),t-xv(this.fi()),e,n)},Q.Th=function(e){var t,n;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Hk();case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&zv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&zv(this.q).i==0);case 10:return(this.Bb&IG)==0;case 11:return(this.Bb&kW)!=0;case 12:return(this.Bb&yz)!=0;case 13:return this.j!=null;case 14:return OP(this)!=null;case 15:return(this.Bb&BG)!=0;case 16:return(this.Bb&rR)!=0;case 17:return!!Mb(this)}return Ux(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.$h=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:Yb(this,Sh(t));return;case 2:qO(this,hc(xh(t)));return;case 3:JO(this,hc(xh(t)));return;case 4:Yw(this,P(t,15).a);return;case 5:this.Xk(P(t,15).a);return;case 8:mO(this,P(t,143));return;case 9:r=FM(this,P(t,87),null),r&&r.mj();return;case 10:mk(this,hc(xh(t)));return;case 11:gk(this,hc(xh(t)));return;case 12:hk(this,hc(xh(t)));return;case 13:Fve(this,Sh(t));return;case 15:pk(this,hc(xh(t)));return;case 16:jk(this,hc(xh(t)));return}Rk(this,e-xv(this.fi()),gw((n=P(jE(this,16),29),n||this.fi()),e),t)},Q.fi=function(){return OL(),KBt},Q.hi=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:j(this.Cb,88)&&xN(TS(P(this.Cb,88)),4),ZT(this,null);return;case 2:qO(this,!0);return;case 3:JO(this,!0);return;case 4:Yw(this,0);return;case 5:this.Xk(1);return;case 8:mO(this,null);return;case 9:n=FM(this,null,null),n&&n.mj();return;case 10:mk(this,!0);return;case 11:gk(this,!1);return;case 12:hk(this,!1);return;case 13:this.i=null,NT(this,null);return;case 15:pk(this,!1);return;case 16:jk(this,!1);return}KO(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.mi=function(){py(BC((uN(),l9),this)),rM(this),this.Bb|=1},Q.nk=function(){return this.f},Q.gk=function(){return OP(this)},Q.ok=function(){return Mb(this)},Q.sk=function(){return null},Q.Yk=function(){return this.k},Q.Jj=function(){return this.n},Q.tk=function(){return bM(this)},Q.uk=function(){var e,t,n,r,i,a,o,s,c;return this.p||(n=Mb(this),(n.i??pI(n),n.i).length,r=this.sk(),r&&xv(Mb(r)),i=rM(this),o=i.ik(),e=o?o.i&1?o==J9?Lq:o==q9?Wq:o==Q9?Uq:o==Z9?Hq:o==Y9?Kq:o==$9?Zq:o==X9?Rq:Bq:o:null,t=OP(this),s=i.gk(),rXe(this),(this.Bb&rR)!=0&&((a=D2e((uN(),l9),n))&&a!=this||(a=ox(BC(l9,this))))?this.p=new Mve(this,a):this.Hk()?this.$k()?this.p=r?(this.Bb&BG)==0?e?this._k()?new My(49,e,this,r):new My(7,e,this,r):this._k()?new aS(48,this,r):new aS(6,this,r):e?this._k()?new My(47,e,this,r):new My(5,e,this,r):this._k()?new aS(46,this,r):new aS(4,this,r):(this.Bb&BG)==0?e?e==fq?new _g(41,mBt,this):this._k()?new _g(45,e,this):new _g(3,e,this):this._k()?new Qy(44,this):new Qy(2,this):e?e==fq?new _g(50,mBt,this):this._k()?new _g(43,e,this):new _g(1,e,this):this._k()?new Qy(42,this):new Qy(0,this):j(i,159)?this.p=e==t9?new Qy(40,this):this.Bb&512?(this.Bb&BG)==0?e?new _g(11,e,this):new Qy(10,this):e?new _g(9,e,this):new Qy(8,this):(this.Bb&BG)==0?e?new _g(15,e,this):new Qy(14,this):e?new _g(13,e,this):new Qy(12,this):r?(c=r.t,this.p=c>1||c==-1?this._k()?(this.Bb&BG)==0?e?new My(27,e,this,r):new aS(26,this,r):e?new My(25,e,this,r):new aS(24,this,r):(this.Bb&BG)==0?e?new My(31,e,this,r):new aS(30,this,r):e?new My(29,e,this,r):new aS(28,this,r):this._k()?(this.Bb&BG)==0?e?new My(35,e,this,r):new aS(34,this,r):e?new My(33,e,this,r):new aS(32,this,r):(this.Bb&BG)==0?e?new My(39,e,this,r):new aS(38,this,r):e?new My(37,e,this,r):new aS(36,this,r)):this.p=this._k()?(this.Bb&BG)==0?e?new _g(19,e,this):new Qy(18,this):e?new _g(17,e,this):new Qy(16,this):(this.Bb&BG)==0?e?new _g(23,e,this):new Qy(22,this):e?new _g(21,e,this):new Qy(20,this):this.p=this.Zk()?this._k()?new $Ee(P(i,29),this,r):new BNe(P(i,29),this,r):j(i,159)?e==t9?new Qy(40,this):(this.Bb&BG)==0?e?new uke(t,s,this,(pA(),o==q9?aVt:o==J9?eVt:o==Y9?oVt:o==Q9?iVt:o==Z9?rVt:o==$9?sVt:o==X9?tVt:o==K9?nVt:c9)):new gMe(P(i,159),t,s,this):e?new dke(t,s,this,(pA(),o==q9?aVt:o==J9?eVt:o==Y9?oVt:o==Q9?iVt:o==Z9?rVt:o==$9?sVt:o==X9?tVt:o==K9?nVt:c9)):new _Me(P(i,159),t,s,this):this.$k()?r?(this.Bb&BG)==0?this._k()?new nDe(P(i,29),this,r):new vg(P(i,29),this,r):this._k()?new iDe(P(i,29),this,r):new rDe(P(i,29),this,r):(this.Bb&BG)==0?this._k()?new wSe(P(i,29),this):new vh(P(i,29),this):this._k()?new ESe(P(i,29),this):new TSe(P(i,29),this):this._k()?r?(this.Bb&BG)==0?new eDe(P(i,29),this,r):new aDe(P(i,29),this,r):(this.Bb&BG)==0?new SSe(P(i,29),this):new DSe(P(i,29),this):r?(this.Bb&BG)==0?new tDe(P(i,29),this,r):new oDe(P(i,29),this,r):(this.Bb&BG)==0?new a_(P(i,29),this):new CSe(P(i,29),this)),this.p},Q.pk=function(){return(this.Bb&IG)!=0},Q.Zk=function(){return!1},Q.$k=function(){return!1},Q.qk=function(){return(this.Bb&rR)!=0},Q.vk=function(){return $C(this)},Q._k=function(){return!1},Q.rk=function(){return(this.Bb&BG)!=0},Q.al=function(e){this.k=e},Q.ri=function(e){Yb(this,e)},Q.Ib=function(){return vF(this)},Q.e=!1,Q.n=0,L(OW,`EStructuralFeatureImpl`,451),q(335,451,{109:1,94:1,93:1,38:1,158:1,197:1,57:1,179:1,69:1,114:1,470:1,52:1,100:1,335:1,161:1,451:1,293:1,117:1,118:1,682:1},Rs),Q.Ih=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Lm(),!!(this.Bb&256);case 3:return Lm(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return Lm(),!!AN(this);case 7:return Lm(),i=this.s,i>=1;case 8:return t?rM(this):this.r;case 9:return this.q;case 10:return Lm(),(this.Bb&IG)!=0;case 11:return Lm(),(this.Bb&kW)!=0;case 12:return Lm(),(this.Bb&yz)!=0;case 13:return this.j;case 14:return OP(this);case 15:return Lm(),(this.Bb&BG)!=0;case 16:return Lm(),(this.Bb&rR)!=0;case 17:return Mb(this);case 18:return Lm(),(this.Bb&DW)!=0;case 19:return t?YE(this):qze(this)}return SC(this,e-xv((OL(),V7)),gw((r=P(jE(this,16),29),r||V7),e),t,n)},Q.Th=function(e){var t,n;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return AN(this);case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&zv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&zv(this.q).i==0);case 10:return(this.Bb&IG)==0;case 11:return(this.Bb&kW)!=0;case 12:return(this.Bb&yz)!=0;case 13:return this.j!=null;case 14:return OP(this)!=null;case 15:return(this.Bb&BG)!=0;case 16:return(this.Bb&rR)!=0;case 17:return!!Mb(this);case 18:return(this.Bb&DW)!=0;case 19:return!!qze(this)}return Ux(this,e-xv((OL(),V7)),gw((t=P(jE(this,16),29),t||V7),e))},Q.$h=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:Yb(this,Sh(t));return;case 2:qO(this,hc(xh(t)));return;case 3:JO(this,hc(xh(t)));return;case 4:Yw(this,P(t,15).a);return;case 5:$me(this,P(t,15).a);return;case 8:mO(this,P(t,143));return;case 9:r=FM(this,P(t,87),null),r&&r.mj();return;case 10:mk(this,hc(xh(t)));return;case 11:gk(this,hc(xh(t)));return;case 12:hk(this,hc(xh(t)));return;case 13:Fve(this,Sh(t));return;case 15:pk(this,hc(xh(t)));return;case 16:jk(this,hc(xh(t)));return;case 18:Mk(this,hc(xh(t)));return}Rk(this,e-xv((OL(),V7)),gw((n=P(jE(this,16),29),n||V7),e),t)},Q.fi=function(){return OL(),V7},Q.hi=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:j(this.Cb,88)&&xN(TS(P(this.Cb,88)),4),ZT(this,null);return;case 2:qO(this,!0);return;case 3:JO(this,!0);return;case 4:Yw(this,0);return;case 5:this.b=0,Xw(this,1);return;case 8:mO(this,null);return;case 9:n=FM(this,null,null),n&&n.mj();return;case 10:mk(this,!0);return;case 11:gk(this,!1);return;case 12:hk(this,!1);return;case 13:this.i=null,NT(this,null);return;case 15:pk(this,!1);return;case 16:jk(this,!1);return;case 18:Mk(this,!1);return}KO(this,e-xv((OL(),V7)),gw((t=P(jE(this,16),29),t||V7),e))},Q.mi=function(){YE(this),py(BC((uN(),l9),this)),rM(this),this.Bb|=1},Q.Hk=function(){return AN(this)},Q.Wk=function(e,t){return this.b=0,this.a=null,zO(this,e,t)},Q.Xk=function(e){$me(this,e)},Q.Ib=function(){var e;return this.Db&64?vF(this):(e=new Am(vF(this)),e.a+=` (iD: `,dl(e,(this.Bb&DW)!=0),e.a+=`)`,e.a)},Q.b=0,L(OW,`EAttributeImpl`,335),q(360,439,{109:1,94:1,93:1,143:1,158:1,197:1,57:1,114:1,52:1,100:1,360:1,161:1,117:1,118:1,681:1}),Q.bl=function(e){return e.Ah()==this},Q.xh=function(e){return Vj(this,e)},Q.yh=function(e,t){this.w=null,this.Db=t<<16|this.Db&255,this.Cb=e},Q.Ih=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D==null?this.B:this.D;case 3:return Rj(this);case 4:return this.gk();case 5:return this.F;case 6:return t?Pw(this):kb(this);case 7:return!this.A&&(this.A=new fm(L7,this,7)),this.A}return SC(this,e-xv(this.fi()),gw((r=P(jE(this,16),29),r||this.fi()),e),t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?Vj(this,n):this.Cb.Qh(this,-1-i,null,n))),tI(this,e,6,n)}return a=P(gw((r=P(jE(this,16),29),r||this.fi()),t),69),a.uk().xk(this,DA(this),t-xv(this.fi()),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 6:return tI(this,null,6,n);case 7:return!this.A&&(this.A=new fm(L7,this,7)),ij(this.A,e,n)}return i=P(gw((r=P(jE(this,16),29),r||this.fi()),t),69),i.uk().yk(this,DA(this),t-xv(this.fi()),e,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!Rj(this);case 4:return this.gk()!=null;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!kb(this);case 7:return!!this.A&&this.A.i!=0}return Ux(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:Xb(this,Sh(t));return;case 2:xp(this,Sh(t));return;case 5:eL(this,Sh(t));return;case 7:!this.A&&(this.A=new fm(L7,this,7)),GI(this.A),!this.A&&(this.A=new fm(L7,this,7)),Sv(this.A,P(t,18));return}Rk(this,e-xv(this.fi()),gw((n=P(jE(this,16),29),n||this.fi()),e),t)},Q.fi=function(){return OL(),BBt},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),ZT(this,null);return;case 2:iO(this,null),Zw(this,this.D);return;case 5:eL(this,null);return;case 7:!this.A&&(this.A=new fm(L7,this,7)),GI(this.A);return}KO(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.fk=function(){var e;return this.G==-1&&(this.G=(e=Pw(this),e?dj(e.si(),this):-1)),this.G},Q.gk=function(){return null},Q.hk=function(){return Pw(this)},Q.cl=function(){return this.v},Q.ik=function(){return Rj(this)},Q.jk=function(){return this.D==null?this.B:this.D},Q.kk=function(){return this.F},Q.dk=function(e){return oI(this,e)},Q.dl=function(e){this.v=e},Q.el=function(e){eGe(this,e)},Q.fl=function(e){this.C=e},Q.ri=function(e){Xb(this,e)},Q.Ib=function(){return tA(this)},Q.C=null,Q.D=null,Q.G=-1,L(OW,`EClassifierImpl`,360),q(88,360,{109:1,94:1,93:1,29:1,143:1,158:1,197:1,57:1,114:1,52:1,100:1,88:1,360:1,161:1,471:1,117:1,118:1,681:1},Hoe),Q.bl=function(e){return nwe(this,e.Ah())},Q.Ih=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D==null?this.B:this.D;case 3:return Rj(this);case 4:return null;case 5:return this.F;case 6:return t?Pw(this):kb(this);case 7:return!this.A&&(this.A=new fm(L7,this,7)),this.A;case 8:return Lm(),!!(this.Bb&256);case 9:return Lm(),!!(this.Bb&512);case 10:return rb(this);case 11:return!this.q&&(this.q=new F(N7,this,11,10)),this.q;case 12:return DI(this);case 13:return CI(this);case 14:return CI(this),this.r;case 15:return DI(this),this.k;case 16:return $8e(this);case 17:return yI(this);case 18:return pI(this);case 19:return wP(this);case 20:return DI(this),this.o;case 21:return!this.s&&(this.s=new F(T7,this,21,17)),this.s;case 22:return tS(this);case 23:return cF(this)}return SC(this,e-xv((OL(),H7)),gw((r=P(jE(this,16),29),r||H7),e),t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?Vj(this,n):this.Cb.Qh(this,-1-i,null,n))),tI(this,e,6,n);case 11:return!this.q&&(this.q=new F(N7,this,11,10)),oA(this.q,e,n);case 21:return!this.s&&(this.s=new F(T7,this,21,17)),oA(this.s,e,n)}return a=P(gw((r=P(jE(this,16),29),r||(OL(),H7)),t),69),a.uk().xk(this,DA(this),t-xv((OL(),H7)),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 6:return tI(this,null,6,n);case 7:return!this.A&&(this.A=new fm(L7,this,7)),ij(this.A,e,n);case 11:return!this.q&&(this.q=new F(N7,this,11,10)),ij(this.q,e,n);case 21:return!this.s&&(this.s=new F(T7,this,21,17)),ij(this.s,e,n);case 22:return ij(tS(this),e,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),H7)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),H7)),e,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!Rj(this);case 4:return!1;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!kb(this);case 7:return!!this.A&&this.A.i!=0;case 8:return!!(this.Bb&256);case 9:return!!(this.Bb&512);case 10:return!!this.u&&tS(this.u.a).i!=0&&!(this.n&&Sj(this.n));case 11:return!!this.q&&this.q.i!=0;case 12:return DI(this).i!=0;case 13:return CI(this).i!=0;case 14:return CI(this),this.r.i!=0;case 15:return DI(this),this.k.i!=0;case 16:return $8e(this).i!=0;case 17:return yI(this).i!=0;case 18:return pI(this).i!=0;case 19:return wP(this).i!=0;case 20:return DI(this),!!this.o;case 21:return!!this.s&&this.s.i!=0;case 22:return!!this.n&&Sj(this.n);case 23:return cF(this).i!=0}return Ux(this,e-xv((OL(),H7)),gw((t=P(jE(this,16),29),t||H7),e))},Q.Wh=function(e){return(this.i==null||this.q&&this.q.i!=0?null:FP(this,e))||pft(this,e)},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:Xb(this,Sh(t));return;case 2:xp(this,Sh(t));return;case 5:eL(this,Sh(t));return;case 7:!this.A&&(this.A=new fm(L7,this,7)),GI(this.A),!this.A&&(this.A=new fm(L7,this,7)),Sv(this.A,P(t,18));return;case 8:YO(this,hc(xh(t)));return;case 9:XO(this,hc(xh(t)));return;case 10:KI(rb(this)),Sv(rb(this),P(t,18));return;case 11:!this.q&&(this.q=new F(N7,this,11,10)),GI(this.q),!this.q&&(this.q=new F(N7,this,11,10)),Sv(this.q,P(t,18));return;case 21:!this.s&&(this.s=new F(T7,this,21,17)),GI(this.s),!this.s&&(this.s=new F(T7,this,21,17)),Sv(this.s,P(t,18));return;case 22:GI(tS(this)),Sv(tS(this),P(t,18));return}Rk(this,e-xv((OL(),H7)),gw((n=P(jE(this,16),29),n||H7),e),t)},Q.fi=function(){return OL(),H7},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),ZT(this,null);return;case 2:iO(this,null),Zw(this,this.D);return;case 5:eL(this,null);return;case 7:!this.A&&(this.A=new fm(L7,this,7)),GI(this.A);return;case 8:YO(this,!1);return;case 9:XO(this,!1);return;case 10:this.u&&KI(this.u);return;case 11:!this.q&&(this.q=new F(N7,this,11,10)),GI(this.q);return;case 21:!this.s&&(this.s=new F(T7,this,21,17)),GI(this.s);return;case 22:this.n&&GI(this.n);return}KO(this,e-xv((OL(),H7)),gw((t=P(jE(this,16),29),t||H7),e))},Q.mi=function(){var e,t;if(DI(this),CI(this),$8e(this),yI(this),pI(this),wP(this),cF(this),FS(mDe(TS(this))),this.s)for(e=0,t=this.s.i;e<t;++e)Ch(H(this.s,e));if(this.q)for(e=0,t=this.q.i;e<t;++e)Ch(H(this.q,e));BO((uN(),l9),this).ve(),this.Bb|=1},Q.Ib=function(){return f4e(this)},Q.k=null,Q.r=null;var n9,XBt,r9;L(OW,`EClassImpl`,88),q(2057,2056,Vbt),Q.Ci=function(e,t){return cI(this,e,t)},Q.Di=function(e){return cI(this,this.i,e)},Q.Ei=function(e,t){GN(this,e,t)},Q.Fi=function(e){ZN(this,e)},Q.Uk=function(e,t){return oA(this,e,t)},Q.Yi=function(e){return mVe(this,e)},Q.Vk=function(e,t){return ij(this,e,t)},Q.Vi=function(e,t){return Rst(this,e,t)},Q.Gi=function(){return new $m(this)},Q.Hi=function(){return new eh(this)},Q.Ii=function(e){return cT(this,e)},L(LG,`NotifyingInternalEListImpl`,2057),q(624,2057,XG),Q.Gc=function(e){return glt(this,e)},Q.Gj=function(e,t,n,r,i){return zb(this,e,t,n,r,i)},Q.Hj=function(e){vs(this,e)},Q.Dk=function(e){return this},Q.Jk=function(){return gw(this.e.Ah(),this.Jj())},Q.Ij=function(){return this.Jk()},Q.Jj=function(){return $k(this.e.Ah(),this.Jk())},Q.gl=function(){return P(this.Jk().Fk(),29).ik()},Q.hl=function(){return vj(P(this.Jk(),19)).n},Q.hj=function(){return this.e},Q.il=function(){return!0},Q.jl=function(){return!1},Q.kl=function(){return!1},Q.ll=function(){return!1},Q.bd=function(e){return dj(this,e)},Q.Lj=function(e,t){var n=P(e,52);return this.kl()?this.il()?n.Oh(this.e,this.hl(),this.gl(),t):n.Oh(this.e,$k(n.Ah(),vj(P(this.Jk(),19))),null,t):n.Oh(this.e,-1-this.Jj(),null,t)},Q.Mj=function(e,t){var n=P(e,52);return this.kl()?this.il()?n.Qh(this.e,this.hl(),this.gl(),t):n.Qh(this.e,$k(n.Ah(),vj(P(this.Jk(),19))),null,t):n.Qh(this.e,-1-this.Jj(),null,t)},Q.$k=function(){return!1},Q.ml=function(){return!0},Q.dk=function(e){return HLe(this.d,e)},Q.Nj=function(){return fp(this.e)},Q.Oj=function(){return this.i!=0},Q.$i=function(e){return Qw(this.d,e)},Q.Ui=function(e,t){return this.ml()&&this.ll()?JN(this,e,P(t,57)):t},Q.nl=function(e){return e.Sh()?kO(this.e,P(e,52)):e},Q.Wb=function(e){Abe(this,e)},Q.Nc=function(){return hVe(this)},Q.Oc=function(e){var t;if(this.ll())for(t=this.i-1;t>=0;--t)H(this,t);return rZe(this,e)},Q.Ek=function(){GI(this)},Q.Xi=function(e,t){return iWe(this,e,t)},L(LG,`EcoreEList`,624),q(491,624,XG,kg),Q.Ji=function(){return!1},Q.Jj=function(){return this.c},Q.Kj=function(){return!1},Q.ml=function(){return!0},Q.Qi=function(){return!0},Q.Ui=function(e,t){return t},Q.Wi=function(){return!1},Q.c=0,L(LG,`EObjectEList`,491),q(81,491,XG,um),Q.Kj=function(){return!0},Q.kl=function(){return!1},Q.$k=function(){return!0},L(LG,`EObjectContainmentEList`,81),q(544,81,XG,lm),Q.Li=function(){this.b=!0},Q.Oj=function(){return this.b},Q.Ek=function(){var e;GI(this),fp(this.e)?(e=this.b,this.b=!1,CE(this.e,new DS(this.e,2,this.c,e,!1))):this.b=!1},Q.b=!1,L(LG,`EObjectContainmentEList/Unsettable`,544),q(1131,544,XG,cke),Q.Ri=function(e,t){var n=P(dk(this,e,t),87),r;return fp(this.e)&&vs(this,new hC(this.a,7,(OL(),VBt),G(t),(r=n.c,j(r,88)?P(r,29):J7),e)),n},Q.Sj=function(e,t){return dZe(this,P(e,87),t)},Q.Tj=function(e,t){return uZe(this,P(e,87),t)},Q.Uj=function(e,t,n){return H2e(this,P(e,87),P(t,87),n)},Q.Gj=function(e,t,n,r,i){switch(e){case 3:return zb(this,e,t,n,r,this.i>1);case 5:return zb(this,e,t,n,r,this.i-P(n,16).gc()>0);default:return new KC(this.e,e,this.c,t,n,r,!0)}},Q.Rj=function(){return!0},Q.Oj=function(){return Sj(this)},Q.Ek=function(){GI(this)},L(OW,`EClassImpl/1`,1131),q(1145,1144,jG),Q.bj=function(e){var t,n=e.ej(),r,i,a,o,s;if(n!=8){if(r=LQe(e),r==0)switch(n){case 1:case 9:s=e.ij(),s!=null&&(t=TS(P(s,471)),!t.c&&(t.c=new Ya),QC(t.c,e.hj())),o=e.gj(),o!=null&&(i=P(o,471),i.Bb&1||(t=TS(i),!t.c&&(t.c=new Ya),lC(t.c,P(e.hj(),29))));break;case 3:o=e.gj(),o!=null&&(i=P(o,471),i.Bb&1||(t=TS(i),!t.c&&(t.c=new Ya),lC(t.c,P(e.hj(),29))));break;case 5:if(o=e.gj(),o!=null)for(a=P(o,18).Jc();a.Ob();)i=P(a.Pb(),471),i.Bb&1||(t=TS(i),!t.c&&(t.c=new Ya),lC(t.c,P(e.hj(),29)));break;case 4:s=e.ij(),s!=null&&(i=P(s,471),i.Bb&1||(t=TS(i),!t.c&&(t.c=new Ya),QC(t.c,e.hj())));break;case 6:if(s=e.ij(),s!=null)for(a=P(s,18).Jc();a.Ob();)i=P(a.Pb(),471),i.Bb&1||(t=TS(i),!t.c&&(t.c=new Ya),QC(t.c,e.hj()))}this.ol(r)}},Q.ol=function(e){Sit(this,e)},Q.b=63,L(OW,`ESuperAdapter`,1145),q(1146,1145,jG,Lde),Q.ol=function(e){xN(this,e)},L(OW,`EClassImpl/10`,1146),q(1135,699,XG),Q.Ci=function(e,t){return PM(this,e,t)},Q.Di=function(e){return o1e(this,e)},Q.Ei=function(e,t){VO(this,e,t)},Q.Fi=function(e){IS(this,e)},Q.Yi=function(e){return mVe(this,e)},Q.Vi=function(e,t){return ZC(this,e,t)},Q.Uk=function(e,t){throw E(new ps)},Q.Gi=function(){return new $m(this)},Q.Hi=function(){return new eh(this)},Q.Ii=function(e){return cT(this,e)},Q.Vk=function(e,t){throw E(new ps)},Q.Dk=function(e){return this},Q.Oj=function(){return this.i!=0},Q.Wb=function(e){throw E(new ps)},Q.Ek=function(){throw E(new ps)},L(LG,`EcoreEList/UnmodifiableEList`,1135),q(333,1135,XG,$f),Q.Wi=function(){return!1},L(LG,`EcoreEList/UnmodifiableEList/FastCompare`,333),q(1138,333,XG,_qe),Q.bd=function(e){var t,n,r;if(j(e,179)&&(t=P(e,179),n=t.Jj(),n!=-1)){for(r=this.i;n<r;++n)if(A(this.g[n])===A(e))return n}return-1},L(OW,`EClassImpl/1EAllStructuralFeaturesList`,1138),q(1132,492,mG,Mre),Q.$i=function(e){return V(M7,Hbt,87,e,0,1)},Q.Wi=function(){return!1},L(OW,`EClassImpl/1EGenericSuperTypeEList`,1132),q(625,492,mG,Ja),Q.$i=function(e){return V(T7,JG,179,e,0,1)},Q.Wi=function(){return!1},L(OW,`EClassImpl/1EStructuralFeatureUniqueEList`,625),q(743,492,mG,Nre),Q.$i=function(e){return V(I7,JG,19,e,0,1)},Q.Wi=function(){return!1},L(OW,`EClassImpl/1ReferenceList`,743),q(1133,492,mG,Rde),Q.Ki=function(e,t){fke(this,P(t,38))},Q.$i=function(e){return V(E7,JG,38,e,0,1)},Q.Wi=function(){return!1},L(OW,`EClassImpl/2`,1133),q(1134,492,mG,Pre),Q.$i=function(e){return V(E7,JG,38,e,0,1)},Q.Wi=function(){return!1},L(OW,`EClassImpl/3`,1134),q(1136,333,XG,IDe),Q.Ec=function(e){return uRe(this,P(e,38))},Q.Fi=function(e){oge(this,P(e,38))},L(OW,`EClassImpl/4`,1136),q(1137,333,XG,LDe),Q.Ec=function(e){return dRe(this,P(e,19))},Q.Fi=function(e){sge(this,P(e,19))},L(OW,`EClassImpl/5`,1137),q(1139,492,mG,Fre),Q.$i=function(e){return V(N7,YG,62,e,0,1)},Q.Wi=function(){return!1},L(OW,`EClassImpl/6`,1139),q(1140,492,mG,Ire),Q.$i=function(e){return V(I7,JG,19,e,0,1)},Q.Wi=function(){return!1},L(OW,`EClassImpl/7`,1140),q(2060,2059,{3:1,4:1,20:1,31:1,56:1,18:1,16:1,71:1,61:1,72:1}),Q.Ci=function(e,t){return Lot(this,e,t)},Q.Di=function(e){return Lot(this,this.Cj(),e)},Q.Ei=function(e,t){D9e(this,e,t)},Q.Fi=function(e){o9e(this,e)},Q.Uk=function(e,t){return s1e(this,e,t)},Q.Vk=function(e,t){return h$e(this,e,t)},Q.Vi=function(e,t){return Rot(this,e,t)},Q.Yi=function(e){return this.vj(e)},Q.Gi=function(){return new $m(this)},Q.nj=function(){return this.qj()},Q.Hi=function(){return new eh(this)},Q.Ii=function(e){return cT(this,e)},L(LG,`DelegatingNotifyingInternalEListImpl`,2060),q(744,2060,eK),Q.Ji=function(){var e=gw(ib(this.b),this.Jj()).Fk();return j(e,159)&&!j(e,459)&&!(e.ik().i&1)},Q.Gc=function(e){var t,n,r,i,a,o,s,c;if(this.ml()){if(c=this.Cj(),c>4){if(this.dk(e)){if(this.$k()){if(r=P(e,52),n=r.Bh(),s=n==this.b&&(this.kl()?r.vh(r.Ch(),P(gw(ib(this.b),this.Jj()).Fk(),29).ik())==vj(P(gw(ib(this.b),this.Jj()),19)).n:-1-r.Ch()==this.Jj()),this.ll()&&!s&&!n&&r.Gh()){for(i=0;i<c;++i)if(t=q_(this,this.vj(i)),A(t)===A(e))return!0}return s}if(this.kl()&&!this.jl()){if(a=P(e,57).Jh(vj(P(gw(ib(this.b),this.Jj()),19))),A(a)===A(this.b))return!0;if(a==null||!P(a,57).Sh())return!1}}else return!1}if(o=this.sj(e),this.ll()&&!o){for(i=0;i<c;++i)if(r=q_(this,this.vj(i)),A(r)===A(e))return!0}return o}return this.sj(e)},Q.Gj=function(e,t,n,r,i){return new KC(this.b,e,this.Jj(),t,n,r,i)},Q.Hj=function(e){CE(this.b,e)},Q.Dk=function(e){return this},Q.Ij=function(){return gw(ib(this.b),this.Jj())},Q.Jj=function(){return $k(ib(this.b),gw(ib(this.b),this.Jj()))},Q.hj=function(){return this.b},Q.il=function(){return!!gw(ib(this.b),this.Jj()).Fk().ik()},Q.Kj=function(){var e,t=gw(ib(this.b),this.Jj());return j(t,103)?(e=P(t,19),(e.Bb&DW)!=0||!!vj(P(t,19))):!1},Q.jl=function(){var e,t=gw(ib(this.b),this.Jj()),n,r;return j(t,103)?(e=P(t,19),n=vj(e),!!n&&(r=n.t,r>1||r==-1)):!1},Q.kl=function(){var e,t=gw(ib(this.b),this.Jj()),n;return j(t,103)?(e=P(t,19),n=vj(e),!!n):!1},Q.ll=function(){var e,t=gw(ib(this.b),this.Jj());return j(t,103)?(e=P(t,19),(e.Bb&xz)!=0):!1},Q.bd=function(e){var t,n,r=this.xj(e),i;if(r>=0)return r;if(this.ml()){for(n=0,i=this.Cj();n<i;++n)if(t=q_(this,this.vj(n)),A(t)===A(e))return n}return-1},Q.Lj=function(e,t){var n=P(e,52);return this.kl()?this.il()?n.Oh(this.b,vj(P(gw(ib(this.b),this.Jj()),19)).n,P(gw(ib(this.b),this.Jj()).Fk(),29).ik(),t):n.Oh(this.b,$k(n.Ah(),vj(P(gw(ib(this.b),this.Jj()),19))),null,t):n.Oh(this.b,-1-this.Jj(),null,t)},Q.Mj=function(e,t){var n=P(e,52);return this.kl()?this.il()?n.Qh(this.b,vj(P(gw(ib(this.b),this.Jj()),19)).n,P(gw(ib(this.b),this.Jj()).Fk(),29).ik(),t):n.Qh(this.b,$k(n.Ah(),vj(P(gw(ib(this.b),this.Jj()),19))),null,t):n.Qh(this.b,-1-this.Jj(),null,t)},Q.$k=function(){var e,t=gw(ib(this.b),this.Jj());return j(t,103)?(e=P(t,19),(e.Bb&DW)!=0):!1},Q.ml=function(){return j(gw(ib(this.b),this.Jj()).Fk(),88)},Q.dk=function(e){return gw(ib(this.b),this.Jj()).Fk().dk(e)},Q.Nj=function(){return fp(this.b)},Q.Oj=function(){return!this.yj()},Q.Qi=function(){return gw(ib(this.b),this.Jj()).Qi()},Q.Ui=function(e,t){return QI(this,e,t)},Q.Wb=function(e){KI(this),Sv(this,P(e,16))},Q.Nc=function(){var e;if(this.ll())for(e=this.Cj()-1;e>=0;--e)QI(this,e,this.vj(e));return this.Dj()},Q.Oc=function(e){var t;if(this.ll())for(t=this.Cj()-1;t>=0;--t)QI(this,t,this.vj(t));return this.Ej(e)},Q.Ek=function(){KI(this)},Q.Xi=function(e,t){return CVe(this,e,t)},L(LG,`DelegatingEcoreEList`,744),q(1141,744,eK,sCe),Q.oj=function(e,t){xSe(this,e,P(t,29))},Q.pj=function(e){Yye(this,P(e,29))},Q.vj=function(e){var t=P(H(tS(this.a),e),87).c;return j(t,88)?P(t,29):(OL(),J7)},Q.Aj=function(e){var t=P(eF(tS(this.a),e),87).c;return j(t,88)?P(t,29):(OL(),J7)},Q.Bj=function(e,t){return c1e(this,e,P(t,29))},Q.Ji=function(){return!1},Q.Gj=function(e,t,n,r,i){return null},Q.qj=function(){return new zde(this)},Q.rj=function(){GI(tS(this.a))},Q.sj=function(e){return gYe(this,e)},Q.tj=function(e){for(var t,n=e.Jc();n.Ob();)if(t=n.Pb(),!gYe(this,t))return!1;return!0},Q.uj=function(e){var t,n,r;if(j(e,16)&&(r=P(e,16),r.gc()==tS(this.a).i)){for(t=r.Jc(),n=new gm(this);t.Ob();)if(A(t.Pb())!==A(JA(n)))return!1;return!0}return!1},Q.wj=function(){var e,t,n=1,r,i;for(t=new gm(tS(this.a));t.e!=t.i.gc();)e=P(JA(t),87),r=(i=e.c,j(i,88)?P(i,29):(OL(),J7)),n=31*n+(r?Hm(r):0);return n},Q.xj=function(e){var t,n,r=0,i;for(n=new gm(tS(this.a));n.e!=n.i.gc();){if(t=P(JA(n),87),A(e)===A((i=t.c,j(i,88)?P(i,29):(OL(),J7))))return r;++r}return-1},Q.yj=function(){return tS(this.a).i==0},Q.zj=function(){return null},Q.Cj=function(){return tS(this.a).i},Q.Dj=function(){var e,t,n,r,i,a=tS(this.a).i;for(i=V(aq,BL,1,a,5,1),n=0,t=new gm(tS(this.a));t.e!=t.i.gc();)e=P(JA(t),87),i[n++]=(r=e.c,j(r,88)?P(r,29):(OL(),J7));return i},Q.Ej=function(e){var t,n,r,i,a,o,s=tS(this.a).i;for(e.length<s&&(i=Qw(GD(e).c,s),e=i),e.length>s&&Mv(e,s,null),r=0,n=new gm(tS(this.a));n.e!=n.i.gc();)t=P(JA(n),87),a=(o=t.c,j(o,88)?P(o,29):(OL(),J7)),Mv(e,r++,a);return e},Q.Fj=function(){var e,t,n,r,i=new Nc;for(i.a+=`[`,e=tS(this.a),t=0,r=tS(this.a).i;t<r;)Uf(i,km((n=P(H(e,t),87).c,j(n,88)?P(n,29):(OL(),J7)))),++t<r&&(i.a+=zL);return i.a+=`]`,i.a},Q.Hj=function(e){},Q.Jj=function(){return 10},Q.il=function(){return!0},Q.Kj=function(){return!1},Q.jl=function(){return!1},Q.kl=function(){return!1},Q.ll=function(){return!0},Q.$k=function(){return!1},Q.ml=function(){return!0},Q.dk=function(e){return j(e,88)},Q.Oj=function(){return tIe(this.a)},Q.Qi=function(){return!0},Q.Wi=function(){return!0},L(OW,`EClassImpl/8`,1141),q(1142,2027,xR,zde),Q.dd=function(e){return cT(this.a,e)},Q.gc=function(){return tS(this.a.a).i},L(OW,`EClassImpl/8/1`,1142),q(1143,492,mG,Lre),Q.$i=function(e){return V(D7,BL,143,e,0,1)},Q.Wi=function(){return!1},L(OW,`EClassImpl/9`,1143),q(1130,48,Mz,npe),L(OW,`EClassImpl/MyHashSet`,1130),q(563,360,{109:1,94:1,93:1,143:1,159:1,832:1,158:1,197:1,57:1,114:1,52:1,100:1,360:1,161:1,117:1,118:1,681:1},hs),Q.Ih=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D==null?this.B:this.D;case 3:return Rj(this);case 4:return this.gk();case 5:return this.F;case 6:return t?Pw(this):kb(this);case 7:return!this.A&&(this.A=new fm(L7,this,7)),this.A;case 8:return Lm(),!!(this.Bb&256)}return SC(this,e-xv(this.fi()),gw((r=P(jE(this,16),29),r||this.fi()),e),t,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!Rj(this);case 4:return this.gk()!=null;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!kb(this);case 7:return!!this.A&&this.A.i!=0;case 8:return!(this.Bb&256)}return Ux(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:Xb(this,Sh(t));return;case 2:xp(this,Sh(t));return;case 5:eL(this,Sh(t));return;case 7:!this.A&&(this.A=new fm(L7,this,7)),GI(this.A),!this.A&&(this.A=new fm(L7,this,7)),Sv(this.A,P(t,18));return;case 8:ZO(this,hc(xh(t)));return}Rk(this,e-xv(this.fi()),gw((n=P(jE(this,16),29),n||this.fi()),e),t)},Q.fi=function(){return OL(),HBt},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),ZT(this,null);return;case 2:iO(this,null),Zw(this,this.D);return;case 5:eL(this,null);return;case 7:!this.A&&(this.A=new fm(L7,this,7)),GI(this.A);return;case 8:ZO(this,!0);return}KO(this,e-xv(this.fi()),gw((t=P(jE(this,16),29),t||this.fi()),e))},Q.mi=function(){BO((uN(),l9),this).ve(),this.Bb|=1},Q.mk=function(){var e,t,n;if(!this.c&&(e=Eet(Pw(this)),!e.dc()))for(n=e.Jc();n.Ob();)t=Sh(n.Pb()),nI(this,t)&&IYe(this);return this.b},Q.gk=function(){var e;if(!this.e){e=null;try{e=Rj(this)}catch(e){if(e=tD(e),!j(e,101))throw E(e)}this.d=null,e&&e.i&1&&(this.d=e==J9?(Lm(),Fq):e==q9?G(0):e==Q9?new ho(0):e==Z9?0:e==Y9?AA(0):e==$9?PO(0):e==X9?YC(0):NE(0)),this.e=!0}return this.d},Q.lk=function(){return!!(this.Bb&256)},Q.pl=function(e){e&&(this.D=`org.eclipse.emf.common.util.AbstractEnumerator`)},Q.el=function(e){eGe(this,e),this.pl(e)},Q.fl=function(e){this.C=e,this.e=!1},Q.Ib=function(){var e;return this.Db&64?tA(this):(e=new Am(tA(this)),e.a+=` (serializable: `,dl(e,!!(this.Bb&256)),e.a+=`)`,e.a)},Q.c=!1,Q.d=null,Q.e=!1,L(OW,`EDataTypeImpl`,563),q(459,563,{109:1,94:1,93:1,143:1,159:1,832:1,675:1,158:1,197:1,57:1,114:1,52:1,100:1,360:1,459:1,161:1,117:1,118:1,681:1},rpe),Q.Ih=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D==null?this.B:this.D;case 3:return Rj(this);case 4:return oO(this);case 5:return this.F;case 6:return t?Pw(this):kb(this);case 7:return!this.A&&(this.A=new fm(L7,this,7)),this.A;case 8:return Lm(),!!(this.Bb&256);case 9:return!this.a&&(this.a=new F(j7,this,9,5)),this.a}return SC(this,e-xv((OL(),U7)),gw((r=P(jE(this,16),29),r||U7),e),t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?Vj(this,n):this.Cb.Qh(this,-1-i,null,n))),tI(this,e,6,n);case 9:return!this.a&&(this.a=new F(j7,this,9,5)),oA(this.a,e,n)}return a=P(gw((r=P(jE(this,16),29),r||(OL(),U7)),t),69),a.uk().xk(this,DA(this),t-xv((OL(),U7)),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 6:return tI(this,null,6,n);case 7:return!this.A&&(this.A=new fm(L7,this,7)),ij(this.A,e,n);case 9:return!this.a&&(this.a=new F(j7,this,9,5)),ij(this.a,e,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),U7)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),U7)),e,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!Rj(this);case 4:return!!oO(this);case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!kb(this);case 7:return!!this.A&&this.A.i!=0;case 8:return!(this.Bb&256);case 9:return!!this.a&&this.a.i!=0}return Ux(this,e-xv((OL(),U7)),gw((t=P(jE(this,16),29),t||U7),e))},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:Xb(this,Sh(t));return;case 2:xp(this,Sh(t));return;case 5:eL(this,Sh(t));return;case 7:!this.A&&(this.A=new fm(L7,this,7)),GI(this.A),!this.A&&(this.A=new fm(L7,this,7)),Sv(this.A,P(t,18));return;case 8:ZO(this,hc(xh(t)));return;case 9:!this.a&&(this.a=new F(j7,this,9,5)),GI(this.a),!this.a&&(this.a=new F(j7,this,9,5)),Sv(this.a,P(t,18));return}Rk(this,e-xv((OL(),U7)),gw((n=P(jE(this,16),29),n||U7),e),t)},Q.fi=function(){return OL(),U7},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),ZT(this,null);return;case 2:iO(this,null),Zw(this,this.D);return;case 5:eL(this,null);return;case 7:!this.A&&(this.A=new fm(L7,this,7)),GI(this.A);return;case 8:ZO(this,!0);return;case 9:!this.a&&(this.a=new F(j7,this,9,5)),GI(this.a);return}KO(this,e-xv((OL(),U7)),gw((t=P(jE(this,16),29),t||U7),e))},Q.mi=function(){var e,t;if(this.a)for(e=0,t=this.a.i;e<t;++e)Ch(H(this.a,e));BO((uN(),l9),this).ve(),this.Bb|=1},Q.gk=function(){return oO(this)},Q.dk=function(e){return e!=null},Q.pl=function(e){},L(OW,`EEnumImpl`,459),q(568,439,{109:1,94:1,93:1,2004:1,684:1,158:1,197:1,57:1,114:1,52:1,100:1,568:1,161:1,117:1,118:1},afe),Q.ve=function(){return this.zb},Q.xh=function(e){return A0e(this,e)},Q.Ih=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return G(this.d);case 3:return this.b?this.b:this.a;case 4:return i=this.c,i??this.zb;case 5:return this.Db>>16==5?P(this.Cb,675):null}return SC(this,e-xv((OL(),W7)),gw((r=P(jE(this,16),29),r||W7),e),t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 5:return this.Cb&&(n=(i=this.Db>>16,i>=0?A0e(this,n):this.Cb.Qh(this,-1-i,null,n))),tI(this,e,5,n)}return a=P(gw((r=P(jE(this,16),29),r||(OL(),W7)),t),69),a.uk().xk(this,DA(this),t-xv((OL(),W7)),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 5:return tI(this,null,5,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),W7)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),W7)),e,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.d!=0;case 3:return!!this.b;case 4:return this.c!=null;case 5:return!!(this.Db>>16==5&&P(this.Cb,675))}return Ux(this,e-xv((OL(),W7)),gw((t=P(jE(this,16),29),t||W7),e))},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:ZT(this,Sh(t));return;case 2:Jw(this,P(t,15).a);return;case 3:K7e(this,P(t,2004));return;case 4:ST(this,Sh(t));return}Rk(this,e-xv((OL(),W7)),gw((n=P(jE(this,16),29),n||W7),e),t)},Q.fi=function(){return OL(),W7},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:ZT(this,null);return;case 2:Jw(this,0);return;case 3:K7e(this,null);return;case 4:ST(this,null);return}KO(this,e-xv((OL(),W7)),gw((t=P(jE(this,16),29),t||W7),e))},Q.Ib=function(){return this.c??this.zb},Q.b=null,Q.c=null,Q.d=0,L(OW,`EEnumLiteralImpl`,568);var ZBt=Jg(OW,`EFactoryImpl/InternalEDateTimeFormat`);q(485,1,{2079:1},Go),L(OW,`EFactoryImpl/1ClientInternalEDateTimeFormat`,485),q(248,118,{109:1,94:1,93:1,87:1,57:1,114:1,52:1,100:1,248:1,117:1,118:1},ts),Q.zh=function(e,t,n){var r;return n=tI(this,e,t,n),this.e&&j(e,179)&&(r=CP(this,this.e),r!=this.c&&(n=tL(this,r,n))),n},Q.Ih=function(e,t,n){var r;switch(e){case 0:return this.f;case 1:return!this.d&&(this.d=new um(M7,this,1)),this.d;case 2:return t?aI(this):this.c;case 3:return this.b;case 4:return this.e;case 5:return t?Tj(this):this.a}return SC(this,e-xv((OL(),K7)),gw((r=P(jE(this,16),29),r||K7),e),t,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return BJe(this,null,n);case 1:return!this.d&&(this.d=new um(M7,this,1)),ij(this.d,e,n);case 3:return zJe(this,null,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),K7)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),K7)),e,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.f;case 1:return!!this.d&&this.d.i!=0;case 2:return!!this.c;case 3:return!!this.b;case 4:return!!this.e;case 5:return!!this.a}return Ux(this,e-xv((OL(),K7)),gw((t=P(jE(this,16),29),t||K7),e))},Q.$h=function(e,t){var n;switch(e){case 0:_4e(this,P(t,87));return;case 1:!this.d&&(this.d=new um(M7,this,1)),GI(this.d),!this.d&&(this.d=new um(M7,this,1)),Sv(this.d,P(t,18));return;case 3:g4e(this,P(t,87));return;case 4:l6e(this,P(t,835));return;case 5:Nw(this,P(t,143));return}Rk(this,e-xv((OL(),K7)),gw((n=P(jE(this,16),29),n||K7),e),t)},Q.fi=function(){return OL(),K7},Q.hi=function(e){var t;switch(e){case 0:_4e(this,null);return;case 1:!this.d&&(this.d=new um(M7,this,1)),GI(this.d);return;case 3:g4e(this,null);return;case 4:l6e(this,null);return;case 5:Nw(this,null);return}KO(this,e-xv((OL(),K7)),gw((t=P(jE(this,16),29),t||K7),e))},Q.Ib=function(){var e=new jm(pP(this));return e.a+=` (expression: `,II(this,e),e.a+=`)`,e.a};var QBt;L(OW,`EGenericTypeImpl`,248),q(2032,2027,tK),Q.Ei=function(e,t){aCe(this,e,t)},Q.Uk=function(e,t){return aCe(this,this.gc(),e),t},Q.Yi=function(e){return rj(this.nj(),e)},Q.Gi=function(){return this.Hi()},Q.nj=function(){return new Gde(this)},Q.Hi=function(){return this.Ii(0)},Q.Ii=function(e){return this.nj().dd(e)},Q.Vk=function(e,t){return Qk(this,e,!0),t},Q.Ri=function(e,t){var n,r=Qj(this,t);return n=this.dd(e),n.Rb(r),r},Q.Si=function(e,t){var n;Qk(this,t,!0),n=this.dd(e),n.Rb(t)},L(LG,`AbstractSequentialInternalEList`,2032),q(482,2032,tK,Xm),Q.Yi=function(e){return rj(this.nj(),e)},Q.Gi=function(){return this.b==null?(bu(),bu(),a9):this.ql()},Q.nj=function(){return new oye(this.a,this.b)},Q.Hi=function(){return this.b==null?(bu(),bu(),a9):this.ql()},Q.Ii=function(e){var t,n;if(this.b==null){if(e<0||e>1)throw E(new oc(NG+e+`, size=0`));return bu(),bu(),a9}for(n=this.ql(),t=0;t<e;++t)ME(n);return n},Q.dc=function(){var e,t,n,r,i,a;if(this.b!=null){for(n=0;n<this.b.length;++n)if(e=this.b[n],!this.tl()||this.a.Uh(e)){if(a=this.a.Kh(e,!1),Su(),P(e,69).vk()){for(t=P(a,163),r=0,i=t.gc();r<i;++r)if(lje(t.Rl(r))&&t.Sl(r)!=null)return!1}else if(e.Hk()){if(!P(a,18).dc())return!1}else if(a!=null)return!1}}return!0},Q.Jc=function(){return PT(this)},Q.dd=function(e){var t,n;if(this.b==null){if(e!=0)throw E(new oc(NG+e+`, size=0`));return bu(),bu(),a9}for(n=this.sl()?this.rl():this.ql(),t=0;t<e;++t)ME(n);return n},Q.Ri=function(e,t){throw E(new ps)},Q.Si=function(e,t){throw E(new ps)},Q.ql=function(){return new Zm(this.a,this.b)},Q.rl=function(){return new mSe(this.a,this.b)},Q.sl=function(){return!0},Q.gc=function(){var e,t,n,r,i=0,a,o;if(this.b!=null){for(n=0;n<this.b.length;++n)if(e=this.b[n],!this.tl()||this.a.Uh(e)){if(o=this.a.Kh(e,!1),Su(),P(e,69).vk())for(t=P(o,163),r=0,a=t.gc();r<a;++r)lje(t.Rl(r))&&t.Sl(r)!=null&&++i;else e.Hk()?i+=P(o,18).gc():o!=null&&++i}}return i},Q.tl=function(){return!0};var i9;L(LG,`EContentsEList`,482),q(1147,482,tK,pSe),Q.ql=function(){return new hSe(this.a,this.b)},Q.rl=function(){return new gSe(this.a,this.b)},Q.tl=function(){return!1},L(OW,`ENamedElementImpl/1`,1147),q(287,1,nK,Zm),Q.Nb=function(e){ev(this,e)},Q.Rb=function(e){throw E(new ps)},Q.ul=function(e){if(this.g!=0||this.e)throw E(new pc(`Iterator already in use or already filtered`));this.e=e},Q.Ob=function(){var e,t,n,r,i,a;switch(this.g){case 3:case 2:return!0;case 1:return!1;case-3:this.p?this.p.Pb():++this.n;default:if(!this.k||(this.p?!I8e(this,this.p):!X7e(this))){for(;this.d<this.c.length;)if(t=this.c[this.d++],(!this.e||t.nk()!=z5||t.Jj()!=0)&&(!this.tl()||this.b.Uh(t))){if(a=this.b.Kh(t,this.sl()),this.f=(Su(),P(t,69).vk()),this.f||t.Hk()){if(this.sl()?(r=P(a,16),this.k=r):(r=P(a,72),this.k=this.j=r),j(this.k,59)?(this.p=null,this.o=this.k.gc(),this.n=0):this.p=this.j?this.j.Hi():this.k.cd(),this.p?I8e(this,this.p):X7e(this))return i=this.p?this.p.Pb():this.j?this.j.Yi(this.n++):this.k.Xb(this.n++),this.f?(e=P(i,75),e.Jk(),n=e.kd(),this.i=n):(n=i,this.i=n),this.g=3,!0}else if(a!=null)return this.k=null,this.p=null,n=a,this.i=n,this.g=2,!0}return this.k=null,this.p=null,this.f=!1,this.g=1,!1}return i=this.p?this.p.Pb():this.j?this.j.Yi(this.n++):this.k.Xb(this.n++),this.f?(e=P(i,75),e.Jk(),n=e.kd(),this.i=n):(n=i,this.i=n),this.g=3,!0}},Q.Sb=function(){var e,t,n,r,i,a;switch(this.g){case-3:case-2:return!0;case-1:return!1;case 3:this.p?this.p.Ub():--this.n;default:if(!this.k||(this.p?!L8e(this,this.p):!b5e(this))){for(;this.d>0;)if(t=this.c[--this.d],(!this.e||t.nk()!=z5||t.Jj()!=0)&&(!this.tl()||this.b.Uh(t))){if(a=this.b.Kh(t,this.sl()),this.f=(Su(),P(t,69).vk()),this.f||t.Hk()){if(this.sl()?(r=P(a,16),this.k=r):(r=P(a,72),this.k=this.j=r),j(this.k,59)?(this.o=this.k.gc(),this.n=this.o):this.p=this.j?this.j.Ii(this.k.gc()):this.k.dd(this.k.gc()),this.p?L8e(this,this.p):b5e(this))return i=this.p?this.p.Ub():this.j?this.j.Yi(--this.n):this.k.Xb(--this.n),this.f?(e=P(i,75),e.Jk(),n=e.kd(),this.i=n):(n=i,this.i=n),this.g=-3,!0}else if(a!=null)return this.k=null,this.p=null,n=a,this.i=n,this.g=-2,!0}return this.k=null,this.p=null,this.g=-1,!1}return i=this.p?this.p.Ub():this.j?this.j.Yi(--this.n):this.k.Xb(--this.n),this.f?(e=P(i,75),e.Jk(),n=e.kd(),this.i=n):(n=i,this.i=n),this.g=-3,!0}},Q.Pb=function(){return ME(this)},Q.Tb=function(){return this.a},Q.Ub=function(){var e;if(this.g<-1||this.Sb())return--this.a,this.g=0,e=this.i,this.Sb(),e;throw E(new ms)},Q.Vb=function(){return this.a-1},Q.Qb=function(){throw E(new ps)},Q.sl=function(){return!1},Q.Wb=function(e){throw E(new ps)},Q.tl=function(){return!0},Q.a=0,Q.d=0,Q.f=!1,Q.g=0,Q.n=0,Q.o=0;var a9;L(LG,`EContentsEList/FeatureIteratorImpl`,287),q(700,287,nK,mSe),Q.sl=function(){return!0},L(LG,`EContentsEList/ResolvingFeatureIteratorImpl`,700),q(1148,700,nK,gSe),Q.tl=function(){return!1},L(OW,`ENamedElementImpl/1/1`,1148),q(1149,287,nK,hSe),Q.tl=function(){return!1},L(OW,`ENamedElementImpl/1/2`,1149),q(39,151,MG,sS,cS,U_,mC,KC,DS,qUe,cIe,JUe,lIe,fze,uIe,ZUe,dIe,dze,fIe,YUe,pIe,W_,hC,Vy,XUe,mIe,uze,sIe),Q.Ij=function(){return eVe(this)},Q.Pj=function(){var e=eVe(this);return e?e.gk():null},Q.fj=function(e){return this.b==-1&&this.a&&(this.b=this.c.Eh(this.a.Jj(),this.a.nk())),this.c.vh(this.b,e)},Q.hj=function(){return this.c},Q.Qj=function(){var e=eVe(this);return e?e.rk():!1},Q.b=-1,L(OW,`ENotificationImpl`,39),q(403,293,{109:1,94:1,93:1,158:1,197:1,57:1,62:1,114:1,470:1,52:1,100:1,161:1,403:1,293:1,117:1,118:1},zs),Q.xh=function(e){return J0e(this,e)},Q.Ih=function(e,t,n){var r,i,a;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Lm(),!!(this.Bb&256);case 3:return Lm(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return Lm(),a=this.t,a>1||a==-1;case 7:return Lm(),i=this.s,i>=1;case 8:return t?rM(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?P(this.Cb,29):null;case 11:return!this.d&&(this.d=new fm(L7,this,11)),this.d;case 12:return!this.c&&(this.c=new F(F7,this,12,10)),this.c;case 13:return!this.a&&(this.a=new kh(this,this)),this.a;case 14:return HC(this)}return SC(this,e-xv((OL(),Y7)),gw((r=P(jE(this,16),29),r||Y7),e),t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16,i>=0?J0e(this,n):this.Cb.Qh(this,-1-i,null,n))),tI(this,e,10,n);case 12:return!this.c&&(this.c=new F(F7,this,12,10)),oA(this.c,e,n)}return a=P(gw((r=P(jE(this,16),29),r||(OL(),Y7)),t),69),a.uk().xk(this,DA(this),t-xv((OL(),Y7)),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 9:return Cv(this,n);case 10:return tI(this,null,10,n);case 11:return!this.d&&(this.d=new fm(L7,this,11)),ij(this.d,e,n);case 12:return!this.c&&(this.c=new F(F7,this,12,10)),ij(this.c,e,n);case 14:return ij(HC(this),e,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),Y7)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),Y7)),e,n)},Q.Th=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&zv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&zv(this.q).i==0);case 10:return!!(this.Db>>16==10&&P(this.Cb,29));case 11:return!!this.d&&this.d.i!=0;case 12:return!!this.c&&this.c.i!=0;case 13:return!!this.a&&HC(this.a.a).i!=0&&!(this.b&&Cj(this.b));case 14:return!!this.b&&Cj(this.b)}return Ux(this,e-xv((OL(),Y7)),gw((t=P(jE(this,16),29),t||Y7),e))},Q.$h=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:ZT(this,Sh(t));return;case 2:qO(this,hc(xh(t)));return;case 3:JO(this,hc(xh(t)));return;case 4:Yw(this,P(t,15).a);return;case 5:Xw(this,P(t,15).a);return;case 8:mO(this,P(t,143));return;case 9:r=FM(this,P(t,87),null),r&&r.mj();return;case 11:!this.d&&(this.d=new fm(L7,this,11)),GI(this.d),!this.d&&(this.d=new fm(L7,this,11)),Sv(this.d,P(t,18));return;case 12:!this.c&&(this.c=new F(F7,this,12,10)),GI(this.c),!this.c&&(this.c=new F(F7,this,12,10)),Sv(this.c,P(t,18));return;case 13:!this.a&&(this.a=new kh(this,this)),KI(this.a),!this.a&&(this.a=new kh(this,this)),Sv(this.a,P(t,18));return;case 14:GI(HC(this)),Sv(HC(this),P(t,18));return}Rk(this,e-xv((OL(),Y7)),gw((n=P(jE(this,16),29),n||Y7),e),t)},Q.fi=function(){return OL(),Y7},Q.hi=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:ZT(this,null);return;case 2:qO(this,!0);return;case 3:JO(this,!0);return;case 4:Yw(this,0);return;case 5:Xw(this,1);return;case 8:mO(this,null);return;case 9:n=FM(this,null,null),n&&n.mj();return;case 11:!this.d&&(this.d=new fm(L7,this,11)),GI(this.d);return;case 12:!this.c&&(this.c=new F(F7,this,12,10)),GI(this.c);return;case 13:this.a&&KI(this.a);return;case 14:this.b&&GI(this.b);return}KO(this,e-xv((OL(),Y7)),gw((t=P(jE(this,16),29),t||Y7),e))},Q.mi=function(){var e,t;if(this.c)for(e=0,t=this.c.i;e<t;++e)Ch(H(this.c,e));rM(this),this.Bb|=1},L(OW,`EOperationImpl`,403),q(500,744,eK,kh),Q.oj=function(e,t){bSe(this,e,P(t,143))},Q.pj=function(e){Xye(this,P(e,143))},Q.vj=function(e){return P(H(HC(this.a),e),87).c||(OL(),q7)},Q.Aj=function(e){return P(eF(HC(this.a),e),87).c||(OL(),q7)},Q.Bj=function(e,t){return iQe(this,e,P(t,143))},Q.Ji=function(){return!1},Q.Gj=function(e,t,n,r,i){return null},Q.qj=function(){return new Bde(this)},Q.rj=function(){GI(HC(this.a))},Q.sj=function(e){return SYe(this,e)},Q.tj=function(e){for(var t,n=e.Jc();n.Ob();)if(t=n.Pb(),!SYe(this,t))return!1;return!0},Q.uj=function(e){var t,n,r;if(j(e,16)&&(r=P(e,16),r.gc()==HC(this.a).i)){for(t=r.Jc(),n=new gm(this);t.Ob();)if(A(t.Pb())!==A(JA(n)))return!1;return!0}return!1},Q.wj=function(){var e,t,n=1,r,i;for(t=new gm(HC(this.a));t.e!=t.i.gc();)e=P(JA(t),87),r=(i=e.c,i||(OL(),q7)),n=31*n+(r?YT(r):0);return n},Q.xj=function(e){var t,n,r=0,i;for(n=new gm(HC(this.a));n.e!=n.i.gc();){if(t=P(JA(n),87),A(e)===A((i=t.c,i||(OL(),q7))))return r;++r}return-1},Q.yj=function(){return HC(this.a).i==0},Q.zj=function(){return null},Q.Cj=function(){return HC(this.a).i},Q.Dj=function(){var e,t,n,r,i,a=HC(this.a).i;for(i=V(aq,BL,1,a,5,1),n=0,t=new gm(HC(this.a));t.e!=t.i.gc();)e=P(JA(t),87),i[n++]=(r=e.c,r||(OL(),q7));return i},Q.Ej=function(e){var t,n,r,i,a,o,s=HC(this.a).i;for(e.length<s&&(i=Qw(GD(e).c,s),e=i),e.length>s&&Mv(e,s,null),r=0,n=new gm(HC(this.a));n.e!=n.i.gc();)t=P(JA(n),87),a=(o=t.c,o||(OL(),q7)),Mv(e,r++,a);return e},Q.Fj=function(){var e,t,n,r,i=new Nc;for(i.a+=`[`,e=HC(this.a),t=0,r=HC(this.a).i;t<r;)Uf(i,km((n=P(H(e,t),87).c,n||(OL(),q7)))),++t<r&&(i.a+=zL);return i.a+=`]`,i.a},Q.Hj=function(e){},Q.Jj=function(){return 13},Q.il=function(){return!0},Q.Kj=function(){return!1},Q.jl=function(){return!1},Q.kl=function(){return!1},Q.ll=function(){return!0},Q.$k=function(){return!1},Q.ml=function(){return!0},Q.dk=function(e){return j(e,143)},Q.Oj=function(){return SIe(this.a)},Q.Qi=function(){return!0},Q.Wi=function(){return!0},L(OW,`EOperationImpl/1`,500),q(1331,2027,xR,Bde),Q.dd=function(e){return cT(this.a,e)},Q.gc=function(){return HC(this.a.a).i},L(OW,`EOperationImpl/1/1`,1331),q(1332,544,XG,lke),Q.Ri=function(e,t){var n=P(dk(this,e,t),87),r;return fp(this.e)&&vs(this,new hC(this.a,7,(OL(),GBt),G(t),(r=n.c,r||q7),e)),n},Q.Sj=function(e,t){return sYe(this,P(e,87),t)},Q.Tj=function(e,t){return oYe(this,P(e,87),t)},Q.Uj=function(e,t,n){return MQe(this,P(e,87),P(t,87),n)},Q.Gj=function(e,t,n,r,i){switch(e){case 3:return zb(this,e,t,n,r,this.i>1);case 5:return zb(this,e,t,n,r,this.i-P(n,16).gc()>0);default:return new KC(this.e,e,this.c,t,n,r,!0)}},Q.Rj=function(){return!0},Q.Oj=function(){return Cj(this)},Q.Ek=function(){GI(this)},L(OW,`EOperationImpl/2`,1332),q(493,1,{2002:1,493:1},jve),L(OW,`EPackageImpl/1`,493),q(14,81,XG,F),Q.gl=function(){return this.d},Q.hl=function(){return this.b},Q.kl=function(){return!0},Q.b=0,L(LG,`EObjectContainmentWithInverseEList`,14),q(361,14,XG,Gh),Q.ll=function(){return!0},Q.Ui=function(e,t){return JN(this,e,P(t,57))},L(LG,`EObjectContainmentWithInverseEList/Resolving`,361),q(313,361,XG,H_),Q.Li=function(){this.a.tb=null},L(OW,`EPackageImpl/2`,313),q(1244,1,{},Rre),L(OW,`EPackageImpl/3`,1244),q(721,44,jz,Bs),Q._b=function(e){return Nf(e)?qy(this,e):!!h_(this.f,e)},L(OW,`EPackageRegistryImpl`,721),q(504,293,{109:1,94:1,93:1,158:1,197:1,57:1,2081:1,114:1,470:1,52:1,100:1,161:1,504:1,293:1,117:1,118:1},Vs),Q.xh=function(e){return Y0e(this,e)},Q.Ih=function(e,t,n){var r,i,a;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Lm(),!!(this.Bb&256);case 3:return Lm(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return Lm(),a=this.t,a>1||a==-1;case 7:return Lm(),i=this.s,i>=1;case 8:return t?rM(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?P(this.Cb,62):null}return SC(this,e-xv((OL(),Z7)),gw((r=P(jE(this,16),29),r||Z7),e),t,n)},Q.Ph=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),oA(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16,i>=0?Y0e(this,n):this.Cb.Qh(this,-1-i,null,n))),tI(this,e,10,n)}return a=P(gw((r=P(jE(this,16),29),r||(OL(),Z7)),t),69),a.uk().xk(this,DA(this),t-xv((OL(),Z7)),e,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 9:return Cv(this,n);case 10:return tI(this,null,10,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),Z7)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),Z7)),e,n)},Q.Th=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&zv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&zv(this.q).i==0);case 10:return!!(this.Db>>16==10&&P(this.Cb,62))}return Ux(this,e-xv((OL(),Z7)),gw((t=P(jE(this,16),29),t||Z7),e))},Q.fi=function(){return OL(),Z7},L(OW,`EParameterImpl`,504),q(103,451,{109:1,94:1,93:1,158:1,197:1,57:1,19:1,179:1,69:1,114:1,470:1,52:1,100:1,161:1,103:1,451:1,293:1,117:1,118:1,682:1},ISe),Q.Ih=function(e,t,n){var r,i,a,o;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Lm(),!!(this.Bb&256);case 3:return Lm(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return Lm(),o=this.t,o>1||o==-1;case 7:return Lm(),i=this.s,i>=1;case 8:return t?rM(this):this.r;case 9:return this.q;case 10:return Lm(),(this.Bb&IG)!=0;case 11:return Lm(),(this.Bb&kW)!=0;case 12:return Lm(),(this.Bb&yz)!=0;case 13:return this.j;case 14:return OP(this);case 15:return Lm(),(this.Bb&BG)!=0;case 16:return Lm(),(this.Bb&rR)!=0;case 17:return Mb(this);case 18:return Lm(),(this.Bb&DW)!=0;case 19:return Lm(),a=vj(this),!!(a&&(a.Bb&DW)!=0);case 20:return Lm(),(this.Bb&xz)!=0;case 21:return t?vj(this):this.b;case 22:return t?dqe(this):sze(this);case 23:return!this.a&&(this.a=new mm(E7,this,23)),this.a}return SC(this,e-xv((OL(),Q7)),gw((r=P(jE(this,16),29),r||Q7),e),t,n)},Q.Th=function(e){var t,n,r,i;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return i=this.t,i>1||i==-1;case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&zv(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&zv(this.q).i==0);case 10:return(this.Bb&IG)==0;case 11:return(this.Bb&kW)!=0;case 12:return(this.Bb&yz)!=0;case 13:return this.j!=null;case 14:return OP(this)!=null;case 15:return(this.Bb&BG)!=0;case 16:return(this.Bb&rR)!=0;case 17:return!!Mb(this);case 18:return(this.Bb&DW)!=0;case 19:return r=vj(this),!!r&&(r.Bb&DW)!=0;case 20:return(this.Bb&xz)==0;case 21:return!!this.b;case 22:return!!sze(this);case 23:return!!this.a&&this.a.i!=0}return Ux(this,e-xv((OL(),Q7)),gw((t=P(jE(this,16),29),t||Q7),e))},Q.$h=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:Yb(this,Sh(t));return;case 2:qO(this,hc(xh(t)));return;case 3:JO(this,hc(xh(t)));return;case 4:Yw(this,P(t,15).a);return;case 5:Xw(this,P(t,15).a);return;case 8:mO(this,P(t,143));return;case 9:r=FM(this,P(t,87),null),r&&r.mj();return;case 10:mk(this,hc(xh(t)));return;case 11:gk(this,hc(xh(t)));return;case 12:hk(this,hc(xh(t)));return;case 13:Fve(this,Sh(t));return;case 15:pk(this,hc(xh(t)));return;case 16:jk(this,hc(xh(t)));return;case 18:RPe(this,hc(xh(t)));return;case 20:eXe(this,hc(xh(t)));return;case 21:zT(this,P(t,19));return;case 23:!this.a&&(this.a=new mm(E7,this,23)),GI(this.a),!this.a&&(this.a=new mm(E7,this,23)),Sv(this.a,P(t,18));return}Rk(this,e-xv((OL(),Q7)),gw((n=P(jE(this,16),29),n||Q7),e),t)},Q.fi=function(){return OL(),Q7},Q.hi=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:j(this.Cb,88)&&xN(TS(P(this.Cb,88)),4),ZT(this,null);return;case 2:qO(this,!0);return;case 3:JO(this,!0);return;case 4:Yw(this,0);return;case 5:Xw(this,1);return;case 8:mO(this,null);return;case 9:n=FM(this,null,null),n&&n.mj();return;case 10:mk(this,!0);return;case 11:gk(this,!1);return;case 12:hk(this,!1);return;case 13:this.i=null,NT(this,null);return;case 15:pk(this,!1);return;case 16:jk(this,!1);return;case 18:$Ye(this,!1),j(this.Cb,88)&&xN(TS(P(this.Cb,88)),2);return;case 20:eXe(this,!0);return;case 21:zT(this,null);return;case 23:!this.a&&(this.a=new mm(E7,this,23)),GI(this.a);return}KO(this,e-xv((OL(),Q7)),gw((t=P(jE(this,16),29),t||Q7),e))},Q.mi=function(){dqe(this),py(BC((uN(),l9),this)),rM(this),this.Bb|=1},Q.sk=function(){return vj(this)},Q.Zk=function(){var e=vj(this);return!!e&&(e.Bb&DW)!=0},Q.$k=function(){return(this.Bb&DW)!=0},Q._k=function(){return(this.Bb&xz)!=0},Q.Wk=function(e,t){return this.c=null,zO(this,e,t)},Q.Ib=function(){var e;return this.Db&64?vF(this):(e=new Am(vF(this)),e.a+=` (containment: `,dl(e,(this.Bb&DW)!=0),e.a+=`, resolveProxies: `,dl(e,(this.Bb&xz)!=0),e.a+=`)`,e.a)},L(OW,`EReferenceImpl`,103),q(550,118,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1,550:1,117:1,118:1},zre),Q.Fb=function(e){return this===e},Q.jd=function(){return this.b},Q.kd=function(){return this.c},Q.Hb=function(){return Hm(this)},Q.Ai=function(e){TOe(this,Sh(e))},Q.ld=function(e){return WDe(this,Sh(e))},Q.Ih=function(e,t,n){var r;switch(e){case 0:return this.b;case 1:return this.c}return SC(this,e-xv((OL(),$7)),gw((r=P(jE(this,16),29),r||$7),e),t,n)},Q.Th=function(e){var t;switch(e){case 0:return this.b!=null;case 1:return this.c!=null}return Ux(this,e-xv((OL(),$7)),gw((t=P(jE(this,16),29),t||$7),e))},Q.$h=function(e,t){var n;switch(e){case 0:EOe(this,Sh(t));return;case 1:CT(this,Sh(t));return}Rk(this,e-xv((OL(),$7)),gw((n=P(jE(this,16),29),n||$7),e),t)},Q.fi=function(){return OL(),$7},Q.hi=function(e){var t;switch(e){case 0:jT(this,null);return;case 1:CT(this,null);return}KO(this,e-xv((OL(),$7)),gw((t=P(jE(this,16),29),t||$7),e))},Q.yi=function(){var e;return this.a==-1&&(e=this.b,this.a=e==null?0:MD(e)),this.a},Q.zi=function(e){this.a=e},Q.Ib=function(){var e;return this.Db&64?pP(this):(e=new Am(pP(this)),e.a+=` (key: `,Uf(e,this.b),e.a+=`, value: `,Uf(e,this.c),e.a+=`)`,e.a)},Q.a=-1,Q.b=null,Q.c=null;var o9=L(OW,`EStringToStringMapEntryImpl`,550),$Bt=Jg(LG,`FeatureMap/Entry/Internal`);q(562,1,rK),Q.vl=function(e){return this.wl(P(e,52))},Q.wl=function(e){return this.vl(e)},Q.Fb=function(e){var t,n;return this===e?!0:j(e,75)?(t=P(e,75),t.Jk()==this.c&&(n=this.kd(),n==null?t.kd()==null:UO(n,t.kd()))):!1},Q.Jk=function(){return this.c},Q.Hb=function(){var e=this.kd();return YT(this.c)^(e==null?0:YT(e))},Q.Ib=function(){var e=this.c,t=Pw(e.ok()).vi();return e.ve(),(t!=null&&t.length!=0?t+`:`+e.ve():e.ve())+`=`+this.kd()},L(OW,`EStructuralFeatureImpl/BasicFeatureMapEntry`,562),q(778,562,rK,TCe),Q.wl=function(e){return new TCe(this.c,e)},Q.kd=function(){return this.a},Q.xl=function(e,t,n){return EGe(this,e,this.a,t,n)},Q.yl=function(e,t,n){return DGe(this,e,this.a,t,n)},L(OW,`EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry`,778),q(1305,1,{},Mve),Q.wk=function(e,t,n,r,i){return P(vC(e,this.b),219).Wl(this.a).Dk(r)},Q.xk=function(e,t,n,r,i){return P(vC(e,this.b),219).Nl(this.a,r,i)},Q.yk=function(e,t,n,r,i){return P(vC(e,this.b),219).Ol(this.a,r,i)},Q.zk=function(e,t,n){return P(vC(e,this.b),219).Wl(this.a).Oj()},Q.Ak=function(e,t,n,r){P(vC(e,this.b),219).Wl(this.a).Wb(r)},Q.Bk=function(e,t,n){return P(vC(e,this.b),219).Wl(this.a)},Q.Ck=function(e,t,n){P(vC(e,this.b),219).Wl(this.a).Ek()},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator`,1305),q(89,1,{},_g,My,Qy,aS),Q.wk=function(e,t,n,r,i){var a=t.ii(n);if(a??t.ji(n,a=CL(this,e)),!i)switch(this.e){case 50:case 41:return P(a,587)._j();case 40:return P(a,219).Tl()}return a},Q.xk=function(e,t,n,r,i){var a,o=t.ii(n);return o??t.ji(n,o=CL(this,e)),a=P(o,72).Uk(r,i),a},Q.yk=function(e,t,n,r,i){var a=t.ii(n);return a!=null&&(i=P(a,72).Vk(r,i)),i},Q.zk=function(e,t,n){var r=t.ii(n);return r!=null&&P(r,78).Oj()},Q.Ak=function(e,t,n,r){var i=P(t.ii(n),78);!i&&t.ji(n,i=CL(this,e)),i.Wb(r)},Q.Bk=function(e,t,n){var r,i=t.ii(n);return i??t.ji(n,i=CL(this,e)),j(i,78)?P(i,78):(r=P(t.ii(n),16),new Vde(r))},Q.Ck=function(e,t,n){var r=P(t.ii(n),78);!r&&t.ji(n,r=CL(this,e)),r.Ek()},Q.b=0,Q.e=0,L(OW,`EStructuralFeatureImpl/InternalSettingDelegateMany`,89),q(499,1,{}),Q.xk=function(e,t,n,r,i){throw E(new ps)},Q.yk=function(e,t,n,r,i){throw E(new ps)},Q.Bk=function(e,t,n){return new fMe(this,e,t,n)};var s9;L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingle`,499),q(1322,1,RG,fMe),Q.Dk=function(e){return this.a.wk(this.c,this.d,this.b,e,!0)},Q.Oj=function(){return this.a.zk(this.c,this.d,this.b)},Q.Wb=function(e){this.a.Ak(this.c,this.d,this.b,e)},Q.Ek=function(){this.a.Ck(this.c,this.d,this.b)},Q.b=0,L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingle/1`,1322),q(771,499,{},BNe),Q.wk=function(e,t,n,r,i){return FF(e,e.Mh(),e.Ch())==this.b?this._k()&&r?QN(e):e.Mh():null},Q.xk=function(e,t,n,r,i){var a,o;return e.Mh()&&(i=(a=e.Ch(),a>=0?e.xh(i):e.Mh().Qh(e,-1-a,null,i))),o=$k(e.Ah(),this.e),e.zh(r,o,i)},Q.yk=function(e,t,n,r,i){var a=$k(e.Ah(),this.e);return e.zh(null,a,i)},Q.zk=function(e,t,n){var r=$k(e.Ah(),this.e);return!!e.Mh()&&e.Ch()==r},Q.Ak=function(e,t,n,r){var i,a,o,s,c;if(r!=null&&!oI(this.a,r))throw E(new dc(iK+(j(r,57)?f4e(P(r,57).Ah()):OUe(GD(r)))+aK+this.a+`'`));if(i=e.Mh(),o=$k(e.Ah(),this.e),A(r)!==A(i)||e.Ch()!=o&&r!=null){if(tM(e,P(r,57)))throw E(new fc(jW+e.Ib()));c=null,i&&(c=(a=e.Ch(),a>=0?e.xh(c):e.Mh().Qh(e,-1-a,null,c))),s=P(r,52),s&&(c=s.Oh(e,$k(s.Ah(),this.b),null,c)),c=e.zh(s,o,c),c&&c.mj()}else e.sh()&&e.th()&&CE(e,new U_(e,1,o,r,r))},Q.Ck=function(e,t,n){var r=e.Mh(),i,a,o;r?(o=(i=e.Ch(),i>=0?e.xh(null):e.Mh().Qh(e,-1-i,null,null)),a=$k(e.Ah(),this.e),o=e.zh(null,a,o),o&&o.mj()):e.sh()&&e.th()&&CE(e,new W_(e,1,this.e,null,null))},Q._k=function(){return!1},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleContainer`,771),q(1306,771,{},$Ee),Q._k=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving`,1306),q(560,499,{}),Q.wk=function(e,t,n,r,i){var a=t.ii(n);return a==null?this.b:A(a)===A(s9)?null:a},Q.zk=function(e,t,n){var r=t.ii(n);return r!=null&&(A(r)===A(s9)||!UO(r,this.b))},Q.Ak=function(e,t,n,r){var i,a;e.sh()&&e.th()?(i=(a=t.ii(n),a==null?this.b:A(a)===A(s9)?null:a),r==null?this.c==null?this.b==null?t.ji(n,null):t.ji(n,s9):(t.ji(n,null),r=this.b):(this.zl(r),t.ji(n,r)),CE(e,this.d.Al(e,1,this.e,i,r))):r==null?this.c==null?this.b==null?t.ji(n,null):t.ji(n,s9):t.ji(n,null):(this.zl(r),t.ji(n,r))},Q.Ck=function(e,t,n){var r,i;e.sh()&&e.th()?(r=(i=t.ii(n),i==null?this.b:A(i)===A(s9)?null:i),t.ki(n),CE(e,this.d.Al(e,1,this.e,r,this.b))):t.ki(n)},Q.zl=function(e){throw E(new gfe)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData`,560),q(oK,1,{},Bre),Q.Al=function(e,t,n,r,i){return new W_(e,t,n,r,i)},Q.Bl=function(e,t,n,r,i,a){return new Vy(e,t,n,r,i,a)};var eVt,tVt,nVt,rVt,iVt,aVt,oVt,c9,sVt;L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator`,oK),q(1323,oK,{},Vre),Q.Al=function(e,t,n,r,i){return new uze(e,t,n,hc(xh(r)),hc(xh(i)))},Q.Bl=function(e,t,n,r,i,a){return new sIe(e,t,n,hc(xh(r)),hc(xh(i)),a)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1`,1323),q(1324,oK,{},Hre),Q.Al=function(e,t,n,r,i){return new qUe(e,t,n,P(r,221).a,P(i,221).a)},Q.Bl=function(e,t,n,r,i,a){return new cIe(e,t,n,P(r,221).a,P(i,221).a,a)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2`,1324),q(1325,oK,{},Ure),Q.Al=function(e,t,n,r,i){return new JUe(e,t,n,P(r,180).a,P(i,180).a)},Q.Bl=function(e,t,n,r,i,a){return new lIe(e,t,n,P(r,180).a,P(i,180).a,a)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3`,1325),q(1326,oK,{},Wre),Q.Al=function(e,t,n,r,i){return new fze(e,t,n,D(N(r)),D(N(i)))},Q.Bl=function(e,t,n,r,i,a){return new uIe(e,t,n,D(N(r)),D(N(i)),a)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4`,1326),q(1327,oK,{},Gre),Q.Al=function(e,t,n,r,i){return new ZUe(e,t,n,P(r,164).a,P(i,164).a)},Q.Bl=function(e,t,n,r,i,a){return new dIe(e,t,n,P(r,164).a,P(i,164).a,a)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5`,1327),q(1328,oK,{},Kre),Q.Al=function(e,t,n,r,i){return new dze(e,t,n,P(r,15).a,P(i,15).a)},Q.Bl=function(e,t,n,r,i,a){return new fIe(e,t,n,P(r,15).a,P(i,15).a,a)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6`,1328),q(1329,oK,{},qre),Q.Al=function(e,t,n,r,i){return new YUe(e,t,n,P(r,190).a,P(i,190).a)},Q.Bl=function(e,t,n,r,i,a){return new pIe(e,t,n,P(r,190).a,P(i,190).a,a)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7`,1329),q(1330,oK,{},Jre),Q.Al=function(e,t,n,r,i){return new XUe(e,t,n,P(r,191).a,P(i,191).a)},Q.Bl=function(e,t,n,r,i,a){return new mIe(e,t,n,P(r,191).a,P(i,191).a,a)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8`,1330),q(1308,560,{},gMe),Q.zl=function(e){if(!this.a.dk(e))throw E(new dc(iK+GD(e)+aK+this.a+`'`))},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic`,1308),q(1309,560,{},uke),Q.zl=function(e){},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic`,1309),q(772,560,{}),Q.zk=function(e,t,n){return t.ii(n)!=null},Q.Ak=function(e,t,n,r){var i,a;e.sh()&&e.th()?(i=!0,a=t.ii(n),a==null?(i=!1,a=this.b):A(a)===A(s9)&&(a=null),r==null?this.c==null?t.ji(n,s9):(t.ji(n,null),r=this.b):(this.zl(r),t.ji(n,r)),CE(e,this.d.Bl(e,1,this.e,a,r,!i))):r==null?this.c==null?t.ji(n,s9):t.ji(n,null):(this.zl(r),t.ji(n,r))},Q.Ck=function(e,t,n){var r,i;e.sh()&&e.th()?(r=!0,i=t.ii(n),i==null?(r=!1,i=this.b):A(i)===A(s9)&&(i=null),t.ki(n),CE(e,this.d.Bl(e,2,this.e,i,this.b,r))):t.ki(n)},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable`,772),q(1310,772,{},_Me),Q.zl=function(e){if(!this.a.dk(e))throw E(new dc(iK+GD(e)+aK+this.a+`'`))},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic`,1310),q(1311,772,{},dke),Q.zl=function(e){},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic`,1311),q(402,499,{},a_),Q.wk=function(e,t,n,r,i){var a,o,s,c,l=t.ii(n);if(this.rk()&&A(l)===A(s9))return null;if(this._k()&&r&&l!=null){if(s=P(l,52),s.Sh()&&(c=kO(e,s),s!=c)){if(!oI(this.a,c))throw E(new dc(iK+GD(c)+aK+this.a+`'`));t.ji(n,l=c),this.$k()&&(a=P(c,52),o=s.Qh(e,this.b?$k(s.Ah(),this.b):-1-$k(e.Ah(),this.e),null,null),!a.Mh()&&(o=a.Oh(e,this.b?$k(a.Ah(),this.b):-1-$k(e.Ah(),this.e),null,o)),o&&o.mj()),e.sh()&&e.th()&&CE(e,new W_(e,9,this.e,s,c))}return l}return l},Q.xk=function(e,t,n,r,i){var a,o=t.ii(n);return A(o)===A(s9)&&(o=null),t.ji(n,r),this.Kj()?A(o)!==A(r)&&o!=null&&(a=P(o,52),i=a.Qh(e,$k(a.Ah(),this.b),null,i)):this.$k()&&o!=null&&(i=P(o,52).Qh(e,-1-$k(e.Ah(),this.e),null,i)),e.sh()&&e.th()&&(!i&&(i=new al(4)),i.lj(new W_(e,1,this.e,o,r))),i},Q.yk=function(e,t,n,r,i){var a=t.ii(n);return A(a)===A(s9)&&(a=null),t.ki(n),e.sh()&&e.th()&&(!i&&(i=new al(4)),this.rk()?i.lj(new W_(e,2,this.e,a,null)):i.lj(new W_(e,1,this.e,a,null))),i},Q.zk=function(e,t,n){return t.ii(n)!=null},Q.Ak=function(e,t,n,r){var i,a,o,s,c;if(r!=null&&!oI(this.a,r))throw E(new dc(iK+(j(r,57)?f4e(P(r,57).Ah()):OUe(GD(r)))+aK+this.a+`'`));c=t.ii(n),s=c!=null,this.rk()&&A(c)===A(s9)&&(c=null),o=null,this.Kj()?A(c)!==A(r)&&(c!=null&&(i=P(c,52),o=i.Qh(e,$k(i.Ah(),this.b),null,o)),r!=null&&(i=P(r,52),o=i.Oh(e,$k(i.Ah(),this.b),null,o))):this.$k()&&A(c)!==A(r)&&(c!=null&&(o=P(c,52).Qh(e,-1-$k(e.Ah(),this.e),null,o)),r!=null&&(o=P(r,52).Oh(e,-1-$k(e.Ah(),this.e),null,o))),r==null&&this.rk()?t.ji(n,s9):t.ji(n,r),e.sh()&&e.th()?(a=new Vy(e,1,this.e,c,r,this.rk()&&!s),o?(o.lj(a),o.mj()):CE(e,a)):o&&o.mj()},Q.Ck=function(e,t,n){var r,i,a,o,s=t.ii(n);o=s!=null,this.rk()&&A(s)===A(s9)&&(s=null),a=null,s!=null&&(this.Kj()?(r=P(s,52),a=r.Qh(e,$k(r.Ah(),this.b),null,a)):this.$k()&&(a=P(s,52).Qh(e,-1-$k(e.Ah(),this.e),null,a))),t.ki(n),e.sh()&&e.th()?(i=new Vy(e,this.rk()?2:1,this.e,s,null,o),a?(a.lj(i),a.mj()):CE(e,i)):a&&a.mj()},Q.Kj=function(){return!1},Q.$k=function(){return!1},Q._k=function(){return!1},Q.rk=function(){return!1},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObject`,402),q(561,402,{},vh),Q.$k=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment`,561),q(1314,561,{},wSe),Q._k=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving`,1314),q(774,561,{},TSe),Q.rk=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable`,774),q(1316,774,{},ESe),Q._k=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving`,1316),q(639,561,{},vg),Q.Kj=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse`,639),q(1315,639,{},nDe),Q._k=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving`,1315),q(775,639,{},rDe),Q.rk=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable`,775),q(1317,775,{},iDe),Q._k=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving`,1317),q(640,402,{},SSe),Q._k=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving`,640),q(1318,640,{},DSe),Q.rk=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable`,1318),q(776,640,{},eDe),Q.Kj=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse`,776),q(1319,776,{},aDe),Q.rk=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable`,1319),q(1312,402,{},CSe),Q.rk=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable`,1312),q(773,402,{},tDe),Q.Kj=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse`,773),q(1313,773,{},oDe),Q.rk=function(){return!0},L(OW,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable`,1313),q(777,562,rK,eje),Q.wl=function(e){return new eje(this.a,this.c,e)},Q.kd=function(){return this.b},Q.xl=function(e,t,n){return MBe(this,e,this.b,n)},Q.yl=function(e,t,n){return NBe(this,e,this.b,n)},L(OW,`EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry`,777),q(1320,1,RG,Vde),Q.Dk=function(e){return this.a},Q.Oj=function(){return j(this.a,98)?P(this.a,98).Oj():!this.a.dc()},Q.Wb=function(e){this.a.$b(),this.a.Fc(P(e,16))},Q.Ek=function(){j(this.a,98)?P(this.a,98).Ek():this.a.$b()},L(OW,`EStructuralFeatureImpl/SettingMany`,1320),q(1321,562,rK,fRe),Q.vl=function(e){return new Bh((XI(),k9),this.b.oi(this.a,e))},Q.kd=function(){return null},Q.xl=function(e,t,n){return n},Q.yl=function(e,t,n){return n},L(OW,`EStructuralFeatureImpl/SimpleContentFeatureMapEntry`,1321),q(641,562,rK,Bh),Q.vl=function(e){return new Bh(this.c,e)},Q.kd=function(){return this.a},Q.xl=function(e,t,n){return n},Q.yl=function(e,t,n){return n},L(OW,`EStructuralFeatureImpl/SimpleFeatureMapEntry`,641),q(396,492,mG,Ya),Q.$i=function(e){return V(O7,BL,29,e,0,1)},Q.Wi=function(){return!1},L(OW,`ESuperAdapter/1`,396),q(446,439,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,835:1,52:1,100:1,161:1,446:1,117:1,118:1},Xa),Q.Ih=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return!this.a&&(this.a=new s_(this,M7,this)),this.a}return SC(this,e-xv((OL(),e9)),gw((r=P(jE(this,16),29),r||e9),e),t,n)},Q.Rh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(C7,this,0,3)),ij(this.Ab,e,n);case 2:return!this.a&&(this.a=new s_(this,M7,this)),ij(this.a,e,n)}return i=P(gw((r=P(jE(this,16),29),r||(OL(),e9)),t),69),i.uk().yk(this,DA(this),t-xv((OL(),e9)),e,n)},Q.Th=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!!this.a&&this.a.i!=0}return Ux(this,e-xv((OL(),e9)),gw((t=P(jE(this,16),29),t||e9),e))},Q.$h=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab),!this.Ab&&(this.Ab=new F(C7,this,0,3)),Sv(this.Ab,P(t,18));return;case 1:ZT(this,Sh(t));return;case 2:!this.a&&(this.a=new s_(this,M7,this)),GI(this.a),!this.a&&(this.a=new s_(this,M7,this)),Sv(this.a,P(t,18));return}Rk(this,e-xv((OL(),e9)),gw((n=P(jE(this,16),29),n||e9),e),t)},Q.fi=function(){return OL(),e9},Q.hi=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(C7,this,0,3)),GI(this.Ab);return;case 1:ZT(this,null);return;case 2:!this.a&&(this.a=new s_(this,M7,this)),GI(this.a);return}KO(this,e-xv((OL(),e9)),gw((t=P(jE(this,16),29),t||e9),e))},L(OW,`ETypeParameterImpl`,446),q(447,81,XG,s_),Q.Lj=function(e,t){return b3e(this,P(e,87),t)},Q.Mj=function(e,t){return x3e(this,P(e,87),t)},L(OW,`ETypeParameterImpl/1`,447),q(638,44,jz,Hs),Q.ec=function(){return new Ko(this)},L(OW,`ETypeParameterImpl/2`,638),q(557,ZL,QL,Ko),Q.Ec=function(e){return awe(this,P(e,87))},Q.Fc=function(e){var t,n,r=!1;for(n=e.Jc();n.Ob();)t=P(n.Pb(),87),ry(this.a,t,``)??(r=!0);return r},Q.$b=function(){ov(this.a)},Q.Gc=function(e){return Z_(this.a,e)},Q.Jc=function(){return new qo(new bE(new xo(this.a).a))},Q.Kc=function(e){return Hze(this,e)},Q.gc=function(){return Nl(this.a)},L(OW,`ETypeParameterImpl/2/1`,557),q(558,1,qL,qo),Q.Nb=function(e){ev(this,e)},Q.Pb=function(){return P(FT(this.a).jd(),87)},Q.Ob=function(){return this.a.b},Q.Qb=function(){sHe(this.a)},L(OW,`ETypeParameterImpl/2/1/1`,558),q(1282,44,jz,ipe),Q._b=function(e){return Nf(e)?qy(this,e):!!h_(this.f,e)},Q.xc=function(e){var t=Nf(e)?pb(this,e):Ff(h_(this.f,e)),n;return j(t,836)?(n=P(t,836),t=n.Ik(),ry(this,P(e,241),t),t):t??(e==null?(xu(),hVt):null)},L(OW,`EValidatorRegistryImpl`,1282),q(1304,710,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,2005:1,52:1,100:1,161:1,117:1,118:1},Yre),Q.oi=function(e,t){switch(e.fk()){case 21:case 22:case 23:case 24:case 26:case 31:case 32:case 37:case 38:case 39:case 40:case 43:case 44:case 48:case 49:case 20:return t==null?null:zk(t);case 25:return TUe(t);case 27:return vVe(t);case 28:return yVe(t);case 29:return t==null?null:wbe(n7[0],P(t,205));case 41:return t==null?``:pl(P(t,298));case 42:return zk(t);case 50:return Sh(t);default:throw E(new fc(MW+e.ve()+NW))}},Q.pi=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;switch(e.G==-1&&(e.G=(f=Pw(e),f?dj(f.si(),e):-1)),e.G){case 0:return n=new Rs,n;case 1:return t=new jre,t;case 2:return r=new Hoe,r;case 4:return i=new hs,i;case 5:return a=new rpe,a;case 6:return o=new afe,o;case 7:return s=new Voe,s;case 10:return l=new qa,l;case 11:return u=new zs,u;case 12:return d=new HMe,d;case 13:return p=new Vs,p;case 14:return m=new ISe,m;case 17:return h=new zre,h;case 18:return c=new ts,c;case 19:return g=new Xa,g;default:throw E(new fc(IW+e.zb+NW))}},Q.qi=function(e,t){switch(e.fk()){case 20:return t==null?null:new the(t);case 21:return t==null?null:new Cp(t);case 23:case 22:return t==null?null:$Ze(t);case 26:case 24:return t==null?null:YC(QF(t,-128,127)<<24>>24);case 25:return _et(t);case 27:return X1e(t);case 28:return Z1e(t);case 29:return Z3e(t);case 32:case 31:return t==null?null:XM(t);case 38:case 37:return t==null?null:new Efe(t);case 40:case 39:return t==null?null:G(QF(t,ER,FL));case 41:return null;case 42:return null;case 44:case 43:return t==null?null:AA(dL(t));case 49:case 48:return t==null?null:PO(QF(t,cK,32767)<<16>>16);case 50:return t;default:throw E(new fc(MW+e.ve()+NW))}},L(OW,`EcoreFactoryImpl`,1304),q(549,184,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,2003:1,52:1,100:1,161:1,184:1,549:1,117:1,118:1,680:1},Oje),Q.gb=!1,Q.hb=!1;var cVt,lVt=!1;L(OW,`EcorePackageImpl`,549),q(1200,1,{836:1},Xre),Q.Ik=function(){return exe(),gVt},L(OW,`EcorePackageImpl/1`,1200),q(1209,1,pK,Zre),Q.dk=function(e){return j(e,158)},Q.ek=function(e){return V(K5,BL,158,e,0,1)},L(OW,`EcorePackageImpl/10`,1209),q(1210,1,pK,Qre),Q.dk=function(e){return j(e,197)},Q.ek=function(e){return V(J5,BL,197,e,0,1)},L(OW,`EcorePackageImpl/11`,1210),q(1211,1,pK,$re),Q.dk=function(e){return j(e,57)},Q.ek=function(e){return V(R5,BL,57,e,0,1)},L(OW,`EcorePackageImpl/12`,1211),q(1212,1,pK,eie),Q.dk=function(e){return j(e,403)},Q.ek=function(e){return V(N7,YG,62,e,0,1)},L(OW,`EcorePackageImpl/13`,1212),q(1213,1,pK,tie),Q.dk=function(e){return j(e,241)},Q.ek=function(e){return V(Y5,BL,241,e,0,1)},L(OW,`EcorePackageImpl/14`,1213),q(1214,1,pK,nie),Q.dk=function(e){return j(e,504)},Q.ek=function(e){return V(F7,BL,2081,e,0,1)},L(OW,`EcorePackageImpl/15`,1214),q(1215,1,pK,rie),Q.dk=function(e){return j(e,103)},Q.ek=function(e){return V(I7,JG,19,e,0,1)},L(OW,`EcorePackageImpl/16`,1215),q(1216,1,pK,iie),Q.dk=function(e){return j(e,179)},Q.ek=function(e){return V(T7,JG,179,e,0,1)},L(OW,`EcorePackageImpl/17`,1216),q(1217,1,pK,aie),Q.dk=function(e){return j(e,470)},Q.ek=function(e){return V(w7,BL,470,e,0,1)},L(OW,`EcorePackageImpl/18`,1217),q(1218,1,pK,oie),Q.dk=function(e){return j(e,550)},Q.ek=function(e){return V(o9,Tbt,550,e,0,1)},L(OW,`EcorePackageImpl/19`,1218),q(1201,1,pK,sie),Q.dk=function(e){return j(e,335)},Q.ek=function(e){return V(E7,JG,38,e,0,1)},L(OW,`EcorePackageImpl/2`,1201),q(1219,1,pK,cie),Q.dk=function(e){return j(e,248)},Q.ek=function(e){return V(M7,Hbt,87,e,0,1)},L(OW,`EcorePackageImpl/20`,1219),q(1220,1,pK,lie),Q.dk=function(e){return j(e,446)},Q.ek=function(e){return V(L7,BL,835,e,0,1)},L(OW,`EcorePackageImpl/21`,1220),q(1221,1,pK,uie),Q.dk=function(e){return jf(e)},Q.ek=function(e){return V(Lq,X,473,e,8,1)},L(OW,`EcorePackageImpl/22`,1221),q(1222,1,pK,die),Q.dk=function(e){return j(e,195)},Q.ek=function(e){return V(X9,X,195,e,0,2)},L(OW,`EcorePackageImpl/23`,1222),q(1223,1,pK,fie),Q.dk=function(e){return j(e,221)},Q.ek=function(e){return V(Rq,X,221,e,0,1)},L(OW,`EcorePackageImpl/24`,1223),q(1224,1,pK,pie),Q.dk=function(e){return j(e,180)},Q.ek=function(e){return V(Bq,X,180,e,0,1)},L(OW,`EcorePackageImpl/25`,1224),q(1225,1,pK,mie),Q.dk=function(e){return j(e,205)},Q.ek=function(e){return V(kq,X,205,e,0,1)},L(OW,`EcorePackageImpl/26`,1225),q(1226,1,pK,hie),Q.dk=function(e){return!1},Q.ek=function(e){return V(sHt,BL,2177,e,0,1)},L(OW,`EcorePackageImpl/27`,1226),q(1227,1,pK,gie),Q.dk=function(e){return Mf(e)},Q.ek=function(e){return V(Hq,X,346,e,7,1)},L(OW,`EcorePackageImpl/28`,1227),q(1228,1,pK,_ie),Q.dk=function(e){return j(e,61)},Q.ek=function(e){return V(gBt,_B,61,e,0,1)},L(OW,`EcorePackageImpl/29`,1228),q(1202,1,pK,vie),Q.dk=function(e){return j(e,505)},Q.ek=function(e){return V(C7,{3:1,4:1,5:1,1998:1},588,e,0,1)},L(OW,`EcorePackageImpl/3`,1202),q(1229,1,pK,yie),Q.dk=function(e){return j(e,568)},Q.ek=function(e){return V(SBt,BL,2004,e,0,1)},L(OW,`EcorePackageImpl/30`,1229),q(1230,1,pK,bie),Q.dk=function(e){return j(e,163)},Q.ek=function(e){return V(mVt,_B,163,e,0,1)},L(OW,`EcorePackageImpl/31`,1230),q(1231,1,pK,xie),Q.dk=function(e){return j(e,75)},Q.ek=function(e){return V(t9,Zbt,75,e,0,1)},L(OW,`EcorePackageImpl/32`,1231),q(1232,1,pK,Sie),Q.dk=function(e){return j(e,164)},Q.ek=function(e){return V(Uq,X,164,e,0,1)},L(OW,`EcorePackageImpl/33`,1232),q(1233,1,pK,Cie),Q.dk=function(e){return j(e,15)},Q.ek=function(e){return V(Wq,X,15,e,0,1)},L(OW,`EcorePackageImpl/34`,1233),q(1234,1,pK,wie),Q.dk=function(e){return j(e,298)},Q.ek=function(e){return V(oq,BL,298,e,0,1)},L(OW,`EcorePackageImpl/35`,1234),q(1235,1,pK,Tie),Q.dk=function(e){return j(e,190)},Q.ek=function(e){return V(Kq,X,190,e,0,1)},L(OW,`EcorePackageImpl/36`,1235),q(1236,1,pK,Eie),Q.dk=function(e){return j(e,92)},Q.ek=function(e){return V(cq,BL,92,e,0,1)},L(OW,`EcorePackageImpl/37`,1236),q(1237,1,pK,Die),Q.dk=function(e){return j(e,589)},Q.ek=function(e){return V(uVt,BL,589,e,0,1)},L(OW,`EcorePackageImpl/38`,1237),q(1238,1,pK,Oie),Q.dk=function(e){return!1},Q.ek=function(e){return V(cHt,BL,2178,e,0,1)},L(OW,`EcorePackageImpl/39`,1238),q(1203,1,pK,kie),Q.dk=function(e){return j(e,88)},Q.ek=function(e){return V(O7,BL,29,e,0,1)},L(OW,`EcorePackageImpl/4`,1203),q(1239,1,pK,Aie),Q.dk=function(e){return j(e,191)},Q.ek=function(e){return V(Zq,X,191,e,0,1)},L(OW,`EcorePackageImpl/40`,1239),q(1240,1,pK,jie),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(OW,`EcorePackageImpl/41`,1240),q(1241,1,pK,Mie),Q.dk=function(e){return j(e,586)},Q.ek=function(e){return V(vBt,BL,586,e,0,1)},L(OW,`EcorePackageImpl/42`,1241),q(1242,1,pK,Nie),Q.dk=function(e){return!1},Q.ek=function(e){return V(lHt,X,2179,e,0,1)},L(OW,`EcorePackageImpl/43`,1242),q(1243,1,pK,Pie),Q.dk=function(e){return j(e,45)},Q.ek=function(e){return V(fq,fR,45,e,0,1)},L(OW,`EcorePackageImpl/44`,1243),q(1204,1,pK,Fie),Q.dk=function(e){return j(e,143)},Q.ek=function(e){return V(D7,BL,143,e,0,1)},L(OW,`EcorePackageImpl/5`,1204),q(1205,1,pK,Iie),Q.dk=function(e){return j(e,159)},Q.ek=function(e){return V(k7,BL,159,e,0,1)},L(OW,`EcorePackageImpl/6`,1205),q(1206,1,pK,Lie),Q.dk=function(e){return j(e,459)},Q.ek=function(e){return V(A7,BL,675,e,0,1)},L(OW,`EcorePackageImpl/7`,1206),q(1207,1,pK,Rie),Q.dk=function(e){return j(e,568)},Q.ek=function(e){return V(j7,BL,684,e,0,1)},L(OW,`EcorePackageImpl/8`,1207),q(1208,1,pK,zie),Q.dk=function(e){return j(e,469)},Q.ek=function(e){return V(q5,BL,469,e,0,1)},L(OW,`EcorePackageImpl/9`,1208),q(1020,2045,wbt,zpe),Q.Ki=function(e,t){lYe(this,P(t,415))},Q.Oi=function(e,t){r5e(this,e,P(t,415))},L(OW,`MinimalEObjectImpl/1ArrayDelegatingAdapterList`,1020),q(1021,151,MG,tje),Q.hj=function(){return this.a.a},L(OW,`MinimalEObjectImpl/1ArrayDelegatingAdapterList/1`,1021),q(1048,1047,{},nbe),L(`org.eclipse.emf.ecore.plugin`,`EcorePlugin`,1048);var uVt=Jg(Qbt,`Resource`);q(787,1486,$bt),Q.Fl=function(e){},Q.Gl=function(e){},Q.Cl=function(){return!this.a&&(this.a=new Yo(this)),this.a},Q.Dl=function(e){var t,n,r=e.length,i,a;if(r>0){if(nx(0,e.length),e.charCodeAt(0)==47){for(a=new sC(4),i=1,t=1;t<r;++t)nx(t,e.length),e.charCodeAt(t)==47&&(M(a,i==t?``:(iC(i,t,e.length),e.substr(i,t-i))),i=t+1);return M(a,(nx(i,e.length+1),e.substr(i))),b2e(this,a)}nx(r-1,e.length),e.charCodeAt(r-1)==63&&(n=rwe(e,LM(63),r-2),n>0&&(e=(iC(0,n,e.length),e.substr(0,n))))}return p7e(this,e)},Q.El=function(){return this.c},Q.Ib=function(){var e;return pl(this.Pm)+`@`+(e=YT(this)>>>0,e.toString(16))+` uri='`+this.d+`'`},Q.b=!1,L(mK,`ResourceImpl`,787),q(1487,787,$bt,Wde),L(mK,`BinaryResourceImpl`,1487),q(1160,697,hG),Q._i=function(e){return j(e,57)?uNe(this,P(e,57)):j(e,589)?new gm(P(e,589).Cl()):A(e)===A(this.f)?P(e,18).Jc():(Ah(),v7.a)},Q.Ob=function(){return VN(this)},Q.a=!1,L(LG,`EcoreUtil/ContentTreeIterator`,1160),q(1488,1160,hG,Jke),Q._i=function(e){return A(e)===A(this.f)?P(e,16).Jc():new eLe(P(e,57))},L(mK,`ResourceImpl/5`,1488),q(648,2057,Vbt,Yo),Q.Gc=function(e){return this.i<=4?uM(this,e):j(e,52)&&P(e,52).Gh()==this.a},Q.Ki=function(e,t){e==this.i-1&&(this.a.b||(this.a.b=!0))},Q.Mi=function(e,t){e==0?this.a.b||(this.a.b=!0):nC(this,e,t)},Q.Oi=function(e,t){},Q.Pi=function(e,t,n){},Q.Jj=function(){return 2},Q.hj=function(){return this.a},Q.Kj=function(){return!0},Q.Lj=function(e,t){return t=P(e,52).ci(this.a,t),t},Q.Mj=function(e,t){return P(e,52).ci(null,t)},Q.Nj=function(){return!1},Q.Qi=function(){return!0},Q.$i=function(e){return V(R5,BL,57,e,0,1)},Q.Wi=function(){return!1},L(mK,`ResourceImpl/ContentsEList`,648),q(954,2027,xR,Gde),Q.dd=function(e){return this.a.Ii(e)},Q.gc=function(){return this.a.gc()},L(LG,`AbstractSequentialInternalEList/1`,954);var dVt,fVt,l9,pVt;q(626,1,{},RDe);var u9,d9;L(LG,`BasicExtendedMetaData`,626),q(1151,1,{},Nve),Q.Hl=function(){return null},Q.Il=function(){return this.a==-2&&Qse(this,z3e(this.d,this.b)),this.a},Q.Jl=function(){return null},Q.Kl=function(){return Py(),Py(),hJ},Q.ve=function(){return this.c==OK&&tce(this,gQe(this.d,this.b)),this.c},Q.Ll=function(){return 0},Q.a=-2,Q.c=OK,L(LG,`BasicExtendedMetaData/EClassExtendedMetaDataImpl`,1151),q(1152,1,{},gIe),Q.Hl=function(){return this.a==(GS(),u9)&&$se(this,Mit(this.f,this.b)),this.a},Q.Il=function(){return 0},Q.Jl=function(){return this.c==(GS(),u9)&&nce(this,Nit(this.f,this.b)),this.c},Q.Kl=function(){return!this.d&&ice(this,yst(this.f,this.b)),this.d},Q.ve=function(){return this.e==OK&&oce(this,gQe(this.f,this.b)),this.e},Q.Ll=function(){return this.g==-2&&cce(this,W4e(this.f,this.b)),this.g},Q.e=OK,Q.g=-2,L(LG,`BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl`,1152),q(1150,1,{},Pve),Q.b=!1,Q.c=!1,L(LG,`BasicExtendedMetaData/EPackageExtendedMetaDataImpl`,1150),q(1153,1,{},_Ie),Q.c=-2,Q.e=OK,Q.f=OK,L(LG,`BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl`,1153),q(582,624,XG,Ag),Q.Jj=function(){return this.c},Q.ml=function(){return!1},Q.Ui=function(e,t){return t},Q.c=0,L(LG,`EDataTypeEList`,582);var mVt=Jg(LG,`FeatureMap`);q(76,582,{3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1,78:1,163:1,219:1,2001:1,72:1,98:1},yE),Q._c=function(e,t){tnt(this,e,P(t,75))},Q.Ec=function(e){return itt(this,P(e,75))},Q.Fi=function(e){AAe(this,P(e,75))},Q.Lj=function(e,t){return Ewe(this,P(e,75),t)},Q.Mj=function(e,t){return Dwe(this,P(e,75),t)},Q.Ri=function(e,t){return Uat(this,e,t)},Q.Ui=function(e,t){return out(this,e,P(t,75))},Q.fd=function(e,t){return nrt(this,e,P(t,75))},Q.Sj=function(e,t){return Owe(this,P(e,75),t)},Q.Tj=function(e,t){return kwe(this,P(e,75),t)},Q.Uj=function(e,t,n){return v4e(this,P(e,75),P(t,75),n)},Q.Xi=function(e,t){return OM(this,e,P(t,75))},Q.Ml=function(e,t){return UF(this,e,t)},Q.ad=function(e,t){var n,r,i,a,o,s,c,l=new Sw(t.gc()),u;for(i=t.Jc();i.Ob();)if(r=P(i.Pb(),75),a=r.Jk(),qP(this.e,a))(!a.Qi()||!Xx(this,a,r.kd())&&!uM(l,r))&&lC(l,r);else{for(u=UP(this.e.Ah(),a),n=P(this.g,122),o=!0,s=0;s<this.i;++s)if(c=n[s],u.$l(c.Jk())){P(uj(this,s,r),75),o=!1;break}o&&lC(l,r)}return nqe(this,e,l)},Q.Fc=function(e){var t,n,r,i,a,o,s,c=new Sw(e.gc()),l;for(r=e.Jc();r.Ob();)if(n=P(r.Pb(),75),i=n.Jk(),qP(this.e,i))(!i.Qi()||!Xx(this,i,n.kd())&&!uM(c,n))&&lC(c,n);else{for(l=UP(this.e.Ah(),i),t=P(this.g,122),a=!0,o=0;o<this.i;++o)if(s=t[o],l.$l(s.Jk())){P(uj(this,o,n),75),a=!1;break}a&&lC(c,n)}return Sv(this,c)},Q.Di=function(e){return this.j=-1,cI(this,this.i,e)},Q.Nl=function(e,t,n){return yF(this,e,t,n)},Q.Vk=function(e,t){return zF(this,e,t)},Q.Ol=function(e,t,n){return dct(this,e,t,n)},Q.Pl=function(){return this},Q.Ql=function(e,t){return kI(this,e,t)},Q.Rl=function(e){return P(H(this,e),75).Jk()},Q.Sl=function(e){return P(H(this,e),75).kd()},Q.Tl=function(){return this.b},Q.Kj=function(){return!0},Q.Rj=function(){return!0},Q.Ul=function(e){return!iA(this,e)},Q.$i=function(e){return V($Bt,Zbt,344,e,0,1)},Q.nl=function(e){return yh(this,e)},Q.Wb=function(e){uv(this,e)},Q.Vl=function(e,t){FI(this,e,t)},Q.Wl=function(e){return kWe(this,e)},Q.Xl=function(e){w1e(this,e)},L(LG,`BasicFeatureMap`,76),q(1925,1,tR),Q.Nb=function(e){ev(this,e)},Q.Rb=function(e){if(this.g==-1)throw E(new ds);T_(this);try{urt(this.e,this.b,this.a,e),this.d=this.e.j,sj(this)}catch(e){throw e=tD(e),j(e,99)?E(new ls):E(e)}},Q.Ob=function(){return UD(this)},Q.Sb=function(){return Zqe(this)},Q.Pb=function(){return sj(this)},Q.Tb=function(){return this.a},Q.Ub=function(){var e;if(Zqe(this))return T_(this),this.g=--this.a,this.sl()&&(e=MN(this.e,this.b,this.c,this.a,this.j),this.j=e),this.i=0,this.j;throw E(new ms)},Q.Vb=function(){return this.a-1},Q.Qb=function(){if(this.g==-1)throw E(new ds);T_(this);try{b8e(this.e,this.b,this.g),this.d=this.e.j,this.g<this.a&&(--this.a,--this.c),--this.g}catch(e){throw e=tD(e),j(e,99)?E(new ls):E(e)}},Q.sl=function(){return!1},Q.Wb=function(e){if(this.g==-1)throw E(new ds);T_(this);try{wst(this.e,this.b,this.g,e),this.d=this.e.j}catch(e){throw e=tD(e),j(e,99)?E(new ls):E(e)}},Q.a=0,Q.c=0,Q.d=0,Q.f=!1,Q.g=0,Q.i=0,L(LG,`FeatureMapUtil/BasicFeatureEIterator`,1925),q(412,1925,tR,LE),Q.Yl=function(){var e,t,n=this.e.i;for(e=P(this.e.g,122);this.c<n;){if(t=e[this.c],this.k.$l(t.Jk()))return this.j=this.f?t:t.kd(),this.i=2,!0;++this.c}return this.i=1,this.g=-1,!1},Q.Zl=function(){for(var e=P(this.e.g,122),t;--this.c>=0;)if(t=e[this.c],this.k.$l(t.Jk()))return this.j=this.f?t:t.kd(),this.i=-2,!0;return this.i=-1,this.g=-1,!1},L(LG,`BasicFeatureMap/FeatureEIterator`,412),q(666,412,tR,ep),Q.sl=function(){return!0},L(LG,`BasicFeatureMap/ResolvingFeatureEIterator`,666),q(952,482,tK,Mbe),Q.nj=function(){return this},L(LG,`EContentsEList/1`,952),q(953,482,tK,oye),Q.sl=function(){return!1},L(LG,`EContentsEList/2`,953),q(951,287,nK,Nbe),Q.ul=function(e){},Q.Ob=function(){return!1},Q.Sb=function(){return!1},L(LG,`EContentsEList/FeatureIteratorImpl/1`,951),q(825,582,XG,dm),Q.Li=function(){this.a=!0},Q.Oj=function(){return this.a},Q.Ek=function(){var e;GI(this),fp(this.e)?(e=this.a,this.a=!1,CE(this.e,new DS(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(LG,`EDataTypeEList/Unsettable`,825),q(1923,582,XG,Xbe),Q.Qi=function(){return!0},L(LG,`EDataTypeUniqueEList`,1923),q(1924,825,XG,Zbe),Q.Qi=function(){return!0},L(LG,`EDataTypeUniqueEList/Unsettable`,1924),q(145,81,XG,fm),Q.ll=function(){return!0},Q.Ui=function(e,t){return JN(this,e,P(t,57))},L(LG,`EObjectContainmentEList/Resolving`,145),q(1154,544,XG,Qbe),Q.ll=function(){return!0},Q.Ui=function(e,t){return JN(this,e,P(t,57))},L(LG,`EObjectContainmentEList/Unsettable/Resolving`,1154),q(753,14,XG,HCe),Q.Li=function(){this.a=!0},Q.Oj=function(){return this.a},Q.Ek=function(){var e;GI(this),fp(this.e)?(e=this.a,this.a=!1,CE(this.e,new DS(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(LG,`EObjectContainmentWithInverseEList/Unsettable`,753),q(1188,753,XG,UCe),Q.ll=function(){return!0},Q.Ui=function(e,t){return JN(this,e,P(t,57))},L(LG,`EObjectContainmentWithInverseEList/Unsettable/Resolving`,1188),q(745,491,XG,pm),Q.Li=function(){this.a=!0},Q.Oj=function(){return this.a},Q.Ek=function(){var e;GI(this),fp(this.e)?(e=this.a,this.a=!1,CE(this.e,new DS(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(LG,`EObjectEList/Unsettable`,745),q(339,491,XG,mm),Q.ll=function(){return!0},Q.Ui=function(e,t){return JN(this,e,P(t,57))},L(LG,`EObjectResolvingEList`,339),q(1828,745,XG,$be),Q.ll=function(){return!0},Q.Ui=function(e,t){return JN(this,e,P(t,57))},L(LG,`EObjectResolvingEList/Unsettable`,1828),q(1489,1,{},Bie);var hVt;L(LG,`EObjectValidator`,1489),q(548,491,XG,G_),Q.gl=function(){return this.d},Q.hl=function(){return this.b},Q.Kj=function(){return!0},Q.kl=function(){return!0},Q.b=0,L(LG,`EObjectWithInverseEList`,548),q(1191,548,XG,WCe),Q.jl=function(){return!0},L(LG,`EObjectWithInverseEList/ManyInverse`,1191),q(627,548,XG,Kh),Q.Li=function(){this.a=!0},Q.Oj=function(){return this.a},Q.Ek=function(){var e;GI(this),fp(this.e)?(e=this.a,this.a=!1,CE(this.e,new DS(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(LG,`EObjectWithInverseEList/Unsettable`,627),q(1190,627,XG,GCe),Q.jl=function(){return!0},L(LG,`EObjectWithInverseEList/Unsettable/ManyInverse`,1190),q(754,548,XG,KCe),Q.ll=function(){return!0},Q.Ui=function(e,t){return JN(this,e,P(t,57))},L(LG,`EObjectWithInverseResolvingEList`,754),q(33,754,XG,qh),Q.jl=function(){return!0},L(LG,`EObjectWithInverseResolvingEList/ManyInverse`,33),q(755,627,XG,qCe),Q.ll=function(){return!0},Q.Ui=function(e,t){return JN(this,e,P(t,57))},L(LG,`EObjectWithInverseResolvingEList/Unsettable`,755),q(1189,755,XG,JCe),Q.jl=function(){return!0},L(LG,`EObjectWithInverseResolvingEList/Unsettable/ManyInverse`,1189),q(1155,624,XG),Q.Ji=function(){return!(this.b&1792)},Q.Li=function(){this.b|=1},Q.il=function(){return!!(this.b&4)},Q.Kj=function(){return!!(this.b&40)},Q.jl=function(){return!!(this.b&16)},Q.kl=function(){return!!(this.b&8)},Q.ll=function(){return(this.b&kW)!=0},Q.$k=function(){return!!(this.b&32)},Q.ml=function(){return(this.b&IG)!=0},Q.dk=function(e){return this.d?HLe(this.d,e):this.Jk().Fk().dk(e)},Q.Oj=function(){return this.b&2?!!(this.b&1):this.i!=0},Q.Qi=function(){return!!(this.b&128)},Q.Ek=function(){var e;GI(this),this.b&2&&(fp(this.e)?(e=!!(this.b&1),this.b&=-2,vs(this,new DS(this.e,2,$k(this.e.Ah(),this.Jk()),e,!1))):this.b&=-2)},Q.Wi=function(){return!(this.b&1536)},Q.b=0,L(LG,`EcoreEList/Generic`,1155),q(1156,1155,XG,WMe),Q.Jk=function(){return this.a},L(LG,`EcoreEList/Dynamic`,1156),q(752,67,mG,Kde),Q.$i=function(e){return Qw(this.a.a,e)},L(LG,`EcoreEMap/1`,752),q(751,81,XG,Xke),Q.Ki=function(e,t){yj(this.b,P(t,136))},Q.Mi=function(e,t){ZGe(this.b)},Q.Ni=function(e,t,n){var r;++(r=this.b,P(t,136),r).e},Q.Oi=function(e,t){fk(this.b,P(t,136))},Q.Pi=function(e,t,n){fk(this.b,P(n,136)),A(n)===A(t)&&P(n,136).zi(Jye(P(t,136).jd())),yj(this.b,P(t,136))},L(LG,`EcoreEMap/DelegateEObjectContainmentEList`,751),q(1186,142,zG,sWe),L(LG,`EcoreEMap/Unsettable`,1186),q(1187,751,XG,YCe),Q.Li=function(){this.a=!0},Q.Oj=function(){return this.a},Q.Ek=function(){var e;GI(this),fp(this.e)?(e=this.a,this.a=!1,CE(this.e,new DS(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(LG,`EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList`,1187),q(1159,223,jz,MAe),Q.a=!1,Q.b=!1,L(LG,`EcoreUtil/Copier`,1159),q(747,1,qL,eLe),Q.Nb=function(e){ev(this,e)},Q.Ob=function(){return xZe(this)},Q.Pb=function(){var e;return xZe(this),e=this.b,this.b=null,e},Q.Qb=function(){this.a.Qb()},L(LG,`EcoreUtil/ProperContentIterator`,747),q(1490,1489,{},Uoe);var gVt;L(LG,`EcoreValidator`,1490);var _Vt;Jg(LG,`FeatureMapUtil/Validator`),q(1260,1,{2006:1},Vie),Q.$l=function(e){return!0},L(LG,`FeatureMapUtil/1`,1260),q(760,1,{2006:1},Udt),Q.$l=function(e){var t;return this.c==e||(t=xh(Nv(this.a,e)),t==null?Bit(this,e)?(Cze(this.a,e,(Lm(),Iq)),!0):(Cze(this.a,e,(Lm(),Fq)),!1):t==(Lm(),Iq))},Q.e=!1;var f9;L(LG,`FeatureMapUtil/BasicValidator`,760),q(761,44,jz,tm),L(LG,`FeatureMapUtil/BasicValidator/Cache`,761),q(495,56,{20:1,31:1,56:1,18:1,16:1,61:1,78:1,72:1,98:1},Rf),Q._c=function(e,t){urt(this.c,this.b,e,t)},Q.Ec=function(e){return UF(this.c,this.b,e)},Q.ad=function(e,t){return Mct(this.c,this.b,e,t)},Q.Fc=function(e){return Yp(this,e)},Q.Ei=function(e,t){lUe(this.c,this.b,e,t)},Q.Uk=function(e,t){return yF(this.c,this.b,e,t)},Q.Yi=function(e){return AI(this.c,this.b,e,!1)},Q.Gi=function(){return Fye(this.c,this.b)},Q.Hi=function(){return Iye(this.c,this.b)},Q.Ii=function(e){return PBe(this.c,this.b,e)},Q.Vk=function(e,t){return hCe(this,e,t)},Q.$b=function(){ys(this)},Q.Gc=function(e){return Xx(this.c,this.b,e)},Q.Hc=function(e){return wGe(this.c,this.b,e)},Q.Xb=function(e){return AI(this.c,this.b,e,!0)},Q.Dk=function(e){return this},Q.bd=function(e){return eRe(this.c,this.b,e)},Q.dc=function(){return Af(this)},Q.Oj=function(){return!iA(this.c,this.b)},Q.Jc=function(){return yHe(this.c,this.b)},Q.cd=function(){return bHe(this.c,this.b)},Q.dd=function(e){return RYe(this.c,this.b,e)},Q.Ri=function(e,t){return Kot(this.c,this.b,e,t)},Q.Si=function(e,t){zBe(this.c,this.b,e,t)},Q.ed=function(e){return b8e(this.c,this.b,e)},Q.Kc=function(e){return bat(this.c,this.b,e)},Q.fd=function(e,t){return wst(this.c,this.b,e,t)},Q.Wb=function(e){KN(this.c,this.b),Yp(this,P(e,16))},Q.gc=function(){return zYe(this.c,this.b)},Q.Nc=function(){return yIe(this.c,this.b)},Q.Oc=function(e){return tRe(this.c,this.b,e)},Q.Ib=function(){var e,t=new Nc;for(t.a+=`[`,e=Fye(this.c,this.b);UD(e);)Uf(t,km(sj(e))),UD(e)&&(t.a+=zL);return t.a+=`]`,t.a},Q.Ek=function(){KN(this.c,this.b)},L(LG,`FeatureMapUtil/FeatureEList`,495),q(635,39,MG,lS),Q.fj=function(e){return QO(this,e)},Q.kj=function(e){var t,n,r,i,a,o,s;switch(this.d){case 1:case 2:if(a=e.hj(),A(a)===A(this.c)&&QO(this,null)==e.fj(null))return this.g=e.gj(),e.ej()==1&&(this.d=1),!0;break;case 3:if(i=e.ej(),i===3&&(a=e.hj(),A(a)===A(this.c)&&QO(this,null)==e.fj(null)))return this.d=5,t=new Sw(2),lC(t,this.g),lC(t,e.gj()),this.g=t,!0;break;case 5:if(i=e.ej(),i===3&&(a=e.hj(),A(a)===A(this.c)&&QO(this,null)==e.fj(null)))return n=P(this.g,18),n.Ec(e.gj()),!0;break;case 4:switch(i=e.ej(),i){case 3:if(a=e.hj(),A(a)===A(this.c)&&QO(this,null)==e.fj(null))return this.d=1,this.g=e.gj(),!0;break;case 4:if(a=e.hj(),A(a)===A(this.c)&&QO(this,null)==e.fj(null))return this.d=6,s=new Sw(2),lC(s,this.n),lC(s,e.ij()),this.n=s,o=U(O(q9,1),XR,30,15,[this.o,e.jj()]),this.g=o,!0}break;case 6:if(i=e.ej(),i===4&&(a=e.hj(),A(a)===A(this.c)&&QO(this,null)==e.fj(null)))return n=P(this.n,18),n.Ec(e.ij()),o=P(this.g,54),r=V(q9,XR,30,o.length+1,15,1),lI(o,0,r,0,o.length),r[o.length]=e.jj(),this.g=r,!0}return!1},L(LG,`FeatureMapUtil/FeatureENotificationImpl`,635),q(554,495,{20:1,31:1,56:1,18:1,16:1,61:1,78:1,163:1,219:1,2001:1,72:1,98:1},Ug),Q.Ml=function(e,t){return UF(this.c,e,t)},Q.Nl=function(e,t,n){return yF(this.c,e,t,n)},Q.Ol=function(e,t,n){return dct(this.c,e,t,n)},Q.Pl=function(){return this},Q.Ql=function(e,t){return kI(this.c,e,t)},Q.Rl=function(e){return P(AI(this.c,this.b,e,!1),75).Jk()},Q.Sl=function(e){return P(AI(this.c,this.b,e,!1),75).kd()},Q.Tl=function(){return this.a},Q.Ul=function(e){return!iA(this.c,e)},Q.Vl=function(e,t){FI(this.c,e,t)},Q.Wl=function(e){return kWe(this.c,e)},Q.Xl=function(e){w1e(this.c,e)},L(LG,`FeatureMapUtil/FeatureFeatureMap`,554),q(1259,1,RG,Uve),Q.Dk=function(e){return AI(this.b,this.a,-1,e)},Q.Oj=function(){return!iA(this.b,this.a)},Q.Wb=function(e){FI(this.b,this.a,e)},Q.Ek=function(){KN(this.b,this.a)},L(LG,`FeatureMapUtil/FeatureValue`,1259);var p9,m9,h9,g9,vVt,_9=Jg(AK,`AnyType`);q(670,63,DR,Ec),L(AK,`InvalidDatatypeValueException`,670);var v9=Jg(AK,txt),y9=Jg(AK,nxt),yVt=Jg(AK,rxt),bVt,b9,xVt,x9,SVt,CVt,wVt,TVt,EVt,DVt,OVt,kVt,AVt,jVt,MVt,S9,NVt,C9,w9,PVt,T9,E9,D9,FVt,O9,k9;q(829,502,{109:1,94:1,93:1,57:1,52:1,100:1,842:1},Us),Q.Ih=function(e,t,n){switch(e){case 0:return n?(!this.c&&(this.c=new yE(this,0)),this.c):(!this.c&&(this.c=new yE(this,0)),this.c.b);case 1:return n?(!this.c&&(this.c=new yE(this,0)),P(Qb(this.c,(XI(),x9)),163)):(!this.c&&(this.c=new yE(this,0)),P(P(Qb(this.c,(XI(),x9)),163),219)).Tl();case 2:return n?(!this.b&&(this.b=new yE(this,2)),this.b):(!this.b&&(this.b=new yE(this,2)),this.b.b)}return SC(this,e-xv(this.fi()),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():this.fi(),e),t,n)},Q.Rh=function(e,t,n){var r;switch(t){case 0:return!this.c&&(this.c=new yE(this,0)),zF(this.c,e,n);case 1:return(!this.c&&(this.c=new yE(this,0)),P(P(Qb(this.c,(XI(),x9)),163),72)).Vk(e,n);case 2:return!this.b&&(this.b=new yE(this,2)),zF(this.b,e,n)}return r=P(gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():this.fi(),t),69),r.uk().yk(this,cHe(this),t-xv(this.fi()),e,n)},Q.Th=function(e){switch(e){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new yE(this,0)),P(Qb(this.c,(XI(),x9)),163)).dc();case 2:return!!this.b&&this.b.i!=0}return Ux(this,e-xv(this.fi()),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():this.fi(),e))},Q.$h=function(e,t){switch(e){case 0:!this.c&&(this.c=new yE(this,0)),uv(this.c,t);return;case 1:(!this.c&&(this.c=new yE(this,0)),P(P(Qb(this.c,(XI(),x9)),163),219)).Wb(t);return;case 2:!this.b&&(this.b=new yE(this,2)),uv(this.b,t);return}Rk(this,e-xv(this.fi()),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():this.fi(),e),t)},Q.fi=function(){return XI(),xVt},Q.hi=function(e){switch(e){case 0:!this.c&&(this.c=new yE(this,0)),GI(this.c);return;case 1:(!this.c&&(this.c=new yE(this,0)),P(Qb(this.c,(XI(),x9)),163)).$b();return;case 2:!this.b&&(this.b=new yE(this,2)),GI(this.b);return}KO(this,e-xv(this.fi()),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():this.fi(),e))},Q.Ib=function(){var e;return this.j&4?pP(this):(e=new Am(pP(this)),e.a+=` (mixed: `,Hf(e,this.c),e.a+=`, anyAttribute: `,Hf(e,this.b),e.a+=`)`,e.a)},L(jK,`AnyTypeImpl`,829),q(671,502,{109:1,94:1,93:1,57:1,52:1,100:1,2084:1,671:1},qie),Q.Ih=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return SC(this,e-xv((XI(),S9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():S9,e),t,n)},Q.Th=function(e){switch(e){case 0:return this.a!=null;case 1:return this.b!=null}return Ux(this,e-xv((XI(),S9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():S9,e))},Q.$h=function(e,t){switch(e){case 0:dce(this,Sh(t));return;case 1:pce(this,Sh(t));return}Rk(this,e-xv((XI(),S9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():S9,e),t)},Q.fi=function(){return XI(),S9},Q.hi=function(e){switch(e){case 0:this.a=null;return;case 1:this.b=null;return}KO(this,e-xv((XI(),S9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():S9,e))},Q.Ib=function(){var e;return this.j&4?pP(this):(e=new Am(pP(this)),e.a+=` (data: `,Uf(e,this.a),e.a+=`, target: `,Uf(e,this.b),e.a+=`)`,e.a)},Q.a=null,Q.b=null,L(jK,`ProcessingInstructionImpl`,671),q(672,829,{109:1,94:1,93:1,57:1,52:1,100:1,842:1,2085:1,672:1},ape),Q.Ih=function(e,t,n){switch(e){case 0:return n?(!this.c&&(this.c=new yE(this,0)),this.c):(!this.c&&(this.c=new yE(this,0)),this.c.b);case 1:return n?(!this.c&&(this.c=new yE(this,0)),P(Qb(this.c,(XI(),x9)),163)):(!this.c&&(this.c=new yE(this,0)),P(P(Qb(this.c,(XI(),x9)),163),219)).Tl();case 2:return n?(!this.b&&(this.b=new yE(this,2)),this.b):(!this.b&&(this.b=new yE(this,2)),this.b.b);case 3:return!this.c&&(this.c=new yE(this,0)),Sh(kI(this.c,(XI(),w9),!0));case 4:return QCe(this.a,(!this.c&&(this.c=new yE(this,0)),Sh(kI(this.c,(XI(),w9),!0))));case 5:return this.a}return SC(this,e-xv((XI(),C9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():C9,e),t,n)},Q.Th=function(e){switch(e){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new yE(this,0)),P(Qb(this.c,(XI(),x9)),163)).dc();case 2:return!!this.b&&this.b.i!=0;case 3:return!this.c&&(this.c=new yE(this,0)),Sh(kI(this.c,(XI(),w9),!0))!=null;case 4:return QCe(this.a,(!this.c&&(this.c=new yE(this,0)),Sh(kI(this.c,(XI(),w9),!0))))!=null;case 5:return!!this.a}return Ux(this,e-xv((XI(),C9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():C9,e))},Q.$h=function(e,t){switch(e){case 0:!this.c&&(this.c=new yE(this,0)),uv(this.c,t);return;case 1:(!this.c&&(this.c=new yE(this,0)),P(P(Qb(this.c,(XI(),x9)),163),219)).Wb(t);return;case 2:!this.b&&(this.b=new yE(this,2)),uv(this.b,t);return;case 3:vIe(this,Sh(t));return;case 4:vIe(this,ZCe(this.a,t));return;case 5:fce(this,P(t,159));return}Rk(this,e-xv((XI(),C9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():C9,e),t)},Q.fi=function(){return XI(),C9},Q.hi=function(e){switch(e){case 0:!this.c&&(this.c=new yE(this,0)),GI(this.c);return;case 1:(!this.c&&(this.c=new yE(this,0)),P(Qb(this.c,(XI(),x9)),163)).$b();return;case 2:!this.b&&(this.b=new yE(this,2)),GI(this.b);return;case 3:!this.c&&(this.c=new yE(this,0)),FI(this.c,(XI(),w9),null);return;case 4:vIe(this,ZCe(this.a,null));return;case 5:this.a=null;return}KO(this,e-xv((XI(),C9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():C9,e))},L(jK,`SimpleAnyTypeImpl`,672),q(673,502,{109:1,94:1,93:1,57:1,52:1,100:1,2086:1,673:1},ope),Q.Ih=function(e,t,n){switch(e){case 0:return n?(!this.a&&(this.a=new yE(this,0)),this.a):(!this.a&&(this.a=new yE(this,0)),this.a.b);case 1:return n?(!this.b&&(this.b=new pC((OL(),$7),o9,this,1)),this.b):(!this.b&&(this.b=new pC((OL(),$7),o9,this,1)),eC(this.b));case 2:return n?(!this.c&&(this.c=new pC((OL(),$7),o9,this,2)),this.c):(!this.c&&(this.c=new pC((OL(),$7),o9,this,2)),eC(this.c));case 3:return!this.a&&(this.a=new yE(this,0)),Qb(this.a,(XI(),E9));case 4:return!this.a&&(this.a=new yE(this,0)),Qb(this.a,(XI(),D9));case 5:return!this.a&&(this.a=new yE(this,0)),Qb(this.a,(XI(),O9));case 6:return!this.a&&(this.a=new yE(this,0)),Qb(this.a,(XI(),k9))}return SC(this,e-xv((XI(),T9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():T9,e),t,n)},Q.Rh=function(e,t,n){var r;switch(t){case 0:return!this.a&&(this.a=new yE(this,0)),zF(this.a,e,n);case 1:return!this.b&&(this.b=new pC((OL(),$7),o9,this,1)),Zh(this.b,e,n);case 2:return!this.c&&(this.c=new pC((OL(),$7),o9,this,2)),Zh(this.c,e,n);case 5:return!this.a&&(this.a=new yE(this,0)),hCe(Qb(this.a,(XI(),O9)),e,n)}return r=P(gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():(XI(),T9),t),69),r.uk().yk(this,cHe(this),t-xv((XI(),T9)),e,n)},Q.Th=function(e){switch(e){case 0:return!!this.a&&this.a.i!=0;case 1:return!!this.b&&this.b.f!=0;case 2:return!!this.c&&this.c.f!=0;case 3:return!this.a&&(this.a=new yE(this,0)),!Af(Qb(this.a,(XI(),E9)));case 4:return!this.a&&(this.a=new yE(this,0)),!Af(Qb(this.a,(XI(),D9)));case 5:return!this.a&&(this.a=new yE(this,0)),!Af(Qb(this.a,(XI(),O9)));case 6:return!this.a&&(this.a=new yE(this,0)),!Af(Qb(this.a,(XI(),k9)))}return Ux(this,e-xv((XI(),T9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():T9,e))},Q.$h=function(e,t){switch(e){case 0:!this.a&&(this.a=new yE(this,0)),uv(this.a,t);return;case 1:!this.b&&(this.b=new pC((OL(),$7),o9,this,1)),_E(this.b,t);return;case 2:!this.c&&(this.c=new pC((OL(),$7),o9,this,2)),_E(this.c,t);return;case 3:!this.a&&(this.a=new yE(this,0)),ys(Qb(this.a,(XI(),E9))),!this.a&&(this.a=new yE(this,0)),Yp(Qb(this.a,E9),P(t,18));return;case 4:!this.a&&(this.a=new yE(this,0)),ys(Qb(this.a,(XI(),D9))),!this.a&&(this.a=new yE(this,0)),Yp(Qb(this.a,D9),P(t,18));return;case 5:!this.a&&(this.a=new yE(this,0)),ys(Qb(this.a,(XI(),O9))),!this.a&&(this.a=new yE(this,0)),Yp(Qb(this.a,O9),P(t,18));return;case 6:!this.a&&(this.a=new yE(this,0)),ys(Qb(this.a,(XI(),k9))),!this.a&&(this.a=new yE(this,0)),Yp(Qb(this.a,k9),P(t,18));return}Rk(this,e-xv((XI(),T9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():T9,e),t)},Q.fi=function(){return XI(),T9},Q.hi=function(e){switch(e){case 0:!this.a&&(this.a=new yE(this,0)),GI(this.a);return;case 1:!this.b&&(this.b=new pC((OL(),$7),o9,this,1)),this.b.c.$b();return;case 2:!this.c&&(this.c=new pC((OL(),$7),o9,this,2)),this.c.c.$b();return;case 3:!this.a&&(this.a=new yE(this,0)),ys(Qb(this.a,(XI(),E9)));return;case 4:!this.a&&(this.a=new yE(this,0)),ys(Qb(this.a,(XI(),D9)));return;case 5:!this.a&&(this.a=new yE(this,0)),ys(Qb(this.a,(XI(),O9)));return;case 6:!this.a&&(this.a=new yE(this,0)),ys(Qb(this.a,(XI(),k9)));return}KO(this,e-xv((XI(),T9)),gw(this.j&2?(!this.k&&(this.k=new Qa),this.k).Lk():T9,e))},Q.Ib=function(){var e;return this.j&4?pP(this):(e=new Am(pP(this)),e.a+=` (mixed: `,Hf(e,this.a),e.a+=`)`,e.a)},L(jK,`XMLTypeDocumentRootImpl`,673),q(1993,710,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1,2087:1},Hie),Q.oi=function(e,t){switch(e.fk()){case 7:case 8:case 9:case 10:case 16:case 22:case 23:case 24:case 25:case 26:case 32:case 33:case 34:case 36:case 37:case 44:case 45:case 50:case 51:case 53:case 55:case 56:case 57:case 58:case 60:case 61:case 4:return t==null?null:zk(t);case 19:case 28:case 29:case 35:case 38:case 39:case 41:case 46:case 52:case 54:case 5:return Sh(t);case 6:return PSe(P(t,195));case 12:case 47:case 49:case 11:return Iut(this,e,t);case 13:return t==null?null:zct(P(t,247));case 15:case 14:return t==null?null:hAe(D(N(t)));case 17:return y4e((XI(),t));case 18:return y4e(t);case 21:case 20:return t==null?null:gAe(P(t,164).a);case 27:return FSe(P(t,195));case 30:return T1e((XI(),P(t,16)));case 31:return T1e(P(t,16));case 40:return NSe((XI(),t));case 42:return b4e((XI(),t));case 43:return b4e(t);case 59:case 48:return MSe((XI(),t));default:throw E(new fc(MW+e.ve()+NW))}},Q.pi=function(e){var t,n,r,i,a;switch(e.G==-1&&(e.G=(n=Pw(e),n?dj(n.si(),e):-1)),e.G){case 0:return t=new Us,t;case 1:return r=new qie,r;case 2:return i=new ape,i;case 3:return a=new ope,a;default:throw E(new fc(IW+e.zb+NW))}},Q.qi=function(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_;switch(e.fk()){case 5:case 52:case 4:return t;case 6:return qQe(t);case 8:case 7:return t==null?null:N4e(t);case 9:return t==null?null:YC(QF((r=NI(t,!0),r.length>0&&(nx(0,r.length),r.charCodeAt(0)==43)?(nx(1,r.length+1),r.substr(1)):r),-128,127)<<24>>24);case 10:return t==null?null:YC(QF((i=NI(t,!0),i.length>0&&(nx(0,i.length),i.charCodeAt(0)==43)?(nx(1,i.length+1),i.substr(1)):i),-128,127)<<24>>24);case 11:return Sh(_L(this,(XI(),wVt),t));case 12:return Sh(_L(this,(XI(),TVt),t));case 13:return t==null?null:new the(NI(t,!0));case 15:case 14:return ltt(t);case 16:return Sh(_L(this,(XI(),EVt),t));case 17:return NZe((XI(),t));case 18:return NZe(t);case 28:case 29:case 35:case 38:case 39:case 41:case 54:case 19:return NI(t,!0);case 21:case 20:return Ctt(t);case 22:return Sh(_L(this,(XI(),DVt),t));case 23:return Sh(_L(this,(XI(),OVt),t));case 24:return Sh(_L(this,(XI(),kVt),t));case 25:return Sh(_L(this,(XI(),AVt),t));case 26:return Sh(_L(this,(XI(),jVt),t));case 27:return NQe(t);case 30:return PZe((XI(),t));case 31:return PZe(t);case 32:return t==null?null:G(QF((u=NI(t,!0),u.length>0&&(nx(0,u.length),u.charCodeAt(0)==43)?(nx(1,u.length+1),u.substr(1)):u),ER,FL));case 33:return t==null?null:new Cp((d=NI(t,!0),d.length>0&&(nx(0,d.length),d.charCodeAt(0)==43)?(nx(1,d.length+1),d.substr(1)):d));case 34:return t==null?null:G(QF((f=NI(t,!0),f.length>0&&(nx(0,f.length),f.charCodeAt(0)==43)?(nx(1,f.length+1),f.substr(1)):f),ER,FL));case 36:return t==null?null:AA(dL((p=NI(t,!0),p.length>0&&(nx(0,p.length),p.charCodeAt(0)==43)?(nx(1,p.length+1),p.substr(1)):p)));case 37:return t==null?null:AA(dL((m=NI(t,!0),m.length>0&&(nx(0,m.length),m.charCodeAt(0)==43)?(nx(1,m.length+1),m.substr(1)):m)));case 40:return u1e((XI(),t));case 42:return FZe((XI(),t));case 43:return FZe(t);case 44:return t==null?null:new Cp((h=NI(t,!0),h.length>0&&(nx(0,h.length),h.charCodeAt(0)==43)?(nx(1,h.length+1),h.substr(1)):h));case 45:return t==null?null:new Cp((g=NI(t,!0),g.length>0&&(nx(0,g.length),g.charCodeAt(0)==43)?(nx(1,g.length+1),g.substr(1)):g));case 46:return NI(t,!1);case 47:return Sh(_L(this,(XI(),MVt),t));case 59:case 48:return l1e((XI(),t));case 49:return Sh(_L(this,(XI(),NVt),t));case 50:return t==null?null:PO(QF((_=NI(t,!0),_.length>0&&(nx(0,_.length),_.charCodeAt(0)==43)?(nx(1,_.length+1),_.substr(1)):_),cK,32767)<<16>>16);case 51:return t==null?null:PO(QF((a=NI(t,!0),a.length>0&&(nx(0,a.length),a.charCodeAt(0)==43)?(nx(1,a.length+1),a.substr(1)):a),cK,32767)<<16>>16);case 53:return Sh(_L(this,(XI(),PVt),t));case 55:return t==null?null:PO(QF((o=NI(t,!0),o.length>0&&(nx(0,o.length),o.charCodeAt(0)==43)?(nx(1,o.length+1),o.substr(1)):o),cK,32767)<<16>>16);case 56:return t==null?null:PO(QF((s=NI(t,!0),s.length>0&&(nx(0,s.length),s.charCodeAt(0)==43)?(nx(1,s.length+1),s.substr(1)):s),cK,32767)<<16>>16);case 57:return t==null?null:AA(dL((c=NI(t,!0),c.length>0&&(nx(0,c.length),c.charCodeAt(0)==43)?(nx(1,c.length+1),c.substr(1)):c)));case 58:return t==null?null:AA(dL((l=NI(t,!0),l.length>0&&(nx(0,l.length),l.charCodeAt(0)==43)?(nx(1,l.length+1),l.substr(1)):l)));case 60:return t==null?null:G(QF((n=NI(t,!0),n.length>0&&(nx(0,n.length),n.charCodeAt(0)==43)?(nx(1,n.length+1),n.substr(1)):n),ER,FL));case 61:return t==null?null:G(QF(NI(t,!0),ER,FL));default:throw E(new fc(MW+e.ve()+NW))}};var IVt,LVt,RVt,zVt;L(jK,`XMLTypeFactoryImpl`,1993),q(583,184,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1,2009:1,583:1},kje),Q.N=!1,Q.O=!1;var BVt=!1;L(jK,`XMLTypePackageImpl`,583),q(1926,1,{836:1},Uie),Q.Ik=function(){return Hot(),aHt},L(jK,`XMLTypePackageImpl/1`,1926),q(1935,1,pK,Wie),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/10`,1935),q(1936,1,pK,Gie),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/11`,1936),q(1937,1,pK,Kie),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/12`,1937),q(1938,1,pK,Jie),Q.dk=function(e){return Mf(e)},Q.ek=function(e){return V(Hq,X,346,e,7,1)},L(jK,`XMLTypePackageImpl/13`,1938),q(1939,1,pK,Yie),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/14`,1939),q(1940,1,pK,Xie),Q.dk=function(e){return j(e,16)},Q.ek=function(e){return V(dq,_B,16,e,0,1)},L(jK,`XMLTypePackageImpl/15`,1940),q(1941,1,pK,Zie),Q.dk=function(e){return j(e,16)},Q.ek=function(e){return V(dq,_B,16,e,0,1)},L(jK,`XMLTypePackageImpl/16`,1941),q(1942,1,pK,Qie),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/17`,1942),q(1943,1,pK,$ie),Q.dk=function(e){return j(e,164)},Q.ek=function(e){return V(Uq,X,164,e,0,1)},L(jK,`XMLTypePackageImpl/18`,1943),q(1944,1,pK,eae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/19`,1944),q(1927,1,pK,tae),Q.dk=function(e){return j(e,842)},Q.ek=function(e){return V(_9,BL,842,e,0,1)},L(jK,`XMLTypePackageImpl/2`,1927),q(1945,1,pK,nae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/20`,1945),q(1946,1,pK,rae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/21`,1946),q(1947,1,pK,iae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/22`,1947),q(1948,1,pK,aae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/23`,1948),q(1949,1,pK,oae),Q.dk=function(e){return j(e,195)},Q.ek=function(e){return V(X9,X,195,e,0,2)},L(jK,`XMLTypePackageImpl/24`,1949),q(1950,1,pK,sae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/25`,1950),q(1951,1,pK,cae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/26`,1951),q(1952,1,pK,lae),Q.dk=function(e){return j(e,16)},Q.ek=function(e){return V(dq,_B,16,e,0,1)},L(jK,`XMLTypePackageImpl/27`,1952),q(1953,1,pK,uae),Q.dk=function(e){return j(e,16)},Q.ek=function(e){return V(dq,_B,16,e,0,1)},L(jK,`XMLTypePackageImpl/28`,1953),q(1954,1,pK,dae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/29`,1954),q(1928,1,pK,fae),Q.dk=function(e){return j(e,671)},Q.ek=function(e){return V(v9,BL,2084,e,0,1)},L(jK,`XMLTypePackageImpl/3`,1928),q(1955,1,pK,pae),Q.dk=function(e){return j(e,15)},Q.ek=function(e){return V(Wq,X,15,e,0,1)},L(jK,`XMLTypePackageImpl/30`,1955),q(1956,1,pK,mae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/31`,1956),q(1957,1,pK,hae),Q.dk=function(e){return j(e,190)},Q.ek=function(e){return V(Kq,X,190,e,0,1)},L(jK,`XMLTypePackageImpl/32`,1957),q(1958,1,pK,gae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/33`,1958),q(1959,1,pK,_ae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/34`,1959),q(1960,1,pK,vae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/35`,1960),q(1961,1,pK,yae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/36`,1961),q(1962,1,pK,bae),Q.dk=function(e){return j(e,16)},Q.ek=function(e){return V(dq,_B,16,e,0,1)},L(jK,`XMLTypePackageImpl/37`,1962),q(1963,1,pK,xae),Q.dk=function(e){return j(e,16)},Q.ek=function(e){return V(dq,_B,16,e,0,1)},L(jK,`XMLTypePackageImpl/38`,1963),q(1964,1,pK,Sae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/39`,1964),q(1929,1,pK,Cae),Q.dk=function(e){return j(e,672)},Q.ek=function(e){return V(y9,BL,2085,e,0,1)},L(jK,`XMLTypePackageImpl/4`,1929),q(1965,1,pK,wae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/40`,1965),q(1966,1,pK,Tae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/41`,1966),q(1967,1,pK,Eae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/42`,1967),q(1968,1,pK,Dae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/43`,1968),q(1969,1,pK,Oae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/44`,1969),q(1970,1,pK,kae),Q.dk=function(e){return j(e,191)},Q.ek=function(e){return V(Zq,X,191,e,0,1)},L(jK,`XMLTypePackageImpl/45`,1970),q(1971,1,pK,Aae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/46`,1971),q(1972,1,pK,jae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/47`,1972),q(1973,1,pK,Mae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/48`,1973),q(1974,1,pK,Nae),Q.dk=function(e){return j(e,191)},Q.ek=function(e){return V(Zq,X,191,e,0,1)},L(jK,`XMLTypePackageImpl/49`,1974),q(1930,1,pK,Pae),Q.dk=function(e){return j(e,673)},Q.ek=function(e){return V(yVt,BL,2086,e,0,1)},L(jK,`XMLTypePackageImpl/5`,1930),q(1975,1,pK,Fae),Q.dk=function(e){return j(e,190)},Q.ek=function(e){return V(Kq,X,190,e,0,1)},L(jK,`XMLTypePackageImpl/50`,1975),q(1976,1,pK,Iae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/51`,1976),q(1977,1,pK,Lae),Q.dk=function(e){return j(e,15)},Q.ek=function(e){return V(Wq,X,15,e,0,1)},L(jK,`XMLTypePackageImpl/52`,1977),q(1931,1,pK,Rae),Q.dk=function(e){return Nf(e)},Q.ek=function(e){return V(eJ,X,2,e,6,1)},L(jK,`XMLTypePackageImpl/6`,1931),q(1932,1,pK,zae),Q.dk=function(e){return j(e,195)},Q.ek=function(e){return V(X9,X,195,e,0,2)},L(jK,`XMLTypePackageImpl/7`,1932),q(1933,1,pK,Bae),Q.dk=function(e){return jf(e)},Q.ek=function(e){return V(Lq,X,473,e,8,1)},L(jK,`XMLTypePackageImpl/8`,1933),q(1934,1,pK,Vae),Q.dk=function(e){return j(e,221)},Q.ek=function(e){return V(Rq,X,221,e,0,1)},L(jK,`XMLTypePackageImpl/9`,1934);var A9,j9,M9,N9,$;q(53,63,DR,Tc),L(WK,`RegEx/ParseException`,53),q(821,1,{},Hae),Q._l=function(e){return e<this.j&&ny(this.i,e)==63},Q.am=function(){var e,t,n,r,i;if(this.c!=10)throw E(new Tc(AL((Np(),_G))));switch(e=this.a,e){case 101:e=27;break;case 102:e=12;break;case 110:e=10;break;case 114:e=13;break;case 116:e=9;break;case 120:if(bL(this),this.c!=0)throw E(new Tc(AL((Np(),OG))));if(this.a==123){i=0,n=0;do{if(bL(this),this.c!=0)throw E(new Tc(AL((Np(),OG))));if((i=Ej(this.a))<0)break;if(n>n*16)throw E(new Tc(AL((Np(),mbt))));n=n*16+i}while(1);if(this.a!=125)throw E(new Tc(AL((Np(),hbt))));if(n>GK)throw E(new Tc(AL((Np(),gbt))));e=n}else{if(i=0,this.c!=0||(i=Ej(this.a))<0||(n=i,bL(this),this.c!=0||(i=Ej(this.a))<0))throw E(new Tc(AL((Np(),OG))));n=n*16+i,e=n}break;case 117:if(r=0,bL(this),this.c!=0||(r=Ej(this.a))<0||(t=r,bL(this),this.c!=0||(r=Ej(this.a))<0)||(t=t*16+r,bL(this),this.c!=0||(r=Ej(this.a))<0)||(t=t*16+r,bL(this),this.c!=0||(r=Ej(this.a))<0))throw E(new Tc(AL((Np(),OG))));t=t*16+r,e=t;break;case 118:if(bL(this),this.c!=0||(r=Ej(this.a))<0||(t=r,bL(this),this.c!=0||(r=Ej(this.a))<0)||(t=t*16+r,bL(this),this.c!=0||(r=Ej(this.a))<0)||(t=t*16+r,bL(this),this.c!=0||(r=Ej(this.a))<0)||(t=t*16+r,bL(this),this.c!=0||(r=Ej(this.a))<0)||(t=t*16+r,bL(this),this.c!=0||(r=Ej(this.a))<0))throw E(new Tc(AL((Np(),OG))));if(t=t*16+r,t>GK)throw E(new Tc(AL((Np(),`parser.descappe.4`))));e=t;break;case 65:case 90:case 122:throw E(new Tc(AL((Np(),_bt))))}return e},Q.bm=function(e){var t,n;switch(e){case 100:n=(this.e&32)==32?fL(`Nd`,!0):(EL(),z9);break;case 68:n=(this.e&32)==32?fL(`Nd`,!1):(EL(),JVt);break;case 119:n=(this.e&32)==32?fL(`IsWord`,!0):(EL(),U9);break;case 87:n=(this.e&32)==32?fL(`IsWord`,!1):(EL(),XVt);break;case 115:n=(this.e&32)==32?fL(`IsSpace`,!0):(EL(),H9);break;case 83:n=(this.e&32)==32?fL(`IsSpace`,!1):(EL(),YVt);break;default:throw E(new tc((t=e,_xt+t.toString(16))))}return n},Q.cm=function(e){var t,n,r,i,a,o,s,c,l,u,d,f;for(this.b=1,bL(this),t=null,this.c==0&&this.a==94?(bL(this),e?u=(EL(),EL(),++W9,new fx(5)):(t=(EL(),EL(),++W9,new fx(4)),ZP(t,0,GK),u=(++W9,new fx(4)))):u=(EL(),EL(),++W9,new fx(4)),i=!0;(f=this.c)!=1&&(f!=0||this.a!=93||i);){if(i=!1,n=this.a,r=!1,f==10)switch(n){case 100:case 68:case 119:case 87:case 115:case 83:PI(u,this.bm(n)),r=!0;break;case 105:case 73:case 99:case 67:n=this.sm(u,n),n<0&&(r=!0);break;case 112:case 80:if(d=jN(this,n),!d)throw E(new Tc(AL((Np(),SG))));PI(u,d),r=!0;break;default:n=this.am()}else if(f==20){if(o=rh(this.i,58,this.d),o<0)throw E(new Tc(AL((Np(),CG))));if(s=!0,ny(this.i,this.d)==94&&(++this.d,s=!1),a=eb(this.i,this.d,o),c=tVe(a,s,(this.e&512)==512),!c)throw E(new Tc(AL((Np(),lbt))));if(PI(u,c),r=!0,o+1>=this.j||ny(this.i,o+1)!=93)throw E(new Tc(AL((Np(),CG))));this.d=o+2}if(bL(this),!r){if(this.c!=0||this.a!=45)ZP(u,n,n);else{if(bL(this),(f=this.c)==1)throw E(new Tc(AL((Np(),wG))));f==0&&this.a==93?(ZP(u,n,n),ZP(u,45,45)):(l=this.a,f==10&&(l=this.am()),bL(this),ZP(u,n,l))}}(this.e&IG)==IG&&this.c==0&&this.a==44&&bL(this)}if(this.c==1)throw E(new Tc(AL((Np(),wG))));return t&&($I(t,u),u=t),fP(u),HI(u),this.b=0,bL(this),u},Q.dm=function(){for(var e,t,n=this.cm(!1),r;(r=this.c)!=7;)if(e=this.a,r==0&&(e==45||e==38)||r==4){if(bL(this),this.c!=9)throw E(new Tc(AL((Np(),dbt))));if(t=this.cm(!1),r==4)PI(n,t);else if(e==45)$I(n,t);else if(e==38)Cut(n,t);else throw E(new tc(`ASSERT`))}else throw E(new Tc(AL((Np(),fbt))));return bL(this),n},Q.em=function(){var e=this.a-48,t=(EL(),EL(),++W9,new cb(12,null,e));return!this.g&&(this.g=new xs),_s(this.g,new qde(e)),bL(this),t},Q.fm=function(){return bL(this),EL(),QVt},Q.gm=function(){return bL(this),EL(),ZVt},Q.hm=function(){throw E(new Tc(AL((Np(),kG))))},Q.im=function(){throw E(new Tc(AL((Np(),kG))))},Q.jm=function(){return bL(this),Bqe()},Q.km=function(){return bL(this),EL(),eHt},Q.lm=function(){return bL(this),EL(),nHt},Q.mm=function(){var e;if(this.d>=this.j||((e=ny(this.i,this.d++))&65504)!=64)throw E(new Tc(AL((Np(),obt))));return bL(this),EL(),EL(),++W9,new i_(0,e-64)},Q.nm=function(){return bL(this),dst()},Q.om=function(){return bL(this),EL(),rHt},Q.pm=function(){var e=(EL(),EL(),++W9,new i_(0,105));return bL(this),e},Q.qm=function(){return bL(this),EL(),tHt},Q.rm=function(){return bL(this),EL(),$Vt},Q.sm=function(e,t){return this.am()},Q.tm=function(){return bL(this),EL(),KVt},Q.um=function(){var e,t,n,r,i;if(this.d+1>=this.j)throw E(new Tc(AL((Np(),rbt))));if(r=-1,t=null,e=ny(this.i,this.d),49<=e&&e<=57){if(r=e-48,!this.g&&(this.g=new xs),_s(this.g,new qde(r)),++this.d,ny(this.i,this.d)!=41)throw E(new Tc(AL((Np(),yG))));++this.d}else switch(e==63&&--this.d,bL(this),t=mpt(this),t.e){case 20:case 21:case 22:case 23:break;case 8:if(this.c!=7)throw E(new Tc(AL((Np(),yG))));break;default:throw E(new Tc(AL((Np(),ibt))))}if(bL(this),i=wA(this),n=null,i.e==2){if(i.Nm()!=2)throw E(new Tc(AL((Np(),abt))));n=i.Jm(1),i=i.Jm(0)}if(this.c!=7)throw E(new Tc(AL((Np(),yG))));return bL(this),EL(),EL(),++W9,new KHe(r,t,i,n)},Q.vm=function(){return bL(this),EL(),qVt},Q.wm=function(){var e;if(bL(this),e=Q_(24,wA(this)),this.c!=7)throw E(new Tc(AL((Np(),yG))));return bL(this),e},Q.xm=function(){var e;if(bL(this),e=Q_(20,wA(this)),this.c!=7)throw E(new Tc(AL((Np(),yG))));return bL(this),e},Q.ym=function(){var e;if(bL(this),e=Q_(22,wA(this)),this.c!=7)throw E(new Tc(AL((Np(),yG))));return bL(this),e},Q.zm=function(){var e=0,t,n=0,r,i;for(t=-1;this.d<this.j&&(t=ny(this.i,this.d),i=YN(t),i!=0);)e|=i,++this.d;if(this.d>=this.j)throw E(new Tc(AL((Np(),bG))));if(t==45){for(++this.d;this.d<this.j&&(t=ny(this.i,this.d),i=YN(t),i!=0);)n|=i,++this.d;if(this.d>=this.j)throw E(new Tc(AL((Np(),bG))))}if(t==58){if(++this.d,bL(this),r=kAe(wA(this),e,n),this.c!=7)throw E(new Tc(AL((Np(),yG))));bL(this)}else if(t==41)++this.d,bL(this),r=kAe(wA(this),e,n);else throw E(new Tc(AL((Np(),nbt))));return r},Q.Am=function(){var e;if(bL(this),e=Q_(21,wA(this)),this.c!=7)throw E(new Tc(AL((Np(),yG))));return bL(this),e},Q.Bm=function(){var e;if(bL(this),e=Q_(23,wA(this)),this.c!=7)throw E(new Tc(AL((Np(),yG))));return bL(this),e},Q.Cm=function(){var e,t;if(bL(this),e=this.f++,t=$_(wA(this),e),this.c!=7)throw E(new Tc(AL((Np(),yG))));return bL(this),t},Q.Dm=function(){var e;if(bL(this),e=$_(wA(this),0),this.c!=7)throw E(new Tc(AL((Np(),yG))));return bL(this),e},Q.Em=function(e){return bL(this),this.c==5?(bL(this),r_(e,(EL(),EL(),++W9,new $x(9,e)))):r_(e,(EL(),EL(),++W9,new $x(3,e)))},Q.Fm=function(e){var t;return bL(this),t=(EL(),EL(),++W9,new Pp(2)),this.c==5?(bL(this),WI(t,B9),WI(t,e)):(WI(t,e),WI(t,B9)),t},Q.Gm=function(e){return bL(this),this.c==5?(bL(this),EL(),EL(),++W9,new $x(9,e)):(EL(),EL(),++W9,new $x(3,e))},Q.a=0,Q.b=0,Q.c=0,Q.d=0,Q.e=0,Q.f=1,Q.g=null,Q.j=0,L(WK,`RegEx/RegexParser`,821),q(1913,821,{},spe),Q._l=function(e){return!1},Q.am=function(){return lF(this)},Q.bm=function(e){return $F(e)},Q.cm=function(e){return Npt(this)},Q.dm=function(){throw E(new Tc(AL((Np(),kG))))},Q.em=function(){throw E(new Tc(AL((Np(),kG))))},Q.fm=function(){throw E(new Tc(AL((Np(),kG))))},Q.gm=function(){throw E(new Tc(AL((Np(),kG))))},Q.hm=function(){return bL(this),$F(67)},Q.im=function(){return bL(this),$F(73)},Q.jm=function(){throw E(new Tc(AL((Np(),kG))))},Q.km=function(){throw E(new Tc(AL((Np(),kG))))},Q.lm=function(){throw E(new Tc(AL((Np(),kG))))},Q.mm=function(){return bL(this),$F(99)},Q.nm=function(){throw E(new Tc(AL((Np(),kG))))},Q.om=function(){throw E(new Tc(AL((Np(),kG))))},Q.pm=function(){return bL(this),$F(105)},Q.qm=function(){throw E(new Tc(AL((Np(),kG))))},Q.rm=function(){throw E(new Tc(AL((Np(),kG))))},Q.sm=function(e,t){return PI(e,$F(t)),-1},Q.tm=function(){return bL(this),EL(),EL(),++W9,new i_(0,94)},Q.um=function(){throw E(new Tc(AL((Np(),kG))))},Q.vm=function(){return bL(this),EL(),EL(),++W9,new i_(0,36)},Q.wm=function(){throw E(new Tc(AL((Np(),kG))))},Q.xm=function(){throw E(new Tc(AL((Np(),kG))))},Q.ym=function(){throw E(new Tc(AL((Np(),kG))))},Q.zm=function(){throw E(new Tc(AL((Np(),kG))))},Q.Am=function(){throw E(new Tc(AL((Np(),kG))))},Q.Bm=function(){throw E(new Tc(AL((Np(),kG))))},Q.Cm=function(){var e;if(bL(this),e=$_(wA(this),0),this.c!=7)throw E(new Tc(AL((Np(),yG))));return bL(this),e},Q.Dm=function(){throw E(new Tc(AL((Np(),kG))))},Q.Em=function(e){return bL(this),r_(e,(EL(),EL(),++W9,new $x(3,e)))},Q.Fm=function(e){var t;return bL(this),t=(EL(),EL(),++W9,new Pp(2)),WI(t,e),WI(t,B9),t},Q.Gm=function(e){return bL(this),EL(),EL(),++W9,new $x(3,e)};var P9=null,F9=null;L(WK,`RegEx/ParserForXMLSchema`,1913),q(121,1,eq,Xo),Q.Hm=function(e){throw E(new tc(`Not supported.`))},Q.Im=function(){return-1},Q.Jm=function(e){return null},Q.Km=function(){return null},Q.Lm=function(e){},Q.Mm=function(e){},Q.Nm=function(){return 0},Q.Ib=function(){return this.Om(0)},Q.Om=function(e){return this.e==11?`.`:``},Q.e=0;var VVt,I9,L9,HVt,UVt,R9=null,z9,WVt=null,GVt,B9,V9=null,KVt,qVt,JVt,YVt,XVt,ZVt,H9,QVt,$Vt,eHt,tHt,U9,nHt,rHt,W9=0,iHt=L(WK,`RegEx/Token`,121);q(137,121,{3:1,137:1,121:1},fx),Q.Om=function(e){var t,n,r;if(this.e==4){if(this==GVt)n=`.`;else if(this==z9)n=`\\d`;else if(this==U9)n=`\\w`;else if(this==H9)n=`\\s`;else{for(r=new Nc,r.a+=`[`,t=0;t<this.b.length;t+=2)(e&IG)!=0&&t>0&&(r.a+=`,`),this.b[t]===this.b[t+1]?Uf(r,_I(this.b[t])):(Uf(r,_I(this.b[t])),r.a+=`-`,Uf(r,_I(this.b[t+1])));r.a+=`]`,n=r.a}}else if(this==JVt)n=`\\D`;else if(this==XVt)n=`\\W`;else if(this==YVt)n=`\\S`;else{for(r=new Nc,r.a+=`[^`,t=0;t<this.b.length;t+=2)(e&IG)!=0&&t>0&&(r.a+=`,`),this.b[t]===this.b[t+1]?Uf(r,_I(this.b[t])):(Uf(r,_I(this.b[t])),r.a+=`-`,Uf(r,_I(this.b[t+1])));r.a+=`]`,n=r.a}return n},Q.a=!1,Q.c=!1,L(WK,`RegEx/RangeToken`,137),q(581,1,{581:1},qde),Q.a=0,L(WK,`RegEx/RegexParser/ReferencePosition`,581),q(580,1,{3:1,580:1},age),Q.Fb=function(e){var t;return e==null||!j(e,580)?!1:(t=P(e,580),Yh(this.b,t.b)&&this.a==t.a)},Q.Hb=function(){return MD(this.b+`/`+VP(this.a))},Q.Ib=function(){return this.c.Om(this.a)},Q.a=0,L(WK,`RegEx/RegularExpression`,580),q(228,121,eq,i_),Q.Im=function(){return this.a},Q.Om=function(e){var t,n,r;switch(this.e){case 0:switch(this.a){case 124:case 42:case 43:case 63:case 40:case 41:case 46:case 91:case 123:case 92:r=`\\`+Fh(this.a&IR);break;case 12:r=`\\f`;break;case 10:r=`\\n`;break;case 13:r=`\\r`;break;case 9:r=`\\t`;break;case 27:r=`\\e`;break;default:this.a>=xz?(n=(t=this.a>>>0,`0`+t.toString(16)),r=`\\v`+eb(n,n.length-6,n.length)):r=``+Fh(this.a&IR)}break;case 8:r=this==KVt||this==qVt?``+Fh(this.a&IR):`\\`+Fh(this.a&IR);break;default:r=null}return r},Q.a=0,L(WK,`RegEx/Token/CharToken`,228),q(323,121,eq,$x),Q.Jm=function(e){return this.a},Q.Lm=function(e){this.b=e},Q.Mm=function(e){this.c=e},Q.Nm=function(){return 1},Q.Om=function(e){var t;if(this.e==3){if(this.c<0&&this.b<0)t=this.a.Om(e)+`*`;else if(this.c==this.b)t=this.a.Om(e)+`{`+this.c+`}`;else if(this.c>=0&&this.b>=0)t=this.a.Om(e)+`{`+this.c+`,`+this.b+`}`;else if(this.c>=0&&this.b<0)t=this.a.Om(e)+`{`+this.c+`,}`;else throw E(new tc(`Token#toString(): CLOSURE `+this.c+zL+this.b))}else if(this.c<0&&this.b<0)t=this.a.Om(e)+`*?`;else if(this.c==this.b)t=this.a.Om(e)+`{`+this.c+`}?`;else if(this.c>=0&&this.b>=0)t=this.a.Om(e)+`{`+this.c+`,`+this.b+`}?`;else if(this.c>=0&&this.b<0)t=this.a.Om(e)+`{`+this.c+`,}?`;else throw E(new tc(`Token#toString(): NONGREEDYCLOSURE `+this.c+zL+this.b));return t},Q.b=0,Q.c=0,L(WK,`RegEx/Token/ClosureToken`,323),q(822,121,eq,fAe),Q.Jm=function(e){return e==0?this.a:this.b},Q.Nm=function(){return 2},Q.Om=function(e){return this.b.e==3&&this.b.Jm(0)==this.a?this.a.Om(e)+`+`:this.b.e==9&&this.b.Jm(0)==this.a?this.a.Om(e)+`+?`:this.a.Om(e)+(``+this.b.Om(e))},L(WK,`RegEx/Token/ConcatToken`,822),q(1911,121,eq,KHe),Q.Jm=function(e){if(e==0)return this.d;if(e==1)return this.b;throw E(new tc(`Internal Error: `+e))},Q.Nm=function(){return this.b?2:1},Q.Om=function(e){var t=this.c>0?`(?(`+this.c+`)`:this.a.e==8?`(?(`+this.a+`)`:`(?`+this.a;return this.b?t+=this.d+`|`+this.b+`)`:t+=this.d+`)`,t},Q.c=0,L(WK,`RegEx/Token/ConditionToken`,1911),q(1912,121,eq,VFe),Q.Jm=function(e){return this.b},Q.Nm=function(){return 1},Q.Om=function(e){return`(?`+(this.a==0?``:VP(this.a))+(this.c==0?``:VP(this.c))+`:`+this.b.Om(e)+`)`},Q.a=0,Q.c=0,L(WK,`RegEx/Token/ModifierToken`,1912),q(823,121,eq,ije),Q.Jm=function(e){return this.a},Q.Nm=function(){return 1},Q.Om=function(e){var t=null;switch(this.e){case 6:t=this.b==0?`(?:`+this.a.Om(e)+`)`:`(`+this.a.Om(e)+`)`;break;case 20:t=`(?=`+this.a.Om(e)+`)`;break;case 21:t=`(?!`+this.a.Om(e)+`)`;break;case 22:t=`(?<=`+this.a.Om(e)+`)`;break;case 23:t=`(?<!`+this.a.Om(e)+`)`;break;case 24:t=`(?>`+this.a.Om(e)+`)`}return t},Q.b=0,L(WK,`RegEx/Token/ParenToken`,823),q(518,121,{3:1,121:1,518:1},cb),Q.Km=function(){return this.b},Q.Om=function(e){return this.e==12?`\\`+this.a:Vet(this.b)},Q.a=0,L(WK,`RegEx/Token/StringToken`,518),q(466,121,eq,Pp),Q.Hm=function(e){WI(this,e)},Q.Jm=function(e){return P(Gv(this.a,e),121)},Q.Nm=function(){return this.a?this.a.a.c.length:0},Q.Om=function(e){var t,n,r,i,a;if(this.e==1){if(this.a.a.c.length==2)t=P(Gv(this.a,0),121),n=P(Gv(this.a,1),121),i=n.e==3&&n.Jm(0)==t?t.Om(e)+`+`:n.e==9&&n.Jm(0)==t?t.Om(e)+`+?`:t.Om(e)+(``+n.Om(e));else{for(a=new Nc,r=0;r<this.a.a.c.length;r++)Uf(a,P(Gv(this.a,r),121).Om(e));i=a.a}return i}if(this.a.a.c.length==2&&P(Gv(this.a,1),121).e==7)i=P(Gv(this.a,0),121).Om(e)+`?`;else if(this.a.a.c.length==2&&P(Gv(this.a,0),121).e==7)i=P(Gv(this.a,1),121).Om(e)+`??`;else{for(a=new Nc,Uf(a,P(Gv(this.a,0),121).Om(e)),r=1;r<this.a.a.c.length;r++)a.a+=`|`,Uf(a,P(Gv(this.a,r),121).Om(e));i=a.a}return i},L(WK,`RegEx/Token/UnionToken`,466),q(515,1,{590:1},xl),Q.Ib=function(){return this.a.b},L(xxt,`XMLTypeUtil/PatternMatcherImpl`,515),q(1676,1489,{},Uae);var aHt;L(xxt,`XMLTypeValidator`,1676),q(270,1,lR,C_),Q.Ic=function(e){vS(this,e)},Q.Jc=function(){return(this.b-this.a)*this.c<0?G9:new hm(this)},Q.a=0,Q.b=0,Q.c=0;var G9;L(nq,`ExclusiveRange`,270),q(1055,1,tR,Wae),Q.Rb=function(e){P(e,15),ibe()},Q.Nb=function(e){ev(this,e)},Q.Pb=function(){return Nhe()},Q.Ub=function(){return Phe()},Q.Wb=function(e){P(e,15),rbe()},Q.Ob=function(){return!1},Q.Sb=function(){return!1},Q.Tb=function(){return-1},Q.Vb=function(){return-1},Q.Qb=function(){throw E(new xc(wxt))},L(nq,`ExclusiveRange/1`,1055),q(259,1,tR,hm),Q.Rb=function(e){P(e,15),abe()},Q.Nb=function(e){ev(this,e)},Q.Pb=function(){return MJe(this)},Q.Ub=function(){return uVe(this)},Q.Wb=function(e){P(e,15),obe()},Q.Ob=function(){return this.c.c<0?this.a>=this.c.b:this.a<=this.c.b},Q.Sb=function(){return this.b>0},Q.Tb=function(){return this.b},Q.Vb=function(){return this.b-1},Q.Qb=function(){throw E(new xc(wxt))},Q.a=0,Q.b=0,L(nq,`ExclusiveRange/RangeIterator`,259);var K9=ey(HG,`C`),q9=ey(GG,`I`),J9=ey(ML,`Z`),Y9=ey(KG,`J`),X9=ey(VG,`B`),Z9=ey(UG,`D`),Q9=ey(WG,`F`),$9=ey(qG,`S`),oHt=Jg(`org.eclipse.elk.core.labels`,`ILabelManager`),sHt=Jg(eG,`DiagnosticChain`),cHt=Jg(Qbt,`ResourceSet`),lHt=L(eG,`InvocationTargetException`,null),uHt=(Mc(),aze),dHt=dHt=a4e;pWe(pfe),tGe(`permProps`,[[[`locale`,`default`],[Txt,`gecko1_8`]],[[`locale`,`default`],[Txt,`safari`]]]),dHt(null,`elk`,null)}))(),1),$ee=Zt.default.Worker??Zt.default.default??Zt.default,Qt=null,$t;function ete(){return Qt||(Qt=new $ee,Qt.onmessage=e=>{$t=e.data},Qt.dispatcher.saveDispatch({data:{id:0,cmd:`register`,algorithms:[`layered`]}}),Qt)}function en(e){let t=ete();if($t=void 0,t.dispatcher.saveDispatch({data:{id:1,cmd:`layout`,graph:e,layoutOptions:{},options:{}}}),!$t)throw Error(`ELK returned no result (the synchronous dispatch path of elkjs changed)`);if($t.error)throw Error(`ELK layout failed: ${String($t.error.message??$t.error)}`);return $t.data}var tn=10,tte=1400,nn=16,rn=11,an={out:{bottom:0,right:40,left:40,top:700},in:{top:0,left:40,right:40,bottom:700}},on=[1,0,-1,0],sn=[0,1,0,-1],cn=(e,t,n,r,i,a)=>Math.max(e,n)>i.x-a&&Math.min(e,n)<i.x+i.w+a&&Math.max(t,r)>i.y-a&&Math.min(t,r)<i.y+i.h+a;function ln(e,t,n=!1,r=0){let i=e.x+e.w/2,a=e.y+e.h/2,o=[[i,e.y,`top`],[i,e.y+e.h,`bottom`],[e.x,a,`left`],[e.x+e.w,a,`right`]];if(!t){for(let t of[.25,.75])o.push([e.x+e.w*t,e.y,`top`,!0],[e.x+e.w*t,e.y+e.h,`bottom`,!0]);if(n){let t=r?Math.min(Math.max(r,e.h/4),e.h/2-8):e.h/4;for(let n of[-t,t])o.push([e.x,e.y+e.h/2+n,`left`,!0],[e.x+e.w,e.y+e.h/2+n,`right`,!0])}}return o}var un={top:3,bottom:1,left:2,right:0};function dn(e,t,n,r,i){let a=Math.abs(t-r)<.5;for(let[[o,s],[c,l]]of i)if(Math.abs(s-l)<.5===a){if(a){if(Math.abs(s-t)>=10)continue;if(Math.min(Math.max(e,n),Math.max(o,c))-Math.max(Math.min(e,n),Math.min(o,c))>.5)return!0}else{if(Math.abs(o-e)>=10)continue;if(Math.min(Math.max(t,r),Math.max(s,l))-Math.max(Math.min(t,r),Math.min(s,l))>.5)return!0}}return!1}var fn=e=>[[[e.x,e.y],[e.x+e.w,e.y]],[[e.x,e.y+e.h],[e.x+e.w,e.y+e.h]],[[e.x,e.y],[e.x,e.y+e.h]],[[e.x+e.w,e.y],[e.x+e.w,e.y+e.h]]],nte=class{constructor(){this.n=0,this.k=new Float64Array(1024),this.s=new Int32Array(1024),this.c=new Float64Array(1024)}swap(e,t){let{k:n,s:r,c:i}=this,a=n[e];n[e]=n[t],n[t]=a;let o=r[e];r[e]=r[t],r[t]=o;let s=i[e];i[e]=i[t],i[t]=s}push(e,t,n){if(this.n===this.k.length){let e=(e,t)=>{let n=new t(e.length*2);return n.set(e),n};this.k=e(this.k,Float64Array),this.s=e(this.s,Int32Array),this.c=e(this.c,Float64Array)}let r=this.n;for(this.n+=1,this.k[r]=e,this.s[r]=t,this.c[r]=n;r>0;){let e=r-1>>1;if(this.k[e]<=this.k[r])break;this.swap(e,r),r=e}}pop(){let{k:e,s:t,c:n}=this;if(this.top=[e[0],t[0],n[0]],--this.n,this.n>0){e[0]=e[this.n],t[0]=t[this.n],n[0]=n[this.n];let r=0;for(;;){let t=r*2+1,n=t+1,i=r;if(t<this.n&&e[t]<e[i]&&(i=t),n<this.n&&e[n]<e[i]&&(i=n),i===r)break;this.swap(i,r),r=i}}return this.top}get size(){return this.n}};function pn(e){let{from:t,to:n,nodes:r,blocks:i=[],routes:a=[],borders:o=[],bounds:s=null}=e,c={out:{...an.out,...e.portCost?.out},in:{...an.in,...e.portCost?.in}},l=e.crossCost??1400,u=e.parallelGap??10,d=[...a.filter(e=>!e.share&&e.points.length).flatMap(e=>[e.points[0],e.points[e.points.length-1]]),...e.taken??[]],f=([e,t])=>!d.some(([n,r])=>Math.abs(n-e)<1&&Math.abs(r-t)<1),p=ln(t,e.fromDiamond,e.sidePorts,e.sideSpread).filter(([t,n,r])=>(!e.outSides||e.outSides.includes(r))&&f([t,n])),m=t=>!e.inAt||e.inAt.some(([e,n])=>Math.abs(e-t[0])<1&&Math.abs(n-t[1])<1),h=ln(n,e.toDiamond,e.sidePorts,e.sideSpread).filter(([t,n,r])=>(!e.inSides||e.inSides.includes(r))&&f([t,n])&&m([t,n])),g=e=>e===t||e===n||e.x===t.x&&e.y===t.y||e.x===n.x&&e.y===n.y,_=r.filter(e=>!g(e)),v=new Set,y=new Set;for(let e of _)v.add(e.x-tn-1).add(e.x+e.w+tn+1),y.add(e.y-tn-1).add(e.y+e.h+tn+1);for(let e of i)v.add(e.x-4).add(e.x+e.w+4),y.add(e.y-4).add(e.y+e.h+4);for(let[[e,t],[n,r]]of o)v.add(e-10-1).add(e+10+1).add(n-10-1).add(n+10+1),y.add(t-10-1).add(t+10+1).add(r-10-1).add(r+10+1);for(let[e,t]of[...p,...h])v.add(e),y.add(t);for(let e of[t,n])v.add(e.x-tn-1).add(e.x+e.w+tn+1),y.add(e.y-tn-1).add(e.y+e.h+tn+1);for(let t of a)for(let[n,r]of t.points)v.add(n-u-1).add(n+u+1),y.add(r-u-1).add(r+u+1),t.share&&e.join&&(v.add(n),y.add(r));let b=e=>[...e].map(e=>Math.round(e*2)/2).sort((e,t)=>e-t).filter((e,t,n)=>t===0||e!==n[t-1]),x=b(v),S=b(y),C=e=>e.flatMap((t,n)=>n===0?[t]:[(e[n-1]+t)/2,t]);x=C(x),S=C(S);let ee=new Map(x.map((e,t)=>[e,t])),w=new Map(S.map((e,t)=>[e,t])),te=x.length,ne=S.length,re=[],ie=[];for(let e of a)for(let t=1;t<e.points.length;t+=1){let[n,r]=e.points[t-1],[i,a]=e.points[t];Math.abs(r-a)<.5?re.push({y:r,a:Math.min(n,i),b:Math.max(n,i),share:e.share}):ie.push({x:n,a:Math.min(r,a),b:Math.max(r,a),share:e.share})}let ae=(e,r,a,c)=>{if(s&&(Math.min(e,a)<s.x||Math.max(e,a)>s.x+s.w||Math.min(r,c)<s.y||Math.max(r,c)>s.y+s.h)||dn(e,r,a,c,o)||_.some(t=>cn(e,r,a,c,t,tn))||[t,n].some(t=>cn(e,r,a,c,t,-.5))||i.some(t=>cn(e,r,a,c,t,2)))return null;if(Math.abs(r-c)<.5){let t=Math.min(e,a),n=Math.max(e,a);return re.some(e=>!e.share&&Math.abs(e.y-r)<u&&Math.min(n,e.b)-Math.max(t,e.a)>.5)?null:ie.filter(e=>!e.share&&e.x>=t-.01&&e.x<n-.01&&r>e.a+.5&&r<e.b-.5).length}let l=Math.min(r,c),d=Math.max(r,c);return ie.some(t=>!t.share&&Math.abs(t.x-e)<u&&Math.min(d,t.b)-Math.max(l,t.a)>.5)?null:re.filter(t=>!t.share&&t.y>=l-.01&&t.y<d-.01&&e>t.a+.5&&e<t.b-.5).length},oe=(e,t,n,r)=>Math.abs(t-r)<.5?re.some(r=>r.share&&Math.abs(r.y-t)<.5&&Math.min(Math.max(e,n),r.b)-Math.max(Math.min(e,n),r.a)>.5):ie.some(n=>n.share&&Math.abs(n.x-e)<.5&&Math.min(Math.max(t,r),n.b)-Math.max(Math.min(t,r),n.a)>.5),se=te*ne,ce=new Uint8Array(se),le=new Uint8Array(se),ue=new Uint16Array(se),de=new Uint16Array(se),fe=new Uint8Array(se),pe=new Uint8Array(se),me=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>1;e[i]<t?n=i+1:r=i}return n},he=(e,t,n,r,i)=>{let a=Math.max(0,me(x,e)-1),o=Math.min(te-1,me(x,t)+1),s=Math.max(0,me(S,n)-1),c=Math.min(ne-1,me(S,r)+1);for(let e=s;e<=c;e+=1)for(let t=a;t<=o;t+=1)i(t,e)},ge=e=>(t,n)=>{let r=n*te+t;t+1<te&&!ce[r]&&e(x[t],S[n],x[t+1],S[n])&&(ce[r]=1),n+1<ne&&!le[r]&&e(x[t],S[n],x[t],S[n+1])&&(le[r]=1)};for(let e of _)he(e.x-tn,e.x+e.w+tn,e.y-tn,e.y+e.h+tn,ge((t,n,r,i)=>cn(t,n,r,i,e,tn)));for(let e of[t,n])he(e.x,e.x+e.w,e.y,e.y+e.h,ge((t,n,r,i)=>cn(t,n,r,i,e,-.5)));for(let e of i)he(e.x-2,e.x+e.w+2,e.y-2,e.y+e.h+2,ge((t,n,r,i)=>cn(t,n,r,i,e,2)));for(let e of o){let[[t,n],[r,i]]=e;he(Math.min(t,r)-10,Math.max(t,r)+10,Math.min(n,i)-10,Math.max(n,i)+10,ge((t,n,r,i)=>dn(t,n,r,i,[e])))}for(let t of re)t.share?he(t.a,t.b,t.y,t.y,(n,r)=>{e.join&&n+1<te&&Math.abs(t.y-S[r])<.5&&x[n]>=t.a-.5&&x[n+1]<=t.b+.5&&(fe[r*te+n]=1)}):(he(t.a,t.b,t.y-u,t.y+u,(e,n)=>{e+1<te&&Math.abs(t.y-S[n])<u&&Math.min(x[e+1],t.b)-Math.max(x[e],t.a)>.5&&(ce[n*te+e]=1)}),he(t.a,t.b,t.y,t.y,(e,n)=>{n+1<ne&&t.y>=S[n]-.01&&t.y<S[n+1]-.01&&x[e]>t.a+.5&&x[e]<t.b-.5&&(de[n*te+e]+=1)}));for(let t of ie)t.share?he(t.x,t.x,t.a,t.b,(n,r)=>{e.join&&r+1<ne&&Math.abs(t.x-x[n])<.5&&S[r]>=t.a-.5&&S[r+1]<=t.b+.5&&(pe[r*te+n]=1)}):(he(t.x-u,t.x+u,t.a,t.b,(e,n)=>{n+1<ne&&Math.abs(t.x-x[e])<u&&Math.min(S[n+1],t.b)-Math.max(S[n],t.a)>.5&&(le[n*te+e]=1)}),he(t.x,t.x,t.a,t.b,(e,n)=>{e+1<te&&t.x>=x[e]-.01&&t.x<x[e+1]-.01&&S[n]>t.a+.5&&S[n]<t.b-.5&&(ue[n*te+e]+=1)}));let _e=new Uint8Array(se),ve=new Uint8Array(se);for(let t of e.soft??[])he(t.x,t.x+t.w,t.y,t.y+t.h,(e,n)=>{let r=n*te+e,i=(e,n)=>e>t.x&&e<t.x+t.w&&n>t.y&&n<t.y+t.h;e+1<te&&i((x[e]+x[e+1])/2,S[n])&&(_e[r]=1),n+1<ne&&i(x[e],(S[n]+S[n+1])/2)&&(ve[r]=1)});let ye=(e,t,n,r)=>!s||!(Math.min(e,n)<s.x||Math.max(e,n)>s.x+s.w||Math.min(t,r)<s.y||Math.max(t,r)>s.y+s.h),be=(e,t,n)=>{let r=e+on[n],i=t+sn[n];if(r<0||i<0||r>=te||i>=ne)return null;let a=n===0||n===2,o=a?t*te+Math.min(e,r):Math.min(t,i)*te+e;if((a?ce[o]:le[o])||!ye(x[e],S[t],x[r],S[i]))return null;let s=Math.abs(x[r]-x[e])+Math.abs(S[i]-S[t]),c=a?ue[o]:de[o],u=a?fe[o]:pe[o],d=a?_e[o]:ve[o];return{ni:r,nj:i,cost:s*(u?.8:d?1.05:1)+c*l}},xe=new Map;for(let[e,t,n,r]of h){let i=ee.get(Math.round(e*2)/2),a=w.get(Math.round(t*2)/2);if(i===void 0||a===void 0)continue;let o=(un[n]+2)%4;xe.set((a*te+i)*4+o,c.in[n]+(r?nn:0))}let Se=new Uint8Array(te*ne);for(let[e,t,n]of h){let r=ee.get(Math.round(e*2)/2),i=w.get(Math.round(t*2)/2);if(r===void 0||i===void 0)continue;let a=un[n];for(let n=r+on[a],o=i+sn[a];n>=0&&o>=0&&n<te&&o<ne&&!(Math.abs(x[n]-e)+Math.abs(S[o]-t)>=rn);n+=on[a],o+=sn[a])Se[o*te+n]=1}let Ce=h.map(([e,t,n])=>[e,t,(un[n]+2)%4]),we=e.join&&a.some(e=>e.share)?.8:1,Te=t=>{if(e.exhaustive)return 0;let n=t%4,r=(t-n)/4,i=r%te,a=(r-i)/te,o=x[i],s=S[a],c=1/0;for(let[e,t,r]of Ce){let i;i=n===r?(on[n]?Math.abs(t-s)<.5&&(e-o)*on[n]>-.5:Math.abs(e-o)<.5&&(t-s)*sn[n]>-.5)?0:2:(n+2)%4===r?2:1,c=Math.min(c,Math.max(0,Math.abs(e-o)+Math.abs(t-s)-.5)*we+i*600)}return c},Ee=new Float64Array(te*ne*4).fill(1/0),De=new Int32Array(te*ne*4).fill(-1),Oe=new nte,ke=new Set;for(let[e,t,n,r]of p){let i=ee.get(Math.round(e*2)/2),a=w.get(Math.round(t*2)/2);if(i===void 0||a===void 0)continue;let o=(a*te+i)*4+un[n],s=c.out[n]+(r?nn:0);ke.add(o),s<Ee[o]&&(Ee[o]=s,Oe.push(s+Te(o),o,s))}let Ae=null,je=e.maxCost??1/0;for(;Oe.size;){let[e,t,n]=Oe.pop();if(n>Ee[t])continue;if(e>=je)break;if(xe.has(t)){let e=n+xe.get(t);e<je&&(je=e,Ae=t)}let r=t%4,i=(t-r)/4,a=i%te,o=(i-a)/te;for(let e of ke.has(t)||Se[i]?[r]:[r,(r+1)%4,(r+3)%4]){let i=be(a,o,e);if(!i)continue;let s=(i.nj*te+i.ni)*4+e,c=n+i.cost+(e===r?0:600);c<Ee[s]&&(Ee[s]=c,De[s]=t,Oe.push(c+Te(s),s,c))}}if(e.onCost?.(je),Ae===null)return null;let Me=[];for(let e=Ae;e!==-1;e=De[e]){let t=(e-e%4)/4,n=t%te,r=(t-n)/te;Me.push([x[n],S[r]])}Me.reverse();let Ne=[Me[0]];for(let e=1;e<Me.length-1;e+=1){let[t,n]=Ne[Ne.length-1],[r,i]=Me[e],[a,o]=Me[e+1];t===r&&r===a||n===i&&i===o||Ne.push(Me[e])}return Ne.push(Me[Me.length-1]),ite(Ne,ae,e.join?oe:void 0)}var rte=160;function ite(e,t,n=()=>!1){let r=e.map(e=>[...e]);for(let e=1;e<r.length-2;e+=1){let i=Math.abs(r[e][0]-r[e+1][0])<.5?0:1,a=r[e][i];if(n(...r[e],...r[e+1]))continue;let o=n=>{let a=[...r[e-1]],o=[...r[e]],s=[...r[e+1]],c=[...r[e+2]];if(o[i]=n,s[i]=n,e===1&&Math.abs(a[i]-o[i])+Math.abs(a[1-i]-o[1-i])<rn||e+2===r.length-1&&Math.abs(s[i]-c[i])+Math.abs(s[1-i]-c[1-i])<rn)return null;let l=[t(...a,...o),t(...o,...s),t(...s,...c)];return l.some(e=>e===null)?null:l.reduce((e,t)=>e+t,0)},s=o(a);if(s===null)continue;let c=e=>{let t=a;for(let n=2;n<=rte;n+=2){let r=o(a+e*n);if(r===null||r>s)return{v:t,open:!1};t=a+e*n}return{v:t,open:!0}},l=c(-1),u=c(1);if(l.open||u.open)continue;let d=Math.round((l.v+u.v)/2);r[e][i]=d,r[e+1][i]=d}return r}var mn=8,hn=3,gn=8,ate=1.2,ote=12,_n=14,vn=20,ste=10,cte=12;function yn(e){let t=0;for(let n=1;n<e.length-1;n+=1){let[r,i]=e[n-1],[a,o]=e[n],[s,c]=e[n+1];r===a&&a===s||i===o&&o===c||(t+=1)}return t}var bn={main:3,branch:2,back:1};function xn(e,t,n,r=e.points,i=!1){if(r.length<2)return 0;let a=yn(r)*(bn[e.kind]??1);if(e.kind!==`back`){for(let[i,o]of[[e.from,r[0]],[e.to,r[r.length-1]]]){if(!n.has(i))continue;let r=t.get(i),s=r.x+r.w/2,c=r.y+r.h/2;Math.abs(o[0]-s)<1||Math.abs(o[1]-c)<1||(a+=bn[e.kind])}let o=t.get(e.to);if(i&&o&&!n.has(e.to)&&r.length>=2){let t=r[r.length-1],n=r[r.length-2];t[0]===n[0]&&Math.abs(t[0]-(o.x+o.w/2))>gn&&(a+=bn[e.kind]*ate)}}return a}var Sn=e=>e.slice(1).map((t,n)=>[e[n],t]),Cn=e=>Sn(e).reduce((e,[t,n])=>e+Math.abs(n[0]-t[0])+Math.abs(n[1]-t[1]),0);function wn([e,t],n,r){let i=Math.min(e[0],t[0]),a=Math.max(e[0],t[0]),o=Math.min(e[1],t[1]),s=Math.max(e[1],t[1]);return a>n.x-r&&i<n.x+n.w+r&&s>n.y-r&&o<n.y+n.h+r}var Tn=(e,t,n)=>e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n;function lte([e,t],[n,r]){let i=Math.abs(e[0]-t[0])<.5;if(i!==Math.abs(n[0]-r[0])<.5)return!1;let[a,o]=i?[0,1]:[1,0];if(Math.abs(e[a]-n[a])>=ote)return!1;let s=Math.max(Math.min(e[o],t[o]),Math.min(n[o],r[o]));return Math.min(Math.max(e[o],t[o]),Math.max(n[o],r[o]))-s>2}function ute([e,t],[n,r]){let i=Math.abs(e[0]-t[0])<.5;if(i===Math.abs(n[0]-r[0])<.5)return!1;let[a,o,s,c]=i?[e,t,n,r]:[n,r,e,t],l=a[0],u=s[1];return l>Math.min(s[0],c[0])+.5&&l<Math.max(s[0],c[0])-.5&&u>Math.min(a[1],o[1])+.5&&u<Math.max(a[1],o[1])-.5}function En(e,t,n,r,i=new Set,a={}){let{borders:o=[],within:s=()=>null}=a,c=(e,t)=>r?[t,e]:[e,t],l=e=>{let n=t.get(e),[i,a,o,s]=r?[n.y,n.x,n.h,n.w]:[n.x,n.y,n.w,n.h];return{a0:i,a1:i+o,am:i+o/2,c0:a,c1:a+s,cm:a+s/2}},u=[...t.entries()].map(([e,t])=>({id:e,...t})),d=e=>e.labelAt&&e.labelSize?{x:e.labelAt.x,y:e.labelAt.y,w:e.labelSize.width,h:e.labelSize.height}:null,f=(e,t,n)=>Sn(e).every((e,r,i)=>u.every(a=>r===0&&a.id===t||r===i.length-1&&a.id===n||!wn(e,a,a.id===t||a.id===n?0:mn))),p=e=>Sn(e).every(e=>n.every(t=>!wn(e,t,2))),m=(e,t)=>{if(Sn(t).some(([e,t])=>dn(e[0],e[1],t[0],t[1],o)))return!1;let n=s(e);return!n||t.every(([e,t])=>e>=n.x&&e<=n.x+n.w&&t>=n.y&&t<=n.y+n.h)},h=e=>{let n=l(e.from),r=l(e.to),a=[];if(e.kind!==`back`){let t=(e,t,n)=>i.has(t)?Math.abs(n-e.cm)<1:n>=e.c0+mn&&n<=e.c1-mn,o=Math.max(n.c0,r.c0),s=Math.min(n.c1,r.c1);for(let i of[n.cm,r.cm,(o+s)/2])r.a0>n.a1&&t(n,e.from,i)&&t(r,e.to,i)&&a.push([c(n.a1,i),c(r.a0,i)]);let l=(e,t)=>i.has(t)?[e.cm]:[e.cm,e.cm-(e.c1-e.c0)/4,e.cm+(e.c1-e.c0)/4];for(let t of l(r,e.to)){let e=t>n.cm?1:-1;(e>0?t>=n.c1+_n:t<=n.c0-_n)&&r.a0>n.am+_n&&a.push([c(n.am,e>0?n.c1:n.c0),c(n.am,t),c(r.a0,t)])}for(let t of l(n,e.from)){let e=t>r.cm?r.c1:r.c0;(t>r.cm?t>=r.c1+_n:t<=r.c0-_n)&&r.am>n.a1+_n&&a.push([c(n.a1,t),c(r.am,t),c(r.am,e)])}if(r.a0-n.a1>28){let t=[.5,.25,.75].map(e=>n.a1+_n+(r.a0-n.a1-28)*e);for(let i of l(n,e.from))for(let o of l(r,e.to))if(!(Math.abs(i-o)<1))for(let e of t)a.push([c(n.a1,i),c(e,i),c(e,o),c(r.a0,o)])}}else if(r.a1<n.a0){let o=(e,t,n,r)=>{if(!i.has(t))return r?e.a0:e.a1;let a=(e.a1-e.a0)/2*(1-Math.abs(n-e.cm)/((e.c1-e.c0)/2));return r?e.am-a:e.am+a},s=(e,t,n)=>i.has(t)?Math.abs(n-e.cm)<=(e.c1-e.c0)*.35:n>=e.c0+mn&&n<=e.c1-mn,u=Math.max(n.c0,r.c0),d=Math.min(n.c1,r.c1),f=[(u+d)/2];for(let e=u+mn;e<=d-mn;e+=6)f.push(e);for(let t of f)s(n,e.from,t)&&s(r,e.to,t)&&a.push([c(o(n,e.from,t,!0),t),c(o(r,e.to,t,!1),t)]);if(i.has(e.to)){let t=r.c1-r.c0,i=[];for(let e=.04;e<=.35;e+=.02)i.push(r.cm-t*e,r.cm+t*e);for(let t of i){let i=t>n.cm?1:-1;(i>0?t<n.c1+_n:t>n.c0-_n)||a.push([c(n.am,i>0?n.c1:n.c0),c(n.am,t),c(o(r,e.to,t,!1),t)])}}let p=r.cm>n.cm?1:-1;(p>0?r.cm>=n.c1+_n:r.cm<=n.c0-_n)&&a.push([c(n.am,p>0?n.c1:n.c0),c(n.am,r.cm),c(r.a1,r.cm)]),(n.cm>r.cm?n.cm>=r.c1+_n:n.cm<=r.c0-_n)&&a.push([c(n.a0,n.cm),c(r.am,n.cm),c(r.am,n.cm>r.cm?r.c1:r.c0)]);let m=[...t.keys()].map(l).filter(e=>e.a1>r.am&&e.a0<n.am);for(let e of[-1,1]){let t=e>0?Math.max(n.c1,r.c1):Math.min(n.c0,r.c0),i=[];for(let n=0;n<cte;n+=1)i.push(t+e*(vn+n*ste));for(let t of m)i.push(e>0?t.c1+vn:t.c0-vn);for(let o of i){if(e>0?o<t:o>t)continue;let i=e>0?n.c1:n.c0,s=e>0?r.c1:r.c0;a.push([c(n.am,i),c(n.am,o),c(r.am,o),c(r.am,s)])}}}return a},g=r=>{let a=e.map(e=>({...e})),o=new Set(a.filter(e=>!(r&&e.kind===`back`))),s=e=>a.filter(t=>t!==e&&o.has(t)),c=(e,t)=>s(t).reduce((t,n)=>t+Sn(e).reduce((e,t)=>e+Sn(n.points).filter(e=>ute(t,e)).length,0),0),l=(e,t)=>s(t).some(t=>Sn(e).some(e=>Sn(t.points).some(t=>lte(e,t)))),g=(e,t)=>s(t).some(t=>{let n=d(t);return n&&Sn(e).some(e=>wn(e,n,1))}),_=(e,t,r=!1)=>{if(!e.labelSize)return{ok:!0,at:null};let{width:i,height:a}=e.labelSize,o=r=>r.x<8||r.y<8||u.some(e=>Tn(r,e,hn))||n.some(e=>Tn(r,e,hn))||s(e).some(e=>{let t=d(e);return t&&Tn(r,t,hn)||Sn(e.points).some(e=>wn(e,r,hn))})||Sn(t).some(e=>wn(e,r,1)),c=d(e);if(c&&r&&!o(c))return{ok:!0,at:e.labelAt};for(let[e,n]of Sn(t)){let t=Math.abs(e[1]-n[1])<.5,r=Math.abs(n[0]-e[0])+Math.abs(n[1]-e[1]),s=t?i:a;if(r<s+8)continue;let c=Math.sign(t?n[0]-e[0]:n[1]-e[1]);for(let n of[6,(r-s)/2])for(let r of[-1,1]){let s;if(t)s={x:c>0?e[0]+n:e[0]-n-i,y:r<0?e[1]-4-a:e[1]+4,w:i,h:a};else{let t=c>0?e[1]+n:e[1]-n-a;s={x:r<0?e[0]-4-i:e[0]+4,y:t,w:i,h:a}}if(!o(s))return{ok:!0,at:{x:s.x,y:s.y}}}}return{ok:!1}},v=(e,t)=>{let n=[e[0],e[e.length-1]];return s(t).some(e=>[e.points[0],e.points[e.points.length-1]].some(e=>e&&n.some(t=>Math.abs(t[0]-e[0])<1&&Math.abs(t[1]-e[1])<1)))},y=(e,t)=>!v(t,e)&&f(t,e.from,e.to)&&p(t)&&!l(t,e)&&!g(t,e)&&m(e,t),b=(e,t)=>{let n=s(e).filter(e=>{let n=d(e);return n&&Sn(t).some(e=>wn(e,n,1))}),r={points:e.points,labelAt:e.labelAt,moved:n.map(e=>[e,e.labelAt])},i=()=>{e.points=r.points,e.labelAt=r.labelAt;for(let[e,t]of r.moved)e.labelAt=t};e.points=t;for(let e of n){e.labelAt=null;let t=_(e,e.points);if(!t.ok)return i(),null;e.labelAt=t.at}return i},x=(e,n)=>{let r=xn(e,t,i,e.points,!0),a=c(e.points,e),o=Cn(e.points),s=h(e).map(n=>({pts:n,cost:xn(e,t,i,n,!0),len:Cn(n)})).filter(e=>n||e.cost<=r&&e.len<=o*1.6+40).map(t=>({...t,cross:c(t.pts,e)})).filter(e=>n||e.cost<r||e.cross<a).sort((e,t)=>(n?e.cross-t.cross:0)||e.cost-t.cost||e.len-t.len);for(let t of s){if(!n&&t.cross>a||!f(t.pts,e.from,e.to)||!p(t.pts)||l(t.pts,e)||!m(e,t.pts)||v(t.pts,e))continue;let r=b(e,t.pts);if(!r)continue;let i=_(e,t.pts);if(!i.ok)r();else return i.at&&(e.labelAt=i.at),!0}return!1},S={main:0,branch:1,back:2},C=[...a].sort((e,t)=>S[e.kind]-S[t.kind]),ee=e=>{for(let n=0,r=!0;r&&n<4;n+=1){r=!1;for(let n of e)n.points.length>=2&&xn(n,t,i,n.points,!0)>0&&x(n,!1)&&(r=!0)}};if(ee(C.filter(e=>o.has(e))),r){for(let e of C.filter(e=>!o.has(e))){o.add(e);let t=y(e,e.points)&&_(e,e.points,!0);if(t?.ok)t.at&&(e.labelAt=t.at);else if(!x(e,!0))return null}ee(C)}return a};return g(!0)??g(!1)}var Dn=.5,On=e=>e.slice(1).map((t,n)=>[e[n],t]),kn=([e,t])=>Math.abs(e[0]-t[0])<Dn,An=(e,t)=>Math.min(e,t),jn=(e,t)=>Math.max(e,t);function Mn(e,t){if(kn(e)!==kn(t))return 0;let n=+!kn(e);if(Math.abs(e[0][n]-t[0][n])>=Dn)return 0;let r=1-n;return Math.max(0,An(jn(e[0][r],e[1][r]),jn(t[0][r],t[1][r]))-jn(An(e[0][r],e[1][r]),An(t[0][r],t[1][r])))}var dte=10;function fte(e,t){if(kn(e)!==kn(t))return!1;let n=+!kn(e),r=Math.abs(e[0][n]-t[0][n]);if(r<Dn||r>=dte)return!1;let i=1-n;return An(jn(e[0][i],e[1][i]),jn(t[0][i],t[1][i]))-jn(An(e[0][i],e[1][i]),An(t[0][i],t[1][i]))>Dn}function pte([e,t],[n,r]){return e>=An(n[0],r[0])-Dn&&e<=jn(n[0],r[0])+Dn&&t>=An(n[1],r[1])-Dn&&t<=jn(n[1],r[1])+Dn}function mte(e,t){if(kn(e)===kn(t))return!1;let[n,r]=kn(e)?[e,t]:[t,e],i=n[0][0],a=r[0][1];return i>An(r[0][0],r[1][0])+Dn&&i<jn(r[0][0],r[1][0])-Dn&&a>An(n[0][1],n[1][1])+Dn&&a<jn(n[0][1],n[1][1])-Dn}function Nn(e,t){let n=On(e),r=On(t);if(n.some(e=>r.some(t=>mte(e,t)||fte(e,t))))return!1;let i=n.map(e=>r.some(t=>Mn(e,t)>Dn)),a=i.indexOf(!0);if(a<0)return!0;let[o,s]=e[e.length-1],[c,l]=t[t.length-1];if(Math.abs(o-c)>=Dn||Math.abs(s-l)>=Dn||!i.slice(a).every(Boolean))return!1;for(let e=a;e<n.length;e+=1){let t=n[e];if(e>a&&!Pn(t[0],r)||!Pn(t[1],r))return!1}return!0}var Pn=(e,t)=>t.some(t=>pte(e,t));function Fn(e,t){let n=t.flatMap(e=>On(e)),r=On(e),i=r.findIndex(e=>n.some(t=>Mn(e,t)>Dn));if(i<0)return e;let a=r[i],o=+!!kn(a),s=Math.sign(a[1][o]-a[0][o]),c=a[1][o];for(let e of n){if(Mn(a,e)<=Dn)continue;let t=s>0?An(e[0][o],e[1][o]):jn(e[0][o],e[1][o]);c=s>0?Math.min(c,Math.max(t,a[0][o])):Math.max(c,Math.min(t,a[0][o]))}let l=[...a[0]];return l[o]=c,[...e.slice(0,i+1),l]}var In=10,Ln={x:8,y:8,w:1e6,h:1e6},Rn={back:0,branch:1,main:2},hte=150,gte=400,zn=600;function Bn(e,t,n){if(e.length<2)return!1;let[r,i]=e.slice(-2),a=t.x+t.w/2,o=t.y+t.h/2;return Math.abs(r[1]-i[1])<.5?i[0]<r[0]?a<n.x:a>n.x+n.w:i[1]<r[1]?o<n.y:o>n.y+n.h}var Vn=40;function Hn(e,t,n){let r=e.map(e=>e[0]),i=e.map(e=>e[1]);return Math.max(0,Math.max(...r)-Math.max(t.x+t.w,n.x+n.w),Math.min(t.x,n.x)-Math.min(...r),Math.max(...i)-Math.max(t.y+t.h,n.y+n.h),Math.min(t.y,n.y)-Math.min(...i))}var Un=e=>e.slice(1).reduce((t,n,r)=>t+Math.abs(n[0]-e[r][0])+Math.abs(n[1]-e[r][1]),0);function Wn(e,t){let n=([e,t],[n,r])=>{let i=Math.abs(e[0]-t[0])<.5;if(i===Math.abs(n[0]-r[0])<.5)return!1;let[a,o,s,c]=i?[e,t,n,r]:[n,r,e,t];return a[0]>Math.min(s[0],c[0])+.5&&a[0]<Math.max(s[0],c[0])-.5&&s[1]>Math.min(a[1],o[1])+.5&&s[1]<Math.max(a[1],o[1])-.5},r=qn(e);return t.reduce((e,t)=>e+r.reduce((e,r)=>e+qn(t.points).filter(e=>n(r,e)).length,0),0)}var Gn=(e,t,n)=>e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n,Kn=([e,t],n,r)=>Math.max(e[0],t[0])>n.x-r&&Math.min(e[0],t[0])<n.x+n.w+r&&Math.max(e[1],t[1])>n.y-r&&Math.min(e[1],t[1])<n.y+n.h+r,qn=e=>e.slice(1).map((t,n)=>[e[n],t]);function Jn([e,t],[n,r]){return e[0]===t[0]&&n[0]===r[0]&&e[0]===n[0]?Math.min(Math.max(e[1],t[1]),Math.max(n[1],r[1]))-Math.max(Math.min(e[1],t[1]),Math.min(n[1],r[1]))>.5:e[1]===t[1]&&n[1]===r[1]&&e[1]===n[1]&&Math.min(Math.max(e[0],t[0]),Math.max(n[0],r[0]))-Math.max(Math.min(e[0],t[0]),Math.min(n[0],r[0]))>.5}function Yn(e,t,n){return e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n}function Xn(e){let{placed:t,diamonds:n,titles:r=[],borders:i=[],within:a=()=>null,boxes:o=[]}=e,s=[...t.values()],c=e=>e.labelAt?{x:e.labelAt.x,y:e.labelAt.y,w:e.labelSize.width,h:e.labelSize.height}:null,l=e=>e.isBack??e.kind===`back`,u=(e,t)=>t.to===e.to&&!l(e)&&t.kind!==`back`,d=(e,n)=>Un(e)+hte*yn(e)+(!l(n)&&Bn(e,t.get(n.from),t.get(n.to))?gte:0);return{routeFor:(e,l,f=[],p=!1,m=void 0)=>{let h=l.filter(t=>t!==e),g=h.map(c).filter(Boolean),_=c=>pn({from:t.get(e.from),to:t.get(e.to),fromDiamond:n.has(e.from),toDiamond:n.has(e.to),nodes:s,blocks:[...r,...g],routes:h.map(t=>({points:t.points,share:c&&u(e,t)})),taken:f,inAt:c?h.filter(t=>u(e,t)).map(e=>e.points[e.points.length-1]):void 0,join:c,soft:a(e)?void 0:o,borders:i,bounds:a(e)??Ln,maxCost:m});if(p){let t=h.some(t=>u(e,t))?_(!0):null,n=h.filter(t=>u(e,t)).map(e=>e.points);return t&&n.every(e=>Nn(t,e))&&Fn(t,n)!==t?t:null}let v=_(!1),y=t.get(e.from),b=t.get(e.to),x=!(v&&!Bn(v,y,b)&&Hn(v,y,b)<=Vn&&yn(v)<3)&&h.some(t=>u(e,t))?_(!0):null,S=x&&h.every(t=>!u(e,t)||Nn(x,t.points)),C=t=>d(t,e)+Hn(t,y,b)+zn*Wn(t,h);return S&&(!v||C(x)<C(v))?x:v},joinable:u,routeScore:d,labelRect:c}}function Zn(e){let{placed:t,connections:n,diamonds:r,titles:i=[],borders:a=[],within:o=()=>null,boxOf:s=()=>null}=e,c=[...t.values()],{routeFor:l,joinable:u,routeScore:d,labelRect:f}=Xn(e),p=(e,t,n=null)=>{let r=e.points.map(e=>[...e]);if(r.length<2)return null;if(n&&r[0][0]===r[1][0]&&r[0][0]>=n.x+t+8&&r[0][0]<=n.x+n.w+t-8)return r;if(r[0][0]===r[1][0]){if(r.length<3||r[1][1]!==r[2][1]||(r[0][0]+=t,r[1][0]+=t,Math.sign(r[2][0]-r[1][0])!==Math.sign(e.points[2][0]-e.points[1][0])||r[2][0]===r[1][0]))return null}else if(r[0][1]===r[1][1]){if(r[0][0]+=t,Math.sign(r[1][0]-r[0][0])!==Math.sign(e.points[1][0]-e.points[0][0])||r[1][0]===r[0][0])return null}else return null;return r},m=(e,t,n=null)=>{let r=p({points:[...e.points].reverse()},t,n);return r?r.reverse():null},h=(e,t)=>qn(e).every(e=>t.every(t=>!Kn(e,t,4))),g=e=>e.points.length===2&&e.points[0][0]===e.points[1][0],_=e=>{let t=e.points;return g(e)||t.length===4&&t[0][0]===t[1][0]&&t[1][1]===t[2][1]&&t[2][0]===t[3][0]&&Math.abs(t[1][0]-t[2][0])<=8},v=(e,i,a,o)=>{let s=[e],c=[i],l=new Set,u=new Map;if(a){let e=m(a,i);if(!e)return null;u.set(a,e)}for(let e=0;e<s.length;e+=1){let i=s[e];for(let d of n){if(d===o||d===a)continue;let f=e=>r.has(e)?null:t.get(e);if(d.to===i&&!l.has(d)){let t=m(d,c[e],f(i));if(!t)return null;u.set(d,t)}else if(d.from===i){if(d.kind!==`back`&&_(d)&&n.filter(e=>e.to===d.to).length===1){if(l.add(d),s.includes(d.to))continue;s.push(d.to);let n=t.get(i),a=t.get(d.to);c.push(r.has(i)?n.x+n.w/2+c[e]-(a.x+a.w/2):c[e])}else{let t=p(d,c[e],f(i));if(!t)return null;u.set(d,t)}}}}return{dx:i,dxs:c,chain:s,rects:s.map(e=>t.get(e)),chainLinks:l,adapted:u}},y=(e,r,a)=>{let{chain:o,rects:l,chainLinks:u,adapted:d}=e,p=new Map;l.forEach((t,n)=>p.set(t,e.dxs[n]));for(let e of r)e.rects.forEach((t,n)=>p.set(t,e.dxs[n]));let m=e=>p.has(e)?{x:e.x+p.get(e),y:e.y,w:e.w,h:e.h}:e,g=c.map(e=>({orig:e,now:m(e)})),_=e=>e!==a&&!u.has(e)&&!d.has(e)&&!r.some(t=>t.chainLinks.has(e)||t.adapted.has(e));return l.every((e,t)=>{let r=m(e),a=s(o[t]);return a&&(r.x<a.x+28||r.x+r.w>a.x+a.w-28)||g.some(e=>!l.includes(e.orig)&&Yn(r,e.now,14))||i.some(e=>Yn(r,e,4))||n.some(e=>_(e)&&qn(e.points).some(e=>Kn(e,r,8)))?!1:!n.some(e=>_(e)&&f(e)&&Yn(r,f(e),4))})&&[...d.entries()].every(([e,r])=>h(r,g.filter(n=>n.orig!==t.get(e.from)&&n.orig!==t.get(e.to)).map(e=>e.now))&&Wn(r,n.filter(e=>_(e)))<=Wn(e.points,n.filter(e=>_(e))))},b=e=>{e.rects.forEach((t,n)=>{t.x+=e.dxs[n]});for(let n of e.chainLinks){let i=e.chain.indexOf(n.from);if(r.has(n.from)){let e=t.get(n.from),r=t.get(n.to);n.points=[[e.x+e.w/2,e.y+e.h],[e.x+e.w/2,r.y]]}else n.points=n.points.map(([t,n])=>[t+e.dxs[i],n]);n.labelAt&&={x:n.labelAt.x+e.dxs[i],y:n.labelAt.y}}for(let[t,n]of e.adapted)t.points=n},x=()=>n.every(e=>qn(e.points).every((n,r,i)=>c.every(a=>{let o=a===t.get(e.from)||a===t.get(e.to);return o&&(r===0||r===i.length-1)?!0:!Kn(n,a,o?-.5:1)}))),S=(e,o,p,m,h)=>{let g=new Map([[e.to,h]]);for(let e=!0;e;){e=!1;for(let i of n){if(i.kind===`back`||!g.has(i.from)||g.has(i.to)||!_(i)||n.filter(e=>e.to===i.to&&e.kind!==`back`).length!==1)continue;let a=t.get(i.from),o=t.get(i.to);g.set(i.to,r.has(i.from)?a.x+a.w/2+g.get(i.from)-(o.x+o.w/2):g.get(i.from)),e=!0}}let v=new Map([...t].map(([e,t])=>[t,e])),y=e=>({...e,x:e.x+(g.get(v.get(e))??0)});for(let[e]of[...g]){let n=y(t.get(e));for(let t of c){let r=v.get(t);if(g.has(r)||!Yn(n,y(t),14))continue;let i=g.get(e)<0?n.x-14-(t.x+t.w):n.x+n.w+14-t.x;g.set(r,i)}}for(let t of c){let n=v.get(t);if(n===e.from||n===e.to)continue;let r=y(t);if(!Kn([[o,p],[o,m]],r,In))continue;let i=r.x+r.w/2>=o?o+In+1-r.x:o-In-1-(r.x+r.w);g.set(n,(g.get(n)??0)+i)}for(let[e]of g){let n=y(t.get(e)),r=s(e);if(r&&(n.x<r.x+28-6||n.x+n.w>r.x+r.w-28+6)||c.some(r=>r!==t.get(e)&&Yn(n,y(r),(g.has(v.get(r)),14)))||i.some(e=>Yn(n,e,4)))return!1}let b=n.filter(t=>t!==e&&(g.has(t.from)||g.has(t.to)));for(let[r]of g){let i=y(t.get(r));if(n.some(t=>t!==e&&!b.includes(t)&&qn(t.points).some(e=>Kn(e,i,8))))return!1}let S=e=>{let r=n.filter(t=>t!==e);return d(e.points,e)+Hn(e.points,t.get(e.from),t.get(e.to))+zn*Wn(e.points,r)},C=[e,...b].reduce((e,t)=>e+S(t),0),ee={rects:[...g.keys()].map(e=>[t.get(e),t.get(e).x]),lines:n.map(e=>[e,e.points,e.labelAt])},w=()=>{for(let[e,t]of ee.rects)e.x=t;for(let[e,t,n]of ee.lines)e.points=t,e.labelAt=n;return!1};for(let[e,n]of g)t.get(e).x+=n;if(e.points=[[o,p],[o,m]],qn(e.points).some(n=>c.some(r=>r!==t.get(e.from)&&r!==t.get(e.to)&&Kn(n,r,8))))return w();for(let e of[...b].sort((e,t)=>Rn[t.kind]-Rn[e.kind])){let t=l(e,n);if(!t)return w();e.points=t}if([e,...b].reduce((e,t)=>e+S(t),0)>=C||!x())return w();for(let t of[e,...b]){if(!t.labelSize)continue;let e=n.filter(e=>e!==t),r=e.map(f).filter(Boolean);t.labelAt=Qn(Fn(t.points,e.filter(e=>u(t,e)).map(e=>e.points)),t.labelSize,c,[...i,...r],e,a)}return!0},C=()=>{let e=!1;for(let i of n){let a=i.points.length===4&&i.points[0][0]===i.points[1][0]&&i.points[1][1]===i.points[2][1]&&i.points[2][0]===i.points[3][0]||i.points.length===3&&i.points[0][0]===i.points[1][0]&&i.points[1][1]===i.points[2][1];if(i.kind===`back`||!(g(i)||a))continue;let o=t.get(i.from),s=t.get(i.to);if(!o||!s||i.kind!==`main`&&n.filter(e=>e.to===i.to&&e.kind!==`back`).length!==1)continue;let l=r.has(i.from),u=n.filter(e=>e.from===i.from&&e.kind!==`back`).length===1,d=l||u?o.x+o.w/2:i.points[0][0],f=l?o.y+o.h:i.points[0][1],p=d-(s.x+s.w/2),m=!l||Math.abs(i.points[0][1]-f)<.5;if(Math.abs(p)<.5&&m)continue;let h=g(i)||i.points.length===4?i.points[i.points.length-1][1]:s.y;if(Math.abs(p)<.5){let t=i.points;i.points=[[d,f],[d,h]],!qn(i.points).some(e=>c.some(t=>t!==o&&t!==s&&Kn(e,t,In)))&&x()?e=!0:(i.points=t,S(i,d,f,h,0)&&(e=!0));continue}let _=v(i.to,p,null,i);if(!_){S(i,d,f,h,p)&&(e=!0);continue}let C=[],ee={x:s.x+p,y:s.y,w:s.w,h:s.h},w=!1;for(let e of c){if(_.rects.includes(e)||!Yn(ee,e,14))continue;let a=[...t.keys()].find(n=>t.get(n)===e),o=n.filter(e=>e.to===a);if(!a||o.length!==1||o[0].kind===`back`||r.has(a)){w=!0;break}let s=p<0?ee.x-14-(e.x+e.w):ee.x+ee.w+14-e.x,c=v(a,p<0?Math.min(0,s):Math.max(0,s),o[0],i);if(!c||!y(c,[_],i)){w=!0;break}C.push(c)}if(w||!y(_,C,i)){S(i,d,f,h,p)&&(e=!0);continue}let te=new Map;for(let e of[_,...C])e.rects.forEach((t,n)=>te.set(t,e.dxs[n]));let ne=e=>te.has(e)?{...e,x:e.x+te.get(e)}:e,re=(e,n,r)=>qn(e).some(e=>c.some(i=>i!==t.get(n)&&i!==t.get(r)&&Kn(e,ne(i),In)));if(re([[d,f],[d,h]],i.from,i.to)){S(i,d,f,h,p)&&(e=!0);continue}if([_,...C].some(e=>[...e.chainLinks].some(t=>re(t.points.map(([n,r])=>[n+e.dxs[e.chain.indexOf(t.from)],r]),t.from,t.to))))continue;let ie={rects:c.map(e=>[e,e.x]),lines:n.map(e=>[e,e.points,e.labelAt])};b(_);for(let e of C)b(e);let ae=i.points;if(i.points=[[d,f],[d,h]],!x()){for(let[e,t]of ie.rects)e.x=t;for(let[e,t,n]of ie.lines)e.points=t,e.labelAt=n;i.points=ae,S(i,d,f,h,p)&&(e=!0)}else e=!0}return e};for(let e=0;e<3&&C();e+=1);for(let e of r){let r=t.get(e),o=e=>Math.abs(e[0]-(r.x+r.w/2))<1&&Math.abs(e[1]-r.y)<1,s=n.filter(t=>t.to===e&&t.kind!==`back`);if(s.some(e=>o(e.points[e.points.length-1])))for(let e of s){if(o(e.points[e.points.length-1]))continue;let t=n.filter(t=>t!==e),r=l(e,n,[],!0);if(r&&o(r[r.length-1])&&!(Wn(r,t)>Wn(e.points,t)||yn(r)>yn(e.points)+1)&&(e.points=r,e.labelSize)){let n=t.map(f).filter(Boolean);e.labelAt=Qn(Fn(r,t.filter(t=>u(e,t)).map(e=>e.points)),e.labelSize,c,[...i,...n],t,a)}}}for(let e of n){if(e.kind===`back`||!r.has(e.from)||e.points.length<2)continue;let o=t.get(e.from),[s,u]=e.points,d=o.y+o.h,p=o.x+o.w/2;if(s[0]!==u[0]||u[1]<=s[1]||s[1]>=d-1.5||s[1]<o.y+o.h/2||u[1]-d<24)continue;let m=Math.min(14,(u[1]-d)/2),h=Math.abs(s[0]-p)<4?[[p,d],...e.points.slice(1)]:[[p,d],[p,d+m],[s[0],d+m],...e.points.slice(1)],g=n.filter(t=>t!==e);if(qn(h).some((n,r,i)=>c.some(r=>r!==o&&r!==t.get(e.to)&&Kn(n,r,2))&&r<i.length))continue;let _=e=>Math.abs(e[0]-p)<1&&Math.abs(e[1]-d)<1,v=g.filter(t=>t.from===e.from&&_(t.points[0])||qn(t.points).some(e=>qn(h).slice(0,3).some(t=>Jn(e,t))));if(!v.length){Wn(h,g)<=Wn(e.points,g)&&(e.points=h);continue}let[y]=v;if(e.kind!==`main`||v.length!==1||y.kind===`back`||y.from!==e.from||!_(y.points[0]))continue;let b=n.filter(t=>t!==e&&t!==y),x={...e,points:h},S=l(y,[...b,x],[[p,d]]);if(!(!S||yn(S)>yn(y.points)+1)&&!(Wn(S,[...b,x])>Wn(y.points,[...b,e]))&&!(Wn(h,[...b,{points:S}])>Wn(e.points,[...b,y]))&&(e.points=h,y.points=S,y.labelSize)){let e=n.filter(e=>e!==y).map(f).filter(Boolean);y.labelAt=Qn(y.points,y.labelSize,c,[...i,...e],n.filter(e=>e!==y),a)}}for(let e=0;e<2&&C();e+=1);let ee=(e,n,i)=>{let a=t.get(n);return r.has(n)?Math.abs(e[i]-(i===0?a.x+a.w/2:a.y+a.h/2))<.5:i===0?e[0]>=a.x+8&&e[0]<=a.x+a.w-8:e[1]>=a.y+8&&e[1]<=a.y+a.h-8},w=e=>e.filter((t,n)=>n===0||n===e.length-1||(e[n-1][0]!==t[0]||t[0]!==e[n+1][0])&&(e[n-1][1]!==t[1]||t[1]!==e[n+1][1])).filter((e,t,n)=>t===0||e[0]!==n[t-1][0]||e[1]!==n[t-1][1]);for(let e=0;e<2;e+=1)for(let e of n){let r=n.filter(t=>t!==e);if(!r.some(t=>t.to===e.to&&qn(t.points).some(t=>qn(e.points).some(e=>Jn(e,t)))))for(let n=1;n<e.points.length-2;n+=1){let i=e.points,[a,o,s,l]=[i[n-1],i[n],i[n+1],i[n+2]],u=+(o[0]===s[0]),d=s[u]-o[u];if(Math.abs(d)<.5||Math.abs(d)>8||a[u]!==o[u]||s[u]!==l[u]||Math.sign(o[1-u]-a[1-u])!==Math.sign(l[1-u]-s[1-u]))continue;let f=(e,t,n,r)=>e.map((e,i)=>i>=t&&i<=n?u===0?[e[0]+r,e[1]]:[e[0],e[1]+r]:e),p=[f(i,0,n,d),f(i,n+1,i.length-1,-d)],m=(n,a)=>{let o=a===`start`?n[0]:n[n.length-1];return!ee(o,a===`start`?e.from:e.to,u)||qn(n).some((n,r,i)=>c.some(a=>(r!==0||a!==t.get(e.from))&&(r!==i.length-1||a!==t.get(e.to))&&Kn(n,a,a===t.get(e.from)||a===t.get(e.to)?-.5:2)))||r.some(e=>qn(e.points).some(e=>qn(n).some(t=>Jn(t,e))))?!1:Wn(n,r)<=Wn(i,r)},h=[m(p[0],`start`)&&p[0],m(p[1],`end`)&&p[1]].find(Boolean);if(h){e.points=w(h);break}}}for(let e of n){if(!e.points.slice(1).some((t,n)=>dn(e.points[n][0],e.points[n][1],t[0],t[1],a)))continue;let s=n.filter(t=>t!==e),l=s.map(f).filter(Boolean),u=pn({from:t.get(e.from),to:t.get(e.to),fromDiamond:r.has(e.from),toDiamond:r.has(e.to),nodes:c,blocks:[...i,...l],routes:s.map(e=>({points:e.points})),borders:a,bounds:o(e)??Ln});!u||Wn(u,s)>Wn(e.points,s)||(e.points=u,e.labelSize&&(e.labelAt=Qn(u,e.labelSize,c,[...i,...l],s,a)))}let te=(e,n,r)=>d(n,e)+Hn(n,t.get(e.from),t.get(e.to))+zn*Wn(n,r),ne=(e,t)=>Un(e)+600*yn(e)+tte*Wn(e,t)+1400,re=e=>{let t=n.filter(t=>t!==e),r=l(e,n,[],!1,ne(e.points,t));if(!(!r||te(e,r,t)>=te(e,e.points,t))&&(e.points=r,e.labelSize)){let n=t.map(f).filter(Boolean);e.labelAt=Qn(Fn(r,t.filter(t=>u(e,t)).map(e=>e.points)),e.labelSize,c,[...i,...n],t,a)}},ie=e=>{let t=new Set([e.from,e.to]),r=n.filter(r=>r!==e&&r.kind!==`back`&&(t.has(r.from)||t.has(r.to))&&n.some(e=>e!==r&&u(r,e))).slice(0,3);for(let t of r){let r=[t.points,t.labelAt,e.points,e.labelAt],o=()=>{let r=n.filter(n=>n!==t&&n!==e);return te(t,t.points,[...r,e])+te(e,e.points,[...r,t])},s=o(),d=l(t,n,[],!0);if(!d)continue;t.points=d;let p=l(e,n);if(p&&(e.points=p),p&&o()<s){for(let r of[t,e]){if(!r.labelSize)continue;let e=n.filter(e=>e!==r),t=e.map(f).filter(Boolean);r.labelAt=Qn(Fn(r.points,e.filter(e=>u(r,e)).map(e=>e.points)),r.labelSize,c,[...i,...t],e,a)}return}[t.points,t.labelAt,e.points,e.labelAt]=r}},ae=[...n].sort((e,t)=>Rn[e.kind]-Rn[t.kind]);for(let e of ae)Wn(e.points,n.filter(t=>t!==e))>0&&re(e);for(let e of ae){if(e.kind===`back`)continue;let n=t.get(e.from),r=t.get(e.to),i=()=>Bn(e.points,n,r)||Hn(e.points,n,r)>Vn||yn(e.points)>=3;i()&&(re(e),i()&&ie(e))}for(let e of n){let t=f(e);if(!t)continue;let r=n.filter(t=>t!==e);if(!r.some(e=>qn(e.points).some(e=>Kn(e,t,2)))&&!c.some(e=>Yn(t,e,2)))continue;let o=r.map(f).filter(Boolean);e.labelAt=Qn(e.points,e.labelSize,c,[...i,...o],r,a)}}function Qn(e,t,n,r,i,a=[],o={}){let{width:s,height:c}=t,l=t=>(t.x<16||t.y<16?100:0)+n.filter(e=>Gn(t,e,3)).length*50+r.filter(e=>Gn(t,e,3)).length*20+i.filter(e=>qn(e.points).some(e=>Kn(e,t,3))).length*10+a.filter(e=>Kn(e,t,3)).length*5+(qn(e).some(e=>Kn(e,t,1))?30:0),u=null;for(let[t,n]of qn(e)){let e=Math.abs(t[1]-n[1])<.5,r=Math.abs(n[0]-t[0])+Math.abs(n[1]-t[1]),i=e?s:c;if(r<i+8)continue;let a=Math.sign(e?n[0]-t[0]:n[1]-t[1]),o=[(r-i)/2,6,r-i-6];for(let e=6;e<=r-i-6;e+=8)o.push(e);for(let n of[4,14])for(let i of o)for(let o of[1,-1]){let d=e?{x:a>0?t[0]+i:t[0]-i-s,y:o<0?t[1]-n-c:t[1]+n,w:s,h:c}:{x:o<0?t[0]-n-s:t[0]+n,y:a>0?t[1]+i:t[1]-i-c,w:s,h:c},f=l(d);if(f===0)return{x:d.x,y:d.y};(!u||f<u.bad||f===u.bad&&r>u.len)&&(u={bad:f,len:r,x:d.x,y:d.y})}}if(o.onLine)for(let[t,n]of qn(e)){let e=Math.abs(t[1]-n[1])<.5,r=Math.abs(n[0]-t[0])+Math.abs(n[1]-t[1]);if(r<(e?s:c)+8)continue;let i={x:(t[0]+n[0])/2-s/2,y:(t[1]+n[1])/2-c/2,w:s,h:c},a=l(i)-30+4;(!u||a<u.bad)&&(u={bad:a,len:r,x:i.x,y:i.y})}if(u)return{x:u.x,y:u.y};let[d,f]=qn(e).sort((e,t)=>Math.abs(t[1][0]-t[0][0])+Math.abs(t[1][1]-t[0][1])-(Math.abs(e[1][0]-e[0][0])+Math.abs(e[1][1]-e[0][1])))[0];return{x:Math.max(16,(d[0]+f[0])/2+4),y:Math.max(16,(d[1]+f[1])/2-c/2)}}var _te=1.5,vte=480,yte=.7;function bte(e){let t=[...e.placed.entries()];if(t.length<4)return null;let n=[...new Set(t.map(([,e])=>e.y))].sort((e,t)=>e-t),r=null;for(let i=1;i<n.length;i+=1){let a=n[i],o=new Set(t.filter(([,e])=>e.y<a).map(([e])=>e)),s=new Set(t.filter(([,e])=>e.y>=a).map(([e])=>e));if(o.size<2||s.size<2)continue;let c=e.inner.filter(e=>o.has(e.from)!==o.has(e.to)),l=c.filter(e=>!e.isBack).length,u=c.length-l,d=Math.max(...t.filter(([e])=>o.has(e)).map(([,e])=>e.y+e.h)),f=Math.max(...t.map(([,e])=>e.y+e.h))-a,p=l*1e3+u*300+Math.abs(d-f);(!r||p<r.score)&&(r={score:p,top:o,bottom:s})}return r?[r.top,r.bottom]:null}function $n(e){let t=e.width;for(let[n,r]of e.placed)e.placed.set(n,{...r,x:t-r.x-r.w});for(let n of e.connections)n.points=n.points.map(([e,n])=>[t-e,n]),n.labelAt&&={x:t-n.labelAt.x-n.labelSize.width,y:n.labelAt.y}}var er={x:-1e6,y:-1e6,w:2e6,h:2e6},tr={"elk.layered.priority.straightness":`10`,"elk.layered.priority.direction":`10`},nr=[{"elk.layered.nodePlacement.strategy":`BRANDES_KOEPF`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},{"elk.layered.nodePlacement.strategy":`NETWORK_SIMPLEX`},{"elk.layered.nodePlacement.strategy":`BRANDES_KOEPF`}],rr=(e,t,n)=>{let r=Math.min(e.w-56,he(t)*13+4);return n?{x:e.x+28-2,y:e.y+7,w:r,h:18}:{x:e.x+7,y:e.y+28-2,w:18,h:r}};function ir({nodes:e,groups:t,stages:n,ruleEnds:r,labelBox:i,vertical:a}){let o=new Map(e.map(e=>[e.id,e])),s=a?44:28,c=a?28:44,l=new Set(e.filter(e=>e.kind===`decision`).map(e=>e.id)),u=e=>{let{w:t,h:n}=It(e);return a?{w:t,h:n}:{w:n,h:t}},d=e=>{let t=i(e);return a?t:{width:t.height,height:t.width}},f=(e,n)=>{let r=new Set(n.map(e=>e.id)),i=t.filter(e=>r.has(e.from)&&r.has(e.to)),a=t.filter(e=>r.has(e.from)&&!r.has(e.to)&&!e.isBack),o=t.filter(e=>!r.has(e.from)&&r.has(e.to)&&!e.isBack),s=null;for(let e of nr){let t=y(n,i,e,a,o),r=t.connections.reduce((e,n)=>e+xn(n,t.placed,l),0);(!s||r<s.cost)&&(s={...t,cost:r})}return{st:e,ids:r,inner:i,...s}},p=n.map(t=>f(t,e.filter(e=>e.stageId===t.id))),m=p.map(e=>e.height).sort((e,t)=>e-t),h=m[Math.floor((m.length-1)/2)],g=p.reduce((e,t)=>e+t.width+56+56,0),_=[];for(let t of p){let n=t.height>vte&&t.height>h*_te&&t.height>g*yte?bte(t):null;if(n)for(let r of n)_.push(f(t.st,e.filter(e=>r.has(e.id))));else _.push(t)}let v=new Map;_.forEach((e,t)=>{for(let n of e.ids)v.set(n,t)}),_.forEach((e,n)=>{let r=r=>{let i=[...e.placed.entries()],a=(t,n)=>{let a=e.placed.get(t);return i.some(([e,i])=>{if(e===t||i.y>=a.y+a.h||i.y+i.h<=a.y)return!1;let o=i.x>=a.x+a.w,s=i.x+i.w<=a.x;return n===`right`?r?s:o:r?o:s})},o=0;for(let e of t){if(e.isBack)continue;let t=v.get(e.from),r=v.get(e.to);t===n&&r>n&&a(e.from,`right`)&&(o+=1),r===n&&t<n&&a(e.to,`left`)&&(o+=1)}return o};r(!0)<r(!1)&&$n(e)});function y(e,t,n,i=[],a=[]){let o=`__exit__`,s=`__entry__`,c=[];i.length&&c.push({id:o,width:1,height:1,layoutOptions:{"elk.layered.layering.layerConstraint":`LAST_SEPARATE`}}),a.length&&c.push({id:s,width:1,height:1,layoutOptions:{"elk.layered.layering.layerConstraint":`FIRST_SEPARATE`}});let f=[...i.map((e,t)=>({id:`x${t}`,sources:[e.from],targets:[o],layoutOptions:e.isMain?tr:{}})),...a.map((e,t)=>({id:`y${t}`,sources:[s],targets:[e.to],layoutOptions:e.isMain?tr:{}}))],p={id:`root`,layoutOptions:{"elk.algorithm":`layered`,"elk.direction":`DOWN`,"elk.padding":`[top=0,left=0,bottom=0,right=0]`,"elk.edgeRouting":`ORTHOGONAL`,"elk.spacing.nodeNode":`44`,"elk.layered.spacing.nodeNodeBetweenLayers":`28`,"elk.spacing.edgeNode":`16`,"elk.spacing.edgeEdge":`10`,"elk.spacing.edgeLabel":`4`,"elk.layered.spacing.edgeNodeBetweenLayers":`16`,"elk.layered.crossingMinimization.strategy":`LAYER_SWEEP`,...n,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.edgeLabels.inline":`false`,"elk.separateConnectedComponents":`false`},children:[...e.map(e=>{let{w:t,h:n}=u(e),i=r.has(e.id)?{"elk.layered.layering.layerConstraint":`LAST`}:{};return{id:e.id,width:t,height:n,layoutOptions:i}}),...c],edges:t.map((e,t)=>({id:`g${t}`,sources:[e.isBack?e.to:e.from],targets:[e.isBack?e.from:e.to],labels:e.label?[{id:`l${t}`,text:e.label,...d(e.label)}]:[],layoutOptions:e.isMain?tr:{}}))};p.edges.push(...f);let m=en(p),h=new Map(m.children.filter(e=>e.id!==o&&e.id!==s).map(e=>[e.id,{x:e.x,y:e.y,w:e.width,h:e.height}])),g=new Map((m.edges??[]).map(e=>[e.id,e])),_=En(t.map((e,t)=>{let n=g.get(`g${t}`),r=n?.sections?.[0],i=r?[r.startPoint,...r.bendPoints??[],r.endPoint].map(e=>[e.x,e.y]):[];e.isBack&&i.reverse(),i.length>=2&&(i[0]=or(i[0],h.get(e.from),l.has(e.from)),i[i.length-1]=or(i[i.length-1],h.get(e.to),l.has(e.to)));let a=n?.labels?.[0];return{id:`c:${e.from}->${e.to}`,from:e.from,to:e.to,kind:e.isBack?`back`:e.isMain?`main`:`branch`,merged:e.merged,points:i,label:e.label,labelAt:a?{x:a.x,y:a.y}:null,labelSize:a?{width:a.width,height:a.height}:null}}),h,[],!0,l);Zn({placed:h,connections:_,diamonds:l,within:()=>er,boxOf:()=>null});let v=1/0,y=1/0,b=-1/0,x=-1/0,S=(e,t)=>{v=Math.min(v,e),y=Math.min(y,t),b=Math.max(b,e),x=Math.max(x,t)};for(let e of h.values())S(e.x,e.y),S(e.x+e.w,e.y+e.h);for(let e of _){for(let[t,n]of e.points)S(t,n);e.labelAt&&(S(e.labelAt.x,e.labelAt.y),S(e.labelAt.x+e.labelSize.width,e.labelAt.y+e.labelSize.height))}let C=([e,t])=>[e-v,t-y];for(let[e,t]of h)h.set(e,{...t,x:t.x-v,y:t.y-y});for(let e of _)e.points=e.points.map(C),e.labelAt&&={x:e.labelAt.x-v,y:e.labelAt.y-y};return{placed:h,connections:_,width:b-v,height:x-y}}let b=new Map,x=[],S=[],C=32;for(let e of n){let t=_.filter(t=>t.st===e),n=t.reduce((e,t)=>e+t.width,0)+56*(t.length-1),r=he(e.label)*13+56,i=Math.max(n+c+28,a?r:0,a?180:0),o=Math.max(Math.max(...t.map(e=>e.height))+s+28,a?0:r);x.push({stageId:e.id,label:e.label,x:C,y:32,w:i,h:o});let l=C+c+(i-c-28-n)/2,u=32+s;for(let e of t){for(let[t,n]of e.placed)b.set(t,{...n,x:n.x+l,y:n.y+u});for(let t of e.connections)S.push({...t,points:t.points.map(([e,t])=>[e+l,t+u]),labelAt:t.labelAt?{x:t.labelAt.x+l,y:t.labelAt.y+u}:null});l+=e.width+56}C+=i+56}let ee=Math.max(...x.map(e=>e.h)),w=x.flatMap(fn),te=new Map(x.map(e=>[e.stageId,e])),ne=e=>{let t=o.get(e.from).stageId;return t===o.get(e.to).stageId?te.get(t):null},re=x.map(e=>rr(e,e.label,a)),ie=[...b.values()],ae=e=>e.labelAt?{x:e.labelAt.x,y:e.labelAt.y,w:e.labelSize.width,h:e.labelSize.height}:null,oe={placed:b,connections:S,diamonds:l,titles:re,boxes:x,borders:w,within:ne,boxOf:e=>te.get(o.get(e)?.stageId)??null},{routeFor:se,joinable:ce}=Xn(oe),le=e=>e.isMain?0:e.isBack?2:1,ue=t.filter(e=>v.get(e.from)!==v.get(e.to)).sort((e,t)=>le(e)-le(t));for(let e of ue){let t=S.filter(t=>t.kind===`back`&&!e.isBack),n=se(e,S.filter(e=>!t.includes(e)),t.flatMap(e=>[e.points[0],e.points[e.points.length-1]]))??sr(b.get(e.from),b.get(e.to)),r=S.map(ae).filter(Boolean),i=e.label?d(e.label):null,a=Fn(n,S.filter(t=>ce(e,t)).map(e=>e.points)),o=i?Qn(a,i,ie,[...re,...r],S,w):null;S.push({id:`c:${e.from}->${e.to}`,from:e.from,to:e.to,kind:e.isBack?`back`:e.isMain?`main`:`branch`,merged:e.merged,points:n,label:e.label,labelAt:o,labelSize:i})}let de=En(S,b,re,!0,l,{borders:w,within:ne});S.splice(0,S.length,...de),Zn(oe);let fe=C-56+32,pe=32+ee+32;for(let e of S){for(let[t,n]of e.points)fe=Math.max(fe,t+32),pe=Math.max(pe,n+32);e.labelAt&&(fe=Math.max(fe,e.labelAt.x+e.labelSize.width+32),pe=Math.max(pe,e.labelAt.y+e.labelSize.height+32))}let me={boxes:x,placed:b,connections:S,titles:re,borders:w,width:fe,height:pe,diamonds:l};return{frame:me,...ar(me,a)}}function ar(e,t){let n=t?e=>e:([e,t])=>[t,e],r=t?e=>e:e=>({...e,x:e.y,y:e.x,w:e.h,h:e.w});return{placed:new Map([...e.placed].map(([e,t])=>[e,r(t)])),stageBoxes:e.boxes.map(e=>r(e)),connections:e.connections.map(e=>({...e,points:e.points.map(n),labelAt:e.labelAt?t?e.labelAt:{x:e.labelAt.y,y:e.labelAt.x}:null,labelSize:e.labelSize?t?e.labelSize:{width:e.labelSize.height,height:e.labelSize.width}:null})),size:t?{width:e.width,height:e.height}:{width:e.height,height:e.width}}}function or(e,t,n){if(!n||!t)return e;let[r,i]=e,a=t.x+t.w/2,o=t.y+t.h/2;if(Math.abs(i-t.y)<.5||Math.abs(i-(t.y+t.h))<.5){let e=t.h/2*(1-Math.min(1,Math.abs(r-a)/(t.w/2)));return[r,i<o?o-e:o+e]}let s=t.w/2*(1-Math.min(1,Math.abs(i-o)/(t.h/2)));return[r<a?a-s:a+s,i]}function sr(e,t){let n=e.y+e.h/2,r=t.y+t.h/2,i=e.x+e.w,a=t.x,o=(i+a)/2;return[[i,n],[o,n],[o,r],[a,r]]}var cr=e=>Array.isArray(e.when)?e.when:[e.when];function lr({rules:e,stages:t,byId:n,x:r,y:i,available:a}){let o=Math.round(Math.min(Lt,Math.max(640,a))),s=Rt.map(e=>Math.round(o*e)),c=new Map(t.map((e,t)=>[e.id,t])),l=(e,t,n=1)=>Math.max(1,Math.ceil(e*13*n*zt/(t-24))),u=e.map((e,n)=>{let r=(e.stageIds??[]).filter(e=>c.has(e)).map(e=>c.get(e)).sort((e,t)=>e-t),i=cr(e),a=i.length>1?1+i.reduce((e,t)=>e+l(he(t),s[0]-16),0):l(he(i[0]),s[0]),o=l(he(e.then),s[1],1.08),u=r.length?t[r[0]].label:``,d=r.length?t[r[r.length-1]].label:``,f=r.length>1?he(u)+he(d)+3:he(u||`全程`),p=l(f,s[2]);return{rule:e,index:n,h:Math.max(a,o,p)*20+18+1,stageIds:r.map(e=>t[e].id),scope:r.length===0?{kind:`all`}:r.length===1?{kind:`one`,stage:u}:{kind:`range`,from:u,to:d,n:r.length},first:r.length?r[0]:-1}}),d=(e,t)=>e.first-t.first||e.index-t.index,f=[...new Set(e.map(e=>e.endId).filter(e=>e&&n.has(e)))],p=[...f.map(e=>({endId:e,endLabel:n.get(e).label,rows:u.filter(t=>t.rule.endId===e).sort(d)})),{endId:null,endLabel:null,rows:u.filter(e=>!e.rule.endId||!n.has(e.rule.endId)).sort(d)}].filter(e=>e.rows.length),m=f.length>0,h=84;for(let e of p){e.headed=m,e.y=h,m&&(h+=40);for(let t of e.rows)t.y=h,h+=t.h;e.h=h-e.y}return{x:r,y:i,w:o,h,cols:s,groups:p,count:e.length}}var ur=e=>`${e.from}|${e.to}|${e.condition??``}`;function dr(e,t=8){if(!Array.isArray(e)||e.length<2)return``;if(e.length===2)return`M ${e[0][0]} ${e[0][1]} L ${e[1][0]} ${e[1][1]}`;let n=[`M ${e[0][0]} ${e[0][1]}`];for(let r=1;r<e.length-1;r+=1){let[i,a]=e[r-1],[o,s]=e[r],[c,l]=e[r+1],u=Math.hypot(o-i,s-a),d=Math.hypot(c-o,l-s),f=Math.max(0,Math.min(t,u/2,d/2));if(f===0){n.push(`L ${o} ${s}`);continue}let p=(o-i)/(u||1),m=(s-a)/(u||1),h=(c-o)/(d||1),g=(l-s)/(d||1);n.push(`L ${o-p*f} ${s-m*f}`),n.push(`Q ${o} ${s} ${o+h*f} ${s+g*f}`)}let r=e[e.length-1];return n.push(`L ${r[0]} ${r[1]}`),n.join(` `)}var fr=12;function pr(e,t=40){if(!Array.isArray(e)||e.length<2)return``;if(e.length===2)return dr(e);let n=[`M ${e[0][0]} ${e[0][1]}`];for(let r=1;r<e.length-1;r+=1){let[i,a]=e[r-1],[o,s]=e[r],[c,l]=e[r+1],u=Math.hypot(o-i,s-a),d=Math.hypot(c-o,l-s),f=r===1?u:u/2,p=r===e.length-2?Math.max(0,d-fr):d/2,m=Math.max(0,Math.min(t,f,p));if(m===0){n.push(`L ${o} ${s}`);continue}let h=(o-i)/(u||1),g=(s-a)/(u||1),_=(c-o)/(d||1),v=(l-s)/(d||1),y=.55,b=o-h*m,x=s-g*m,S=o+_*m,C=s+v*m;n.push(`L ${b} ${x}`),n.push(`C ${b+h*m*y} ${x+g*m*y} ${S-_*m*y} ${C-v*m*y} ${S} ${C}`)}let r=e[e.length-1];return n.push(`L ${r[0]} ${r[1]}`),n.join(` `)}var mr=()=>({nodes:0,edges:0,connections:0,layers:0,widest:0,backEdges:0,decisions:0,ends:0,groupedEdges:0});function hr(e){let t=he(e)*12;return{width:Math.min(150,Math.ceil(t+12)),height:Math.max(1,Math.ceil(t/138-1e-9))*16+2}}function gr(e,t={},n,r=`vertical`){let i=Kt(e),a=qt(e),o=r!==`horizontal`,s=o?`vertical`:`horizontal`;if(i.length)return{errors:i,hints:a,orientation:s,nodes:[],edges:[],connections:[],rows:[],spine:[],stageBoxes:[],ruleTable:null,size:{width:0,height:0},stats:mr()};let c=e.nodes,l=new Map((e.stages??[]).map(e=>[e.id,e])),u=new Map(c.map(e=>[e.id,e])),d=c.map(e=>e.id),f=new Map(d.map(e=>[e,[]])),p=new Map(d.map(e=>[e,[]]));e.edges.forEach((e,t)=>{f.get(e.from).push({...e,index:t}),p.get(e.to).push({...e,index:t})});let m=new Set,h=new Map,g=e=>{h.set(e,1);for(let t of f.get(e)){let e=h.get(t.to)??0;e===1?m.add(ur(t)):e===0&&g(t.to)}h.set(e,2)},_=[...d.filter(e=>p.get(e).length===0),...d];for(let e of _)(h.get(e)??0)===0&&g(e);let v=new Set([...Gt(e)].filter(e=>u.has(e)&&p.get(e).length===0)),y=d.filter(e=>p.get(e).length===0&&!v.has(e)),b=[],x=new Set;{let e=y[0],t=new Set;for(;e!==void 0&&!t.has(e)&&(t.add(e),b.push(e),x.add(e),u.get(e).kind!==`end`);){let n=f.get(e);e=(n.find(e=>e.main===!0)??n.find(e=>!e.condition&&!t.has(e.to))??n.find(e=>!t.has(e.to)))?.to}}let S=new Map(b.slice(0,-1).map((e,t)=>[e,b[t+1]])),C=new Map;for(let t of e.edges){let e=`${t.from}|${t.to}`;C.has(e)||C.set(e,[]),C.get(e).push(t)}let ee=[...C.values()].map(e=>{let{from:t,to:n}=e[0],r=m.has(ur(e[0])),i=e.map(e=>e.condition).filter(Boolean);return{from:t,to:n,isBack:r,isMain:!r&&S.get(t)===n,merged:e.length,label:i.length?i.join(` / `):``}}),w=t?.stages!==!1&&l.size>0,te=(e.stages??[]).filter(e=>c.some(t=>t.stageId===e.id)),ne=e=>{let{w:t,h:n}=It(e),r=v.has(e.id)?{"elk.layered.layering.layerConstraint":`LAST`}:{};return{id:e.id,width:t,height:n,layoutOptions:r}},re={"elk.spacing.nodeNode":`44`,"elk.layered.spacing.nodeNodeBetweenLayers":`28`,"elk.spacing.edgeNode":`16`,"elk.spacing.edgeEdge":`10`,"elk.spacing.edgeLabel":`4`,"elk.layered.spacing.edgeNodeBetweenLayers":`16`},ie={...re,"elk.padding":`[top=44,left=28,bottom=28,right=28]`},ae=(e,t)=>({id:`root`,layoutOptions:{"elk.algorithm":`layered`,"elk.direction":o?`DOWN`:`RIGHT`,"elk.padding":`[top=0,left=0,bottom=0,right=0]`,"elk.edgeRouting":`ORTHOGONAL`,...re,"elk.layered.crossingMinimization.strategy":`LAYER_SWEEP`,...t,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.edgeLabels.inline":`false`,"elk.separateConnectedComponents":`false`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.json.shapeCoords":`ROOT`,"elk.json.edgeCoords":`ROOT`},children:e?[...te.map(e=>({id:`stage:${e.id}`,layoutOptions:ie,children:c.filter(t=>t.stageId===e.id).map(ne)})),...c.filter(e=>!te.some(t=>t.id===e.stageId)).map(ne)]:c.map(ne),edges:ee.map((e,t)=>({id:`g${t}`,sources:[e.isBack?e.to:e.from],targets:[e.isBack?e.from:e.to],labels:e.label?[{id:`l${t}`,text:e.label,...hr(e.label)}]:[],layoutOptions:e.isMain?{"elk.layered.priority.straightness":`10`,"elk.layered.priority.direction":`10`}:{}}))}),oe=new Set(c.filter(e=>e.kind===`decision`).map(e=>e.id)),se=e=>{let t,n=w&&te.length>0;try{t=en(ae(n,e))}catch(r){if(!n)throw r;t=en(ae(!1,e))}let r=new Map,i=[],a=e=>{for(let t of e??[])if(t.id.startsWith(`stage:`)){let e=l.get(t.id.slice(6));i.push({stageId:e.id,label:e.label,x:t.x+32,y:t.y+32,w:t.width,h:t.height}),a(t.children)}else r.set(t.id,{x:t.x+32,y:t.y+32,w:t.width,h:t.height})};a(t.children);let s={width:t.width+32+32,height:t.height+32+32},c=(e,t)=>{if(u.get(t)?.kind!==`decision`)return e;let n=r.get(t),[i,a]=e,o=n.x+n.w/2,s=n.y+n.h/2;if(Math.abs(a-n.y)<.5||Math.abs(a-(n.y+n.h))<.5){let e=n.h/2*(1-Math.min(1,Math.abs(i-o)/(n.w/2)));return[i,a<s?s-e:s+e]}let c=n.w/2*(1-Math.min(1,Math.abs(a-s)/(n.h/2)));return[i<o?o-c:o+c,a]},d=new Map(t.edges.map(e=>[e.id,e])),f=ee.map((e,t)=>{let n=d.get(`g${t}`),r=n?.sections?.[0],i=r?[r.startPoint,...r.bendPoints??[],r.endPoint].map(e=>[e.x+32,e.y+32]):[];e.isBack&&i.reverse(),i.length>=2&&(i[0]=c(i[0],e.from),i[i.length-1]=c(i[i.length-1],e.to));let a=n?.labels?.[0];return{id:`c:${e.from}->${e.to}`,from:e.from,to:e.to,kind:e.isBack?`back`:e.isMain?`main`:`branch`,merged:e.merged,points:i,d:dr(i),label:e.label,labelAt:a?{x:a.x+32,y:a.y+32}:null,labelSize:a?{width:a.width,height:a.height}:null}}),p=i.map(e=>({x:e.x+28-2,y:e.y+7,w:Math.min(e.w-56,he(e.label)*13+4),h:18}));En(f,r,p,o,oe).forEach((e,t)=>{f[t]={...e,d:dr(e.points),dCurve:pr(e.points)}});for(let e of f){for(let[t,n]of e.points)s.width=Math.max(s.width,t+32),s.height=Math.max(s.height,n+32);e.labelAt&&(s.width=Math.max(s.width,e.labelAt.x+e.labelSize.width+32),s.height=Math.max(s.height,e.labelAt.y+e.labelSize.height+32))}return{placed:r,stageBoxes:i,stageTitles:p,connections:f,size:s}},ce=[{"elk.layered.nodePlacement.strategy":`BRANDES_KOEPF`,"elk.layered.nodePlacement.bk.fixedAlignment":`BALANCED`},{"elk.layered.nodePlacement.strategy":`NETWORK_SIMPLEX`},{"elk.layered.nodePlacement.strategy":`BRANDES_KOEPF`}],le=w&&te.length>1&&c.every(e=>l.has(e.stageId)),ue=null;if(le)ue=ir({nodes:c,groups:ee,stages:te,ruleEnds:v,labelBox:hr,vertical:o});else for(let e of ce){let t=se(e),n=t.connections.reduce((e,n)=>e+xn(n,t.placed,oe),0);(!ue||n<ue.cost)&&(ue={...t,cost:n})}le||_r(ue,oe,o,u);let{placed:de,stageBoxes:fe,size:pe}=ue,me=ue.connections.map(e=>({...e,d:dr(e.points),dCurve:pr(e.points)})),ge=new Map([...de.entries()].map(([e,t])=>{let n=o?t.y:t.x,r=o?t.x:t.y,i=o?t.h:t.w,a=o?t.w:t.h;return[e,{a0:n,a1:n+i,c0:r,c1:r+a,am:n+i/2,cm:r+a/2}]})),_e=e.edges.filter(e=>m.has(ur(e))),ve=[...new Set(d.map(e=>Math.round(ge.get(e).a0)))].sort((e,t)=>e-t),ye=e=>ve.indexOf(Math.round(ge.get(e).a0)),be=ve.map((e,t)=>{let n=d.filter(e=>ye(e)===t);return{layer:t,along:e,extent:Math.max(...n.map(t=>ge.get(t).a1-e)),count:n.length}}),xe=t?.rules!==!1&&Array.isArray(e.rules)&&e.rules.length>0,Se=null;xe&&(Se=lr({rules:e.rules,stages:e.stages??[],byId:u,x:32,y:pe.height-32+40,available:pe.width-64}),pe.width=Math.max(pe.width,Se.x+Se.w+32),pe.height=Se.y+Se.h+32);let Ce=new Map;for(let t of e.rules??[])t.endId&&Ce.set(t.endId,(Ce.get(t.endId)??0)+1);let we=new Map((e.actors??[]).map(e=>[e.id,e])),Te=new Map((e.sources??[]).map(e=>[e.id,e])),Ee=c.map(e=>{let n=de.get(e.id);return{id:e.id,type:`pnode`,position:{x:n.x,y:n.y},data:{node:e,w:n.w,h:n.h,textW:It(e).textW,cut:It(e).cut,isSpine:x.has(e.id),stageLabel:l.get(e.stageId)?.label??``,actorNames:(e.actorIds??[]).map(e=>we.get(e)?.name??e),sources:(e.sourceIds??[]).map(e=>Te.get(e)).filter(Boolean),sourceCount:(e.sourceIds??[]).filter(e=>Te.has(e)).length,layer:ye(e.id),ruleCount:xe?Ce.get(e.id)??0:0,showDetail:t?.detail!==!1,vertical:o}}}),De={nodes:c.length,edges:e.edges.length,connections:me.length,layers:be.length,widest:Math.max(...be.map(e=>e.count)),backEdges:_e.length,decisions:c.filter(e=>e.kind===`decision`).length,ends:c.filter(e=>e.kind===`end`).length,groupedEdges:e.edges.length-me.length};return{errors:i,hints:a,orientation:s,nodes:Ee,edges:[],connections:me,rows:be,spine:b,stageBoxes:fe,ruleTable:Se,size:{width:Math.ceil(pe.width),height:Math.ceil(pe.height)},stats:De}}function _r(e,t,n,r){let i=n?e=>({...e}):e=>({...e,x:e.y,y:e.x,w:e.h,h:e.w}),a=n?e=>[...e]:([e,t])=>[t,e],o=e=>({...e,points:e.points.map(a),labelAt:e.labelAt?n?{...e.labelAt}:{x:e.labelAt.y,y:e.labelAt.x}:null,labelSize:e.labelSize?n?{...e.labelSize}:{width:e.labelSize.height,height:e.labelSize.width}:null}),s=new Map([...e.placed].map(([e,t])=>[e,i(t)])),c=e.stageBoxes.map(i),l=e.connections.map(o),u={x:-6,y:-1e6,w:1e7,h:2e7},d=e=>c.find(t=>t.stageId===r.get(e)?.stageId)??u;Zn({placed:s,connections:l,diamonds:t,titles:(e.stageTitles??[]).map(i),boxes:c,borders:c.flatMap(fn),within:e=>{let t=d(e.from);return t!==u&&t===d(e.to)?t:null},boxOf:d}),e.placed=new Map([...s].map(([e,t])=>[e,i(t)])),e.connections=l.map(o);for(let t of e.placed.values())e.size.width=Math.max(e.size.width,t.x+t.w+32),e.size.height=Math.max(e.size.height,t.y+t.h+32);for(let t of e.connections)for(let[n,r]of t.points)e.size.width=Math.max(e.size.width,n+32),e.size.height=Math.max(e.size.height,r+32)}var vr={envelope:[{name:`type`,req:`yes`,ty:`string`,note:`always "procedure"`},y(1),{name:`title`,req:`yes`,ty:`string`,note:`diagram title, shown at the top left`}],domain:[{name:`domain`,req:`no`,ty:`string`,note:`which class of flow this is: ${Ht.join(` / `)}`}],actors:[{name:`id`,req:`yes`,ty:`string`,note:`unique within the diagram; nodes reference it via actorIds`},{name:`name`,req:`yes`,ty:`string`,note:`display name, e.g. "Party A"`},{name:`role`,req:`no`,ty:`string`,note:`role, e.g. "owner"`},{name:``,req:``,ty:``,note:`actorIds on a node is display-only (it marks who acted); it never affects placement`}],stages:[{name:`id`,req:`yes`,ty:`string`,note:`nodes reference it via stageId`},{name:`label`,req:`yes`,ty:`string`,note:`stage name, e.g. "requirements sign-off"`},{name:``,req:``,ty:``,note:`array order is the order in the flow; omit stages and no stage bands are drawn`}],sources:[{name:`id`,req:`yes`,ty:`string`,note:`nodes reference it via sourceIds`},{name:`type`,req:`yes`,ty:`string`,note:`contract / evidence / judgment and four more, the same seven as fact`},{name:`name`,req:`yes`,ty:`string`,note:`material name, e.g. "software development services contract"`},{name:`loc`,req:`no`,ty:`object`,note:`location, e.g. { file, clause, page }`}],nodes:[{name:`id`,req:`yes`,ty:`string`,note:`unique within the diagram; edges reference it via from/to`},{name:`kind`,req:`yes`,ty:`string`,note:`shape: ${Bt.join(` / `)} (decision = a diamond decision point; it needs at least 2 outgoing edges, each with a condition)`},{name:`label`,req:`yes`,ty:`string`,note:`the text shown on the node: two lines, about 20 Chinese characters; a longer label is cut on the node and hinted by validate. Keep it a short phrase and put the rest in detail`},{name:`detail`,req:`no`,ty:`string`,note:`amounts, deadlines and the like; the first line, about 16 Chinese characters, shows under the label (a ⋯ mark says more is left), the full text is in the popover`},{name:`actorIds`,req:`no`,ty:`string[]`,note:`references actors; display-only`},{name:`stageId`,req:`no`,ty:`string`,note:`references stages; decides which stage band it falls in`},{name:`outcome`,req:`no`,ty:`string`,note:`outcome (drives colour, not shape): ${Vt.join(` / `)}, default neutral`},{name:`sourceIds`,req:`no`,ty:`string[]`,note:`which materials it rests on`}],rules:[{name:``,req:``,ty:``,note:`Optional (v1.1). Contingent clauses: breach, delay liability, rights to terminate`},{name:``,req:``,ty:``,note:`a rule is NOT a step: write it here, not as a node with edges out of some step`},{name:`id`,req:`yes`,ty:`string`,note:`unique among rules and nodes`},{name:`when`,req:`yes`,ty:`string|str[]`,note:`the trigger; an array means "any one of these"`},{name:`then`,req:`yes`,ty:`string`,note:`the consequence, with amounts, e.g. "penalty 0.1% per day, capped at 5%"`},{name:`stageIds`,req:`no`,ty:`string[]`,note:`the stages it applies in; omit = throughout. One rule for all its stages, never one copy per stage`},{name:`outcome`,req:`no`,ty:`string`,note:`colour: ${Vt.join(` / `)}`},{name:`endId`,req:`no`,ty:`string`,note:`only if it ends the contract: the id of the end node it leads to`},{name:`sourceIds`,req:`no`,ty:`string[]`,note:`which clause it rests on`}],edges:[{name:`from`,req:`yes`,ty:`string`,note:`id of the source node`},{name:`to`,req:`yes`,ty:`string`,note:`id of the target node`},{name:`condition`,req:`no`,ty:`string`,note:`the condition for taking this edge (a human-readable phrase such as "pass" or "Party B's fault"). Required on every outgoing edge of a decision`},{name:`main`,req:`no`,ty:`boolean`,note:`whether this edge is on the main line. If marked, it must connect through to an end; if unmarked the engine infers it`},{name:``,req:``,ty:``,note:`several edges may run between the same pair of nodes (different conditions); they are merged into one link with the conditions shown side by side`}]};function yr(){let e=[`Fields of a procedure spec. "yes" means required.`,``];for(let[t,n]of Object.entries(vr)){e.push(`[${t}]`);for(let t of n)t.name?e.push(` ${t.name.padEnd(10)} ${t.req.padEnd(2)} ${t.ty.padEnd(10)} ${t.note}`):e.push(` · ${t.note}`);e.push(``)}return e.push(`Cross-field rules (dangling references, whether a decision has enough`),e.push(`outgoing edges, isolated nodes, whether the main line connects through) are`),e.push(`not listed above: call antu_validate after writing. It reports each problem.`),e.join(`
1454
1454
  `)}function br(e,t,{canvas:n}){let r=t(e,{}),i=Math.max(Number(Ot(r.size,n).toFixed(3)),.7);return{text:{font:14,canvas:n,open:{name:`route`,fit:Math.min(i,1)},other:{name:`route`,fit:Math.min(i,1)}},counts:{nodes:r.stats.nodes,edges:r.edgeCount,rules:r.rules,stages:Array.isArray(e.stages)?e.stages.length:0,actors:e.actors?.length??0,sources:e.sources?.length??0},size:r.size,stations:r.stations,hangs:r.hangs,loops:r.loops,jumps:r.jumps,cut:r.cut,off:r.off,notFollowed:r.notFollowed,edgesDrawn:r.edgesDrawn,hints:r.hints}}function xr(e){let t=e.counts,n=[`Kind: route (the main line as one line, left to right; orientation does not apply)`,`Data: ${t.nodes} nodes / ${t.edges} edges / ${t.rules} rules / ${t.stages} stages / ${t.actors} parties / ${t.sources} sources`,`Content ${e.size.width}×${e.size.height}; it opens at a readable zoom from the left, a long route scrolls sideways`,`${e.stations} stations on the main line, ${e.hangs} branch(es) hanging below it, ${e.loops} loop(s) back and ${e.jumps} jump(s) ahead drawn as arcs; ${e.edgesDrawn} of ${t.edges} edges are on the picture`];return e.cut&&n.push(`${e.cut} hanging branch(es) cut off after 4 boxes ("... and N more")`),e.notFollowed&&n.push(`${e.notFollowed} way(s) out of a hanging branch not followed (the flowchart shows them)`),e.off&&n.push(`${e.off} node(s) not on the picture (listed under it)`),t.rules&&n.push(`${t.rules} rule(s) not drawn here; the flowchart lists them`),n.push(...jt(e.text,`splitting the flow by stage`)),e.hints.length&&n.push(``,`${e.hints.length} hint(s):`,...e.hints.map(e=>` - ${e}`)),n.join(`
1455
- `)}var Sr={specVersion:1,label:`graphType.procedure`,fields:vr,describe:yr,info:(e,t,n)=>{let r=Array.isArray(e.nodes)?e.nodes.length:0,i=Array.isArray(e.stages)?e.stages.length:0,a=t(`info.nodes`,{n:n(r)});return i>0&&(a+=` · ${t(`info.stages`,{n:n(i)})}`),[a,t(`info.actors`,{n:n(e.actors?.length||0)}),t(`info.sources`,{n:n(e.sources?.length||0)})]},report:(e,t,{canvas:n,kind:r})=>{if(r===`route`)return br(e,t,{canvas:n});let i={},a;for(let r of[`vertical`,`horizontal`])a=t(e,{},void 0,r),i[r]={size:a.size,fit:Number(Ot(a.size,n).toFixed(3))};let o=i.vertical,s=i.horizontal;return{text:{font:14,canvas:n,open:{name:`vertical`,fit:o.fit},other:{name:`horizontal`,fit:s.fit}},counts:{nodes:a.stats.nodes,edges:a.stats.edges,links:a.stats.connections,layers:a.stats.layers,widest:a.stats.widest,backEdges:a.stats.backEdges,rules:Array.isArray(e.rules)?e.rules.length:0,stages:Array.isArray(e.stages)?e.stages.length:0,actors:e.actors?.length??0,sources:e.sources?.length??0},byOrientation:i,suggestedOrientation:`vertical`,betterFit:s.fit>o.fit?`horizontal`:`vertical`,hints:a.hints}},formatReport:e=>{if(e.kind===`route`)return xr(e);let t=e.counts,n=e.byOrientation.vertical,r=e.byOrientation.horizontal,i=[`Data: ${t.nodes} nodes / ${t.edges} edges (${t.links} links after merging) / ${t.rules} rules / ${t.stages} stages / ${t.actors} parties / ${t.sources} sources`,`Shape: ${t.layers} layers, widest layer ${t.widest} nodes, ${t.backEdges} loop(s) back`,`Vertical: content ${n.size.width}×${n.size.height}, fit zoom ${n.fit}`,`Horizontal: content ${r.size.width}×${r.size.height}, fit zoom ${r.fit}`,`Suggested orientation: ${e.suggestedOrientation} (what the diagram opens with; a flowchart reads top to bottom)`];return e.betterFit!==e.suggestedOrientation&&i.push(`Horizontal fits a screen better (${r.fit} vs ${n.fit}); the reader can switch to it.`),i.push(...jt(e.text,`splitting the flow by stage`)),e.hints.length&&i.push(``,`${e.hints.length} hint(s):`,...e.hints.map(e=>` - ${e}`)),i.join(`
1455
+ `)}var Sr={specVersion:1,label:`graphType.procedure`,fields:vr,describe:yr,info:(e,t,n)=>{let r=Array.isArray(e.nodes)?e.nodes.length:0,i=Array.isArray(e.stages)?e.stages.length:0,a=t(`info.nodes`,{n:n(r)});return i>0&&(a+=` · ${t(`info.stages`,{n:n(i)})}`),[a,t(`info.actors`,{n:n(e.actors?.length||0)}),t(`info.sources`,{n:n(e.sources?.length||0)})]},report:(e,t,{canvas:n,kind:r})=>{if(r===`route`)return br(e,t,{canvas:n});let i={},a;for(let r of[`vertical`,`horizontal`])a=t(e,{rules:!1},void 0,r),i[r]={size:a.size,fit:Number(Ot(a.size,n).toFixed(3))};let o=i.vertical,s=i.horizontal;return{text:{font:14,canvas:n,open:{name:`vertical`,fit:o.fit},other:{name:`horizontal`,fit:s.fit}},counts:{nodes:a.stats.nodes,edges:a.stats.edges,links:a.stats.connections,layers:a.stats.layers,widest:a.stats.widest,backEdges:a.stats.backEdges,rules:Array.isArray(e.rules)?e.rules.length:0,stages:Array.isArray(e.stages)?e.stages.length:0,actors:e.actors?.length??0,sources:e.sources?.length??0},byOrientation:i,suggestedOrientation:`vertical`,betterFit:s.fit>o.fit?`horizontal`:`vertical`,hints:a.hints}},formatReport:e=>{if(e.kind===`route`)return xr(e);let t=e.counts,n=e.byOrientation.vertical,r=e.byOrientation.horizontal,i=[`Data: ${t.nodes} nodes / ${t.edges} edges (${t.links} links after merging) / ${t.rules} rules / ${t.stages} stages / ${t.actors} parties / ${t.sources} sources`,`Shape: ${t.layers} layers, widest layer ${t.widest} nodes, ${t.backEdges} loop(s) back`,`Vertical: content ${n.size.width}×${n.size.height}, fit zoom ${n.fit}`,`Horizontal: content ${r.size.width}×${r.size.height}, fit zoom ${r.fit}`,`Suggested orientation: ${e.suggestedOrientation} (what the diagram opens with; a flowchart reads top to bottom)`];return e.betterFit!==e.suggestedOrientation&&i.push(`Horizontal fits a screen better (${r.fit} vs ${n.fit}); the reader can switch to it.`),i.push(...jt(e.text,`splitting the flow by stage`)),e.hints.length&&i.push(``,`${e.hints.length} hint(s):`,...e.hints.map(e=>` - ${e}`)),i.join(`
1456
1456
  `)},summarize:e=>{let t=Array.isArray(e.nodes)?e.nodes.length:0,n=Array.isArray(e.edges)?e.edges.length:0,r=Array.isArray(e.rules)?e.rules.length:0,i=Array.isArray(e.stages)?e.stages.length:0;return{nodes:t,edges:n,rules:r,stages:i,line:`${t} nodes / ${n} edges / ${r} rules / ${i} stages`}},validate:e=>Kt(e),normalize:e=>jee(e),diagrams:{flow:{version:1,status:`experimental`,since:`0.2.0`},route:{version:1,status:`experimental`,since:`0.7.0`}},layouts:{flow:gr,route:Qee}},Cr={statute:`sourceType.statute`,case:`sourceType.case`,contract:`sourceType.contract`,evidence:`sourceType.evidence`,document:`sourceType.document`,web:`sourceType.web`,other:`sourceType.other`},wr=[`person`,`company`,`organization`,`government`,`other`],Tr=[`equity`,`control`,`contract`,`debt`,`guarantee`,`kinship`,`employment`,`agency`,`other`],Er=new Set([`contract`,`kinship`]),Dr=[`equity`],Or=[`debt`,`contract`],kr=[`guarantee`],Ar=[`debt`,`contract`],jr=/^\d{4}(-\d{2}(-\d{2})?)?$/,Mr=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Nr=e=>Array.isArray(e)?e:[],Pr=e=>typeof e?.directed==`boolean`?e.directed:!Er.has(e?.kind);function Fr(e){let t=[];if(!Mr(e))return[w(`err.specNotObject`)];if(e.asOf!==void 0&&(typeof e.asOf!=`string`||!jr.test(e.asOf))&&t.push(w(`rerr.badAsOf`,{value:String(e.asOf)})),(typeof e.title!=`string`||!e.title.trim())&&t.push(w(`rerr.required`,{at:`the diagram`,field:`title`})),(!Array.isArray(e.entities)||e.entities.length===0)&&t.push(w(`rerr.entitiesEmpty`)),(!Array.isArray(e.relations)||e.relations.length===0)&&t.push(w(`rerr.relationsEmpty`)),t.length)return t;let n=new Set;e.groups!==void 0&&(Array.isArray(e.groups)?e.groups.forEach((e,r)=>{let i=`groups[${r}]`+(Mr(e)&&e.id?` (${e.id})`:``);if(!Mr(e))return void t.push(w(`rerr.notObject`,{at:`groups[${r}]`}));!e.id||typeof e.id!=`string`?t.push(w(`rerr.required`,{at:i,field:`id`})):n.has(e.id)?t.push(w(`rerr.duplicateId`,{at:i,id:e.id,what:`group`})):n.add(e.id),(!e.label||typeof e.label!=`string`)&&t.push(w(`rerr.required`,{at:i,field:`label`}))}):t.push(w(`rerr.notArray`,{field:`groups`})));let r=new Set;e.sources!==void 0&&(Array.isArray(e.sources)?e.sources.forEach((e,n)=>{let i=`sources[${n}]`+(Mr(e)&&e.id?` (${e.id})`:``);if(!Mr(e))return void t.push(w(`rerr.notObject`,{at:`sources[${n}]`}));!e.id||typeof e.id!=`string`?t.push(w(`rerr.required`,{at:i,field:`id`})):r.has(e.id)?t.push(w(`rerr.duplicateId`,{at:i,id:e.id,what:`source`})):r.add(e.id),(!e.name||typeof e.name!=`string`)&&t.push(w(`rerr.required`,{at:i,field:`name`})),Object.keys(Cr).includes(e.type)||t.push(w(`rerr.badSourceType`,{at:i,value:String(e.type),allowed:Object.keys(Cr).join(` / `)}))}):t.push(w(`rerr.notArray`,{field:`sources`})));let i=new Map;e.entities.forEach((e,a)=>{if(!Mr(e))return void t.push(w(`rerr.notObject`,{at:`entities[${a}]`}));let o=`entities[${a}]`+(e.id?` (${e.id})`:``);if(!e.id||typeof e.id!=`string`)t.push(w(`rerr.required`,{at:o,field:`id`}));else{i.has(e.id)?t.push(w(`rerr.duplicateId`,{at:o,id:e.id,what:`entity`})):i.set(e.id,e),wr.includes(e.kind)||t.push(w(`rerr.badEntityKind`,{at:o,value:String(e.kind),allowed:wr.join(` / `)})),(!e.label||typeof e.label!=`string`)&&t.push(w(`rerr.required`,{at:o,field:`label`}));for(let n of[`role`,`detail`])e[n]!==void 0&&typeof e[n]!=`string`&&t.push(w(`rerr.mustBeString`,{at:o,field:n}));e.groupId!==void 0&&!n.has(e.groupId)&&t.push(w(`rerr.badRef`,{at:o,field:`groupId`,kind:`group`,id:String(e.groupId)}));for(let n of Nr(e.sourceIds))r.has(n)||t.push(w(`rerr.badRef`,{at:o,field:`sourceIds`,kind:`source`,id:String(n)}))}});let a=new Map,o=new Set;return e.relations.forEach((e,n)=>{if(!Mr(e))return void t.push(w(`rerr.notObject`,{at:`relations[${n}]`}));let s=`relations[${n}]`+(e.id?` (${e.id})`:``);!e.id||typeof e.id!=`string`?t.push(w(`rerr.required`,{at:s,field:`id`})):a.has(e.id)?t.push(w(`rerr.duplicateId`,{at:s,id:e.id,what:`relation`})):a.set(e.id,e),Tr.includes(e.kind)||t.push(w(`rerr.badRelationKind`,{at:s,value:String(e.kind),allowed:Tr.join(` / `)}));for(let n of[`from`,`to`])(typeof e[n]!=`string`||!i.has(e[n]))&&t.push(w(`rerr.badEnd`,{at:s,end:n,id:String(e[n])}));if(typeof e.from==`string`&&e.from===e.to&&t.push(w(`rerr.selfRelation`,{at:s,id:e.from})),typeof e.from==`string`&&typeof e.to==`string`){let n=[e.from,e.to,e.kind,e.label??``].join(`\0`);o.has(n)&&t.push(w(`rerr.duplicateRelation`,{at:s,from:e.from,to:e.to,kind:String(e.kind)})),o.add(n)}for(let n of[`label`,`detail`])e[n]!==void 0&&typeof e[n]!=`string`&&t.push(w(`rerr.mustBeString`,{at:s,field:n}));e.directed!==void 0&&typeof e.directed!=`boolean`&&t.push(w(`rerr.mustBeBoolean`,{at:s,field:`directed`}));for(let n of Nr(e.sourceIds))r.has(n)||t.push(w(`rerr.badRef`,{at:s,field:`sourceIds`,kind:`source`,id:String(n)}));e.share!==void 0&&(Dr.includes(e.kind)?(typeof e.share!=`number`||!(e.share>=0&&e.share<=100))&&t.push(w(`rerr.badShare`,{at:s,value:String(e.share)})):t.push(w(`rerr.fieldNotHere`,{at:s,field:`share`,kinds:Dr.join(` / `)}))),e.amount!==void 0&&(Or.includes(e.kind)?(typeof e.amount!=`string`||!e.amount.trim())&&t.push(w(`rerr.mustBeString`,{at:s,field:`amount`})):t.push(w(`rerr.fieldNotHere`,{at:s,field:`amount`,kinds:Or.join(` / `)}))),e.secures!==void 0&&!kr.includes(e.kind)&&t.push(w(`rerr.fieldNotHere`,{at:s,field:`secures`,kinds:kr.join(` / `)}))}),e.relations.forEach((e,n)=>{if(!Mr(e)||e.secures===void 0||!kr.includes(e.kind))return;let r=`relations[${n}]`+(e.id?` (${e.id})`:``),i=a.get(e.secures);i?Ar.includes(i.kind)||t.push(w(`rerr.securesNotClaim`,{at:r,id:e.secures,kind:String(i.kind),claims:Ar.join(` / `)})):t.push(w(`rerr.badSecures`,{at:r,id:String(e.secures)}))}),t}function Ir(e){let t=[];if(!Mr(e)||!Array.isArray(e.entities)||!Array.isArray(e.relations))return t;let n=Nr(e.entities).filter(e=>Mr(e)&&typeof e.id==`string`),r=new Set(n.map(e=>e.id)),i=Nr(e.relations).filter(e=>Mr(e)&&r.has(e.from)&&r.has(e.to)),a=e=>n.find(t=>t.id===e)?.label??e,o=new Map;for(let e of i)e.kind===`equity`&&typeof e.share==`number`&&o.set(e.to,(o.get(e.to)??0)+e.share);for(let[e,n]of o)n>100+1e-9&&t.push(w(`rhint.shareOver100`,{id:e,label:a(e),total:Number(n.toFixed(4))}));let s=new Set(i.flatMap(e=>[e.from,e.to]));for(let e of n)s.has(e.id)||t.push(w(`rhint.isolated`,{id:e.id,label:e.label??e.id}));for(let e of i)e.kind===`guarantee`&&e.secures===void 0&&t.push(w(`rhint.noSecures`,{id:e.id??`${e.from}->${e.to}`}));let c=new Map;for(let e of i)e.kind===`equity`&&c.set(e.from,[...c.get(e.from)??[],e.to]);let l=new Map,u=[];for(let e of c.keys()){if(l.has(e))continue;let t=[e],n=[0];for(l.set(e,1);t.length;){let e=t.at(-1),r=c.get(e)??[],i=n.at(-1);if(i<r.length){n[n.length-1]+=1;let e=r[i];l.get(e)===1?u.push([...t.slice(t.indexOf(e)),e]):l.has(e)||(l.set(e,1),t.push(e),n.push(0))}else l.set(e,2),t.pop(),n.pop()}}for(let e of u)t.push(w(`rhint.equityCycle`,{path:e.map(a).join(` → `)}));return t}var Lr=8;function Rr(e,t,n,r=12){if(!Array.isArray(e)||e.length!==4||!t||!n)return e;let[i,a,o,s]=e,c=(e,t,n)=>e>=t+Lr&&e<=t+n-Lr;if(i[0]===a[0]&&a[1]===o[1]&&o[0]===s[0]){let l=Math.abs(o[0]-a[0]);if(l===0||l>=r)return e;let u=(i[0]+s[0])/2;return c(u,t.x,t.w)&&c(u,n.x,n.w)?[[u,i[1]],[u,s[1]]]:e}if(i[1]===a[1]&&a[0]===o[0]&&o[1]===s[1]){let l=Math.abs(o[1]-a[1]);if(l===0||l>=r)return e;let u=(i[1]+s[1])/2;return c(u,t.y,t.h)&&c(u,n.y,n.h)?[[i[0],u],[s[0],u]]:e}return e}function zr(e,t=w){return typeof e.label==`string`&&e.label.trim()?e.label:t(`rel.auto.${e.kind}`,{share:e.share,amount:e.amount})}var xte=(e,t=8)=>Math.ceil(e/t-1e-9)*t,Br={minH:40,minW:120,stepW:40,gap:24,levelGap:48,padX:12,padY:6},Ste={hair:.75,normal:1.1,strong:1.75,heavy:2.5},Vr={solid:void 0,dashed:`6 4`,dotted:`2 3`,longDash:`10 4`,dashDot:`10 3 2 3`},Hr=e=>Math.max(Br.minW,Math.ceil(e/Br.stepW-1e-9)*Br.stepW),Cte=e=>Math.max(Br.minH,xte(e)),Ur=1.3,Wr=1.2,Gr=(e,t)=>{let n=String(e??``),r=[...n].filter(e=>e.codePointAt(0)<11904).join(``);return he(n)+he(r)*(t-1)},wte=1300;function Kr(e,t){if(t>1)return Tte(e,t);let n=Gr(e,Wr)*12;return{width:Math.min(150,Math.ceil(n+12)),height:Math.max(1,Math.ceil(n/138-1e-9))*16+2}}function qr(e){let t=String(e?.label??``),n=e?.role?String(e.role):``,r=Gr(t,Ur)*14,i=n?he(n)*12:0,a=Hr(Math.min(168,Math.max(r,i))+32),o=a-32;return{w:a,h:Cte(Math.min(2,Math.max(1,Math.ceil(r/o-1e-9)))*20+(n?18:0)+10),textW:o}}function Tte(e,t){let n=Gr(e,Wr)*12,r=Math.min(138,n/t+12),i=Math.max(1,Math.ceil(n/r-1e-9));return{width:Math.ceil(r+12),height:i*16+2}}function Jr(e,t=w){let n=e.entities,r=e.relations,i=new Map((e.sources??[]).map(e=>[e.id,e])),a=new Map((e.groups??[]).map(e=>[e.id,e])),o=new Map(n.map(e=>[e.id,e.label])),s=r.map(e=>zr(e,t)),c=new Map(n.map(e=>[e.id,qr(e)])),l=new Map(n.map(e=>[e.id,0]));for(let e of r)l.set(e.from,l.get(e.from)+1),l.set(e.to,l.get(e.to)+1);let u=e=>r.map((e,t)=>({r:e,i:t})).filter(({r:t})=>t.from===e||t.to===e).map(({r:t,i:n})=>({id:t.id,kind:t.kind,directed:Pr(t),out:t.from===e,other:o.get(t.from===e?t.to:t.from),text:s[n]}));return{labelTexts:s,sizes:c,dataOf:(e,t={})=>({entity:e,w:c.get(e.id).w,h:c.get(e.id).h,textW:c.get(e.id).textW,groupLabel:a.get(e.groupId)?.label??``,sources:(e.sourceIds??[]).map(e=>i.get(e)).filter(Boolean),sourceCount:(e.sourceIds??[]).filter(e=>i.has(e)).length,relationCount:l.get(e.id),relations:u(e.id),vertical:!0,...t})}}var Yr=15,Ete=16;function Xr(e){return e.length<=1?[e]:e.flatMap((t,n)=>Xr([...e.slice(0,n),...e.slice(n+1)]).map(e=>[t,...e]))}function Zr(e){return()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function Dte(e,t){let n=[...e];for(let e=n.length-1;e>0;--e){let r=Math.floor(t()*(e+1));[n[e],n[r]]=[n[r],n[e]]}return n}var Ote=()=>({entities:0,relations:0,groups:0,layers:0,widest:0,kinds:{}}),Qr=(e,t,n)=>{let r=Math.min((n?e.w:e.h)-36,he(t)*13+4);return n?{x:e.x+18-2,y:e.y+7,w:r,h:18}:{x:e.x+7,y:e.y+18-2,w:18,h:r}},$r=e=>[[[e.x,e.y],[e.x+e.w,e.y]],[[e.x,e.y+e.h],[e.x+e.w,e.y+e.h]],[[e.x,e.y],[e.x,e.y+e.h]],[[e.x+e.w,e.y],[e.x+e.w,e.y+e.h]]];function ei(e,t){let n=t.y+t.h<e.y;if(!(t.y>e.y+e.h))return n?{out:{bottom:700,top:0},in:{top:700,bottom:0}}:{out:{bottom:200,top:200,left:0,right:0},in:{top:200,bottom:200,left:0,right:0}}}var kte=60,ti=e=>e.slice(1).map((t,n)=>[e[n],t]),ni=(e,t,n)=>e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n,ri=([e,t],n,r)=>Math.max(e[0],t[0])>n.x-r&&Math.min(e[0],t[0])<n.x+n.w+r&&Math.max(e[1],t[1])>n.y-r&&Math.min(e[1],t[1])<n.y+n.h+r,Ate=[.5,.42,.58,.34,.66,.26,.74,.18,.82,.1,.9,.02,.98];function ii(e,t,n,r,i,a){let o=ai(e,t,n,r,i,a);if(o.length){let e=o[0];for(let t of o)(t.bad<e.bad-1e-9||Math.abs(t.bad-e.bad)<1e-9&&t.len>e.len)&&(e=t);return{x:e.x,y:e.y,bad:e.bad}}let{width:s,height:c}=t,[l,u]=ti(e).sort((e,t)=>Math.abs(t[1][0]-t[0][0])+Math.abs(t[1][1]-t[0][1])-(Math.abs(e[1][0]-e[0][0])+Math.abs(e[1][1]-e[0][1])))[0];return{x:Math.max(16,(l[0]+u[0])/2-s/2),y:Math.max(16,(l[1]+u[1])/2-c/2),bad:1/0}}function ai(e,t,n,r,i,a){let{width:o,height:s}=t,c=e=>(e.x<0||e.y<0?100:0)+n.filter(t=>ni(e,t,2)).length*50+r.filter(t=>ni(e,t,2)).length*20+i.filter(t=>ti(t.points).some(t=>ri(t,e,2))).length*10+a.filter(t=>ri(t,e,2)).length*3,l=[];for(let[t,n]of ti(e)){let e=Math.abs(t[1]-n[1])<.5,r=Math.abs(n[0]-t[0])+Math.abs(n[1]-t[1]),i=e?o:s;if(r<i+8)continue;let a=Math.min(22,(r-i)/2),u=r-i-a*2;for(let d of Ate){let f=a+i/2+u*d,p=Math.sign(e?n[0]-t[0]:n[1]-t[1]),m=e?t[0]+p*f:t[0],h=e?t[1]:t[1]+p*f,g={x:m-o/2,y:h-s/2,w:o,h:s};l.push({bad:c(g)+Math.abs(d-.5)*2,len:r,x:g.x,y:g.y});for(let t of[1,-1]){let n=e?{x:g.x,y:g.y+t*(s/2+2),w:o,h:s}:{x:g.x+t*(o/2+2),y:g.y,w:o,h:s};l.push({bad:c(n)+Math.abs(d-.5)*2+4,len:r,x:n.x,y:n.y})}}}return l}function oi(e,t){let n=e.y+e.h/2,r=t.y+t.h/2,i=t.x>=e.x,a=i?e.x+e.w:e.x,o=i?t.x:t.x+t.w,s=(a+o)/2;return[[a,n],[s,n],[s,r],[o,r]]}function jte(e,t={},n,r=`vertical`){let i=Fr(e),a=Ir(e),o=r!==`horizontal`,s=o?`vertical`:`horizontal`;if(i.length)return{errors:i,hints:a,orientation:s,nodes:[],edges:[],connections:[],groupBoxes:[],size:{width:0,height:0},stats:Ote()};let c=typeof t?.t==`function`?t.t:w,l=e.entities,u=e.relations,d=(e.groups??[]).filter(e=>l.some(t=>t.groupId===e.id)),f=t?.groups!==!1&&d.length>0;l.length>25&&a.push(w(`rhint.tooLarge`,{n:l.length,limit:25})),u.length>40&&a.push(w(`rhint.tooManyRelations`,{n:u.length,limit:40}));let p=f?d.map(e=>({group:e,members:l.filter(t=>t.groupId===e.id)})):[],m=f?l.filter(e=>!d.some(t=>t.id===e.groupId)):l,h=[...p];m.length&&h.splice(h.length===2?1:h.length,0,{group:null,members:m});let g=e=>{let{w:t,h:n}=qr(e);return o?{w:t,h:n}:{w:n,h:t}},_=u.map(e=>{let t=zr(e,c),n=Kr(t);return{text:t,frame:o?n:{width:n.height,height:n.width}}}),v={"elk.algorithm":`layered`,"elk.direction":`DOWN`,"elk.padding":`[top=0,left=0,bottom=0,right=0]`,"elk.edgeRouting":`ORTHOGONAL`,"elk.spacing.nodeNode":`32`,"elk.layered.spacing.nodeNodeBetweenLayers":`48`,"elk.spacing.edgeNode":`16`,"elk.spacing.edgeEdge":`12`,"elk.spacing.edgeLabel":`4`,"elk.layered.spacing.edgeNodeBetweenLayers":`16`,"elk.layered.crossingMinimization.strategy":`LAYER_SWEEP`,"elk.layered.nodePlacement.strategy":`BRANDES_KOEPF`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`,"elk.edgeLabels.inline":`false`,"elk.separateConnectedComponents":`false`},y=new Map;h.forEach((e,t)=>e.members.forEach(e=>y.set(e.id,t)));let b=(e,t)=>{let n=u.filter(t=>t.from===e.id||t.to===e.id).map(n=>Math.sign(y.get(n.from===e.id?n.to:n.from)-t));return n.length?n.reduce((e,t)=>e+t,0)/n.length:0},x=(e,t)=>{let n=new Set(e.map(e=>e.id)),r=e.map((e,n)=>({e,i:n,pull:b(e,t)})).sort((e,t)=>e.pull-t.pull||e.i-t.i).map(e=>e.e);if(e.length>1&&!u.some(e=>n.has(e.from)&&n.has(e.to))&&r.every(e=>b(e,t)!==0)){let e=r.map(g),t=Math.max(...e.map(e=>e.w)),n=0;return{at:new Map(r.map((r,i)=>{let a={x:(t-e[i].w)/2,y:n,w:e[i].w,h:e[i].h};return n+=e[i].h+32,[r.id,a]})),width:t,height:n-32,level:new Map(r.map(e=>[e.id,0])),levels:1}}let i=u.map((e,t)=>({r:e,i:t})).filter(({r:e})=>n.has(e.from)&&n.has(e.to)),a=e=>en({id:`camp${t}`,layoutOptions:v,children:e.map(e=>({id:e.id,width:g(e).w,height:g(e).h})),edges:i.filter(({r:e})=>Pr(e)).map(({r:e,i:t})=>({id:`r${t}`,sources:[e.from],targets:[e.to],labels:[{id:`l${t}`,text:_[t].text,width:_[t].frame.width,height:_[t].frame.height}]}))}),s=n=>{let r=new Map(n.children.map(e=>[e.id,[e.x+e.width/2,e.y+e.height/2]])),a=i.map(({r:e})=>({ends:[e.from,e.to],p:r.get(e.from),q:r.get(e.to)})),s=n.width+1e4;for(let n of e){let e=b(n,t);if(e===0)continue;let[i,o]=r.get(n.id);a.push({ends:[n.id],p:[i,o],q:[e>0?i+s:i-s,o]})}let c=(e,t,n)=>Math.sign((t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])),l=0,d=new Map(n.children.map(e=>[e.id,e]));for(let n of o?e:[]){let i=b(n,t);if(i===0)continue;let a=u.filter(e=>(e.from===n.id||e.to===n.id)&&y.get(e.from===n.id?e.to:e.from)!==t).length,[o,s]=r.get(n.id);e.some(e=>{if(e.id===n.id)return!1;let t=d.get(e.id);return s>t.y&&s<t.y+t.height&&(i>0?t.x>o:t.x+t.width<o)})&&(l+=a)}return a.forEach((e,t)=>a.slice(t+1).forEach(t=>{e.ends.some(e=>t.ends.includes(e))||c(e.p,e.q,t.p)*c(e.p,e.q,t.q)<0&&c(t.p,t.q,e.p)*c(t.p,t.q,e.q)<0&&(l+=1)})),l},c=[r];if(e.length>2&&i.length&&e.some(e=>b(e,t)!==0)){let n=Zr(t+e.length*7919),i=e.length<=5?Xr(r):Array.from({length:40},()=>Dte(r,n));c.push(...i)}let l=null,d=1/0;for(let e of c){let t=a(e),n=s(t);if(n<d&&(l=t,d=n),d===0)break}let f=new Map(l.children.map(e=>[e.id,{x:e.x,y:e.y,w:e.width,h:e.height}])),p=l.width;u.map((e,t)=>({r:e,i:t})).filter(({r:e})=>n.has(e.from)&&n.has(e.to)&&!Pr(e)).map(({r:e,i:t})=>({i:t,pair:[f.get(e.from),f.get(e.to)].sort((e,t)=>e.x-t.x)})).filter(({pair:[e,t]})=>e.y<t.y+t.h&&t.y<e.y+e.h).sort((e,t)=>e.pair[1].x-t.pair[1].x).forEach(({i:e,pair:[t,n]})=>{let r=_[e].frame.width+40-(n.x-t.x-t.w);if(r<=0)return;let i=n.x;for(let e of f.values())e.x>=i&&(e.x+=r);p+=r});let m=[...new Set([...f.values()].map(e=>Math.round(e.y)))].sort((e,t)=>e-t),h=new Map([...f].map(([e,t])=>[e,m.indexOf(Math.round(t.y))]));return{at:f,width:p,height:l.height,level:h,levels:m.length}},S=o?32:18,C=o?18:32,ee=e=>{let t=[...e].sort((e,t)=>e-t);return t.length?t.length%2?t[(t.length-1)/2]:(t[t.length/2-1]+t[t.length/2])/2:0},te=h.findIndex(e=>!e.group&&h.some(e=>e.group)),ne=h.map((e,t)=>t===te?null:x(e.members,t)),re=new Map,ie=[];h.forEach((e,t)=>{if(t===te)return;let n=ne[t],r=e.group?S:0,i=[];for(let e of u)for(let[t,a]of[[e.from,e.to],[e.to,e.from]]){if(!n.at.has(t)||!re.has(a))continue;let e=n.at.get(t);i.push(re.get(a)-(r+e.y+e.h/2))}ie[t]=i.length?ee(i):0;for(let[e,i]of n.at)re.set(e,ie[t]+r+i.y+i.h/2)});let ae=null;if(te>=0){let e=h[te].members.map(e=>{let t=u.filter(t=>t.from===e.id||t.to===e.id).map(t=>re.get(t.from===e.id?t.to:t.from)).filter(e=>e!==void 0);return{e,want:t.length?ee(t):null,size:g(e)}}),t=e=>{let t=l.find(t=>t.id===e),n=g(t).h;return[re.get(e)-n/2,re.get(e)+n/2]},n=[];for(let e of u){if(!re.has(e.from)||!re.has(e.to)||y.get(e.from)===y.get(e.to))continue;let[r,i]=t(e.from),[a,o]=t(e.to);Math.min(i,o)>Math.max(r,a)&&n.push([Math.max(r,a),Math.min(i,o)])}for(let t of e){if(t.want===null)continue;let e=t.size.h/2,r=t=>n.some(([n,r])=>t+e+14>n&&t-e-14<r);if(!r(t.want))continue;let i=n.flatMap(([t,n])=>[t-14-e,n+14+e]).filter(e=>!r(e));i.length&&(t.want=i.sort((e,n)=>Math.abs(e-t.want)-Math.abs(n-t.want))[0])}let r=Math.max(0,...re.values());e.forEach((e,t)=>{e.want===null&&(e.want=r+(t+1)*(e.size.h+32))}),e.sort((e,t)=>e.want-t.want);let i=new Map,a=-1/0,o=Math.max(...e.map(e=>e.size.w));for(let t of e){let e=Math.max(t.want-t.size.h/2,a);i.set(t.e.id,{x:(o-t.size.w)/2,y:e,w:t.size.w,h:t.size.h}),a=e+t.size.h+48}ae={at:i,width:o};for(let[e,t]of i)re.set(e,t.y+t.h/2)}let oe=h.map((e,t)=>{let n=new Map;return u.forEach((e,r)=>{let[i,a]=[y.get(e.from),y.get(e.to)].sort((e,t)=>e-t);if(!(i<=t&&a>t))return;let o=[e.from,e.to].sort().join(`\0`),s=n.get(o)??{w:0,k:0};n.set(o,{w:s.w+_[r].frame.width+20,k:s.k+1})}),Math.max(110,...[...n.values()].map(({w:e,k:t})=>e+20*(t>1?3:1)))}),se=[];h.forEach((e,t)=>{t===te?se.push(Math.min(...[...ae.at.values()].map(e=>e.y))):se.push(ie[t])});let ce=32-Math.min(...se),le=new Map,ue=[],de=new Map,fe=1,pe=32,me=32;h.forEach((e,t)=>{if(t===te){for(let[e,t]of ae.at)le.set(e,{x:pe+t.x,y:ce+t.y,w:t.w,h:t.h}),me=Math.max(me,ce+t.y+t.h),de.set(e,0);pe+=ae.width+oe[t];return}let n=ne[t],r=e.group?C:0,i=e.group?S:0,a=ce+ie[t];for(let[e,t]of n.at)le.set(e,{x:pe+r+t.x,y:a+i+t.y,w:t.w,h:t.h}),de.set(e,n.level.get(e));fe=Math.max(fe,n.levels);let o=n.width+r+(e.group?18:0),s=i+n.height+(e.group?18:0);e.group&&ue.push({groupId:e.group.id,label:e.group.label,x:pe,y:a,w:o,h:s}),me=Math.max(me,a+s),pe+=o+oe[t]});let he=pe-oe[h.length-1]+32,ge=me+32,_e=[...le.values()],ve=ue.map(e=>Qr(e,e.label,o)),ye=ue.flatMap($r),be=e=>({x:e.labelAt.x,y:e.labelAt.y,w:e.labelSize.width,h:e.labelSize.height}),xe=e=>{let t=le.get(e.from),n=le.get(e.to);return Math.abs(t.x-n.x)+Math.abs(t.y-n.y)},Se=e=>[e.kind,e.from,e.to].join(`\0`),Ce=new Map;for(let e of u)Ce.set(Se(e),(Ce.get(Se(e))??0)+1);let we=e=>{let t=le.get(e.from),n=le.get(e.to),r=(e,t,n,r)=>Math.min(e+t,n+r)-Math.max(e,n)>0;return r(t.y,t.h,n.y,n.h)||r(t.x,t.w,n.x,n.w)},Te=e=>Ce.get(Se(e))>1?0:we(e)?1:2,Ee=u.map((e,t)=>t).sort((e,t)=>Te(u[e])-Te(u[t])||xe(u[e])-xe(u[t])||e-t),De=Array(u.length),Oe=[];for(let e of Ee){let t=le.get(u[e].from),n=le.get(u[e].to),r=y.get(u[e].from)===y.get(u[e].to)&&h[y.get(u[e].from)].group&&(t.y+t.h<=n.y||n.y+n.h<=t.y),i=e=>pn({from:t,to:n,nodes:_e,blocks:ve,outSides:e,inSides:e,routes:Oe.map(e=>({points:e.points,share:!1})),borders:ye,portCost:ei(t,n),crossCost:wte,sidePorts:!0,sideSpread:Ete,parallelGap:Yr}),a={index:e,points:(r?i([`top`,`bottom`]):null)??i(void 0)??oi(t,n),labelAt:null,labelSize:{width:_[e].frame.width,height:_[e].frame.height}};De[e]=a,Oe.push(a)}De.forEach(e=>{e.points=Rr(e.points,le.get(u[e.index].from),le.get(u[e.index].to),kte)});let ke=(e,t)=>{let n=Kr(_[e.index].text,t);return o?n:{width:n.height,height:n.width}},Ae=(e,t,n)=>{let r=ke(e,t),i=ii(e.points,r,_e,n,De.filter(t=>t!==e),ye);return{at:{x:i.x,y:i.y},size:r,bad:i.bad+(t-1)}},je=[];for(let e of Ee){let t=De[e],n=Ae(t,1,[...ve,...je.map(be)]);t.labelAt=n.at,t.labelBad=n.bad,je.push(t)}for(let e of je){if(e.labelBad<10)continue;let t=[...ve,...je.filter(t=>t!==e).map(be)],n=null;for(let r of[2,3]){let i=Ae(e,r,t);(!n||i.bad<n.bad)&&(n=i)}n&&n.bad<e.labelBad-3&&(e.labelAt=n.at,e.labelSize=n.size,e.labelBad=n.bad)}let Me=(e,t)=>ni(be(e),be(t),0);for(let e of je)for(let t of je){if(e===t||!Me(e,t))continue;let n=[...ve,...je.filter(n=>n!==e&&n!==t).map(be)],r=null;for(let i of[1,2,3]){let a=ke(e,i);for(let o of ai(e.points,a,_e,n,De.filter(t=>t!==e),ye)){let e={at:{x:o.x,y:o.y},size:a,bad:o.bad+(i-1)},s={x:o.x,y:o.y,w:a.width,h:a.height};for(let i of[1,2,3]){let a=Ae(t,i,[...n,s]);(!r||e.bad+a.bad<r.bad-1e-9)&&(r={bad:e.bad+a.bad,pa:e,pb:a})}}}r&&(e.labelAt=r.pa.at,e.labelSize=r.pa.size,t.labelAt=r.pb.at,t.labelSize=r.pb.size)}let Ne=ar({placed:le,boxes:ue,connections:De,width:he,height:ge},o),Pe={...Ne.size},Fe=Ne.connections.map(e=>{let t=u[e.index];return{id:`r:${t.id}`,relationId:t.id,from:t.from,to:t.to,kind:t.kind,directed:Pr(t),secures:t.secures??null,label:_[e.index].text,points:e.points,d:dr(e.points),dCurve:pr(e.points),labelAt:e.labelAt,labelSize:e.labelSize}});for(let e of Fe){for(let[t,n]of e.points)Pe.width=Math.max(Pe.width,t+32),Pe.height=Math.max(Pe.height,n+32);Pe.width=Math.max(Pe.width,e.labelAt.x+e.labelSize.width+32),Pe.height=Math.max(Pe.height,e.labelAt.y+e.labelSize.height+32)}let Ie=Array.from({length:fe},(e,t)=>l.filter(e=>de.get(e.id)===t).length),Le=Jr(e,c),Re=l.map(e=>{let t=Ne.placed.get(e.id);return{id:e.id,type:`rnode`,position:{x:t.x,y:t.y},data:Le.dataOf(e,{w:t.w,h:t.h,layer:de.get(e.id),vertical:o})}}),ze={};for(let e of u)ze[e.kind]=(ze[e.kind]??0)+1;return{errors:i,hints:a,orientation:s,nodes:Re,edges:[],connections:Fe,groupBoxes:Ne.stageBoxes.map((e,t)=>({groupId:ue[t].groupId,label:ue[t].label,x:e.x,y:e.y,w:e.w,h:e.h})),size:{width:Math.ceil(Pe.width),height:Math.ceil(Pe.height)},stats:{entities:l.length,relations:u.length,groups:d.length,layers:fe,widest:Math.max(...Ie),kinds:ze}}}var si=1.7,ci=14,li=4,Mte=70,Nte=.4,Pte=60,Fte=56,ui=64,di=24,fi=36,Ite=20,pi=e=>({x:e.x,y:e.y,w:e.w,h:e.h}),mi=e=>[e.x+e.w/2,e.y+e.h/2],hi=(e,t,n)=>e.x<t.x+t.w+n&&t.x<e.x+e.w+n&&e.y<t.y+t.h+n&&t.y<e.y+e.h+n;function Lte(e,t,n,r=0){let i=0,a=1,o=[t[0]-e[0],t[1]-e[1]],s=[n.x-r,n.y-r],c=[n.x+n.w+r,n.y+n.h+r];for(let t=0;t<2;t+=1)if(Math.abs(o[t])<1e-9){if(e[t]<s[t]||e[t]>c[t])return!1}else{let n=(s[t]-e[t])/o[t],r=(c[t]-e[t])/o[t];if(n>r&&([n,r]=[r,n]),i=Math.max(i,n),a=Math.min(a,r),i>a)return!1}return!0}function gi(e,t,n=2){let[r,i]=mi(e),a=t[0]-r,o=t[1]-i;if(Math.abs(a)<1e-9&&Math.abs(o)<1e-9)return[r,i-e.h/2-n];let s=Math.min((e.w/2+n)/(Math.abs(a)||1e-9),(e.h/2+n)/(Math.abs(o)||1e-9));return[r+a*s,i+o*s]}function _i(e,t,n,r=2){let[i,a]=mi(e),o=n[0]-t[0],s=n[1]-t[1],c=(e,t,n,i)=>Math.abs(e)<1e-9?1/0:(Math.sign(e)*(i+r)-(t-n))/e,l=Math.min(c(o,t[0],i,e.w/2),c(s,t[1],a,e.h/2));return Number.isFinite(l)?[t[0]+o*l,t[1]+s*l]:gi(e,n,r)}function vi(e){let t=new Map((e?.entities??[]).map(e=>[e.id,0]));for(let n of e?.relations??[])t.has(n.from)&&t.set(n.from,t.get(n.from)+1),t.has(n.to)&&t.set(n.to,t.get(n.to)+1);let n=null;for(let r of e?.entities??[])(n===null||t.get(r.id)>t.get(n))&&(n=r.id);return n}function Rte(e){let t=(e?.entities??[]).map(e=>e.id),n=new Map(t.map(e=>[e,[]]));for(let t of e?.relations??[])n.has(t.from)&&n.has(t.to)&&(n.get(t.from).push(t.to),n.get(t.to).push(t.from));let r=new Set,i=[];for(let e of t){if(r.has(e))continue;let a=[],o=[e];for(r.add(e);o.length;){let e=o.shift();a.push(e);for(let t of n.get(e))r.has(t)||(r.add(t),o.push(t))}i.push(t.filter(e=>a.includes(e)))}return i}function zte(e,t,n,r=ci){let i=e.length;if(i<=1)return[...e];let a=Math.PI*2,o=e=>(e%a+a)%a,s=e.map((e,t)=>t).sort((t,n)=>o(e[t])-o(e[n])),c=s.map(t=>o(e[t])),l=s.map((e,a)=>2*Math.asin(Math.min(1,(t[e]+t[s[(a+1)%i]]+r)/(2*n))));if(l.reduce((e,t)=>e+t,0)>a)return null;let u=!1;for(let e=0;e<400&&!u;e+=1){u=!0;for(let e=0;e<i;e+=1){let t=(e+1)%i,n=c[t]+(t===0?a:0)-c[e];if(n<l[e]-1e-9){let r=(l[e]-n)/2;c[e]-=r,c[t]+=r,u=!1}}}if(!u)return null;let d=Array(i);return s.forEach((e,t)=>d[e]=c[t]),d}var yi=.62;function Bte(e,t,n){let r=e.length;if(r<2||!t.length||r>7)return null;let i=e=>n(e)===`a`?Math.PI:n(e)===`b`?0:-Math.PI/2,a=(e,t)=>{let n=Math.abs(e-t)%(Math.PI*2);return Math.min(n,Math.PI*2-n)},o=Math.PI*2/r,s=r===2?[Math.PI,0].map(e=>[e-yi,e+yi]):[0,o/2].map(e=>Array.from({length:r},(t,n)=>e+n*o)),c=null;for(let n of s)for(let r of Xr(e)){let o=new Map(r.map((e,t)=>[e,n[t]])),s=t.reduce((e,t)=>e+a(o.get(t.from),o.get(t.to)),0)+.04*e.reduce((e,t)=>e+a(o.get(t),i(t)),0);(!c||s<c.cost-1e-9)&&(c={cost:s,at:o})}return e.map(e=>c.at.get(e))}function Vte(e,t,n,r,i,a=()=>0){let o=new Set(e.map(e=>e.id)),s=new Map(e.map((e,t)=>[e.id,t])),c=new Map(e.map(e=>[e.id,[]]));for(let e of t)o.has(e.from)&&o.has(e.to)&&(c.get(e.from).push(e.to),c.get(e.to).push(e.from));let l=new Map([[n,0]]),u=[[n]];for(let e=0;u[e]?.length;e+=1){let t=[];for(let n of u[e])for(let r of c.get(n))l.has(r)||(l.set(r,e+1),t.push(r));if(t.length)u.push([...new Set(t)].sort((e,t)=>s.get(e)-s.get(t)));else break}let d=e=>({w:r.get(e).w,h:r.get(e).h}),f=e=>Math.hypot(d(e).w,d(e).h)/2,p=new Map;p.set(n,{x:-d(n).w/2,y:-d(n).h/2,...d(n),ring:0,angle:0});let m=[0],h=[f(n)],g=(e,t)=>[Math.cos(e)*t*si,Math.sin(e)*t],_=e=>{let t=(Math.cos(e)>=-1e-9?0:Math.PI)-e;for(;t>Math.PI;)t-=Math.PI*2;for(;t<-Math.PI;)t+=Math.PI*2;return e+t*Nte};for(let e=1;e<u.length;e+=1){let n=u[e],r=Math.max(...n.map(f)),o;if(e===1){let e=Math.PI*2/n.length,r=n.filter(e=>i(e)===`a`),a=n.filter(e=>i(e)===`b`),s=n.filter(e=>i(e)===`n`),c=s.slice(0,Math.ceil(s.length/2)),l=s.slice(Math.ceil(s.length/2)),u=new Map,d=[[r,(t,n)=>Math.PI+((n.length-1)/2-t)*e],[a,(t,n)=>(t-(n.length-1)/2)*e],[c,(t,n)=>3*Math.PI/2+(t-(n.length-1)/2)*e],[l,(t,n)=>Math.PI/2-(t-(n.length-1)/2)*e]],f=(e,t)=>e.forEach((n,r)=>u.set(n,t(r,e)));d.forEach(([e,t])=>f(e,t));let p=t.filter(e=>e.from!==e.to&&n.includes(e.from)&&n.includes(e.to)),m=(e,t)=>{let n=Math.abs(e-t)%(Math.PI*2);return Math.min(n,Math.PI*2-n)},h=()=>p.reduce((e,t)=>e+m(u.get(t.from),u.get(t.to)),0);for(let e=0;e<2&&p.length;e+=1)for(let e of d){let[t,n]=e;if(t.length<2||t.length>6)continue;let r={c:h()-1e-9,order:t};for(let e of Xr(t)){f(e,n);let t=h();t<r.c-1e-9&&(r={c:t,order:e})}e[0]=r.order,f(r.order,n)}o=n.map(e=>u.get(e));let g=Bte(n,p,i);g&&(o=g)}else{o=n.map(t=>{let n=c.get(t).filter(t=>l.get(t)===e-1).map(e=>p.get(e).angle),r=n.reduce((e,t)=>e+Math.sin(t),0),i=n.reduce((e,t)=>e+Math.cos(t),0);return _(Math.atan2(r,i))});let t=new Map;n.forEach((e,n)=>{let r=o[n].toFixed(4);t.set(r,[...t.get(r)??[],n])});for(let e of t.values())e.forEach((t,n)=>o[t]+=(n-(e.length-1)/2)*.16)}let s=.4*Math.max(0,...t.filter(t=>l.get(t.from)===e-1&&l.get(t.to)===e||l.get(t.to)===e-1&&l.get(t.from)===e).map(a)),v=(e===1?h[0]+r+Pte:m[e-1]+h[e-1]+r+Mte)+s,y=t=>{n.forEach((n,r)=>{let[i,a]=g(t[r],v);p.set(n,{x:i-d(n).w/2,y:a-d(n).h/2,...d(n),ring:e,angle:t[r]})})},b=n.map(f);for(let t=0;t<200;t+=1){let t=zte(o,b,v);if(!t)v*=1.06;else{if(y(t),!n.some((t,r)=>[...p.entries()].some(([i,a])=>i!==t&&(l.get(i)<e||n.indexOf(i)>r)&&hi(pi(p.get(t)),pi(a),ci))))break;v*=1.03}}m.push(v),h.push(r)}return{boxes:p,rings:u,radii:m,halves:h,ring:l,at:g}}var Hte=(e,t,n)=>[...e.entries()].filter(([e])=>e!==t&&e!==n).map(([,e])=>pi(e));function bi(e){let t=`M ${e[0][0]} ${e[0][1]}`,n=[e[0]];for(let r=0;r<e.length-1;r+=1){let i=e[Math.max(0,r-1)],a=e[r],o=e[r+1],s=e[Math.min(e.length-1,r+2)],c=[a[0]+(o[0]-i[0])/6,a[1]+(o[1]-i[1])/6],l=[o[0]-(s[0]-a[0])/6,o[1]-(s[1]-a[1])/6];t+=` C ${c[0]} ${c[1]} ${l[0]} ${l[1]} ${o[0]} ${o[1]}`;for(let e of[.25,.5,.75,1]){let t=1-e;n.push([t*t*t*a[0]+3*t*t*e*c[0]+3*t*e*e*l[0]+e*e*e*o[0],t*t*t*a[1]+3*t*t*e*c[1]+3*t*e*e*l[1]+e*e*e*o[1]])}}return{points:n,d:t}}var xi=(e,t,n)=>e.slice(1).some((r,i)=>t.some(t=>Lte(e[i],r,t,n)));function Si(e,t,n,r,i){let a=null;for(let o of Ci(e,t,n,r,i))(!a||o.bad<a.bad)&&(a=o);return a}var Ute=[.5,.42,.58,.34,.66,.26,.74,.18,.82,.1,.9];function Ci(e,t,n,r,i){let a=e.slice(1).map((t,n)=>[e[n],t]),o=a.map(([e,t])=>Math.hypot(t[0]-e[0],t[1]-e[1])),s=o.reduce((e,t)=>e+t,0),c=t=>{let n=s*t;for(let e=0;e<a.length;e+=1){if(n<=o[e]||e===a.length-1){let t=o[e]?Math.min(1,n/o[e]):0,r=a[e][1][0]-a[e][0][0],i=a[e][1][1]-a[e][0][1];return[a[e][0][0]+r*t,a[e][0][1]+i*t,r,i]}n-=o[e]}return[e[0][0],e[0][1],1,0]},l=[];for(let e of Ute){let[a,o,s,u]=c(e),d=Math.hypot(s,u)||1,f=[-u/d,s/d],p=Math.abs(f[0])*(t.width/2)+Math.abs(f[1])*(t.height/2)+3;for(let s of[0,1,-1]){let c=a+f[0]*s*p,u=o+f[1]*s*p,d={x:c-t.width/2,y:u-t.height/2,w:t.width,h:t.height},m=n.filter(e=>hi(d,e,2)).length*50+r.filter(e=>hi(d,e,2)).length*20+i.filter(e=>xi(e,[d],0)).length*4+Math.abs(e-.5)+(s?.6:0);l.push({bad:m,x:d.x,y:d.y})}}return l}function Wte(e,t={}){let n=Fr(e),r=Ir(e);if(n.length)return{errors:n,hints:r,nodes:[],edges:[],connections:[],size:{width:0,height:0},stats:{entities:0,relations:0,groups:0,kinds:{}}};let i=typeof t?.t==`function`?t.t:w,a=e.entities,o=e.relations;a.length>25&&r.push(w(`rhint.tooLarge`,{n:a.length,limit:25}));let s=e.groups??[],c=e=>s.findIndex(t=>t.id===e.groupId),l=new Map(a.map(e=>[e.id,e])),u=e=>{let t=c(l.get(e));return t===0?`a`:t===1?`b`:`n`},d=new Map(a.map(e=>[e.id,qr(e)])),f=o.map(e=>zr(e,i)),p=f.map(e=>Kr(e)),m=l.has(t?.centre)?t.centre:vi(e),h=Rte(e);h.sort((e,t)=>Number(t.includes(m))-Number(e.includes(m)));let g=h.map((e,t)=>{let n=a.filter(t=>e.includes(t.id)),r=o.filter(t=>e.includes(t.from)&&e.includes(t.to)),i=t===0?m:vi({entities:n,relations:r}),s=Vte(n,r,i,d,u,e=>p[o.indexOf(e)].width),c=e=>[e.from,e.to].sort().join(`\0`),l=new Map;r.forEach(e=>l.set(c(e),[...l.get(c(e))??[],e]));let f=new Map([...s.boxes.entries()].map(([e,t])=>[e,pi(t)])),h=new Map,g=[];for(let e of r){let t=f.get(e.from),n=f.get(e.to),r=l.get(c(e)),a=r.indexOf(e),o=mi(t),u=mi(n),d=Math.hypot(u[0]-o[0],u[1]-o[1])||1,p=e.from<e.to?1:-1,m=[-(u[1]-o[1])/d*p,(u[0]-o[0])/d*p],_=(a-(r.length-1)/2)*Math.min(di,(Math.min(t.h,n.h)/2-5)/Math.max(1,(r.length-1)/2)),v=[o[0]+m[0]*_,o[1]+m[1]*_],y=[u[0]+m[0]*_,u[1]+m[1]*_],b=_i(t,v,y),x=_i(n,y,v),S=[b,x],C=`M ${b[0]} ${b[1]} L ${x[0]} ${x[1]}`,ee=Hte(s.boxes,e.from,e.to);if(xi(S,ee,li)){let r=[(o[0]+u[0])/2,(o[1]+u[1])/2],i=(e,i)=>{let a=[r[0]+m[0]*e*i,r[1]+m[1]*e*i];return bi([gi(t,a),a,gi(n,a)])},s=e=>{for(let t=0;t<10;t+=1){let n=fi+t*Ite+a*di,r=i(e,n);if(!xi(r.points,ee,li))return{arc:r,off:n,side:e}}return null},l=h.get(c(e)),d=null;for(let e of l?[l,-l]:[1,-1]){let t=s(e);if(t&&(!d||!l&&t.off<d.off)&&(d=t),d&&l)break}d&&(h.set(c(e),d.side),S=d.arc.points,C=d.arc.d)}if(xi(S,ee,li)){let r=s.boxes.get(e.from),i=s.boxes.get(e.to),a=i.angle-r.angle;for(;a>Math.PI;)a-=Math.PI*2;for(;a<-Math.PI;)a+=Math.PI*2;let o=Math.max(r.ring,i.ring),c=Math.max(4,Math.ceil(Math.abs(a)/.2));for(let e=0;e<6;e+=1){let i=s.radii[o]+s.halves[o]+26+e*36,l=Array.from({length:c+1},(e,t)=>s.at(r.angle+a*t/c,i)),u=gi(t,l[0]),d=gi(n,l[c]),f=bi([u,...l,d]);if(S=f.points,C=f.d,!xi(S,ee,li))break}}g.push({r:e,points:S,d:C,faint:e.from!==i&&e.to!==i})}let _=[],v=g.map((e,t)=>t).sort((e,t)=>g[e].points.length-g[t].points.length);for(let e of v){let t=g[e],n=p[o.indexOf(t.r)];t.labelSize={width:n.width,height:n.height};let r=Si(t.points,t.labelSize,[...f.values()],_,g.filter(e=>e!==t).map(e=>e.points));t.labelAt={x:r.x,y:r.y},_.push({x:t.labelAt.x,y:t.labelAt.y,w:t.labelSize.width,h:t.labelSize.height})}let y=e=>({x:e.labelAt.x,y:e.labelAt.y,w:e.labelSize.width,h:e.labelSize.height});for(let e of g)for(let t of g){if(e===t||!hi(y(e),y(t),0))continue;let n=g.filter(n=>n!==e&&n!==t).map(y),r=e=>g.filter(t=>t!==e).map(e=>e.points),i=null;for(let a of Ci(e.points,e.labelSize,[...f.values()],n,r(e))){let o={x:a.x,y:a.y,w:e.labelSize.width,h:e.labelSize.height},s=Si(t.points,t.labelSize,[...f.values()],[...n,o],r(t));(!i||a.bad+s.bad<i.bad-1e-9)&&(i={bad:a.bad+s.bad,sa:a,sb:s})}e.labelAt={x:i.sa.x,y:i.sa.y},t.labelAt={x:i.sb.x,y:i.sb.y}}let b=1/0,x=1/0,S=-1/0,C=-1/0,ee=(e,t,n=0,r=0)=>{b=Math.min(b,e),x=Math.min(x,t),S=Math.max(S,e+n),C=Math.max(C,t+r)};for(let e of s.boxes.values())ee(e.x,e.y-18,e.w,e.h+18);for(let e of g){for(let[t,n]of e.points)ee(t,n);ee(e.labelAt.x,e.labelAt.y,e.labelSize.width,e.labelSize.height)}return{centre:i,laid:s,conns:g,bounds:{x0:b,y0:x,x1:S,y1:C},ids:e}}),_=g[0],v=_.bounds.x1-_.bounds.x0,y=Math.max(v,900),b=new Map;b.set(0,[32-_.bounds.x0,32-_.bounds.y0]);let x=32,S=32+(_.bounds.y1-_.bounds.y0)+ui+(g.length>1?36:0),C=0,ee=g.length>1?{x:32,y:32+(_.bounds.y1-_.bounds.y0)+ui-6}:null;for(let e=1;e<g.length;e+=1){let t=g[e].bounds,n=t.x1-t.x0,r=t.y1-t.y0;x>32&&x+n>32+y&&(x=32,S+=C+ui,C=0),b.set(e,[x-t.x0,S-t.y0]),x+=n+Fte,C=Math.max(C,r)}let te=Jr(e,i),ne=e=>s.find(t=>t.id===e.groupId)?.label??``,re=[],ie=[],ae=e=>b.get(e)[1],oe={};for(let e of o)oe[e.kind]=(oe[e.kind]??0)+1;let se=0,ce=0;g.forEach((e,t)=>{let[n,r]=b.get(t);for(let[i,a]of e.laid.boxes){let o=l.get(i),s=c(o);re.push({id:i,type:`rnode`,position:{x:a.x+n,y:a.y+r},data:te.dataOf(o,{layer:a.y+r+a.h/2<ae(t)?0:1,centre:i===e.centre,ring:a.ring,camp:ne(o)?{label:ne(o),tone:s===0?0:s===1?1:2}:null})})}for(let t of e.conns){let e=o.indexOf(t.r);ie.push({id:`r:${t.r.id}`,relationId:t.r.id,from:t.r.from,to:t.r.to,kind:t.r.kind,directed:Pr(t.r),secures:t.r.secures??null,label:f[e],points:t.points.map(([e,t])=>[e+n,t+r]),d:Gte(t.d,n,r),labelAt:{x:t.labelAt.x+n,y:t.labelAt.y+r},labelSize:t.labelSize,faint:t.faint})}se=Math.max(se,e.bounds.x1+n),ce=Math.max(ce,e.bounds.y1+r)});let le=re.find(e=>e.data.centre&&g[0].laid.boxes.has(e.id));return{errors:n,hints:r,nodes:re,edges:[],connections:ie,centre:m,defaultCentre:vi(e),islands:g.map(e=>({centre:e.centre,ids:e.ids})),note:ee,rings:g[0].laid.rings.map(e=>e.length),size:{width:Math.ceil(se+32),height:Math.ceil(ce+32)},centreAt:le?.position,stats:{entities:a.length,relations:o.length,groups:s.length,kinds:oe}}}function Gte(e,t,n){let r=e.match(/-?\d+(\.\d+)?(e-?\d+)?/g).map(Number),i=0;return e.replace(/-?\d+(\.\d+)?(e-?\d+)?/g,()=>{let e=r[i]+(i%2==0?t:n);return i+=1,String(e)})}var Kte=13,wi=18,qte=11.5,Jte=15,Ti=4,Ei=6,Di=24,Yte=168,Xte={latin:1.2,cjk:1.06},Oi=(e,t,n)=>Math.max(1,ye(e,t*.86/n,Xte));function Zte(e,t=``){let n=new Set((e.groups??[]).map(e=>e.id)),r=(e.groups??[]).map(t=>({id:t.id,label:t.label,members:e.entities.filter(e=>e.groupId===t.id)})),i=e.entities.filter(e=>!n.has(e.groupId));i.length&&r.push({id:null,label:t,members:i});let a=[],o=[];for(let e of r)e.members.length&&(o.push({id:e.id,label:e.label,from:a.length,to:a.length+e.members.length-1}),a.push(...e.members));return{order:a,bands:o}}function Qte(e,t){let n=new Map(t.map((e,t)=>[e.id,t])),r=new Map,i=(e,t,n)=>{let i=`${e}|${t}`;r.has(i)||r.set(i,[]),r.get(i).push(n)};for(let t of e.relations){let e=n.get(t.from),r=n.get(t.to);i(e,r,t),!Pr(t)&&e!==r&&i(r,e,t)}return r}function $te(e,t={}){let n=Fr(e),r=Ir(e),i={errors:n,hints:r,nodes:[],edges:[],connections:[],size:{width:0,height:0},stats:{entities:0,relations:0,groups:0,kinds:{}}};if(n.length)return i;let a=typeof t?.t==`function`?t.t:w,o=e.entities,s=e.relations;o.length>25&&r.push(w(`rhint.tooLarge`,{n:o.length,limit:25}));let c=Jr(e,a),l=new Map(s.map((e,t)=>[e.id,t])),u=e=>c.labelTexts[l.get(e.id)],{order:d,bands:f}=Zte(e,a(`rel.matrix.ungrouped`)),p=Qte(e,d),m=d.length,h=e.groups?.length?Di:0,g=(e,t)=>Oi(e,t-8,Kte),_=Math.max(...d.map(e=>g(e.label,136)))*wi+12,v=Yte,y=e=>e.map(e=>{let t=u(e);return{rel:e,text:t,h:Oi(t,108,qte)*Jte+8}}),b=[];for(let e=0;e<m;e++){let t=Math.max(44,Math.ceil(g(d[e].label,v)*wi+12));for(let n=0;n<m;n++){let r=p.get(`${e}|${n}`);if(!r)continue;let i=y(r);t=Math.max(t,i.reduce((e,t)=>e+t.h,0)+Ti*(i.length-1)+12)}b.push(t)}let x=32+h+v,S=32+h+_,C=[],ee=S;for(let e=0;e<m;e++)C.push(ee),ee+=b[e];let te=x+m*136+32,ne=Math.ceil(ee+32),re={width:te,height:ne,corner:{x:32,y:32,w:x-32,h:S-32},bands:[],heads:[],rowHeads:[],cells:[],diagonal:[],chipsTotal:0,filled:0};f.forEach((e,t)=>{let n=x+e.from*136,r=(e.to-e.from+1)*136,i=C[e.from],a=C[e.to]+b[e.to]-i;re.bands.push({id:e.id,label:e.label,tone:t%2,top:{x:n,y:32,w:r,h:Di},left:{x:32,y:i,w:Di,h:a}})}),d.forEach((e,t)=>{re.heads.push({id:e.id,text:e.label,x:x+t*136,y:32+h,w:136,h:_}),re.rowHeads.push({id:e.id,text:e.label,x:32+h,y:C[t],w:v,h:b[t]}),re.diagonal.push({x:x+t*136,y:C[t],w:136,h:b[t]})});for(let[e,t]of p){let[n,r]=e.split(`|`).map(Number),i=x+r*136,a=C[n],o=a+Ei,s=y(t).map(e=>{let t={id:e.rel.id,kind:e.rel.kind,text:e.text,x:i+Ei,y:o,w:124,h:e.h};return o+=e.h+Ti,t});re.chipsTotal+=s.length,re.filled+=1,re.cells.push({row:d[n].id,col:d[r].id,x:i,y:a,w:136,h:b[n],chips:s})}let ie=[{id:`__matrix__`,type:`matrixLayer`,position:{x:0,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,style:{pointerEvents:`none`},data:re}],ae={};for(let e of s)ae[e.kind]=(ae[e.kind]??0)+1;let oe=[...p.values()].filter(e=>e.length>1).length;return{errors:n,hints:r,nodes:ie,edges:[],connections:[],order:d.map(e=>e.id),filled:re.filled,stacked:oe,possible:m*(m-1),size:{width:Math.ceil(te),height:ne},stats:{entities:o.length,relations:s.length,groups:e.groups?.length??0,kinds:ae}}}var ene=16;function ki(e,t,n){let r=new Map;for(let i of e)r.set(t.get(i),Math.max(r.get(t.get(i))??0,n(i).w));return e=>{let i=n(e),a=r.get(t.get(e));return a>i.w?{...i,w:a,textW:a-28}:i}}function Ai(e,t){let n=new Map(e.map(e=>[e,[]]));for(let e of t)n.get(e.from).push(e);let r=new Set(t.map(e=>e.to)),i=new Set,a=new Map,o=e=>{let t=[{id:e,i:0}];for(a.set(e,1);t.length;){let e=t.at(-1),r=n.get(e.id);if(e.i<r.length){let n=r[e.i++];a.get(n.to)===1?i.add(n.key):a.has(n.to)||(a.set(n.to,1),t.push({id:n.to,i:0}))}else a.set(e.id,2),t.pop()}};for(let t of e)!r.has(t)&&!a.has(t)&&o(t);for(let t of e)a.has(t)||o(t);let s=new Map(e.map(e=>[e,[]])),c=new Map(e.map(e=>[e,0]));for(let e of t)i.has(e.key)||(s.get(e.from).push(e.to),c.set(e.to,c.get(e.to)+1));let l=new Map(e.map(e=>[e,0])),u=e.filter(e=>c.get(e)===0);for(let e=0;e<u.length;e++)for(let t of s.get(u[e]))l.set(t,Math.max(l.get(t),l.get(u[e])+1)),c.set(t,c.get(t)-1),c.get(t)===0&&u.push(t);return{back:i,level:new Map(e.map(e=>[e,l.get(e)])),roots:e.filter(e=>!r.has(e))}}function ji(e,t,n,{horizontal:r=!1,gapAcross:i=40,gapAlong:a=96}={}){let{back:o,level:s,roots:c}=Ai(e,t),l=new Set,u=e=>l.has(e),d=e=>u(e)?ene:r?n(e).h:n(e).w,f=e=>u(e)?0:r?n(e).w:n(e).h,p=(e,t)=>r?[t,e]:[e,t],m=[];for(let t of e)(m[s.get(t)]??=[]).push(t);let h=new Map(e.map(e=>[e,[]])),g=new Map(e.map(e=>[e,[]])),_=new Map;for(let e of t){if(o.has(e.key))continue;let t=[e.from];for(let n=s.get(e.from)+1;n<s.get(e.to);n++){let e=`\u0000wp${l.size}`;l.add(e),m[n].push(e),h.set(e,[]),g.set(e,[]),t.push(e)}_.set(e.key,t.slice(1)),t.push(e.to);for(let e=0;e+1<t.length;e++)h.get(t[e+1]).push(t[e]),g.get(t[e]).push(t[e+1])}let v=(e,t,n)=>{let r=new Map(e.map((e,r)=>{let i=t.get(e).map(e=>n.get(e)).filter(e=>e!==void 0);return[e,i.length?i.reduce((e,t)=>e+t,0)/i.length:r]}));return[...e].sort((e,t)=>r.get(e)-r.get(t))},y=e=>new Map(e.map((e,t)=>[e,t]));for(let e=0;e<4;e++){for(let e=1;e<m.length;e++)m[e]=v(m[e],h,y(m[e-1]));for(let e=m.length-2;e>=0;e--)m[e]=v(m[e],g,y(m[e+1]))}let b=new Map,x=e=>e.reduce((e,t)=>e+d(t),0)+i*(e.length-1),S=m.length?Math.max(...m.map(x)):0;for(let e of m){let t=(S-x(e))/2;for(let n of e)b.set(n,t+d(n)/2),t+=d(n)+i}let C=(e,t)=>{let n=e.map(e=>{let n=t.get(e);return n.length?n.reduce((e,t)=>e+b.get(t),0)/n.length:b.get(e)}),r=n.slice();for(let t=1;t<e.length;t++)r[t]=Math.max(r[t],r[t-1]+d(e[t-1])/2+i+d(e[t])/2);let a=r.reduce((e,t,r)=>e+(t-n[r]),0)/(e.length||1);e.forEach((e,t)=>b.set(e,r[t]-a))};for(let e=0;e<6;e++){for(let e=1;e<m.length;e++)C(m[e],h);for(let e=m.length-2;e>=0;e--)C(m[e],g)}let ee=1/0,w=-1/0;for(let e of m)for(let t of e)ee=Math.min(ee,b.get(t)-d(t)/2),w=Math.max(w,b.get(t)+d(t)/2);m.length||(ee=w=0);let te=new Map,ne=new Map,re=[],ie=0;m.forEach((e,t)=>{let r=Math.max(...e.map(f));re[t]=ie+r/2;for(let t of e){let e=b.get(t)-ee;if(u(t)){ne.set(t,p(e,ie+r/2));continue}let[i,a]=p(e-d(t)/2,ie+(r-f(t))/2);te.set(t,{x:i,y:a,w:n(t).w,h:n(t).h})}ie+=r+(t<m.length-1?a:0)});let ae=e=>r?[e.x+e.w,e.y+e.h/2]:[e.x+e.w/2,e.y+e.h],oe=e=>r?e[1]:e[0],se=(e,t)=>r?[e.x,t]:[t,e.y],ce=e=>{let t=_.get(e.key)??[];return t.length?oe(ne.get(t.at(-1))):oe(ae(te.get(e.from)))},le=new Map;for(let n of e){let e=t.filter(e=>!o.has(e.key)&&e.to===n&&!(_.get(e.key)??[]).length);new Set(e.map(e=>e.from)).size>=2&&le.set(n,e)}let ue=new Set([...le.values()].flat().map(e=>e.key)),de=new Map;for(let n of e){let e=te.get(n),i=r?e.h:e.w,a=r?e.y:e.x;for(let e of le.get(n)??[])de.set(e.key,a+i/2);let s=t.filter(e=>!o.has(e.key)&&e.to===n&&!ue.has(e.key)).sort((e,t)=>ce(e)-ce(t));s.forEach((e,t)=>de.set(e.key,a+i*(t+1)/(s.length+1)))}let fe=new Map,pe=new Map,me=new Map;for(let e of t){if(o.has(e.key))continue;let t=`${e.from}\u0000${e.to}`;me.set(t,[...me.get(t)??[],e.key])}let he=e=>{let t=ae(te.get(e.from)),n=me.get(`${e.from}\u0000${e.to}`);if(n.length<2)return t;let i=te.get(e.from),a=(r?i.h:i.w)/2-8,o=Math.max(-a,Math.min(a,(n.indexOf(e.key)-(n.length-1)/2)*12));return r?[t[0],t[1]+o]:[t[0]+o,t[1]]};for(let e of t){if(o.has(e.key))continue;let t=(_.get(e.key)??[]).map(e=>ne.get(e)),n=[he(e),...t,se(te.get(e.to),de.get(e.key))];fe.set(e.key,n);for(let t=0;t+1<n.length;t++){let r=Math.min(oe(n[t]),oe(n[t+1])),i=Math.max(oe(n[t]),oe(n[t+1])),a=s.get(e.from)+t;pe.has(a)||pe.set(a,[]);let o=pe.get(a);if(ue.has(e.key)){let n=o.find(t=>t.bar===e.to);n?(n.lo=Math.min(n.lo,r),n.hi=Math.max(n.hi,i),n.members.push(`${e.key}#${t}`)):o.push({bar:e.to,members:[`${e.key}#${t}`],lo:r,hi:i,track:0})}else i-r<.5||o.push({members:[`${e.key}#${t}`],lo:r,hi:i,track:0})}}let ge=new Map;for(let e of pe.values()){if(!e.length)continue;let t=[];e.sort((e,t)=>e.lo-t.lo||e.hi-t.hi);for(let n of e){for(;t.some(e=>e.track===n.track&&Math.min(e.hi,n.hi)-Math.max(e.lo,n.lo)>.5);)n.track+=1;t.push(n)}let n=Math.max(...e.map(e=>e.track))+1;for(let t of e)for(let e of t.members)ge.set(e,n===1?.45:.25+.35*t.track/(n-1))}let _e=new Map,ve=0,ye=0,be=new Map,xe=new Map;for(let e of t){let t=te.get(e.from),n=te.get(e.to);if(o.has(e.key)){let i=s.get(e.to),a=s.get(e.from),o=0;for(let e=i;e<=a;e++)for(let t of m[e])te.has(t)&&(o=Math.max(o,r?te.get(t).y+te.get(t).h:te.get(t).x+te.get(t).w));let c=o+36+26*ve++;ye=Math.max(ye,c);let l=(be.get(e.from)??0)+1,u=(xe.get(e.to)??0)+1;be.set(e.from,l),xe.set(e.to,u);let d=(e,t)=>Math.min((e-1)*10,(r?t.w:t.h)/2-6),f=r?[t.x+t.w/2+d(l,t),t.y+t.h]:[t.x+t.w,t.y+t.h/2+d(l,t)],p=r?[n.x+n.w/2+d(u,n),n.y+n.h]:[n.x+n.w,n.y+n.h/2+d(u,n)],h=r?[f[0],c]:[c,f[1]],g=r?[p[0],c]:[c,p[1]];_e.set(e.key,{back:!0,segs:[[f,h,g,p]],via:[]})}else{let t=fe.get(e.key),n=t.slice(1,-1),i=[];for(let n=0;n+1<t.length;n++){let[a,o]=[t[n],t[n+1]],s=ge.get(`${e.key}#${n}`)??.45,c=r?a[0]+(o[0]-a[0])*s:a[1]+(o[1]-a[1])*s;i.push(r?[a,[c,a[1]],[c,o[1]],o]:[a,[a[0],c],[o[0],c],o])}_e.set(e.key,{back:!1,segs:i,via:n,gathered:ue.has(e.key)})}}let Se=Math.max(w-ee,ye),Ce=ie;return{levels:m,boxes:te,links:_e,level:s,back:o,roots:c,size:r?{width:Ce,height:Se}:{width:Se,height:Ce}}}function Mi(e){let t=[],n=e=>t.some(t=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h),r=e.map(()=>null),i=([e,t],n,r=22)=>({x:e-n/2-1,y:t-r/2-1,w:n+2,h:r+2});return e.forEach((e,n)=>{if(!e.back)return;let[,a,o]=e.seg;r[n]=[(a[0]+o[0])/2,(a[1]+o[1])/2],t.push(i(r[n],e.w,e.h))}),e.forEach((e,a)=>{if(e.back)return;let[o,s,c,l]=e.seg;if(e.gathered&&Math.hypot(s[0]-o[0],s[1]-o[1])>=28){let c=e.w/2-14,l=(c>8?[0,c,-c]:[0]).flatMap(e=>[.3,.75,.52].map(t=>[o[0]+(s[0]-o[0])*t+e,o[1]+(s[1]-o[1])*t]));r[a]=l.find(t=>!n(i(t,e.w,e.h)))??l[0],t.push(i(r[a],e.w,e.h));return}let u=Math.hypot(l[0]-c[0],l[1]-c[1]),d=e.w/2-14,f=u>=30?(d>8?[0,d,-d]:[0]).flatMap(e=>[.55,.2,.38,.72].map(t=>[c[0]+(l[0]-c[0])*t+e,c[1]+(l[1]-c[1])*t])):[Math.hypot(c[0]-s[0],c[1]-s[1])>.5?[(s[0]+c[0])/2,(s[1]+c[1])/2]:[(o[0]+l[0])/2,(o[1]+l[1])/2]],p=f.find(t=>!n(i(t,e.w,e.h)))??f[0];r[a]=p,t.push(i(p,e.w,e.h))}),r}function Ni(e,t=0,n=0){let r=([e,r])=>`${e+t} ${r+n}`;return`M ${r(e[0][0])}`+e.map(([,e,t,n])=>` L ${r(e)} L ${r(t)} L ${r(n)}`).join(``)}var Pi=20,tne=34,nne=12.5,Fi=19,rne={latin:1.2,cjk:1.06},Ii=(e,t)=>Math.max(1,ye(e,t/nne,rne));function Li(e,t,n){let r=t-40;return{section(i,a){let o=n,s=o+tne;for(let t of a){let n=Ii(t.main,r)*Fi+(t.sub?Ii(t.sub,r)*Fi:0);e.texts.push({x:32+Pi,y:s,w:r,main:t.main,sub:t.sub,tone:t.tone}),s+=n+6}e.frames.push({x:32,y:o,w:t,h:s-o+Pi-6,title:i,titleAt:[32+Pi,o+22]}),n=s+Pi-6+28},empty(r,i){e.empties.push({x:32,y:n,w:t,h:84,text:r,sub:i}),n+=112},y:()=>n}}function ine(e,t){let n=new Map;for(let t of e)n.set(t.from,[...n.get(t.from)??[],t.to]);let r=new Set([t]),i=[t];for(;i.length;)for(let e of n.get(i.pop())??[])r.has(e)||(r.add(e),i.push(e));return r}function Ri(e,t){let n=ine(e,t),r=e.filter(e=>n.has(e.from)&&n.has(e.to)),i=ane(e,t);return r.length?{drawn:r,above:e.filter(e=>i.has(e.from)&&i.has(e.to)&&!r.includes(e))}:{drawn:e.filter(e=>i.has(e.from)&&i.has(e.to)),above:[]}}function ane(e,t){let n=new Map,r=new Map,i=(e,t,n)=>e.set(t,[...e.get(t)??[],n]);for(let t of e)i(r,t.from,t.to),i(n,t.to,t.from);let a=new Set([t]);for(let e of[n,r]){let n=[t],r=new Set([t]);for(;n.length;)for(let t of e.get(n.pop())??[])r.has(t)||(r.add(t),a.add(t),n.push(t))}return a}function zi(e,t){let n=new Map(e.map(e=>[e,e])),r=e=>{let t=e;for(;n.get(t)!==t;)t=n.get(t);for(;n.get(e)!==t;){let r=n.get(e);n.set(e,t),e=r}return t};for(let e of t)n.set(r(e.from),r(e.to));return new Set(e.map(r)).size}var Bi=(e,t)=>zi(e,t)>1;function one(e,t){if(zi(e,t)<2)return null;let n=e=>t.filter(t=>t.from===e||t.to===e).length,r=null;for(let t of e)(r===null||n(t)>n(r))&&(r=t);return r}function Vi(e,t,n){return e===`*`?null:t.includes(e)?e:one(t,n)}var Hi=e=>20+[...e].reduce((e,t)=>e+(/[\u2e80-\u9fff\uff00-\uffef]/.test(t)?12.5:7.4),0),Ui=e=>Math.min(220,Hi(e)),Wi=e=>22+18*(Math.max(1,Math.ceil(Hi(e)/220-1e-9))-1),sne=40,cne=96,lne=760,Gi=e=>`${Number(Number(e).toFixed(2))}%`;function Ki(e,t){let n=e.relations.filter(e=>e.kind===`equity`).map(e=>({key:e.id,rel:e,from:e.from,to:e.to,back:!1})),r=new Set(n.flatMap(e=>[e.from,e.to])),i=e.entities.map(e=>e.id).filter(e=>r.has(e)),a=Vi(t,i,n),o=a?Ri(n,a):null,s=o?o.drawn:n,c=o?o.above.map(e=>e.rel):[],l=new Set(s.map(e=>e.key)),u=new Set(c.map(e=>e.id)),d=e.relations.filter(e=>!l.has(e.id)&&!u.has(e.id)),f=new Set([...a?[a]:[],...s.flatMap(e=>[e.from,e.to])]),p=e.entities.map(e=>e.id).filter(e=>f.has(e)),m=new Set(c.flatMap(e=>[e.from,e.to])),h=e.entities.filter(e=>!f.has(e.id)&&!m.has(e.id)),{back:g,level:_,roots:v}=Ai(p,s);for(let e of s)e.back=g.has(e.key);return{edges:s,ids:p,level:_,roots:v,rest:d,above:c,apart:h,company:a,several:Bi(i,n),companies:i}}function une(e,t=Ki(e)){let n=new Map(t.ids.map(e=>[e,[]]));for(let e of t.edges)e.back||n.get(e.from).push(e);let r=[];for(let e of t.roots){let i=new Map,a=(e,t,r)=>{for(let o of n.get(e)){let e=[...t,o.rel.share],n=r&&typeof o.rel.share==`number`,s=i.get(o.to)??{paths:[],unknown:!1,long:!1};n?s.paths.push(e):s.unknown=!0,e.length>=2&&(s.long=!0),i.set(o.to,s),a(o.to,e,n)}};a(e,[],!0);for(let n of t.ids){let t=i.get(n);if(t&&t.long){if(t.unknown)r.push({holder:e,held:n,total:null,terms:null});else{let i=t.paths.map(e=>e.reduce((e,t)=>t/100*e,1)*100).reduce((e,t)=>e+t,0);r.push({holder:e,held:n,total:Math.round(i*100)/100,terms:t.paths.map(e=>e.map(Gi).join(` × `))})}}}}return r}function dne(e,t={}){let n=Fr(e),r=Ir(e),i={errors:n,hints:r,nodes:[],edges:[],connections:[],size:{width:0,height:0},stats:{entities:0,relations:0,groups:0,kinds:{}}};if(n.length)return i;let a=typeof t?.t==`function`?t.t:w,o=e.entities,s=e.relations;o.length>25&&r.push(w(`rhint.tooLarge`,{n:o.length,limit:25}));let c=new Map(o.map(e=>[e.id,e])),l=Jr(e,a),u=Ki(e,t.company),d=e=>c.get(e).label,f=ki(u.ids,u.level,e=>l.sizes.get(e)),p=ji(u.ids,u.edges,f,{gapAcross:sne,gapAlong:cne}),m=u.edges.filter(e=>e.back).length,h=p.size.width,g=m?24:0,_=Math.max(h+g,lne-64),v=32+(_-h-g)/2,y=[],b={width:_+64,height:0,links:[],pills:[],empties:[],frames:[],texts:[]};for(let[e,t]of p.boxes)y.push({id:e,type:`rnode`,position:{x:t.x+v,y:t.y+32},data:l.dataOf(c.get(e),{layer:p.level.get(e),hintKey:`rel.previewHint`,w:t.w,textW:f(e).textW})});let x=p.levels,S=p.size.height+32,C=u.edges.map(e=>{let t=typeof e.rel.share==`number`?Gi(e.rel.share):a(`rel.equity.noShare`);return e.back?`${t} · ${a(`rel.equity.cross`)}`:t}),ee=Mi(u.edges.map((e,t)=>({seg:p.links.get(e.key).segs.at(-1),w:Ui(C[t]),h:Wi(C[t]),back:e.back,gathered:p.links.get(e.key).gathered})));u.edges.forEach((e,t)=>{let n=p.links.get(e.key);b.links.push({d:Ni(n.segs,v,32),back:e.back,via:n.via.map(([e,t])=>[e+v,t+32])}),b.pills.push({x:ee[t][0]+v,y:ee[t][1]+32,text:C[t],unknown:typeof e.rel.share!=`number`,back:e.back,relId:e.rel.id})});let te=Li(b,_,S+(x.length?28:0)),ne=te.section;u.ids.length||te.empty(a(`rel.equity.noEquity`),a(`rel.equity.noEquityHint`)),u.above.length&&ne(a(`rel.equity.above`,{n:u.above.length}),u.above.map(e=>({main:`${d(e.from)} → ${d(e.to)}${a(`rel.equity.colon`)}${typeof e.share==`number`?Gi(e.share):a(`rel.equity.noShare`)}`})));let re=une(e,u);if(re.length){let e=re.slice(0,30),t=e.map(e=>e.total===null?{main:`${d(e.holder)} → ${d(e.held)}: ${a(`rel.equity.notComputable`)}`,tone:`note`}:{main:`${d(e.holder)} → ${d(e.held)}: ${Gi(e.total)}`,sub:e.terms.length>1||e.terms[0].includes(`×`)?`${e.terms.join(` + `)}`:void 0});re.length>e.length&&t.push({main:a(`rel.equity.moreRows`,{n:re.length-e.length}),tone:`note`}),ne(a(`rel.equity.indirect`,{n:re.length}),t)}let ie=Math.ceil(te.y()-28+32);b.height=ie,y.unshift({id:`__equity__`,type:`lineLayer`,position:{x:0,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,style:{pointerEvents:`none`},data:b});let ae={};for(let e of s)ae[e.kind]=(ae[e.kind]??0)+1;return{errors:n,hints:r,nodes:y,edges:[],connections:[],levels:x.length,holders:u.roots.length,treeParties:u.ids.length,equityLines:u.edges.length,noShare:u.edges.filter(e=>typeof e.rel.share!=`number`).length,crossHoldings:u.edges.filter(e=>e.back).length,indirect:re.length,apart:u.apart.length,above:u.above.length,other:u.rest.length,company:u.company,several:u.several,companies:u.companies.map(e=>({id:e,label:c.get(e).label})),size:{width:Math.ceil(b.width),height:ie},stats:{entities:o.length,relations:s.length,groups:e.groups?.length??0,kinds:ae}}}var fne=[`control`,`employment`,`agency`],pne=40,mne=160,hne=760;function gne(e,t){let n=e.relations.filter(e=>fne.includes(e.kind)).map(e=>({key:e.id,rel:e,from:e.from,to:e.to,back:!1})),r=new Set(n.flatMap(e=>[e.from,e.to])),i=e.entities.map(e=>e.id).filter(e=>r.has(e)),a=Vi(t,i,n),o=a?Ri(n,a):null,s=o?o.drawn:n,c=o?o.above.map(e=>e.rel):[],l=new Set(s.map(e=>e.key)),u=new Set(c.map(e=>e.id)),d=e.relations.filter(e=>!l.has(e.id)&&!u.has(e.id)),f=new Set([...a?[a]:[],...s.flatMap(e=>[e.from,e.to])]),p=e.entities.map(e=>e.id).filter(e=>f.has(e)),m=new Set(c.flatMap(e=>[e.from,e.to])),h=e.entities.filter(e=>!f.has(e.id)&&!m.has(e.id)),{back:g,level:_,roots:v}=Ai(p,s);for(let e of s)e.back=g.has(e.key);return{edges:s,ids:p,level:_,roots:v,rest:d,above:c,apart:h,company:a,several:Bi(i,n),companies:i}}function _ne(e,t={}){let n=Fr(e),r=Ir(e),i={errors:n,hints:r,nodes:[],edges:[],connections:[],size:{width:0,height:0},stats:{entities:0,relations:0,groups:0,kinds:{}}};if(n.length)return i;let a=typeof t?.t==`function`?t.t:w,o=e.entities,s=e.relations;o.length>25&&r.push(w(`rhint.tooLarge`,{n:o.length,limit:25}));let c=new Map(o.map(e=>[e.id,e])),l=Jr(e,a),u=new Map(s.map((e,t)=>[e.id,t])),d=e=>l.labelTexts[u.get(e.id)],f=e=>c.get(e).label,p=gne(e,t.company),m=ki(p.ids,p.level,e=>l.sizes.get(e)),h=ji(p.ids,p.edges,m,{gapAcross:pne,gapAlong:mne}),g=p.edges.filter(e=>e.back).length,_=Math.max(h.size.width+(g?24:0),hne-64),v=32+(_-h.size.width-(g?24:0))/2,y=[],b={width:_+64,height:0,links:[],pills:[],empties:[],frames:[],texts:[]};for(let[e,t]of h.boxes)y.push({id:e,type:`rnode`,position:{x:t.x+v,y:t.y+32},data:l.dataOf(c.get(e),{layer:h.level.get(e),hintKey:`rel.previewHint`,w:t.w,textW:m(e).textW})});let x=p.edges.map(e=>e.back?`${d(e.rel)} · ${a(`rel.authority.cycle`)}`:d(e.rel)),S=Mi(p.edges.map((e,t)=>({seg:h.links.get(e.key).segs.at(-1),w:Ui(x[t]),h:Wi(x[t]),back:e.back,gathered:h.links.get(e.key).gathered})));p.edges.forEach((e,t)=>{let n=h.links.get(e.key);b.links.push({d:Ni(n.segs,v,32),kind:e.rel.kind,back:e.back,via:n.via.map(([e,t])=>[e+v,t+32]),arrow:Pr(e.rel)?`end`:`none`}),b.pills.push({x:S[t][0]+v,y:S[t][1]+32,text:x[t],kind:e.rel.kind,back:e.back,relId:e.rel.id})});let C=Li(b,_,h.size.height+32+(p.ids.length?28:0));p.ids.length||C.empty(a(`rel.authority.none`),a(`rel.authority.noneHint`)),p.above.length&&C.section(a(`rel.authority.above`,{n:p.above.length}),p.above.map(e=>({main:`${d(e)}${a(`rel.equity.colon`)}${f(e.from)} → ${f(e.to)}`})));let ee=Math.ceil(C.y()-28+32);b.height=ee,y.unshift({id:`__authority__`,type:`lineLayer`,position:{x:0,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,style:{pointerEvents:`none`},data:b});let te={};for(let e of s)te[e.kind]=(te[e.kind]??0)+1;return{errors:n,hints:r,nodes:y,edges:[],connections:[],levels:h.levels.length,tops:p.roots.length,chartParties:p.ids.length,authorityLines:p.edges.length,cycles:g,apart:p.apart.length,above:p.above.length,other:p.rest.length,company:p.company,several:p.several,companies:p.companies.map(e=>({id:e,label:c.get(e).label})),size:{width:Math.ceil(b.width),height:ee},stats:{entities:o.length,relations:s.length,groups:e.groups?.length??0,kinds:te}}}var qi=[190,130,400,200],Ji=70,Yi=34,vne=13,Xi=19,yne={latin:1.2,cjk:1.06},Zi=(e,t)=>Math.max(1,ye(e,(t-20)/vne,yne));function bne(e,t){return e.entities.some(e=>e.id===t)?t:vi(e)}var xne=(e,t)=>Pr(e)?e.from===t?`→`:`←`:`↔`;function Sne(e,t){let n=new Map((e.sources??[]).map(e=>[e.id,e.name])),r=new Map;for(let n of e.relations){if(n.from!==t&&n.to!==t)continue;let e=n.from===t?n.to:n.from;r.has(e)||r.set(e,[]),r.get(e).push({rel:n,arrow:xne(n,t)})}let i=[];for(let a of e.entities){if(a.id===t||!r.has(a.id))continue;let e=r.get(a.id);i.push({id:a.id,name:a.label,role:a.role??``,kinds:[...new Set(e.map(e=>e.rel.kind))],rels:e,sources:[...new Set(e.flatMap(e=>(e.rel.sourceIds??[]).map(e=>n.get(e)??e)))]})}return{rows:i,none:e.entities.filter(e=>e.id!==t&&!r.has(e.id)),rest:e.relations.filter(e=>e.from!==t&&e.to!==t)}}function Qi(e,t={}){let n=Fr(e),r=Ir(e),i={errors:n,hints:r,nodes:[],edges:[],connections:[],size:{width:0,height:0},stats:{entities:0,relations:0,groups:0,kinds:{}}};if(n.length)return i;let a=typeof t?.t==`function`?t.t:w,o=e.entities,s=e.relations;o.length>25&&r.push(w(`rhint.tooLarge`,{n:o.length,limit:25}));let c=new Map(o.map(e=>[e.id,e])),l=Jr(e,a),u=new Map(s.map((e,t)=>[e.id,t])),d=e=>l.labelTexts[u.get(e.id)],f=e=>c.get(e).label,p=bne(e,t.centre),{rows:m,none:h,rest:g}=Sne(e,p),_=m.some(e=>e.sources.length),v=_?qi:qi.slice(0,3),y=v.reduce((e,t)=>e+t,0),b=y+64,x={width:b,height:0,links:[],pills:[],empties:[],frames:[],texts:[],table:null},S=m.reduce((e,t)=>e+t.rels.length,0);x.texts.push({x:32,y:32,w:y,main:a(`rel.related.title`,{name:f(p)}),sub:a(`rel.related.count`,{n:m.length,m:S}),tone:`title`});let C=32+Ji,ee=a(`rel.equity.sep`),te=[a(`rel.related.colParty`),a(`rel.related.colKind`),a(`rel.related.colText`),..._?[a(`rel.related.colSource`)]:[]],ne=v.reduce((e,t)=>[...e,e.at(-1)+t],[32]),re=e=>Pr(e)?`${f(e.from)} → ${f(e.to)}`:a(`rel.related.dirNone`,{a:f(e.from),b:f(e.to)}),ie=C+Yi,ae=[];for(let e of m){let t=e.rels.map(e=>{let t=re(e.rel),n=[[a(`rel.kind.${e.rel.kind}`)],[d(e.rel),t]];return{texts:n,h:Math.max(...n.map((e,t)=>e.reduce((e,n)=>e+Zi(n,qi[t+1]),0)))*Xi+16}}),n=[e.name,...e.role?[e.role]:[]],r=[e.sources.length?e.sources.join(ee):`—`],i=(e,t)=>e.reduce((e,n)=>e+Zi(n,t)*Xi,0)+16,o=Math.max(t.reduce((e,t)=>e+t.h,0),i(n,qi[0]),_?i(r,qi[3]):0),s=o-t.reduce((e,t)=>e+t.h,0),c=ie;t.forEach((i,a)=>{let l=i.h+(a===t.length-1?s:0),u=i.texts.map((e,t)=>({x:ne[t+1],w:qi[t+1],lines:e,bold:!1,sub:e.length>1}));a===0&&(u.unshift({x:ne[0],w:qi[0],lines:n,bold:!0,y:ie,h:o}),_&&u.push({x:ne[3],w:qi[3],lines:r,bold:!1,y:ie,h:o})),ae.push({id:a===0?e.id:`${e.id}#${a}`,party:e.id,y:c,h:l,sep:a===t.length-1,cells:u}),c+=l}),ie+=o}x.table={x:32,y:C,w:y,headH:Yi,xs:ne,header:te.map((e,t)=>({x:ne[t],w:v[t],text:e})),rows:ae,bottom:ie};let oe=Li(x,y,ie+28);m.length||oe.empty(a(`rel.related.none`,{name:f(p)}),a(`rel.related.noneHint`));let se=Math.ceil(oe.y()-28+32);x.height=se;let ce=[{id:`__related__`,type:`lineLayer`,position:{x:0,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,style:{pointerEvents:`none`},data:x}],le={};for(let e of s)le[e.kind]=(le[e.kind]??0)+1;return{errors:n,hints:r,nodes:ce,edges:[],connections:[],centre:p,defaultCentre:vi(e),related:m.length,none:h.length,rest:g.length,size:{width:b,height:se},stats:{entities:o.length,relations:s.length,groups:e.groups?.length??0,kinds:le}}}var Cne=3,wne=5e3,Tne=760,Ene=150,$i=140,Dne=14,ea=108;function One(e){let t=new Map,n=new Map;if(!e.length)return{pos:t,row:n};e[0].nodes.forEach((e,r)=>{t.set(e,2*r),n.set(e,0)});let r=(e,r)=>[...t].some(([t,i])=>n.get(t)===e&&i===r),i=1;for(let a=1;a<e.length;a+=1){let o=e[a].nodes,s=!1,c=0;for(;c<o.length;){if(t.has(o[c])){c+=1;continue}let e=c;for(;e<o.length&&!t.has(o[e]);)e+=1;let a=o.slice(c,e),l=a.length,u=o[c-1],d=o[e],f=t.get(u),p=t.get(d);if(p>f&&p-f<2*l){let e=2*l-(p-f);for(let[n,r]of t)r>=p&&t.set(n,r+e);p+=e}let m=p<=f?a.map((e,t)=>f+1+2*t):l===1?[f+Math.round((p-f)/2)]:a.map((e,t)=>f+1+Math.round(t*(p-f-2)/(l-1))),h=[u,d].map(e=>n.get(e)).filter(e=>e!==0),g;if(h.length){let e=h.reduce((e,t)=>Math.abs(t)>Math.abs(e)?t:e);g=e+Math.sign(e)}else g=i,s=!0;let _=e=>{let i=Math.sign(e);for(let t of m)for(let n=-1;n<=1;n+=1)if(r(e,t+n))return!1;if(l>1&&[...t].some(([t,r])=>n.get(t)===e&&r>m[0]&&r<m[l-1]))return!1;for(let a of[u,d])if(!(Math.abs(n.get(a))>=Math.abs(e))){for(let o=n.get(a)+i;o!==e;o+=i)if(r(o,t.get(a)))return!1}return!0},v=g;for(let e=0;e<8&&!_(v);e+=1)v+=Math.sign(g);a.forEach((e,r)=>{t.set(e,m[r]),n.set(e,v)}),c=e}s&&(i=-i)}return{pos:t,row:n}}function ta(e,t){let n=new Map(e.entities.map(e=>[e.id,[]]));for(let t of e.relations)n.get(t.from).push(t.to),n.get(t.to).push(t.from);let r=new Map([[t,0]]),i=[t];for(let e=0;e<i.length;e++)for(let t of n.get(i[e]))r.has(t)||(r.set(t,r.get(i[e])+1),i.push(t));return r}function na(e){let t=null;for(let n of e.entities){let r=ta(e,n.id);for(let i of e.entities)i.id!==n.id&&r.has(i.id)&&(t===null||r.get(i.id)>t.d)&&(t={from:n.id,to:i.id,d:r.get(i.id)})}return t?{from:t.from,to:t.to}:{from:e.entities[0].id,to:e.entities[Math.min(1,e.entities.length-1)].id}}function kne(e,t={}){let n=t=>e.entities.some(e=>e.id===t);return n(t.from)&&n(t.to)&&t.from!==t.to?{from:t.from,to:t.to}:na(e)}function Ane(e,t,n){let r=ta(e,n);if(!r.has(t))return{chains:[],total:0,truncated:!1,shortest:0};let i=r.get(t),a=new Map(e.entities.map(e=>[e.id,[]]));e.relations.forEach((e,t)=>{a.get(e.from).push({r:e,i:t,other:e.to}),a.get(e.to).push({r:e,i:t,other:e.from})});let o=[],s=!1,c=(e,t,l,u)=>{if(o.length>=wne)s=!0;else if(e===n)o.push({nodes:[...t],rels:[...l]});else for(let{r:n,other:o}of a.get(e))u.has(o)||l.length+1+(r.get(o)??1/0)>i+Cne||(u.add(o),t.push(o),l.push(n),c(o,t,l,u),l.pop(),t.pop(),u.delete(o))};c(t,[t],[],new Set([t]));let l=new Map(e.relations.map((e,t)=>[e.id,t]));o.sort((e,t)=>e.rels.length-t.rels.length||e.rels.map(e=>l.get(e.id)).join(`,`).localeCompare(t.rels.map(e=>l.get(e.id)).join(`,`),void 0,{numeric:!0}));let u=new Set,d=o.filter(e=>{let t=e.rels.map(e=>e.id).sort().join(`\0`);return!u.has(t)&&(u.add(t),!0)});return{chains:d.slice(0,3),total:d.length,truncated:s,shortest:i}}function jne(e,t={}){let n=Fr(e),r=Ir(e),i={errors:n,hints:r,nodes:[],edges:[],connections:[],size:{width:0,height:0},stats:{entities:0,relations:0,groups:0,kinds:{}}};if(n.length)return i;let a=typeof t?.t==`function`?t.t:w,o=e.entities,s=e.relations;o.length>25&&r.push(w(`rhint.tooLarge`,{n:o.length,limit:25}));let c=new Map(o.map(e=>[e.id,e])),l=Jr(e,a),u=new Map(s.map((e,t)=>[e.id,t])),d=e=>l.labelTexts[u.get(e.id)],f=e=>c.get(e).label,p=kne(e,t),m=Ane(e,p.from,p.to),h=m.chains,g=h[0]?.rels.length??0,{pos:_,row:v}=One(h),y=[..._.keys()],b=Math.max(Ene,...y.map(e=>l.sizes.get(e).w)),x=y.length?Math.max(...y.map(e=>l.sizes.get(e).h)):0,S=Math.min(0,...v.values()),C=Math.max(0,...v.values()),ee=y.length?Math.max(..._.values())+1:0,te=x+88,ne=e=>32+ea+(e-S)*te,re=e=>Math.min(b/2-16,50+14*(e-1)),ie=Math.max(6,Math.min(14,(x-16)/3)),ae=[],oe=new Map;h.forEach(e=>e.rels.forEach((t,n)=>{let r=e.rels.length===g;if(oe.has(t.id)){r&&(oe.get(t.id).heavy=!0);return}let i={r:t,a:e.nodes[n],b:e.nodes[n+1],heavy:r,pw:Ui(d(t))};oe.set(t.id,i),ae.push(i)}));for(let e of ae){let[t,n,r,i]=[_.get(e.a),_.get(e.b),v.get(e.a),v.get(e.b)];if(r===i)e.type=`row`,[e.s,e.e]=t<=n?[e.a,e.b]:[e.b,e.a];else if(t===n)e.type=`col`,[e.s,e.e]=r<i?[e.a,e.b]:[e.b,e.a];else{e.type=`bend`;let a=Math.abs(r)<Math.abs(i)||Math.abs(r)===Math.abs(i)&&t<n;[e.s,e.e]=a?[e.a,e.b]:[e.b,e.a],e.dir=Math.sign(v.get(e.e)-v.get(e.s)),e.toRight=_.get(e.e)>_.get(e.s)}}let se=new Map;for(let e of ae.filter(e=>e.type===`row`)){let t=[e.s,e.e].join(`\0`);se.has(t)||se.set(t,[]),se.get(t).push(e)}for(let e of se.values()){if(e.length>=3||e.length===2&&e.some(e=>Wi(d(e.r))>22)){let t=[...e].sort((e,t)=>e.pw-t.pw);t.slice(1).forEach((e,t)=>{e.type=`round`,e.side=t%2==0?-1:1,e.level=Math.floor(t/2)+1,e.ph=Wi(d(e.r))});for(let e of[-1,1]){let n=0,r=0;for(let i of t.filter(t=>t.type===`round`&&t.side===e).sort((e,t)=>e.level-t.level))n=r?n+Math.max(32,(r+i.ph)/2+8):Math.max(26,i.ph/2+8),i.off=n,r=i.ph}e.splice(0,e.length,t[0])}e.forEach((t,n)=>{t.y=ne(v.get(t.s))+x/2+(n-(e.length-1)/2)*ie,t.slotOf=e})}let ce=new Map;for(let e of ae.filter(e=>e.type===`bend`)){let t=`${e.e}\u0000${e.toRight?`l`:`r`}`;ce.has(t)||ce.set(t,[]),ce.get(t).push(e)}let le=new Map;for(let e of se.values())le.set(`${e[0].s}\u0000r`,(le.get(`${e[0].s}\u0000r`)??0)+e.length),le.set(`${e[0].e}\u0000l`,(le.get(`${e[0].e}\u0000l`)??0)+e.length);for(let[e,t]of ce){let n=e=>Math.abs(_.get(e.s)-_.get(e.e));t.sort((e,t)=>e.dir>0?n(e)-n(t):n(t)-n(e));let r=le.get(e)??0;t.forEach((e,n)=>{let i=ne(v.get(e.e))+x/2;e.y=r?e.dir>0?i-((r-1)/2+t.length-n)*ie:i+((r-1)/2+1+n)*ie:i+(n-(t.length-1)/2)*ie})}let ue=new Map;for(let e of ae.filter(e=>e.type===`bend`)){let t=`${e.s}\u0000${e.dir}\u0000${e.toRight?`r`:`l`}`;ue.has(t)||ue.set(t,[]),ue.get(t).push(e)}for(let e of ue.values()){e.sort((e,t)=>Math.abs(t.y-ne(v.get(t.s)))-Math.abs(e.y-ne(v.get(e.s))));let t=b/2-14;e.forEach((n,r)=>{let i=e.length===1?14:14+r*(t-14)/(e.length-1);n.exitAt=(n.toRight?1:-1)*Math.min(i,t),n.exitRank=r})}let de=Array.from({length:Math.max(0,ee-1)},()=>(b+$i)/2),fe=[];for(let e=S;e<=C;e+=1){let t=y.filter(t=>v.get(t)===e).sort((e,t)=>_.get(e)-_.get(t));for(let e=1;e<t.length;e+=1){let n=ae.filter(n=>n.type===`row`&&n.s===t[e-1]&&n.e===t[e]),r=[...new Set(n.map(e=>e.slotOf))].reduce((e,t)=>e+t.reduce((e,t)=>e+t.pw+28,0),0);fe.push({a:_.get(t[e-1]),b:_.get(t[e]),w:b+Math.max($i,r)})}}for(let e of ae.filter(e=>e.type===`round`))fe.push({a:_.get(e.s),b:_.get(e.e),w:b+e.pw-2*re(e.level)+28});for(let e of ae.filter(e=>e.type===`bend`)){let[t,n]=[_.get(e.s),_.get(e.e)];fe.push({a:Math.min(t,n),b:Math.max(t,n),w:b/2+56+Math.abs(e.exitAt)})}for(let e=0;e<40;e+=1){let e=!1;for(let t of fe){let n=0;for(let e=t.a;e<t.b;e+=1)n+=de[e];if(n<t.w-.01){for(let e=t.a;e<t.b;e+=1)de[e]+=(t.w-n)/(t.b-t.a);e=!0}}if(!e)break}let pe=e=>32+b/2+de.slice(0,e).reduce((e,t)=>e+t,0),me=ee?pe(ee-1)+b/2:32,he=Math.max(me-32,Tne-64),ge=[],_e={width:he+64,height:0,links:[],pills:[],empties:[],frames:[],texts:[]},ve=new Set,ye=new Set,be=h[0],xe=e=>e===be?.nodes[0]||e===be?.nodes[be.nodes.length-1];for(let e of y)ve.add(e),ge.push({id:e,type:`rnode`,position:{x:pe(_.get(e))-b/2,y:ne(v.get(e))},data:{...l.dataOf(c.get(e),{layer:0,hintKey:`rel.previewHint`,vertical:!1,end:xe(e)}),w:b,h:x,textW:b-28}});let Se=Math.max(0,...ae.filter(e=>e.type===`round`&&e.side>0).map(e=>e.off+e.ph/2)),Ce=h.length?ne(C)+x+Se:32+ea,we=[];for(let e of ae){ye.add(e.r.id);let t=Pr(e.r)?e.r.from===e.s?`end`:`start`:`none`,n={kind:e.r.kind,ink:!0,back:!1,via:[],arrow:t,width:e.heavy?2.6:1.4},r={text:d(e.r),kind:e.r.kind,ink:!0,back:!1,relId:e.r.id};if(e.type===`row`){let t=pe(_.get(e.s))+b/2,i=pe(_.get(e.e))-b/2,a=e.slotOf.reduce((e,t)=>e+t.pw+28,0),o=e.slotOf.slice(0,e.slotOf.indexOf(e)).reduce((e,t)=>e+t.pw+28,0);n.d=`M ${t} ${e.y} L ${i} ${e.y}`,_e.links.push(n);let s=e.slotOf.indexOf(e),c=Wi(d(e.r))>22,l=Wi(d(e.r))/2-3,u=e.slotOf.length<2||!c?0:s===0?-l:s===e.slotOf.length-1?l:0;_e.pills.push({...r,x:t+(i-t-a)/2+o+Dne+e.pw/2,y:e.y+u})}else if(e.type===`round`){let t=v.get(e.s),i=e.side<0?ne(t):ne(t)+x,a=i+e.side*e.off,o=pe(_.get(e.s))+b/2-re(e.level),s=pe(_.get(e.e))-b/2+re(e.level);n.d=`M ${o} ${i} L ${o} ${a} L ${s} ${a} L ${s} ${i}`,_e.links.push(n),_e.pills.push({...r,x:(o+s)/2,y:a})}else if(e.type===`col`){let t=pe(_.get(e.s)),i=ne(v.get(e.s))+x,a=ne(v.get(e.e));n.d=`M ${t} ${i} L ${t} ${a}`,_e.links.push(n),_e.pills.push({...r,x:t,y:(i+a)/2})}else{let t=pe(_.get(e.s))+e.exitAt,i=ne(v.get(e.s))+(e.dir>0?x:0),a=pe(_.get(e.e))+(e.toRight?-b/2:b/2);n.d=`M ${t} ${i} L ${t} ${e.y} L ${a} ${e.y}`,_e.links.push(n);let o={...r,x:t,y:i+e.dir*30};_e.pills.push(o),we.push({pill:o,link:_e.links.length-1,h:e,px:t,y0:i,xe:a})}}let Te=e=>{let t=[...e.matchAll(/[ML] ([\d.-]+) ([\d.-]+)/g)].map(e=>[+e[1],+e[2]]);return t.slice(1).map((e,n)=>[t[n],e])},Ee=(e,[t,n])=>Math.max(t[0],n[0])>e.x&&Math.min(t[0],n[0])<e.x+e.w&&Math.max(t[1],n[1])>e.y&&Math.min(t[1],n[1])<e.y+e.h,De=(e,t)=>({x:e.x-t/2,y:e.y-Wi(e.text)/2,w:t,h:Wi(e.text)}),Oe=_e.links.map(e=>Te(e.d)),ke=_e.pills.filter(e=>!we.some(t=>t.pill===e)).map(e=>De(e,Ui(e.text))),Ae=ge.filter(e=>e.type===`rnode`).map(e=>({x:e.position.x,y:e.position.y,w:b,h:x}));for(let e of we){let t=Ui(e.pill.text),{px:n,y0:r,xe:i,h:a}=e,o=[];for(let e of[.5,.25,.75,.38,.62]){let t=r+a.dir*20,i=a.y-a.dir*16;(i-t)*a.dir>=0&&o.push([n,t+(i-t)*e])}let s=t/2-14;for(let e of[.5,.25,.75]){let t=r+a.dir*20,i=a.y-a.dir*16;if((i-t)*a.dir>=0&&s>8)for(let r of[s,-s])o.push([n+r,t+(i-t)*e])}Math.abs(i-n)>=t+12&&o.push([(n+i)/2,a.y]),o.length||o.push([n,r+a.dir*30]);let c=null;for(let[n,r]of o){let i=De({x:n,y:r,text:e.pill.text},t),a=ke.some(e=>i.x<e.x+e.w&&e.x<i.x+i.w&&i.y<e.y+e.h&&e.y<i.y+i.h)||Ae.some(e=>i.x<e.x+e.w&&e.x<i.x+i.w&&i.y<e.y+e.h&&e.y<i.y+i.h),o={x:i.x+3,y:i.y+2,w:i.w-6,h:i.h-4},s=Oe.reduce((t,n,r)=>r===e.link?t:t+n.filter(e=>Ee(o,e)).length,0),l=(a?1e3:0)+s;if((!c||l<c.score)&&(c={score:l,x:n,y:r}),l===0)break}e.pill.x=c.x,e.pill.y=c.y,ke.push(De(e.pill,t))}let je=h.length?Ce+28:32+ea,Me=m.total-h.length;h.length&&(Me>0||m.truncated)&&(_e.texts.push({x:32,y:je-28+14,w:he,main:a(`rel.path.more`,{n:Me,atLeast:+!!m.truncated}),tone:`note`}),je+=24);let Ne=Li(_e,he,je);h.length||Ne.empty(a(`rel.path.noChain`,{a:f(p.from),b:f(p.to)}),a(`rel.path.noChainHint`));let Pe=o.filter(e=>!ve.has(e.id)),Fe=s.filter(e=>!ye.has(e.id)),Ie=Math.ceil(Ne.y()-28+32);_e.height=Ie,ge.unshift({id:`__path__`,type:`lineLayer`,position:{x:0,y:0},width:1,height:1,draggable:!1,selectable:!1,connectable:!1,focusable:!1,style:{pointerEvents:`none`},data:_e});let Le={};for(let e of s)Le[e.kind]=(Le[e.kind]??0)+1;return{errors:n,hints:r,nodes:ge,edges:[],connections:[],from:p.from,to:p.to,defaultEnds:na(e),chains:h.length,totalChains:m.total,truncated:m.truncated,shortest:m.shortest,drawnParties:ve.size,off:Pe.length,offRels:Fe.length,size:{width:Math.ceil(_e.width),height:Ie},stats:{entities:o.length,relations:s.length,groups:e.groups?.length??0,kinds:Le}}}var ra={envelope:[{name:`type`,req:`yes`,ty:`string`,note:`always "relationship"`},y(1),{name:`title`,req:`yes`,ty:`string`,note:`diagram title, shown at the top left`},{name:`asOf`,req:`no`,ty:`ISO date`,note:`the date these relations hold; the diagram is a cross-section at one point in time`}],groups:[{name:`id`,req:`yes`,ty:`string`,note:`entities reference it via groupId`},{name:`label`,req:`yes`,ty:`string`,note:`the camp or cluster boxed together, e.g. "creditor side"`},{name:``,req:``,ty:``,note:`an entity is in at most one group; groups do not nest; omit groups and no boxes are drawn`}],entities:[{name:`id`,req:`yes`,ty:`string`,note:`unique among entities; relations reference it via from/to`},{name:`kind`,req:`yes`,ty:`string`,note:`${wr.join(` / `)}; fixes the shape and colour only`},{name:`label`,req:`yes`,ty:`string`,note:`the name shown on the box`},{name:`role`,req:`no`,ty:`string`,note:`the role in this case, one short line under the name, e.g. "guarantor"`},{name:`detail`,req:`no`,ty:`string`,note:`registered capital, ID number and the like; the full text in the popover`},{name:`groupId`,req:`no`,ty:`string`,note:`references groups`},{name:`sourceIds`,req:`no`,ty:`string[]`,note:`which materials it rests on`}],relations:[{name:`id`,req:`yes`,ty:`string`,note:`unique among relations (a guarantee's secures refers to it)`},{name:`from`,req:`yes`,ty:`string`,note:`entity id; the direction of the relation runs from here`},{name:`to`,req:`yes`,ty:`string`,note:`entity id`},{name:`kind`,req:`yes`,ty:`string`,note:`${Tr.join(` / `)}. equity: holder -> held. debt: creditor -> debtor. guarantee: guarantor -> creditor. control/employment/agency: the controlling / employing / authorising side first. A tie that stands, never an act (a blow, an insult): acts go in a fact diagram`},{name:`label`,req:`no`,ty:`string`,note:`a short phrase on the line; omit it and the engine writes one from the kind ("Holds 60%")`},{name:`detail`,req:`no`,ty:`string`,note:`terms, dates; the full text in the popover`},{name:`directed`,req:`no`,ty:`boolean`,note:`override of the kind's default: contract and kinship have no arrowhead, the rest do`},{name:`share`,req:`no`,ty:`number`,note:`equity only: the percentage held, 0 to 100`},{name:`amount`,req:`no`,ty:`string`,note:`debt and contract only: the sum as it should be read, e.g. "CNY 500,000"`},{name:`secures`,req:`no`,ty:`string`,note:`guarantee only: the id of the debt or contract relation it secures`},{name:`sourceIds`,req:`no`,ty:`string[]`,note:`which materials it rests on`}],sources:[{name:`id`,req:`yes`,ty:`string`,note:`entities and relations reference it via sourceIds`},{name:`type`,req:`yes`,ty:`string`,note:`contract / evidence / statute and four more, the same seven as fact`},{name:`name`,req:`yes`,ty:`string`,note:`material name, e.g. "loan contract"`},{name:`loc`,req:`no`,ty:`object`,note:`location, e.g. { file, page }`}]};function Mne(){let e=[`Fields of a relationship spec. "yes" means required.`,``];for(let[t,n]of Object.entries(ra)){e.push(`[${t}]`);for(let t of n)t.name?e.push(` ${t.name.padEnd(10)} ${t.req.padEnd(2)} ${t.ty.padEnd(10)} ${t.note}`):e.push(` · ${t.note}`);e.push(``)}return e.push(`Cross-field rules (dangling references, a relation from an entity to itself, share and amount on the`),e.push(`wrong kind, a guarantee that secures something that is not a claim) are not listed above: call`),e.push(`antu_validate after writing. It reports each problem.`),e.join(`
1457
1457
  `)}function Nne(e,t,{canvas:n}){let r=t(e,{}),i=Number(Ot(r.size,n).toFixed(3)),a=(e.entities??[]).find(e=>e.id===r.centre)?.label??r.centre;return{text:{font:14,canvas:n,open:{name:`fitted whole`,fit:i},other:{name:`fitted whole`,fit:i}},counts:{entities:r.stats.entities,relations:r.stats.relations,groups:r.stats.groups,kinds:r.stats.kinds,sources:e.sources?.length??0},size:r.size,centre:{id:r.centre,label:a},rings:r.rings,islands:r.islands.length-1,apart:r.islands.slice(1).reduce((e,t)=>e+t.ids.length,0),hints:r.hints}}function Pne(e){let t=e.counts,n=[`Kind: focus (one party in the middle; orientation does not apply)`,`Data: ${t.entities} entities / ${t.relations} relations / ${t.groups} groups / ${t.sources} sources`,`Opens centred on "${e.centre.label}" (the party with most relations; the reader can pick another)`,`Rings around it: ${e.rings.slice(1).map((e,t)=>`${e} at ${t+1} step${t?`s`:``}`).join(`, `)||`none (it has no relations)`}`,`Content ${e.size.width}×${e.size.height}`];return e.apart&&n.push(`${e.apart} part${e.apart===1?`y is`:`ies are`} not reached from the centre, laid out apart under the picture (${e.islands} separate group${e.islands===1?``:`s`})`),n.push(...jt(e.text,`splitting the diagram by group`)),e.hints.length&&n.push(``,`${e.hints.length} hint(s):`,...e.hints.map(e=>` - ${e}`)),n.join(`
1458
1458
  `)}function Fne(e,t,{canvas:n}){let r=t(e,{}),i=Number(Ot({width:r.size.width,height:1},{width:n.width,height:n.height*1e6}).toFixed(3));return{text:{font:14,canvas:n,open:{name:`fitted to width`,fit:i},other:{name:`fitted to width`,fit:i}},counts:{entities:r.stats.entities,relations:r.stats.relations,groups:r.stats.groups,kinds:r.stats.kinds,sources:e.sources?.length??0},size:r.size,filled:r.filled,stacked:r.stacked,possible:r.possible,fit:i,hints:r.hints}}function Ine(e){let t=e.counts,n=[`Kind: matrix (parties x parties, row to column; orientation does not apply)`,`Data: ${t.entities} entities / ${t.relations} relations / ${t.groups} groups / ${t.sources} sources`,`Content ${e.size.width}×${e.size.height}; it opens fitted to its width (zoom ${e.fit})`,`${e.filled} of ${e.possible} possible pairs have a relation; ${e.stacked} cell(s) hold more than one`];return e.fit<.6&&n.push(`The table is wide for one screen: the reader will zoom in. Splitting the diagram by group keeps each table smaller.`),n.push(...jt(e.text,`splitting the diagram by group`)),e.hints.length&&n.push(``,`${e.hints.length} hint(s):`,...e.hints.map(e=>` - ${e}`)),n.join(`