@miragon/team-topologies-renderer 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/model/di-types.ts","../src/io/saveSvg.ts","../src/io/types.ts","../src/TtBaseViewer.ts","../src/model/TtElementFactory.ts","../src/model/index.ts","../src/theme/palette.ts","../src/draw/styles.ts","../src/draw/label-layout.ts","../src/draw/TeamTopologiesRenderer.ts","../src/draw/index.ts","../src/io/TtImporter.ts","../src/io/TtExporter.ts","../src/io/index.ts","../src/Viewer.ts","../src/NavigatedViewer.ts","../src/modeling/cmd/UpdatePropertiesHandler.ts","../src/modeling/TtModeling.ts","../src/modeling/TtLayouter.ts","../src/modeling/index.ts","../src/rules/TtRules.ts","../src/rules/index.ts","../src/behaviors/TtFlatModelBehavior.ts","../src/behaviors/TtAssociationBehavior.ts","../src/behaviors/index.ts","../src/draw/palette-icons.ts","../src/palette/TtPaletteProvider.ts","../src/palette/index.ts","../src/draw/icons.ts","../src/context-pad/TtContextPadProvider.ts","../src/context-pad/index.ts","../src/label-editing/TtLabelEditing.ts","../src/label-editing/index.ts","../src/keyboard/TtKeyboard.ts","../src/keyboard/index.ts","../src/copy-paste/TtCopyPaste.ts","../src/copy-paste/TtCopyPasteProps.ts","../src/copy-paste/index.ts","../src/zorder/TtZOrder.ts","../src/zorder/index.ts","../src/Modeler.ts"],"sourcesContent":["/**\n * diagram-js runtime model for the Team Topologies notation. Every element is a\n * placed, resizable SHAPE discriminated by `ttKind`:\n * - `team` — one of the four team types (label inside the box)\n * - `interaction` — a mode glyph (parallelogram / triangle / circle), 50%\n * transparent, overlaid on the boundary between teams\n * - `flow` — the \"flow of change\" arrow guide\n * - `annotation` — a free-text note (BPMN-style open bracket)\n *\n * The only connection is the `association`: the dashed connector from an\n * annotation to the element it is attached to.\n *\n * These runtime properties are the source of truth while editing; the exporter\n * rebuilds the canonical `TtDocument` from them.\n */\n\nimport type { Connection, Shape } from \"diagram-js/lib/model/Types\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\n\nexport type TtKind = \"team\" | \"interaction\" | \"flow\" | \"annotation\";\n\nexport interface TtTeam extends Shape {\n ttKind: \"team\";\n teamType: TeamType;\n /** Display name (separate from diagram-js `label`). */\n ttLabel?: string;\n description?: string;\n fill?: string;\n stroke?: string;\n}\n\nexport interface TtInteraction extends Shape {\n ttKind: \"interaction\";\n mode: InteractionMode;\n ttLabel?: string;\n fill?: string;\n stroke?: string;\n}\n\nexport interface TtFlow extends Shape {\n ttKind: \"flow\";\n ttLabel?: string;\n}\n\nexport interface TtAnnotation extends Shape {\n ttKind: \"annotation\";\n /** The annotation text (may contain line breaks). */\n ttLabel?: string;\n}\n\nexport interface TtAssociation extends Connection {\n ttKind: \"association\";\n}\n\nexport type TtElement = TtTeam | TtInteraction | TtFlow | TtAnnotation;\n\nconst SHAPE_KINDS: ReadonlySet<string> = new Set<TtKind>([\n \"team\",\n \"interaction\",\n \"flow\",\n \"annotation\",\n]);\n\nfunction kindOf(el: unknown): string | undefined {\n return typeof el === \"object\" && el !== null\n ? ((el as { ttKind?: unknown }).ttKind as string | undefined)\n : undefined;\n}\n\nexport function isTtElement(el: unknown): el is TtElement {\n const kind = kindOf(el);\n return kind !== undefined && SHAPE_KINDS.has(kind);\n}\n\nexport function isTtTeam(el: unknown): el is TtTeam {\n return kindOf(el) === \"team\";\n}\n\nexport function isTtInteraction(el: unknown): el is TtInteraction {\n return kindOf(el) === \"interaction\";\n}\n\nexport function isTtFlow(el: unknown): el is TtFlow {\n return kindOf(el) === \"flow\";\n}\n\nexport function isTtAnnotation(el: unknown): el is TtAnnotation {\n return kindOf(el) === \"annotation\";\n}\n\nexport function isTtAssociation(el: unknown): el is TtAssociation {\n return kindOf(el) === \"association\";\n}\n","/**\n * Serialises the current canvas into a standalone SVG (snapshot / export),\n * fitted to the content bounds and independent of the current zoom / scroll.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport { isTtElement } from \"../model/di-types.js\";\n\nconst MARGIN = 40;\n\nexport function saveSVG(canvas: Canvas, elementRegistry: ElementRegistry): { svg: string } {\n const container = canvas.getContainer();\n const source = container.querySelector(\"svg\");\n if (!source) throw new Error(\"No SVG found in the canvas container.\");\n\n // Content bounds from the team shapes (interactions sit between them).\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const el of elementRegistry.getAll()) {\n if (!isTtElement(el)) continue;\n const s = el as unknown as { x: number; y: number; width: number; height: number };\n minX = Math.min(minX, s.x);\n minY = Math.min(minY, s.y);\n maxX = Math.max(maxX, s.x + s.width);\n maxY = Math.max(maxY, s.y + s.height);\n }\n if (!Number.isFinite(minX)) {\n minX = 0;\n minY = 0;\n maxX = 100;\n maxY = 100;\n }\n\n const x = minX - MARGIN;\n const y = minY - MARGIN;\n const width = maxX - minX + MARGIN * 2;\n const height = maxY - minY + MARGIN * 2;\n\n const clone = source.cloneNode(true) as SVGSVGElement;\n clone.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n clone.setAttribute(\"viewBox\", `${x} ${y} ${width} ${height}`);\n clone.setAttribute(\"width\", String(Math.round(width)));\n clone.setAttribute(\"height\", String(Math.round(height)));\n\n // Neutralise pan/zoom: let the viewBox (above) drive the geometry.\n const viewport = clone.querySelector<SVGGElement>(\".viewport\");\n if (viewport) viewport.removeAttribute(\"transform\");\n\n const svg = new XMLSerializer().serializeToString(clone);\n return { svg: '<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n' + svg };\n}\n","/** ID of the diagram-js root element holding the Team Topologies diagram. */\nexport const ROOT_ID = \"tt-root\";\n\nexport interface ImportWarning {\n readonly message: string;\n readonly elementId?: string;\n}\n\n/** Diagram-level metadata stashed on the root element. */\nexport interface RootBusinessObject {\n title: string;\n}\n","/**\n * Shared lifecycle & DI bootstrap for every Team Topologies viewer. Subclasses\n * only override `_getModules()`. The renderer\n * is framework-agnostic — mount it into any element (e.g. a VS Code webview).\n */\n\nimport Diagram from \"diagram-js/lib/Diagram\";\nimport type { ModuleDeclaration } from \"didi\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport type { TtDocument } from \"@miragon/team-topologies-schema-model\";\nimport { saveSVG } from \"./io/saveSvg.js\";\nimport type TtImporter from \"./io/TtImporter.js\";\nimport type TtExporter from \"./io/TtExporter.js\";\nimport { ROOT_ID, type ImportWarning, type RootBusinessObject } from \"./io/types.js\";\n\nexport interface TtViewerOptions {\n /** Host element. When absent, a detached <div> is created (attach later). */\n container?: HTMLElement;\n width?: number | string;\n height?: number | string;\n /** Appended to the module list (extension point). */\n additionalModules?: ModuleDeclaration[];\n}\n\nexport type EventCallback<T = unknown> = (event: T) => void;\n\ntype RootWithMeta = Root & { businessObject?: RootBusinessObject };\n\nfunction sizeToCss(value: number | string): string {\n return typeof value === \"number\" ? `${value}px` : value;\n}\n\nexport abstract class TtBaseViewer {\n protected abstract _getModules(): ModuleDeclaration[];\n\n private _diagram: Diagram | undefined;\n private readonly _container: HTMLElement;\n private readonly _options: TtViewerOptions;\n\n constructor(options: TtViewerOptions = {}) {\n this._options = options;\n this._container = this._createContainer(options);\n }\n\n private _createContainer(options: TtViewerOptions): HTMLElement {\n const container = options.container ?? document.createElement(\"div\");\n container.classList.add(\"tt-djs-container\");\n container.style.width = sizeToCss(options.width ?? \"100%\");\n container.style.height = sizeToCss(options.height ?? (options.container ? \"100%\" : \"600px\"));\n return container;\n }\n\n private _ensureDiagram(): Diagram {\n if (!this._diagram) {\n const modules = [...this._getModules(), ...(this._options.additionalModules ?? [])];\n this._diagram = new Diagram({ canvas: { container: this._container }, modules });\n }\n return this._diagram;\n }\n\n /** Resolve a diagram-js service from the didi injector. */\n get<T>(name: string): T {\n return this._ensureDiagram().get<T>(name);\n }\n\n on<T = unknown>(event: string, callback: EventCallback<T>, priority = 1000): void {\n this.get<EventBus>(\"eventBus\").on(event, priority, callback as EventCallback);\n }\n\n off(event: string, callback: EventCallback): void {\n this.get<EventBus>(\"eventBus\").off(event, callback);\n }\n\n /** Load a document into the canvas (replaces existing content). */\n importDocument(doc: TtDocument): { warnings: ImportWarning[] } {\n const diagram = this._ensureDiagram();\n const eventBus = diagram.get<EventBus>(\"eventBus\");\n const importer = diagram.get<TtImporter>(\"ttImporter\");\n importer.clear();\n const warnings = importer.import(doc);\n this._fit();\n eventBus.fire(\"import.done\", { warnings });\n return { warnings };\n }\n\n /** Current canvas state as a canonical document. */\n exportDocument(): TtDocument {\n return this.get<TtExporter>(\"ttExporter\").export();\n }\n\n /** Update diagram-level metadata (title / flow-of-change) on the root. */\n setMeta(partial: Partial<RootBusinessObject>): void {\n const canvas = this.get<Canvas>(\"canvas\");\n let root: RootWithMeta | undefined;\n try {\n root = canvas.getRootElement() as RootWithMeta;\n } catch {\n return;\n }\n if (!root || root.id !== ROOT_ID) return;\n const current = root.businessObject ?? { title: \"Untitled team topology\" };\n root.businessObject = { ...current, ...partial };\n }\n\n /** Read diagram-level metadata (title / flow-of-change) from the root. */\n getMeta(): RootBusinessObject | undefined {\n try {\n const root = this.get<Canvas>(\"canvas\").getRootElement() as RootWithMeta;\n return root.businessObject;\n } catch {\n return undefined;\n }\n }\n\n /** Standalone, self-contained SVG snapshot. */\n saveSVG(): { svg: string } {\n return saveSVG(this.get<Canvas>(\"canvas\"), this.get<ElementRegistry>(\"elementRegistry\"));\n }\n\n /** Fit the content into the viewport, leaving room at the top for the palette. */\n private _fit(topInset = 84, pad = 56): void {\n const canvas = this.get<Canvas>(\"canvas\");\n const registry = this.get<ElementRegistry>(\"elementRegistry\");\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const el of registry.getAll()) {\n const e = el as { x?: number; y?: number; width?: number; height?: number };\n if (\n typeof e.x !== \"number\" ||\n typeof e.y !== \"number\" ||\n typeof e.width !== \"number\" ||\n typeof e.height !== \"number\"\n ) {\n continue;\n }\n minX = Math.min(minX, e.x);\n minY = Math.min(minY, e.y);\n maxX = Math.max(maxX, e.x + e.width);\n maxY = Math.max(maxY, e.y + e.height);\n }\n if (!Number.isFinite(minX)) return;\n\n const rect = this._container.getBoundingClientRect();\n const W = rect.width;\n const H = rect.height;\n const cw = Math.max(maxX - minX, 1);\n const ch = Math.max(maxY - minY, 1);\n if (!W || !H) {\n canvas.zoom(\"fit-viewport\");\n return;\n }\n const s = Math.min((W - 2 * pad) / cw, (H - topInset - pad) / ch, 1.25);\n canvas.viewbox({\n x: minX + cw / 2 - W / 2 / s,\n y: minY - topInset / s,\n width: W / s,\n height: H / s,\n });\n }\n\n /** Attach the container into `target`. */\n attachTo(target: HTMLElement): void {\n target.appendChild(this._container);\n this.get<Canvas>(\"canvas\").resized();\n }\n\n /** Detach the container from the DOM, preserving state. */\n detach(): void {\n this._container.remove();\n }\n\n clear(): void {\n this._ensureDiagram().clear();\n }\n\n destroy(): void {\n if (this._diagram) {\n this._diagram.destroy();\n this._diagram = undefined;\n }\n this._container.remove();\n }\n\n get container(): HTMLElement {\n return this._container;\n }\n}\n","/**\n * Creates diagram-js runtime elements carrying Team Topologies markers, from\n * canonical document elements (import) or from scratch (palette drag-to-create).\n * Teams, interaction glyphs, the flow arrow and annotations are shapes; the\n * annotation connector is the only connection.\n */\n\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport { getMid } from \"diagram-js/lib/layout/LayoutUtil\";\nimport {\n ANNOTATION_SPEC,\n FLOW_SPEC,\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n newId,\n} from \"@miragon/team-topologies-schema-model\";\nimport type {\n FlowShape,\n InteractionMode,\n InteractionShape,\n TeamNode,\n TeamType,\n TextAnnotation,\n} from \"@miragon/team-topologies-schema-model\";\nimport type {\n TtAnnotation,\n TtAssociation,\n TtElement,\n TtFlow,\n TtInteraction,\n TtTeam,\n} from \"./di-types.js\";\n\nexport default class TtElementFactory {\n static $inject = [\"elementFactory\"];\n\n constructor(private readonly elementFactory: ElementFactory) {}\n\n // --- from canonical document elements (import) -------------------------\n\n createTeam(node: TeamNode): TtTeam {\n return this.elementFactory.createShape({\n id: node.id,\n x: node.position.x,\n y: node.position.y,\n width: node.size.width,\n height: node.size.height,\n ttKind: \"team\",\n teamType: node.type,\n ttLabel: node.label,\n ...(node.description ? { description: node.description } : {}),\n ...(node.fill ? { fill: node.fill } : {}),\n ...(node.stroke ? { stroke: node.stroke } : {}),\n } as Partial<TtTeam>) as unknown as TtTeam;\n }\n\n createInteraction(shape: InteractionShape): TtInteraction {\n return this.elementFactory.createShape({\n id: shape.id,\n x: shape.position.x,\n y: shape.position.y,\n width: shape.size.width,\n height: shape.size.height,\n ttKind: \"interaction\",\n mode: shape.mode,\n ...(shape.label ? { ttLabel: shape.label } : {}),\n ...(shape.fill ? { fill: shape.fill } : {}),\n ...(shape.stroke ? { stroke: shape.stroke } : {}),\n } as Partial<TtInteraction>) as unknown as TtInteraction;\n }\n\n createFlow(shape: FlowShape): TtFlow {\n return this.elementFactory.createShape({\n id: shape.id,\n x: shape.position.x,\n y: shape.position.y,\n width: shape.size.width,\n height: shape.size.height,\n ttKind: \"flow\",\n ...(shape.label ? { ttLabel: shape.label } : {}),\n } as Partial<TtFlow>) as unknown as TtFlow;\n }\n\n createAnnotation(annotation: TextAnnotation): TtAnnotation {\n return this.elementFactory.createShape({\n id: annotation.id,\n x: annotation.position.x,\n y: annotation.position.y,\n width: annotation.size.width,\n height: annotation.size.height,\n ttKind: \"annotation\",\n ...(annotation.text ? { ttLabel: annotation.text } : {}),\n } as Partial<TtAnnotation>) as unknown as TtAnnotation;\n }\n\n /**\n * The connector of an imported, attached annotation. Its id is derived from\n * the annotation (connectors aren't stored in the document), so re-importing\n * the same document yields the same id.\n */\n createAssociation(annotation: TtAnnotation, target: TtElement): TtAssociation {\n return this.elementFactory.createConnection({\n id: `assoc_${annotation.id}`,\n ttKind: \"association\",\n source: annotation,\n target,\n waypoints: [getMid(annotation), getMid(target)],\n } as Partial<TtAssociation>) as unknown as TtAssociation;\n }\n\n // --- fresh, not-yet-placed shapes (palette / context-pad create) -------\n //\n // These set an explicit model-style id (`team_…`/`int_…`/`flow_…`, matching\n // the model package's factory). We must NOT fall back to diagram-js' own\n // auto-id: its counter starts at `shape_12` and is not advanced past ids that\n // come in via import, so a re-imported `shape_N` (an element created in a\n // previous session, then autosaved) collides with the next palette create —\n // the first placement after a reload then throws \"element already exists\".\n\n createNewTeam(type: TeamType, label?: string): TtTeam {\n const spec = TEAM_TYPE_SPECS[type];\n return this.elementFactory.createShape({\n id: newId(\"team\"),\n width: spec.defaultSize.width,\n height: spec.defaultSize.height,\n ttKind: \"team\",\n teamType: type,\n ttLabel: label ?? spec.label,\n } as Partial<TtTeam>) as unknown as TtTeam;\n }\n\n createNewInteraction(mode: InteractionMode): TtInteraction {\n const spec = INTERACTION_MODE_SPECS[mode];\n return this.elementFactory.createShape({\n id: newId(\"int\"),\n width: spec.defaultSize.width,\n height: spec.defaultSize.height,\n ttKind: \"interaction\",\n mode,\n } as Partial<TtInteraction>) as unknown as TtInteraction;\n }\n\n createNewFlow(): TtFlow {\n return this.elementFactory.createShape({\n id: newId(\"flow\"),\n width: FLOW_SPEC.defaultSize.width,\n height: FLOW_SPEC.defaultSize.height,\n ttKind: \"flow\",\n ttLabel: FLOW_SPEC.label,\n } as Partial<TtFlow>) as unknown as TtFlow;\n }\n\n createNewAnnotation(text?: string): TtAnnotation {\n return this.elementFactory.createShape({\n id: newId(\"ann\"),\n width: ANNOTATION_SPEC.defaultSize.width,\n height: ANNOTATION_SPEC.defaultSize.height,\n ttKind: \"annotation\",\n ...(text ? { ttLabel: text } : {}),\n } as Partial<TtAnnotation>) as unknown as TtAnnotation;\n }\n\n /** A not-yet-connected association; modeling sets its ends and waypoints. */\n createNewAssociation(): TtAssociation {\n return this.elementFactory.createConnection({\n id: newId(\"assoc\"),\n ttKind: \"association\",\n } as Partial<TtAssociation>) as unknown as TtAssociation;\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtElementFactory from \"./TtElementFactory.js\";\n\n/** Element factory with Team Topologies defaults. */\nexport const ttModelModule: ModuleDeclaration = {\n ttElementFactory: [\"type\", TtElementFactory],\n};\n\nexport { default as TtElementFactory } from \"./TtElementFactory.js\";\nexport * from \"./di-types.js\";\n","/**\n * Miragon design tokens — the single source of truth for every non-notation colour in the renderer.\n *\n * Values mirror the Miragon corporate identity: the `miragon-brand:modeler-tool-design` skill in\n * `Miragon/corporate-identity`, whose vendored `cd-tokens.generated.css` (next to this file) defines\n * the `--cd-*` custom properties, generated from `brand/tokens.json`. Re-copy that CSS from the skill\n * to update; never fork the hex values by hand. `test/theme.sync.test.ts` fails if this mirror drifts\n * from the vendored CSS.\n *\n * Pure data — no DOM, no imports — so it stays inside the P1 DOM-free discipline and can be consumed\n * by the SVG-drawing constants in `draw/styles.ts`.\n *\n * Brand rule: blue leads (`blau` — surfaces, buttons, links, selection), green accents (`gruen` — key\n * visual, highlights; a fill, never body text on white). The four Team Topologies team-type and\n * interaction colours are the official notation and live in `schema-model/notation.ts` — they are NOT\n * part of this brand ramp.\n */\n\n/** Raw Miragon brand ramp + functional layer — exact `--cd-*` values. */\nexport const MIRAGON = {\n /** Primary: surfaces, buttons, links, selection, backgrounds. */\n blau: \"#335DE5\",\n /** Deeper blue for links / accent text on white (WCAG AA, ~5.5:1). */\n blauLink: \"#2B50D4\",\n /** Lightened blue for accents on dark surfaces (unused here — the canvas is light-only). */\n blauHell: \"#6B8AFF\",\n /** Accent: key visual, highlights, the brand gradient. Bright — a fill, never text on white. */\n gruen: \"#00E676\",\n /** Calm neutral surface (warm off-white) — the paper surround. */\n grau: \"#F9F7F7\",\n /** Text on light; not pure black. */\n schwarz: \"#1D1D1D\",\n weiss: \"#FFFFFF\",\n /** Functional / status layer (own layer beside the brand palette; AA as text on white). */\n success: \"#0B7A55\",\n warning: \"#92610A\",\n danger: \"#C92A2A\",\n info: \"#2B50D4\",\n /** Signature brand gradient — brand moments only. Use verbatim. */\n gradientBrand: \"linear-gradient(120deg, #335DE5 30%, #00E676)\",\n} as const;\n\n/**\n * Every `--cd-*` token this repo depends on, mapped to the value it MUST hold. The drift test parses\n * `cd-tokens.generated.css` and asserts each entry matches, so re-copying the vendored CSS with a\n * changed value fails CI until this mirror (and `MIRAGON`) is updated too.\n */\nexport const CD_TOKENS: Record<string, string> = {\n \"--cd-blau\": MIRAGON.blau,\n \"--cd-gruen\": MIRAGON.gruen,\n \"--cd-grau\": MIRAGON.grau,\n \"--cd-schwarz\": MIRAGON.schwarz,\n \"--cd-weiss\": MIRAGON.weiss,\n \"--cd-blau-link\": MIRAGON.blauLink,\n \"--cd-blau-hell\": MIRAGON.blauHell,\n \"--cd-success\": MIRAGON.success,\n \"--cd-success-soft\": \"rgba(11, 122, 85, 0.12)\",\n \"--cd-warning\": MIRAGON.warning,\n \"--cd-warning-soft\": \"rgba(146, 97, 10, 0.12)\",\n \"--cd-danger\": MIRAGON.danger,\n \"--cd-danger-soft\": \"rgba(201, 42, 42, 0.12)\",\n \"--cd-info\": MIRAGON.info,\n \"--cd-info-soft\": \"rgba(43, 80, 212, 0.12)\",\n \"--cd-gradient-brand\": MIRAGON.gradientBrand,\n};\n","/**\n * Shared rendering constants (typography, accent, priorities) — Miragon corporate identity.\n * Colours are derived from the single source of truth in `theme/palette.ts` (`MIRAGON`), which\n * mirrors the vendored `--cd-*` brand tokens.\n */\n\nimport { MIRAGON } from \"../theme/index.js\";\n\n/** BaseRenderer default priority is 1000; 1500 wins the render.shape/connection event. */\nexport const TT_RENDER_PRIORITY = 1500;\n\n/** Selection / hover accent (Miragon blue — kept in sync with the app theme via the shared palette). */\nexport const ACCENT = MIRAGON.blau;\n\nexport const INK = MIRAGON.schwarz;\nexport const INK_SOFT = \"#5B5B5B\";\n\nexport const FONT = {\n /**\n * Set directly as the `font-family` attribute on every SVG <text> (canvas\n * labels and therefore the SVG export too) — not inherited from a CSS\n * container. Prefers the self-hosted Miragon typeface Geist (registered as\n * 'Geist Variable' by @fontsource-variable/geist, with 'Geist' as a fallback\n * name), and falls back to a system sans when the host hasn't loaded it (e.g.\n * an exported SVG opened standalone).\n */\n family:\n \"'Geist Variable', 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif\",\n label: 13.5,\n small: 11,\n annotation: 12,\n} as const;\n\n/** Paper colour used for the label halo so text stays legible over lines. */\nexport const PAPER = MIRAGON.weiss;\n","/**\n * Where and how each element's text is laid out. Shared by the SVG renderer and\n * the inline label editor, so the editor sits exactly on top of the rendered\n * label and uses the same typography.\n */\n\nimport { isTtAnnotation, isTtFlow, isTtInteraction, type TtElement } from \"../model/di-types.js\";\nimport { FONT, INK, INK_SOFT } from \"./styles.js\";\n\n/** Horizontal padding between a shape's outline and its centred label. */\nconst LABEL_INSET = 10;\nconst ANNOTATION_PADDING = { left: 10, right: 6, top: 6, bottom: 6 };\nexport const LINE_HEIGHT = 1.2;\n\nexport interface LabelBox {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface LabelLayout {\n /** The area the text is laid out in, relative to the element's top-left corner. */\n box: LabelBox;\n /** `center`: centred both ways (shape labels). `left-top`: flows from the top-left (annotations). */\n align: \"center\" | \"left-top\";\n fontSize: number;\n fontWeight: string;\n letterSpacing?: string;\n fill: string;\n}\n\n/** Width of the flow arrow's head; the label stays on the shaft. */\nexport function flowHeadWidth(width: number, height: number): number {\n return Math.min(width * 0.16, height * 1.1);\n}\n\nexport function labelLayout(element: TtElement): LabelLayout {\n const width = Math.max(element.width, 1);\n const height = Math.max(element.height, 1);\n\n if (isTtAnnotation(element)) {\n return {\n box: {\n x: ANNOTATION_PADDING.left,\n y: ANNOTATION_PADDING.top,\n width: Math.max(width - ANNOTATION_PADDING.left - ANNOTATION_PADDING.right, 1),\n height: Math.max(height - ANNOTATION_PADDING.top - ANNOTATION_PADDING.bottom, 1),\n },\n align: \"left-top\",\n fontSize: FONT.annotation,\n fontWeight: \"450\",\n fill: INK,\n };\n }\n\n if (isTtFlow(element)) {\n const shaftWidth = width - flowHeadWidth(width, height);\n return {\n box: { x: LABEL_INSET, y: 0, width: shaftWidth - 2 * LABEL_INSET, height },\n align: \"center\",\n fontSize: FONT.small,\n fontWeight: \"650\",\n letterSpacing: \"0.06em\",\n fill: INK_SOFT,\n };\n }\n\n return {\n box: { x: LABEL_INSET, y: 0, width: width - 2 * LABEL_INSET, height },\n align: \"center\",\n fontSize: isTtInteraction(element) ? FONT.small : FONT.label,\n fontWeight: isTtInteraction(element) ? \"600\" : \"640\",\n fill: INK,\n };\n}\n\n/**\n * Greedy word-wrap into lines that roughly fit `maxWidth` at the font size.\n * Explicit line breaks are kept. Character-count based (not measured), so the\n * result is identical on every platform and exported SVGs stay stable.\n */\nexport function wrapLabel(text: string, maxWidth: number, fontSize: number): string[] {\n const maxChars = Math.max(4, Math.floor(maxWidth / (fontSize * 0.58)));\n const paragraphs = text.split(/\\r?\\n/);\n const lines: string[] = [];\n for (const paragraph of paragraphs) {\n const words = paragraph.split(/\\s+/).filter(Boolean);\n let current = \"\";\n for (const word of words) {\n const candidate = current ? `${current} ${word}` : word;\n if (candidate.length > maxChars && current) {\n lines.push(current);\n current = word;\n } else {\n current = candidate;\n }\n }\n lines.push(current);\n }\n while (lines.length > 0 && lines[lines.length - 1] === \"\") lines.pop();\n while (lines.length > 0 && lines[0] === \"\") lines.shift();\n return lines;\n}\n","/**\n * SVG rendering of the Team Topologies notation (BaseRenderer subclass):\n * - teams: SOLID resizable boxes (label wrapped inside), distinguished by shape\n * as well as colour;\n * - interactions: DASHED, 50%-transparent glyphs (collaboration = parallelogram,\n * x-as-a-service = triangle, facilitating = circle) laid over team boundaries;\n * - flow: a dashed \"flow of change\" arrow;\n * - annotations: a BPMN-style open bracket with free text, and the dashed\n * association connecting an annotation to the element it is attached to.\n *\n * Colours/shapes come from the single notation source (`@miragon/team-topologies-schema-model`).\n */\n\nimport BaseRenderer from \"diagram-js/lib/draw/BaseRenderer\";\nimport { append as svgAppend, create as svgCreate, attr as svgAttr } from \"tiny-svg\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { ConnectionLike, ElementLike, ShapeLike } from \"diagram-js/lib/model/Types\";\nimport {\n FLOW_SPEC,\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n dashArray,\n} from \"@miragon/team-topologies-schema-model\";\nimport { FONT, INK_SOFT } from \"./styles.js\";\nimport { TT_RENDER_PRIORITY } from \"./styles.js\";\nimport {\n LINE_HEIGHT,\n flowHeadWidth,\n labelLayout,\n wrapLabel,\n type LabelLayout,\n} from \"./label-layout.js\";\nimport {\n isTtAnnotation,\n isTtAssociation,\n isTtElement,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtAnnotation,\n type TtFlow,\n type TtInteraction,\n type TtTeam,\n} from \"../model/di-types.js\";\n\ntype Attrs = Record<string, string | number>;\n\nexport default class TeamTopologiesRenderer extends BaseRenderer {\n static $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n super(eventBus, TT_RENDER_PRIORITY);\n }\n\n override canRender(element: ElementLike): boolean {\n return isTtElement(element) || isTtAssociation(element);\n }\n\n override drawShape(visuals: SVGElement, element: ShapeLike): SVGElement {\n if (isTtTeam(element)) return this.drawTeam(visuals, element);\n if (isTtInteraction(element)) return this.drawInteraction(visuals, element);\n if (isTtFlow(element)) return this.drawFlow(visuals, element);\n if (isTtAnnotation(element)) return this.drawAnnotation(visuals, element);\n const rect = svgAttr(svgCreate(\"rect\"), {\n width: element.width,\n height: element.height,\n fill: \"#eee\",\n });\n svgAppend(visuals, rect);\n return rect;\n }\n\n override drawConnection(visuals: SVGElement, connection: ConnectionLike): SVGElement {\n const line = svgAttr(svgCreate(\"path\"), {\n d: waypointsPath(connection.waypoints),\n fill: \"none\",\n stroke: INK_SOFT,\n \"stroke-width\": 1.5,\n \"stroke-dasharray\": \"4 4\",\n \"stroke-linecap\": \"round\",\n });\n svgAppend(visuals, line);\n return line;\n }\n\n override getShapePath(shape: ShapeLike): string {\n const { x, y, width, height } = shape;\n return `M${x},${y}l${width},0l0,${height}l${-width},0z`;\n }\n\n override getConnectionPath(connection: ConnectionLike): string {\n return waypointsPath(connection.waypoints);\n }\n\n // --- teams ---------------------------------------------------------------\n\n private drawTeam(visuals: SVGElement, team: TtTeam): SVGElement {\n const spec = TEAM_TYPE_SPECS[team.teamType] ?? TEAM_TYPE_SPECS[\"stream-aligned\"];\n const w = Math.max(team.width, 1);\n const h = Math.max(team.height, 1);\n const sw = spec.strokeWidth;\n const dash = dashArray(spec.strokeStyle, sw);\n const outline = this.teamOutline(spec.shape, w, h, sw, {\n fill: team.fill ?? spec.fill,\n stroke: team.stroke ?? spec.stroke,\n \"stroke-width\": sw,\n ...(dash ? { \"stroke-dasharray\": dash } : {}),\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, outline);\n this.appendLabel(visuals, team.ttLabel ?? \"\", labelLayout(team));\n return outline;\n }\n\n private teamOutline(kind: string, w: number, h: number, sw: number, attrs: Attrs): SVGElement {\n const i = sw / 2;\n const iw = w - sw;\n const ih = h - sw;\n if (kind === \"octagon\") {\n const c = Math.min(iw, ih) * 0.29;\n return svgAttr(svgCreate(\"polygon\"), { points: octagon(i, iw, ih, c), ...attrs });\n }\n const rx = kind === \"rect\" ? 4 : Math.min(20, ih / 2, iw / 2);\n return svgAttr(svgCreate(\"rect\"), { x: i, y: i, width: iw, height: ih, rx, ry: rx, ...attrs });\n }\n\n // --- interactions --------------------------------------------------------\n\n private drawInteraction(visuals: SVGElement, el: TtInteraction): SVGElement {\n const spec = INTERACTION_MODE_SPECS[el.mode] ?? INTERACTION_MODE_SPECS.collaboration;\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = 2;\n const i = sw / 2;\n const common: Attrs = {\n fill: el.fill ?? spec.fill,\n \"fill-opacity\": spec.opacity,\n stroke: el.stroke ?? spec.stroke,\n \"stroke-width\": sw,\n \"stroke-dasharray\": dashArray(spec.strokeStyle, sw) || \"6 4\",\n \"stroke-linejoin\": \"round\",\n };\n\n let glyph: SVGElement;\n if (spec.shape === \"circle\") {\n glyph = svgAttr(svgCreate(\"ellipse\"), {\n cx: w / 2,\n cy: h / 2,\n rx: (w - sw) / 2,\n ry: (h - sw) / 2,\n ...common,\n });\n } else if (spec.shape === \"triangle\") {\n // Point up — the tip indicates the direction the service is provided.\n const pts = `${w / 2},${i} ${w - i},${h - i} ${i},${h - i}`;\n glyph = svgAttr(svgCreate(\"polygon\"), { points: pts, ...common });\n } else {\n const skew = Math.min(w * 0.26, h * 0.85);\n const pts = `${i + skew},${i} ${w - i},${i} ${w - i - skew},${h - i} ${i},${h - i}`;\n glyph = svgAttr(svgCreate(\"polygon\"), { points: pts, ...common });\n }\n svgAppend(visuals, glyph);\n this.appendLabel(visuals, el.ttLabel ?? \"\", labelLayout(el));\n return glyph;\n }\n\n // --- flow of change ------------------------------------------------------\n\n private drawFlow(visuals: SVGElement, el: TtFlow): SVGElement {\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = FLOW_SPEC.strokeWidth;\n const i = sw / 2;\n const head = flowHeadWidth(w, h);\n const shaft = h * 0.5;\n const top = (h - shaft) / 2;\n const bot = top + shaft;\n const pts = [\n [i, top],\n [w - head, top],\n [w - head, i],\n [w - i, h / 2],\n [w - head, h - i],\n [w - head, bot],\n [i, bot],\n ]\n .map((p) => p.join(\",\"))\n .join(\" \");\n const arrow = svgAttr(svgCreate(\"polygon\"), {\n points: pts,\n fill: \"none\",\n stroke: FLOW_SPEC.stroke,\n \"stroke-width\": sw,\n \"stroke-dasharray\": dashArray(FLOW_SPEC.strokeStyle, sw) || \"6 4\",\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, arrow);\n this.appendLabel(visuals, el.ttLabel ?? \"\", labelLayout(el));\n return arrow;\n }\n\n // --- annotations ---------------------------------------------------------\n\n private drawAnnotation(visuals: SVGElement, el: TtAnnotation): SVGElement {\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = 1.5;\n const i = sw / 2;\n const arm = Math.min(14, w / 2);\n const bracket = svgAttr(svgCreate(\"path\"), {\n d: `M${arm},${i} L${i},${i} L${i},${h - i} L${arm},${h - i}`,\n fill: \"none\",\n stroke: INK_SOFT,\n \"stroke-width\": sw,\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, bracket);\n this.appendLabel(visuals, el.ttLabel ?? \"\", labelLayout(el));\n return bracket;\n }\n\n // --- shared label rendering (wrapped, no halo) ---------------------------\n\n private appendLabel(visuals: SVGElement, text: string, layout: LabelLayout): void {\n const { box, fontSize } = layout;\n const lines = wrapLabel(text, box.width, fontSize);\n const lineHeight = fontSize * LINE_HEIGHT;\n const centred = layout.align === \"center\";\n const x = centred ? box.x + box.width / 2 : box.x;\n const startY = centred\n ? box.y + box.height / 2 - ((lines.length - 1) * lineHeight) / 2\n : box.y + lineHeight / 2;\n lines.forEach((ln, idx) => {\n if (!ln) return;\n const t = svgAttr(svgCreate(\"text\"), {\n x,\n y: startY + idx * lineHeight,\n \"font-family\": FONT.family,\n \"font-size\": fontSize,\n fill: layout.fill,\n \"text-anchor\": centred ? \"middle\" : \"start\",\n \"dominant-baseline\": \"central\",\n \"font-weight\": layout.fontWeight,\n ...(layout.letterSpacing ? { \"letter-spacing\": layout.letterSpacing } : {}),\n });\n t.textContent = ln;\n svgAppend(visuals, t);\n });\n }\n}\n\n// --- helpers ---------------------------------------------------------------\n\nfunction octagon(i: number, w: number, h: number, c: number): string {\n return [\n [i + c, i],\n [i + w - c, i],\n [i + w, i + c],\n [i + w, i + h - c],\n [i + w - c, i + h],\n [i + c, i + h],\n [i, i + h - c],\n [i, i + c],\n ]\n .map((p) => p.join(\",\"))\n .join(\" \");\n}\n\nfunction waypointsPath(waypoints: ReadonlyArray<{ x: number; y: number }>): string {\n return waypoints.map((point, idx) => `${idx === 0 ? \"M\" : \"L\"}${point.x},${point.y}`).join(\" \");\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport CroppingConnectionDocking from \"diagram-js/lib/layout/CroppingConnectionDocking\";\nimport TeamTopologiesRenderer from \"./TeamTopologiesRenderer.js\";\n\n/**\n * SVG rendering of all Team Topologies element types (BaseRenderer, priority\n * 1500), plus the docking that crops annotation connectors to the outlines of\n * the shapes they join.\n */\nexport const ttDrawModule: ModuleDeclaration = {\n __init__: [\"ttRenderer\"],\n ttRenderer: [\"type\", TeamTopologiesRenderer],\n connectionDocking: [\"type\", CroppingConnectionDocking],\n};\n\nexport { default as TeamTopologiesRenderer } from \"./TeamTopologiesRenderer.js\";\n","/**\n * Bridges the canonical `TtDocument` into the diagram-js canvas. Stacking order\n * (back → front) is flows, teams, interactions, annotations, so the translucent\n * interaction glyphs read on top of the team boxes they overlay. Attached\n * annotations get their association connector last, once both ends exist.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type ConnectionDocking from \"diagram-js/lib/layout/ConnectionDocking\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport type { TtDocument } from \"@miragon/team-topologies-schema-model\";\nimport { isTtAnnotation, isTtElement, type TtAnnotation } from \"../model/di-types.js\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\nimport { ROOT_ID, type ImportWarning, type RootBusinessObject } from \"./types.js\";\n\ntype RootWithMeta = Root & { businessObject?: RootBusinessObject };\n\nexport default class TtImporter {\n static $inject = [\n \"canvas\",\n \"elementFactory\",\n \"ttElementFactory\",\n \"eventBus\",\n \"elementRegistry\",\n \"connectionDocking\",\n ];\n\n constructor(\n private readonly canvas: Canvas,\n private readonly elementFactory: ElementFactory,\n private readonly factory: TtElementFactory,\n private readonly eventBus: EventBus,\n private readonly elementRegistry: ElementRegistry,\n private readonly connectionDocking: ConnectionDocking,\n ) {}\n\n import(doc: TtDocument): ImportWarning[] {\n const warnings: ImportWarning[] = [];\n this.eventBus.fire(\"import.render.start\", { document: doc });\n\n let existing: RootWithMeta | undefined;\n try {\n existing = this.canvas.getRootElement() as RootWithMeta;\n } catch {\n existing = undefined;\n }\n let root: RootWithMeta;\n if (existing && existing.id === ROOT_ID) {\n root = existing;\n } else {\n root = this.elementFactory.createRoot({ id: ROOT_ID }) as RootWithMeta;\n this.canvas.setRootElement(root);\n }\n root.businessObject = { title: doc.title };\n\n // Back → front: flows, teams, interactions, annotations.\n for (const flow of doc.flows) {\n this.canvas.addShape(this.factory.createFlow(flow), root);\n }\n for (const node of doc.nodes) {\n this.canvas.addShape(this.factory.createTeam(node), root);\n }\n for (const interaction of doc.interactions) {\n this.canvas.addShape(this.factory.createInteraction(interaction), root);\n }\n for (const annotation of doc.annotations) {\n this.canvas.addShape(this.factory.createAnnotation(annotation), root);\n }\n for (const annotation of doc.annotations) {\n if (!annotation.attachedTo) continue;\n const source = this.elementRegistry.get(annotation.id) as TtAnnotation;\n const target = this.elementRegistry.get(annotation.attachedTo);\n if (!isTtElement(target) || isTtAnnotation(target)) {\n warnings.push({\n message: `Annotation \"${annotation.id}\" is attached to unknown element \"${annotation.attachedTo}\"; its connector was dropped.`,\n elementId: annotation.id,\n });\n continue;\n }\n const association = this.factory.createAssociation(source, target);\n association.waypoints = this.connectionDocking.getCroppedWaypoints(association);\n this.canvas.addConnection(association, root);\n }\n\n this.eventBus.fire(\"import.render.done\", { warnings });\n return warnings;\n }\n\n /** Removes every element (for re-import). */\n clear(): void {\n const elements = this.elementRegistry.getAll().filter((el) => el.id !== ROOT_ID);\n const connections = elements.filter((el) => \"waypoints\" in el);\n const shapes = elements.filter((el) => !(\"waypoints\" in el));\n for (const connection of connections) this.canvas.removeConnection(connection.id);\n for (const shape of shapes) {\n try {\n this.canvas.removeShape(shape.id);\n } catch {\n // already removed — ignore\n }\n }\n }\n}\n","/**\n * Rebuilds a canonical `TtDocument` from the diagram-js runtime model. Position\n * and size truth are the live `x/y/width/height`; editable fields (label, type,\n * mode, colours) are read from the runtime properties. An annotation's\n * `attachedTo` comes from its association connection.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport { DOCUMENT_VERSION } from \"@miragon/team-topologies-schema-model\";\nimport type {\n FlowShape,\n InteractionShape,\n TeamNode,\n TextAnnotation,\n TtDocument,\n} from \"@miragon/team-topologies-schema-model\";\nimport {\n isTtAnnotation,\n isTtAssociation,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtAnnotation,\n} from \"../model/di-types.js\";\nimport { ROOT_ID, type RootBusinessObject } from \"./types.js\";\n\nexport default class TtExporter {\n static $inject = [\"elementRegistry\", \"canvas\"];\n\n constructor(\n private readonly elementRegistry: ElementRegistry,\n private readonly canvas: Canvas,\n ) {}\n\n export(): TtDocument {\n let meta: RootBusinessObject | undefined;\n try {\n const root = this.canvas.getRootElement() as Root & {\n businessObject?: RootBusinessObject;\n };\n meta = root.businessObject;\n } catch {\n meta = undefined;\n }\n\n const nodes: TeamNode[] = [];\n const interactions: InteractionShape[] = [];\n const flows: FlowShape[] = [];\n const annotations: TextAnnotation[] = [];\n\n for (const el of this.elementRegistry.getAll()) {\n if (el.id === ROOT_ID) continue;\n const geom = el as unknown as { x: number; y: number; width: number; height: number };\n const position = { x: geom.x, y: geom.y };\n const size = { width: geom.width, height: geom.height };\n\n if (isTtTeam(el)) {\n nodes.push({\n id: el.id,\n type: el.teamType,\n label: el.ttLabel ?? \"\",\n position,\n size,\n ...(el.description ? { description: el.description } : {}),\n ...(el.fill ? { fill: el.fill } : {}),\n ...(el.stroke ? { stroke: el.stroke } : {}),\n });\n } else if (isTtInteraction(el)) {\n interactions.push({\n id: el.id,\n mode: el.mode,\n position,\n size,\n ...(el.ttLabel ? { label: el.ttLabel } : {}),\n ...(el.fill ? { fill: el.fill } : {}),\n ...(el.stroke ? { stroke: el.stroke } : {}),\n });\n } else if (isTtFlow(el)) {\n flows.push({\n id: el.id,\n position,\n size,\n ...(el.ttLabel ? { label: el.ttLabel } : {}),\n });\n } else if (isTtAnnotation(el)) {\n const attachedTo = attachedElementId(el);\n annotations.push({\n id: el.id,\n text: el.ttLabel ?? \"\",\n position,\n size,\n ...(attachedTo ? { attachedTo } : {}),\n });\n }\n }\n\n return {\n version: DOCUMENT_VERSION,\n title: meta?.title ?? \"Untitled team topology\",\n nodes,\n interactions,\n flows,\n annotations,\n };\n }\n}\n\nfunction attachedElementId(annotation: TtAnnotation): string | undefined {\n const connections = [...annotation.outgoing, ...annotation.incoming];\n const association = connections.find(isTtAssociation);\n if (!association) return undefined;\n const other = association.source === annotation ? association.target : association.source;\n return other?.id;\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtImporter from \"./TtImporter.js\";\nimport TtExporter from \"./TtExporter.js\";\n\n/** Document <-> diagram-js bridge (import / export). */\nexport const ioModule: ModuleDeclaration = {\n ttImporter: [\"type\", TtImporter],\n ttExporter: [\"type\", TtExporter],\n};\n\nexport { default as TtImporter } from \"./TtImporter.js\";\nexport { default as TtExporter } from \"./TtExporter.js\";\nexport { saveSVG } from \"./saveSvg.js\";\nexport { ROOT_ID } from \"./types.js\";\nexport type { ImportWarning, RootBusinessObject } from \"./types.js\";\n","import type { ModuleDeclaration } from \"didi\";\nimport { TtBaseViewer } from \"./TtBaseViewer.js\";\nimport { ttModelModule } from \"./model/index.js\";\nimport { ttDrawModule } from \"./draw/index.js\";\nimport { ioModule } from \"./io/index.js\";\n\n/** Read-only renderer: draws a Team Topologies diagram with no interaction. */\nexport class Viewer extends TtBaseViewer {\n protected _getModules(): ModuleDeclaration[] {\n return [ttModelModule, ttDrawModule, ioModule];\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport SelectionModule from \"diagram-js/lib/features/selection\";\nimport ZoomScrollModule from \"diagram-js/lib/navigation/zoomscroll\";\nimport MoveCanvasModule from \"diagram-js/lib/navigation/movecanvas\";\nimport { Viewer } from \"./Viewer.js\";\n\n/** Read-only + navigation: zoom (scroll), pan (drag), selection. */\nexport class NavigatedViewer extends Viewer {\n protected override _getModules(): ModuleDeclaration[] {\n return [...super._getModules(), SelectionModule, ZoomScrollModule, MoveCanvasModule];\n }\n}\n","/**\n * Generic, undo-able command that sets arbitrary Team Topologies properties\n * (ttLabel, teamType, mode, fill, stroke, description). Returns the changed\n * element so the CommandStack fires `elements.changed` → re-render.\n */\n\nimport type { ElementLike } from \"diagram-js/lib/core/Types\";\nimport type CommandHandler from \"diagram-js/lib/command/CommandHandler\";\n\nexport interface UpdatePropertiesContext {\n element: ElementLike & Record<string, unknown>;\n properties: Record<string, unknown>;\n /** set internally by the handler (for revert). */\n oldProperties?: Record<string, unknown>;\n}\n\nfunction setOrDelete(obj: Record<string, unknown>, key: string, value: unknown): void {\n if (value === undefined) delete obj[key];\n else obj[key] = value;\n}\n\nexport default class UpdatePropertiesHandler implements CommandHandler {\n execute(context: UpdatePropertiesContext): ElementLike[] {\n const { element, properties } = context;\n const target = element as unknown as Record<string, unknown>;\n const old: Record<string, unknown> = {};\n for (const key of Object.keys(properties)) {\n old[key] = target[key];\n setOrDelete(target, key, properties[key]);\n }\n context.oldProperties = old;\n return [element];\n }\n\n revert(context: UpdatePropertiesContext): ElementLike[] {\n const { element, oldProperties } = context;\n const target = element as unknown as Record<string, unknown>;\n if (oldProperties) {\n for (const key of Object.keys(oldProperties)) setOrDelete(target, key, oldProperties[key]);\n }\n return [element];\n }\n}\n","/**\n * High-level Team Topologies mutations that go through the command stack\n * (undo/redo). Registers the generic property command handler.\n */\n\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type { Element, Root } from \"diagram-js/lib/model/Types\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\nimport {\n isTtAssociation,\n type TtAnnotation,\n type TtElement,\n type TtInteraction,\n type TtTeam,\n} from \"../model/di-types.js\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\nimport UpdatePropertiesHandler from \"./cmd/UpdatePropertiesHandler.js\";\n\nconst UPDATE_PROPERTIES = \"element.updateProperties\";\n\n/** Gap between an element and an annotation appended to it. */\nconst ANNOTATION_GAP = 40;\n\nexport default class TtModeling {\n static $inject = [\"commandStack\", \"modeling\", \"ttElementFactory\", \"canvas\"];\n\n constructor(\n private readonly commandStack: CommandStack,\n private readonly modeling: Modeling,\n private readonly factory: TtElementFactory,\n private readonly canvas: Canvas,\n ) {\n commandStack.registerHandler(UPDATE_PROPERTIES, UpdatePropertiesHandler);\n }\n\n updateProperties(element: TtElement, properties: Record<string, unknown>): void {\n this.commandStack.execute(UPDATE_PROPERTIES, { element, properties });\n }\n\n /** Rename / relabel any element. */\n updateLabel(element: TtElement, label: string): void {\n this.updateProperties(element, { ttLabel: label || undefined });\n }\n\n setTeamType(team: TtTeam, teamType: TeamType): void {\n this.updateProperties(team, { teamType });\n }\n\n setInteractionMode(interaction: TtInteraction, mode: InteractionMode): void {\n this.updateProperties(interaction, { mode });\n }\n\n /** Set or clear per-element colour overrides (`undefined` reverts to default). */\n setColors(\n element: TtTeam | TtInteraction,\n fill: string | undefined,\n stroke: string | undefined,\n ): void {\n this.updateProperties(element, { fill, stroke });\n }\n\n setDescription(team: TtTeam, description: string | undefined): void {\n this.updateProperties(team, { description });\n }\n\n /** Places a new annotation to the upper right of `element`, attached to it, as one undo step. */\n appendAnnotation(element: TtElement): TtAnnotation {\n const annotation = this.factory.createNewAnnotation();\n const position = {\n x: element.x + element.width + ANNOTATION_GAP + annotation.width / 2,\n y: element.y - ANNOTATION_GAP / 4,\n };\n return this.modeling.appendShape(\n element as Element,\n annotation as Element,\n position,\n this.canvas.getRootElement() as Root,\n { connection: this.factory.createNewAssociation(), connectionTarget: element },\n ) as unknown as TtAnnotation;\n }\n\n /** Removes the annotation's connector; the annotation itself stays. */\n detachAnnotation(annotation: TtAnnotation): void {\n const associations = [...annotation.incoming, ...annotation.outgoing].filter(isTtAssociation);\n if (associations.length > 0) this.modeling.removeElements(associations);\n }\n}\n","/**\n * Lays every annotation connector out as a straight line between the centres of\n * the annotation and its element (the association behaviour then crops it to\n * both outlines). The anchor hints from move / resize / connect are ignored on\n * purpose, so the connector never drifts off-centre.\n */\n\nimport BaseLayouter, { type LayoutConnectionHints } from \"diagram-js/lib/layout/BaseLayouter\";\nimport { getMid } from \"diagram-js/lib/layout/LayoutUtil\";\nimport type { Connection } from \"diagram-js/lib/model/Types\";\nimport type { Point } from \"diagram-js/lib/util/Types\";\n\nexport default class TtLayouter extends BaseLayouter {\n override layoutConnection(connection: Connection, hints: LayoutConnectionHints = {}): Point[] {\n const source = hints.source ?? connection.source;\n const target = hints.target ?? connection.target;\n if (!source || !target) return super.layoutConnection(connection, hints);\n return [getMid(source), getMid(target)];\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport ModelingModule from \"diagram-js/lib/features/modeling\";\nimport TtModeling from \"./TtModeling.js\";\nimport TtLayouter from \"./TtLayouter.js\";\n\n/**\n * High-level Team Topologies mutations + registration of the command handlers.\n * Depends on the diagram-js modeling module so our `layouter` replaces its\n * default one.\n */\nexport const ttModelingModule: ModuleDeclaration = {\n __depends__: [ModelingModule],\n __init__: [\"ttModeling\"],\n ttModeling: [\"type\", TtModeling],\n layouter: [\"type\", TtLayouter],\n};\n\nexport { default as TtModeling } from \"./TtModeling.js\";\nexport { default as TtLayouter } from \"./TtLayouter.js\";\n","/**\n * Allowed editing operations. Every Team Topologies element is a free, placed\n * shape — movable, creatable and resizable. The only connection is an\n * annotation's connector to a team, interaction or flow (the official notation\n * models interactions as overlapping shapes, not lines).\n */\n\nimport RuleProvider from \"diagram-js/lib/features/rules/RuleProvider\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtAnnotation, isTtElement } from \"../model/di-types.js\";\n\ninterface MoveContext {\n target?: { parent?: unknown } | null;\n}\n\ninterface ConnectContext {\n source?: unknown;\n target?: unknown;\n}\n\nfunction isAttachable(element: unknown): boolean {\n return isTtElement(element) && !isTtAnnotation(element);\n}\n\nexport default class TtRules extends RuleProvider {\n static override $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n super(eventBus);\n }\n\n override init(): void {\n this.addRule([\"shape.move\", \"elements.move\"], (context: MoveContext) =>\n context.target && context.target.parent ? null : true,\n );\n this.addRule(\"shape.create\", () => true);\n this.addRule(\"shape.resize\", () => true);\n this.addRule(\"element.copy\", () => true);\n this.addRule(\"connection.create\", ({ source, target }: ConnectContext) =>\n (isTtAnnotation(source) && isAttachable(target)) ||\n (isTtAnnotation(target) && isAttachable(source))\n ? { ttKind: \"association\" }\n : false,\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport RulesModule from \"diagram-js/lib/features/rules\";\nimport TtRules from \"./TtRules.js\";\n\n/** Team Topologies editing rules (connect, move, create, resize). */\nexport const ttRulesModule: ModuleDeclaration = {\n __depends__: [RulesModule],\n __init__: [\"ttRules\"],\n ttRules: [\"type\", TtRules],\n};\n\nexport { default as TtRules } from \"./TtRules.js\";\n","/**\n * Keeps the diagram flat: Team Topologies shapes overlap but never nest.\n *\n * diagram-js parents a newly created shape to whatever element it is dropped on\n * (`context.parent` defaults to the drop target). Interaction glyphs are meant\n * to be placed *over* the teams they relate to, so the natural workflow would\n * otherwise nest the interaction inside a team — gluing it so it moves along\n * with the team. Force every created shape onto the diagram root instead.\n *\n * Re-parenting on *move* is prevented separately in TtRules.\n */\n\nimport CommandInterceptor from \"diagram-js/lib/command/CommandInterceptor\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\n\nexport default class TtFlatModelBehavior extends CommandInterceptor {\n static override $inject = [\"eventBus\", \"canvas\"];\n\n constructor(eventBus: EventBus, canvas: Canvas) {\n super(eventBus);\n\n this.preExecute(\n [\"shape.create\", \"elements.create\"],\n (context: { parent?: unknown }) => {\n context.parent = canvas.getRootElement();\n },\n true,\n );\n }\n}\n","/**\n * Keeps annotation connectors tidy while editing:\n * - crops every laid-out connector to the outlines of the two shapes it joins\n * (the layouter only knows their centres);\n * - an annotation is attached to at most one element (the document stores a\n * single `attachedTo`), so connecting it again replaces the old connector.\n */\n\nimport CommandInterceptor from \"diagram-js/lib/command/CommandInterceptor\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type ConnectionDocking from \"diagram-js/lib/layout/ConnectionDocking\";\nimport type { Connection } from \"diagram-js/lib/model/Types\";\nimport { isTtAnnotation, isTtAssociation } from \"../model/di-types.js\";\n\ninterface ConnectionContext {\n connection: Connection;\n cropped?: boolean;\n}\n\nexport default class TtAssociationBehavior extends CommandInterceptor {\n static override $inject = [\"eventBus\", \"connectionDocking\", \"modeling\"];\n\n constructor(eventBus: EventBus, connectionDocking: ConnectionDocking, modeling: Modeling) {\n super(eventBus);\n\n this.executed(\n [\"connection.layout\", \"connection.create\"],\n (context: ConnectionContext) => {\n if (context.cropped || !isTtAssociation(context.connection)) return;\n context.connection.waypoints = connectionDocking.getCroppedWaypoints(context.connection);\n context.cropped = true;\n },\n true,\n );\n\n this.reverted(\n \"connection.layout\",\n (context: ConnectionContext) => {\n delete context.cropped;\n },\n true,\n );\n\n this.postExecuted(\n \"connection.create\",\n (context: ConnectionContext) => {\n const connection = context.connection;\n if (!isTtAssociation(connection)) return;\n const annotation = isTtAnnotation(connection.source)\n ? connection.source\n : connection.target;\n if (!isTtAnnotation(annotation)) return;\n const previous = [...annotation.incoming, ...annotation.outgoing].filter(\n (other) => other !== connection && isTtAssociation(other),\n );\n if (previous.length > 0) modeling.removeElements(previous);\n },\n true,\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtFlatModelBehavior from \"./TtFlatModelBehavior.js\";\nimport TtAssociationBehavior from \"./TtAssociationBehavior.js\";\n\n/**\n * Editing behaviors that keep the Team Topologies model flat (no nesting) and\n * annotation connectors cropped and one per annotation.\n */\nexport const ttBehaviorsModule: ModuleDeclaration = {\n __init__: [\"ttFlatModelBehavior\", \"ttAssociationBehavior\"],\n ttFlatModelBehavior: [\"type\", TtFlatModelBehavior],\n ttAssociationBehavior: [\"type\", TtAssociationBehavior],\n};\n\nexport { default as TtFlatModelBehavior } from \"./TtFlatModelBehavior.js\";\nexport { default as TtAssociationBehavior } from \"./TtAssociationBehavior.js\";\n","/**\n * Tiny inline-SVG glyphs for the palette entries — the same shapes the canvas\n * draws (so the palette is a faithful preview of each team type / interaction\n * mode). Returned as HTML strings for diagram-js palette `html`.\n */\n\nimport {\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n dashArray,\n} from \"@miragon/team-topologies-schema-model\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\nimport { INK_SOFT } from \"./styles.js\";\n\nfunction svg(inner: string): string {\n return `<svg class=\"tt-palette-svg\" width=\"24\" height=\"24\" viewBox=\"0 0 26 26\" aria-hidden=\"true\">${inner}</svg>`;\n}\n\nexport function teamIconSvg(type: TeamType): string {\n const s = TEAM_TYPE_SPECS[type];\n const dash = dashArray(s.strokeStyle, 1.5);\n const common =\n `fill=\"${s.fill}\" stroke=\"${s.stroke}\" stroke-width=\"1.5\"` +\n (dash ? ` stroke-dasharray=\"${dash}\"` : \"\");\n switch (s.shape) {\n case \"octagon\":\n return svg(`<polygon points=\"8,3 18,3 23,8 23,18 18,23 8,23 3,18 3,8\" ${common}/>`);\n case \"rounded-rect-vertical\":\n return svg(`<rect x=\"8\" y=\"3\" width=\"10\" height=\"20\" rx=\"4\" ${common}/>`);\n case \"rect\":\n return svg(`<rect x=\"3\" y=\"7\" width=\"20\" height=\"12\" rx=\"1.5\" ${common}/>`);\n default:\n return svg(`<rect x=\"3\" y=\"8\" width=\"20\" height=\"10\" rx=\"5\" ${common}/>`);\n }\n}\n\nexport function flowIconSvg(): string {\n return svg(\n `<g fill=\"none\" stroke=\"#6b6459\" stroke-width=\"1.5\" stroke-linejoin=\"round\" stroke-dasharray=\"3 2\">` +\n `<polygon points=\"3,9 16,9 16,5 23,13 16,21 16,17 3,17\"/></g>`,\n );\n}\n\nexport function annotationIconSvg(): string {\n return svg(\n `<g fill=\"none\" stroke=\"${INK_SOFT}\" stroke-width=\"1.5\" stroke-linecap=\"round\">` +\n `<path d=\"M10 4H5v18h5\"/><path d=\"M13 9h9M13 13h9M13 17h6\"/></g>`,\n );\n}\n\n/** Dashed selection frame with a pointer — the lasso (multi-select) tool. */\nexport function lassoIconSvg(): string {\n return svg(\n `<rect x=\"3\" y=\"3\" width=\"16\" height=\"13\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-dasharray=\"3 2\"/>` +\n `<path d=\"M14 12l9 3.6-3.8 1.4-1.4 3.8z\" fill=\"currentColor\"/>`,\n );\n}\n\nexport function interactionIconSvg(mode: InteractionMode): string {\n const s = INTERACTION_MODE_SPECS[mode];\n const dash = dashArray(s.strokeStyle, 1.5);\n const common =\n `fill=\"${s.fill}\" fill-opacity=\"${s.opacity}\" stroke=\"${s.stroke}\" stroke-width=\"1.5\"` +\n (dash ? ` stroke-dasharray=\"${dash}\"` : \"\");\n switch (s.shape) {\n case \"circle\":\n return svg(`<circle cx=\"13\" cy=\"13\" r=\"9\" ${common}/>`);\n case \"triangle\":\n return svg(`<polygon points=\"5,6 22,13 5,20\" ${common}/>`);\n default:\n return svg(`<polygon points=\"9,6 23,6 17,20 3,20\" ${common}/>`);\n }\n}\n","/**\n * The floating tool palette (styled top-centre, Excalidraw style). It starts\n * with the lasso (multi-select) tool; every other entry is drag-to-create: the\n * four team types, the three interaction-mode glyphs (placed over team\n * boundaries), the flow-of-change arrow and the text annotation.\n */\n\nimport type Palette from \"diagram-js/lib/features/palette/Palette\";\nimport type Create from \"diagram-js/lib/features/create/Create\";\nimport type LassoTool from \"diagram-js/lib/features/lasso-tool/LassoTool\";\nimport type {\n PaletteEntries,\n default as PaletteProvider,\n} from \"diagram-js/lib/features/palette/PaletteProvider\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\nimport {\n ALL_INTERACTION_SPECS,\n ALL_TEAM_SPECS,\n ANNOTATION_SPEC,\n FLOW_SPEC,\n} from \"@miragon/team-topologies-schema-model\";\nimport {\n annotationIconSvg,\n flowIconSvg,\n interactionIconSvg,\n lassoIconSvg,\n teamIconSvg,\n} from \"../draw/palette-icons.js\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\n\n/** diagram-js highlights the active tool only inside a group named exactly `tools`. */\nconst GROUP_TOOLS = \"tools\";\nconst GROUP_TEAMS = \"tt-1-teams\";\nconst GROUP_MODES = \"tt-2-modes\";\nconst GROUP_GUIDES = \"tt-3-guides\";\n\nfunction entryHtml(icon: string, title: string, draggable = true): string {\n return `<div class=\"entry tt-palette-entry\" draggable=\"${draggable}\" title=\"${title}\">${icon}</div>`;\n}\n\nexport default class TtPaletteProvider implements PaletteProvider {\n static $inject = [\"palette\", \"create\", \"ttElementFactory\", \"lassoTool\"];\n\n constructor(\n palette: Palette,\n private readonly create: Create,\n private readonly factory: TtElementFactory,\n private readonly lassoTool: LassoTool,\n ) {\n palette.registerProvider(this);\n }\n\n getPaletteEntries(): PaletteEntries {\n const entries: PaletteEntries = {};\n\n const lassoTitle = \"Select several elements (or Shift + drag on the canvas)\";\n entries[\"lasso-tool\"] = {\n group: GROUP_TOOLS,\n title: lassoTitle,\n html: entryHtml(lassoIconSvg(), lassoTitle, false),\n action: { click: (event: Event) => this.lassoTool.activateSelection(event as MouseEvent) },\n };\n\n for (const spec of ALL_TEAM_SPECS) {\n const start = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewTeam(spec.type, spec.label) as unknown as Element,\n );\n entries[`team.${spec.type}`] = {\n group: GROUP_TEAMS,\n title: `${spec.label} team — ${spec.description}`,\n html: entryHtml(teamIconSvg(spec.type), `${spec.label} team — ${spec.description}`),\n action: { dragstart: start, click: start },\n };\n }\n\n for (const spec of ALL_INTERACTION_SPECS) {\n const start = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewInteraction(spec.mode) as unknown as Element,\n );\n entries[`mode.${spec.mode}`] = {\n group: GROUP_MODES,\n title: `${spec.label} — ${spec.description} (place over the teams it relates to)`,\n html: entryHtml(interactionIconSvg(spec.mode), `${spec.label} — ${spec.description}`),\n action: { dragstart: start, click: start },\n };\n }\n\n const startFlow = (event: Event) =>\n this.create.start(event as MouseEvent, this.factory.createNewFlow() as unknown as Element);\n entries[\"flow\"] = {\n group: GROUP_GUIDES,\n title: `${FLOW_SPEC.label} — the implied left-to-right flow`,\n html: entryHtml(flowIconSvg(), FLOW_SPEC.label),\n action: { dragstart: startFlow, click: startFlow },\n };\n\n const startAnnotation = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewAnnotation() as unknown as Element,\n );\n const annotationTitle = `${ANNOTATION_SPEC.label} — a free-text note beside the diagram`;\n entries[\"annotation\"] = {\n group: GROUP_GUIDES,\n title: annotationTitle,\n html: entryHtml(annotationIconSvg(), annotationTitle),\n action: { dragstart: startAnnotation, click: startAnnotation },\n };\n\n return entries;\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport PaletteModule from \"diagram-js/lib/features/palette\";\nimport CreateModule from \"diagram-js/lib/features/create\";\nimport LassoToolModule from \"diagram-js/lib/features/lasso-tool\";\nimport TtPaletteProvider from \"./TtPaletteProvider.js\";\n\n/** Tool palette (lasso, drag-to-create teams, interactions, flows and annotations). */\nexport const ttPaletteModule: ModuleDeclaration = {\n __depends__: [PaletteModule, CreateModule, LassoToolModule],\n __init__: [\"ttPaletteProvider\"],\n ttPaletteProvider: [\"type\", TtPaletteProvider],\n};\n\nexport { default as TtPaletteProvider } from \"./TtPaletteProvider.js\";\n","/**\n * A handful of Material-style icon paths (Apache-2.0) used by the context pad,\n * exposed as HTML markup. Reusable by host chrome too.\n */\n\nexport const ICON_ARROW_FORWARD = \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\";\nexport const ICON_EDIT =\n \"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\";\nexport const ICON_DELETE =\n \"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z\";\nexport const ICON_LINK =\n \"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\";\n/** An open bracket with text lines — the annotation glyph. */\nexport const ICON_ANNOTATION = \"M4 3h5v2H6v14h3v2H4V3zm7 4h9v2h-9V7zm0 4h9v2h-9v-2zm0 4h6v2h-6v-2z\";\nexport const ICON_SWAP = \"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z\";\n\nexport function iconMarkup(path: string, size = 18): string {\n return `<svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"${path}\"/></svg>`;\n}\n","/**\n * Context-pad actions. Teams, interactions and flows: rename, add an attached\n * annotation, delete. Annotations: edit text, connect to an element, delete. An\n * annotation connector: delete. A multi-selection: delete all.\n */\n\nimport type ContextPad from \"diagram-js/lib/features/context-pad/ContextPad\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type Connect from \"diagram-js/lib/features/connect/Connect\";\nimport type Selection from \"diagram-js/lib/features/selection/Selection\";\nimport type {\n ContextPadEntries,\n ContextPadEntry,\n default as ContextPadProvider,\n} from \"diagram-js/lib/features/context-pad/ContextPadProvider\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\nimport { isTtAnnotation, isTtAssociation, isTtElement, type TtElement } from \"../model/di-types.js\";\nimport type TtLabelEditing from \"../label-editing/TtLabelEditing.js\";\nimport type TtModeling from \"../modeling/TtModeling.js\";\nimport { ICON_ANNOTATION, ICON_DELETE, ICON_EDIT, ICON_LINK, iconMarkup } from \"../draw/icons.js\";\n\nfunction cpHtml(path: string, title: string): string {\n return `<div class=\"entry tt-cp-entry\" title=\"${title}\">${iconMarkup(path)}</div>`;\n}\n\nexport default class TtContextPadProvider implements ContextPadProvider {\n static $inject = [\n \"contextPad\",\n \"modeling\",\n \"ttModeling\",\n \"ttLabelEditing\",\n \"connect\",\n \"selection\",\n ];\n\n constructor(\n contextPad: ContextPad,\n private readonly modeling: Modeling,\n private readonly ttModeling: TtModeling,\n private readonly labelEditing: TtLabelEditing,\n private readonly connect: Connect,\n private readonly selection: Selection,\n ) {\n contextPad.registerProvider(this);\n }\n\n getContextPadEntries(element: Element): ContextPadEntries {\n if (isTtAssociation(element))\n return { delete: this.deleteEntry([element], \"Remove connector\") };\n if (!isTtElement(element)) return {};\n\n if (isTtAnnotation(element)) {\n const startConnect = (event: Event) => this.connect.start(event as MouseEvent, element);\n return {\n \"edit-label\": this.editEntry(element, \"Edit text\"),\n connect: {\n group: \"edit\",\n title: \"Attach to an element\",\n html: cpHtml(ICON_LINK, \"Attach to an element\"),\n action: { click: startConnect, dragstart: startConnect },\n },\n delete: this.deleteEntry([element], \"Delete\"),\n };\n }\n\n return {\n \"edit-label\": this.editEntry(element, \"Rename\"),\n \"append-annotation\": {\n group: \"edit\",\n title: \"Add annotation\",\n html: cpHtml(ICON_ANNOTATION, \"Add annotation\"),\n action: {\n click: () => {\n const annotation = this.ttModeling.appendAnnotation(element);\n this.selection.select(annotation as unknown as Element);\n this.labelEditing.activate(annotation);\n },\n },\n },\n delete: this.deleteEntry([element], \"Delete\"),\n };\n }\n\n getMultiElementContextPadEntries(elements: Element[]): ContextPadEntries {\n return { delete: this.deleteEntry(elements, `Delete ${elements.length} elements`) };\n }\n\n private editEntry(element: TtElement, title: string): ContextPadEntry {\n return {\n group: \"edit\",\n title,\n html: cpHtml(ICON_EDIT, title),\n action: { click: () => this.labelEditing.activate(element) },\n };\n }\n\n private deleteEntry(elements: Element[], title: string): ContextPadEntry {\n return {\n group: \"edit\",\n title,\n html: cpHtml(ICON_DELETE, title),\n action: { click: () => this.modeling.removeElements([...elements]) },\n };\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport ConnectModule from \"diagram-js/lib/features/connect\";\nimport ConnectionPreviewModule from \"diagram-js/lib/features/connection-preview\";\nimport ContextPadModule from \"diagram-js/lib/features/context-pad\";\nimport TtContextPadProvider from \"./TtContextPadProvider.js\";\n\n/** Per-element context actions (rename, annotate, attach, delete). */\nexport const ttContextPadModule: ModuleDeclaration = {\n __depends__: [ContextPadModule, ConnectModule, ConnectionPreviewModule],\n __init__: [\"ttContextPadProvider\"],\n ttContextPadProvider: [\"type\", TtContextPadProvider],\n};\n\nexport { default as TtContextPadProvider } from \"./TtContextPadProvider.js\";\n","/**\n * In-place label editing: a borderless, transparent <textarea> laid exactly over\n * the element's label area, in the label's own font, size, alignment and\n * wrapping, scaled with the zoom. The rendered label is hidden meanwhile, so the\n * text never shows twice. Enter (or clicking elsewhere) commits through\n * `ttModeling.updateLabel` — one undo step; Shift+Enter inserts a line break;\n * Escape discards. Double-click any element to edit its label.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtAnnotation, isTtElement, type TtElement } from \"../model/di-types.js\";\nimport type TtModeling from \"../modeling/TtModeling.js\";\nimport { LINE_HEIGHT, labelLayout } from \"../draw/label-layout.js\";\nimport { FONT } from \"../draw/styles.js\";\n\n/** Canvas marker that hides the rendered label while its editor is open. */\nconst EDITING_MARKER = \"tt-label-editing\";\n\n/** Narrow shapes (small interaction glyphs) still get an editor wide enough to type in. */\nconst MIN_EDITOR_WIDTH = 96;\n\ninterface ActiveEdit {\n commit: () => void;\n cleanup: () => void;\n}\n\nexport default class TtLabelEditing {\n static $inject = [\"eventBus\", \"canvas\", \"ttModeling\"];\n\n private active: ActiveEdit | null = null;\n\n constructor(\n eventBus: EventBus,\n private readonly canvas: Canvas,\n private readonly modeling: TtModeling,\n ) {\n eventBus.on(\"element.dblclick\", (event: { element?: unknown }) => {\n if (isTtElement(event.element)) this.activate(event.element);\n });\n // Any click/drag/pan outside the editor commits (only Escape discards).\n eventBus.on([\"element.mousedown\", \"drag.init\", \"canvas.viewbox.changing\"], () =>\n this.active?.commit(),\n );\n // A re-import replaces every element, so a pending edit has nothing left to apply to.\n eventBus.on(\"import.render.start\", () => this.cancel());\n }\n\n activate(element: TtElement): void {\n this.active?.commit();\n\n const layout = labelLayout(element);\n const centred = layout.align === \"center\";\n const scale = this.canvas.zoom();\n const viewbox = this.canvas.viewbox();\n\n const width = centred ? Math.max(layout.box.width, MIN_EDITOR_WIDTH) : layout.box.width;\n const left = element.x + layout.box.x + (layout.box.width - width) / 2;\n const top = (element.y + layout.box.y - viewbox.y) * scale;\n const boxHeight = layout.box.height * scale;\n\n const editor = document.createElement(\"textarea\");\n editor.className = \"tt-label-editor\";\n editor.value = element.ttLabel ?? \"\";\n editor.rows = 1;\n editor.setAttribute(\"aria-label\", isTtAnnotation(element) ? \"Annotation text\" : \"Label\");\n Object.assign(editor.style, {\n left: `${(left - viewbox.x) * scale}px`,\n width: `${width * scale}px`,\n fontFamily: FONT.family,\n fontSize: `${layout.fontSize * scale}px`,\n fontWeight: layout.fontWeight,\n letterSpacing: layout.letterSpacing ?? \"normal\",\n lineHeight: String(LINE_HEIGHT),\n color: layout.fill,\n textAlign: centred ? \"center\" : \"left\",\n });\n\n // Grow with the text; centred labels stay vertically centred like the rendered ones.\n const fitToContent = () => {\n editor.style.height = \"0px\";\n const contentHeight = editor.scrollHeight;\n editor.style.height = `${centred ? contentHeight : Math.max(contentHeight, boxHeight)}px`;\n editor.style.top = `${centred ? top + (boxHeight - contentHeight) / 2 : top}px`;\n };\n\n this.canvas.getContainer().appendChild(editor);\n this.canvas.addMarker(element, EDITING_MARKER);\n fitToContent();\n editor.focus();\n editor.select();\n\n let done = false;\n const cleanup = () => {\n if (done) return;\n done = true;\n editor.removeEventListener(\"keydown\", onKey);\n editor.removeEventListener(\"input\", fitToContent);\n editor.removeEventListener(\"blur\", onBlur);\n editor.remove();\n this.canvas.removeMarker(element, EDITING_MARKER);\n this.active = null;\n };\n const commit = () => {\n if (done) return;\n const value = editor.value.trim();\n const changed = value !== (element.ttLabel ?? \"\");\n cleanup();\n if (changed) this.modeling.updateLabel(element, value);\n };\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && !e.shiftKey && !e.isComposing) {\n e.preventDefault();\n commit();\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n cleanup();\n }\n };\n const onBlur = () => commit();\n editor.addEventListener(\"keydown\", onKey);\n editor.addEventListener(\"input\", fitToContent);\n editor.addEventListener(\"blur\", onBlur);\n\n this.active = { commit, cleanup };\n }\n\n cancel(): void {\n this.active?.cleanup();\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtLabelEditing from \"./TtLabelEditing.js\";\n\n/** In-place label editing (double-click any element to edit its label or text). */\nexport const ttLabelEditingModule: ModuleDeclaration = {\n __init__: [\"ttLabelEditing\"],\n ttLabelEditing: [\"type\", TtLabelEditing],\n};\n\nexport { default as TtLabelEditing } from \"./TtLabelEditing.js\";\n","/**\n * Keyboard shortcuts: undo / redo / select all / delete-selection / copy /\n * paste / nudge the selection with the arrow keys. Bound to the document so they\n * work without first clicking (focusing) the canvas — typing inside form fields\n * (and the inline label editor) is left untouched. No container `tabindex`, so\n * the canvas never shows a focus ring.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\nimport type Selection from \"diagram-js/lib/features/selection/Selection\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type CopyPaste from \"diagram-js/lib/features/copy-paste/CopyPaste\";\nimport type Rules from \"diagram-js/lib/features/rules/Rules\";\nimport type { Element, Shape } from \"diagram-js/lib/model/Types\";\n\nconst NUDGE_STEP = 1;\nconst NUDGE_STEP_FAST = 10;\n\nconst ARROW_DIRECTIONS: Record<string, { x: number; y: number }> = {\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 },\n};\n\nfunction isTypingTarget(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null;\n if (!el) return false;\n return (\n el.tagName === \"INPUT\" ||\n el.tagName === \"TEXTAREA\" ||\n el.tagName === \"SELECT\" ||\n el.isContentEditable\n );\n}\n\nfunction isShape(element: Element): element is Shape {\n return !(\"waypoints\" in element);\n}\n\nexport default class TtKeyboard {\n static $inject = [\n \"eventBus\",\n \"canvas\",\n \"elementRegistry\",\n \"commandStack\",\n \"selection\",\n \"modeling\",\n \"copyPaste\",\n \"rules\",\n ];\n\n constructor(\n eventBus: EventBus,\n canvas: Canvas,\n elementRegistry: ElementRegistry,\n commandStack: CommandStack,\n selection: Selection,\n modeling: Modeling,\n copyPaste: CopyPaste,\n rules: Rules,\n ) {\n const doc = canvas.getContainer().ownerDocument ?? document;\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (isTypingTarget(e.target)) return;\n const cmd = e.ctrlKey || e.metaKey;\n const key = e.key.toLowerCase();\n\n if (cmd && key === \"z\" && !e.shiftKey) {\n e.preventDefault();\n if (commandStack.canUndo()) commandStack.undo();\n } else if ((cmd && key === \"z\" && e.shiftKey) || (cmd && key === \"y\")) {\n e.preventDefault();\n if (commandStack.canRedo()) commandStack.redo();\n } else if (key === \"delete\" || key === \"backspace\") {\n const sel = selection.get() as Element[];\n if (sel.length) {\n e.preventDefault();\n modeling.removeElements([...sel]);\n }\n } else if (cmd && key === \"c\") {\n const sel = selection.get() as Element[];\n if (sel.length) {\n e.preventDefault();\n copyPaste.copy(sel);\n }\n } else if (cmd && key === \"v\") {\n e.preventDefault();\n copyPaste.paste();\n } else if (cmd && key === \"a\") {\n e.preventDefault();\n selection.select(elementRegistry.filter((element) => Boolean(element.parent)));\n } else if (!cmd && !e.altKey && Object.hasOwn(ARROW_DIRECTIONS, e.key)) {\n const shapes = (selection.get() as Element[]).filter(isShape);\n if (!shapes.length || !rules.allowed(\"elements.move\", { shapes })) return;\n e.preventDefault();\n const direction = ARROW_DIRECTIONS[e.key];\n const step = e.shiftKey ? NUDGE_STEP_FAST : NUDGE_STEP;\n modeling.moveElements(shapes, { x: direction.x * step, y: direction.y * step });\n }\n };\n\n doc.addEventListener(\"keydown\", onKeyDown);\n eventBus.on(\"diagram.destroy\", () => doc.removeEventListener(\"keydown\", onKeyDown));\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtKeyboard from \"./TtKeyboard.js\";\n\n/** Undo/redo + delete-selection on the canvas container. */\nexport const ttKeyboardModule: ModuleDeclaration = {\n __init__: [\"ttKeyboard\"],\n ttKeyboard: [\"type\", TtKeyboard],\n};\n\nexport { default as TtKeyboard } from \"./TtKeyboard.js\";\n","/**\n * Copy-paste for Team Topologies shapes, built on the stock diagram-js\n * CopyPaste feature. Only the id handling differs: the stock `createShape`\n * drops the descriptor id and lets diagram-js auto-assign a `shape_N` id, which\n * is the very collision hazard `TtElementFactory` avoids (its counter is not\n * advanced past ids that arrive via import). So we mint a fresh, scheme-correct\n * `team_/int_/flow_/ann_/assoc_` id instead — the custom `tt*` props are already\n * on the descriptor (added by `TtCopyPasteProps`) and pass straight through.\n * Annotation connectors are pasted only together with both of their ends.\n */\n\nimport CopyPaste from \"diagram-js/lib/features/copy-paste/CopyPaste.js\";\nimport { newId } from \"@miragon/team-topologies-schema-model\";\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type Create from \"diagram-js/lib/features/create/Create\";\nimport type Clipboard from \"diagram-js/lib/features/clipboard/Clipboard\";\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type Mouse from \"diagram-js/lib/features/mouse/Mouse\";\nimport type Rules from \"diagram-js/lib/features/rules/Rules\";\nimport type { Connection, Shape } from \"diagram-js/lib/model/Types\";\n\n/** Maps a `ttKind` to the id prefix the model package's factory uses. */\nfunction pasteIdPrefix(ttKind: unknown): string | undefined {\n switch (ttKind) {\n case \"team\":\n return \"team\";\n case \"interaction\":\n return \"int\";\n case \"flow\":\n return \"flow\";\n case \"annotation\":\n return \"ann\";\n case \"association\":\n return \"assoc\";\n default:\n return undefined;\n }\n}\n\nexport default class TtCopyPaste extends CopyPaste {\n static override $inject = [\n \"canvas\",\n \"create\",\n \"clipboard\",\n \"elementFactory\",\n \"eventBus\",\n \"modeling\",\n \"mouse\",\n \"rules\",\n ];\n\n constructor(\n canvas: Canvas,\n create: Create,\n clipboard: Clipboard,\n private readonly elementFactory: ElementFactory,\n eventBus: EventBus,\n modeling: Modeling,\n mouse: Mouse,\n rules: Rules,\n ) {\n super(canvas, create, clipboard, elementFactory, eventBus, modeling, mouse, rules);\n }\n\n override createConnection(attrs: Record<string, unknown>): Connection {\n const prefix = pasteIdPrefix(attrs.ttKind);\n if (!prefix) {\n return super.createConnection(attrs);\n }\n return this.elementFactory.createConnection({ ...attrs, id: newId(prefix) }) as Connection;\n }\n\n override createShape(attrs: Record<string, unknown>): Shape {\n const prefix = pasteIdPrefix(attrs.ttKind);\n if (!prefix) {\n return super.createShape(attrs);\n }\n // Keep the id (unlike stock `createShape`, which strips it): a fresh\n // model-style id avoids \"element already exists\" on the next create.\n return this.elementFactory.createShape({ ...attrs, id: newId(prefix) }) as Shape;\n }\n}\n","/**\n * Carries the Team Topologies props across a copy-paste. diagram-js stores each\n * copied element as a plain descriptor whose built-in listener only records\n * geometry (`id/x/y/width/height/…`). Our domain data lives as flat attributes\n * on the shape (not a moddle businessObject), so without this the pasted copy\n * would lose its type, label, description and colours. This listener copies\n * those fields onto the descriptor; they then flow through to the new shape.\n */\n\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtAssociation, isTtElement } from \"../model/di-types.js\";\n\n/** Flat props that define a Team Topologies shape, beyond geometry. */\nconst TT_PROPS = [\n \"ttKind\",\n \"teamType\",\n \"mode\",\n \"ttLabel\",\n \"description\",\n \"fill\",\n \"stroke\",\n] as const;\n\nexport default class TtCopyPasteProps {\n static $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n eventBus.on(\n \"copyPaste.copyElement\",\n (event: { descriptor: Record<string, unknown>; element: unknown }) => {\n const { descriptor, element } = event;\n if (!isTtElement(element) && !isTtAssociation(element)) return;\n const source = element as Record<string, unknown>;\n for (const prop of TT_PROPS) {\n if (source[prop] !== undefined) descriptor[prop] = source[prop];\n }\n },\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport CopyPasteModule from \"diagram-js/lib/features/copy-paste\";\nimport TtCopyPaste from \"./TtCopyPaste.js\";\nimport TtCopyPasteProps from \"./TtCopyPasteProps.js\";\n\n/**\n * Copy-paste of Team Topologies shapes: the stock diagram-js feature (clipboard,\n * cursor-follow placement) with `copyPaste` overridden to mint model-style ids\n * and a listener that preserves the flat `tt*` props across the round-trip.\n */\nexport const ttCopyPasteModule: ModuleDeclaration = {\n __depends__: [CopyPasteModule],\n __init__: [\"ttCopyPasteProps\"],\n copyPaste: [\"type\", TtCopyPaste],\n ttCopyPasteProps: [\"type\", TtCopyPasteProps],\n};\n\nexport { default as TtCopyPaste } from \"./TtCopyPaste.js\";\n","/**\n * Enforces a fixed stacking order regardless of creation order, by reordering\n * the element graphics within the canvas layer. Back → front:\n *\n * flow < stream-aligned / platform < complicated-subsystem < enabling\n * < interactions < annotations < annotation connectors\n *\n * So interaction glyphs always read on top of teams; enabling teams sit above the\n * complicated-subsystem teams, which in turn sit above the stream-aligned /\n * platform base teams they overlap. Annotation connectors come last so no shape\n * they cross on the way to their element hides them.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport {\n isTtAnnotation,\n isTtAssociation,\n isTtElement,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtAssociation,\n type TtElement,\n} from \"../model/di-types.js\";\n\n/** Lower = further back. */\nfunction tier(el: TtElement | TtAssociation): number {\n if (isTtFlow(el)) return 0;\n if (isTtTeam(el)) {\n if (el.teamType === \"enabling\") return 3;\n if (el.teamType === \"complicated-subsystem\") return 2;\n return 1; // stream-aligned, platform\n }\n if (isTtInteraction(el)) return 4;\n if (isTtAnnotation(el)) return 5;\n if (isTtAssociation(el)) return 6;\n return 1;\n}\n\nfunction isOrdered(el: unknown): el is TtElement | TtAssociation {\n return isTtElement(el) || isTtAssociation(el);\n}\n\nexport default class TtZOrder {\n static $inject = [\"eventBus\", \"canvas\", \"elementRegistry\"];\n\n private importing = false;\n\n constructor(\n eventBus: EventBus,\n private readonly canvas: Canvas,\n private readonly elementRegistry: ElementRegistry,\n ) {\n eventBus.on(\"import.render.start\", () => {\n this.importing = true;\n });\n eventBus.on(\"import.render.done\", () => {\n this.importing = false;\n this.reorder();\n });\n // Covers create + team-type changes (and harmlessly re-runs on move/resize).\n eventBus.on(\"commandStack.changed\", () => {\n if (!this.importing) this.reorder();\n });\n }\n\n /** Re-append each element's graphics group in ascending tier order (back → front). */\n reorder(): void {\n const ordered = this.elementRegistry\n .getAll()\n .filter(isOrdered)\n .sort((a, b) => tier(a) - tier(b));\n for (const el of ordered) {\n const gfx = this.canvas.getGraphics(el) as SVGElement | undefined;\n const wrapper = gfx?.parentNode as (Node & ChildNode) | null;\n const layer = wrapper?.parentNode as (Node & { appendChild(n: Node): Node }) | null;\n if (wrapper && layer) layer.appendChild(wrapper);\n }\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtZOrder from \"./TtZOrder.js\";\n\n/** Keeps the fixed stacking order (interactions on top, base teams at the back). */\nexport const ttZOrderModule: ModuleDeclaration = {\n __init__: [\"ttZOrder\"],\n ttZOrder: [\"type\", TtZOrder],\n};\n\nexport { default as TtZOrder } from \"./TtZOrder.js\";\n","import type { ModuleDeclaration } from \"didi\";\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\n\nimport LassoToolModule from \"diagram-js/lib/features/lasso-tool\";\nimport ModelingModule from \"diagram-js/lib/features/modeling\";\nimport MoveModule from \"diagram-js/lib/features/move\";\nimport OutlineModule from \"diagram-js/lib/features/outline\";\nimport ResizeModule from \"diagram-js/lib/features/resize\";\n\nimport { NavigatedViewer } from \"./NavigatedViewer.js\";\nimport { ttModelingModule } from \"./modeling/index.js\";\nimport { ttRulesModule } from \"./rules/index.js\";\nimport { ttBehaviorsModule } from \"./behaviors/index.js\";\nimport { ttPaletteModule } from \"./palette/index.js\";\nimport { ttContextPadModule } from \"./context-pad/index.js\";\nimport { ttLabelEditingModule } from \"./label-editing/index.js\";\nimport { ttKeyboardModule } from \"./keyboard/index.js\";\nimport { ttCopyPasteModule } from \"./copy-paste/index.js\";\nimport { ttZOrderModule } from \"./zorder/index.js\";\n\n/**\n * Full Team Topologies editor: palette/create, multi-selection (lasso, select\n * all) and group move, resize, annotations with connectors, context pad,\n * in-place label editing, undo/redo.\n */\nexport class Modeler extends NavigatedViewer {\n protected override _getModules(): ModuleDeclaration[] {\n return [\n ...super._getModules(),\n // diagram-js stock\n ModelingModule,\n LassoToolModule,\n MoveModule,\n OutlineModule,\n ResizeModule,\n // Team Topologies editor\n ttModelingModule,\n ttRulesModule,\n ttBehaviorsModule,\n ttPaletteModule,\n ttContextPadModule,\n ttLabelEditingModule,\n ttKeyboardModule,\n ttCopyPasteModule,\n ttZOrderModule,\n ];\n }\n\n undo(): void {\n this.get<CommandStack>(\"commandStack\").undo();\n }\n\n redo(): void {\n this.get<CommandStack>(\"commandStack\").redo();\n }\n\n canUndo(): boolean {\n return this.get<CommandStack>(\"commandStack\").canUndo();\n }\n\n canRedo(): boolean {\n return this.get<CommandStack>(\"commandStack\").canRedo();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAM,qBAAmC,IAAI,IAAY;CACvD;CACA;CACA;CACA;AACF,CAAC;AAED,SAAS,EAAO,GAAiC;CAC/C,OAAO,OAAO,KAAO,YAAY,IAC3B,EAA4B,SAC9B,KAAA;AACN;AAEA,SAAgB,EAAY,GAA8B;CACxD,IAAM,IAAO,EAAO,CAAE;CACtB,OAAO,MAAS,KAAA,KAAa,GAAY,IAAI,CAAI;AACnD;AAEA,SAAgB,EAAS,GAA2B;CAClD,OAAO,EAAO,CAAE,MAAM;AACxB;AAEA,SAAgB,EAAgB,GAAkC;CAChE,OAAO,EAAO,CAAE,MAAM;AACxB;AAEA,SAAgB,EAAS,GAA2B;CAClD,OAAO,EAAO,CAAE,MAAM;AACxB;AAEA,SAAgB,EAAe,GAAiC;CAC9D,OAAO,EAAO,CAAE,MAAM;AACxB;AAEA,SAAgB,EAAgB,GAAkC;CAChE,OAAO,EAAO,CAAE,MAAM;AACxB;;;ACnFA,IAAM,IAAS;AAEf,SAAgB,EAAQ,GAAgB,GAAmD;CAEzF,IAAM,IADY,EAAO,aACV,CAAA,CAAU,cAAc,KAAK;CAC5C,IAAI,CAAC,GAAQ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file":"index.js","names":["svgAttr","svgCreate","Diagram","CroppingConnectionDocking","BaseRenderer","SelectionModule","ZoomScrollModule","MoveCanvasModule","LassoToolModule","ModelingModule","MoveModule","OutlineModule","ResizeModule","BaseLayouter","RulesModule","RuleProvider","CommandInterceptor","PaletteModule","CreateModule","ConnectModule","ConnectionPreviewModule","ContextPadModule","CopyPasteModule","CopyPaste","SHAPE_KINDS","kindOf","el","isTtElement","kind","isTtTeam","isTtInteraction","isTtFlow","isTtAnnotation","isTtAssociation","MARGIN","saveSVG","source","canvas","minX","minY","maxX","maxY","elementRegistry","s","x","y","width","height","clone","viewport","ROOT_ID","sizeToCss","value","TtBaseViewer","options","container","modules","name","event","priority","callback","diagram","eventBus","importer","warnings","doc","root","current","partial","registry","e","rect","W","H","cw","ch","pad","topInset","target","TtElementFactory","elementFactory","node","shape","annotation","getMid","spec","TEAM_TYPE_SPECS","type","newId","label","INTERACTION_MODE_SPECS","mode","FLOW_SPEC","ANNOTATION_SPEC","text","ttModelModule","MIRAGON","TT_RENDER_PRIORITY","INK","INK_SOFT","FONT","LABEL_INSET","ANNOTATION_PADDING","LINE_HEIGHT","flowHeadWidth","labelLayout","element","wrapLabel","maxChars","maxWidth","fontSize","paragraphs","lines","paragraph","words","word","candidate","TeamTopologiesRenderer","visuals","attr","create","append","line","waypointsPath","connection","team","w","h","sw","dash","dashArray","outline","i","iw","ih","c","octagon","attrs","rx","common","glyph","pts","skew","head","shaft","top","bot","p","arrow","arm","bracket","layout","box","lineHeight","centred","startY","ln","t","idx","waypoints","point","ttDrawModule","TtImporter","factory","connectionDocking","existing","flow","interaction","association","elements","connections","shapes","TtExporter","meta","nodes","interactions","flows","annotations","geom","position","size","attachedTo","attachedElementId","DOCUMENT_VERSION","ioModule","Viewer","NavigatedViewer","setOrDelete","obj","key","UpdatePropertiesHandler","context","old","properties","oldProperties","UPDATE_PROPERTIES","ANNOTATION_GAP","TtModeling","commandStack","modeling","associations","TtLayouter","hints","ttModelingModule","isAttachable","TtRules","ttRulesModule","TtFlatModelBehavior","TtAssociationBehavior","previous","other","ttBehaviorsModule","svg","inner","teamIconSvg","flowIconSvg","annotationIconSvg","lassoIconSvg","interactionIconSvg","GROUP_TOOLS","GROUP_TEAMS","GROUP_MODES","GROUP_GUIDES","entryHtml","draggable","title","icon","TtPaletteProvider","lassoTool","palette","entries","lassoTitle","ALL_TEAM_SPECS","start","ALL_INTERACTION_SPECS","startFlow","\"flow\"","startAnnotation","annotationTitle","\"annotation\"","ttPaletteModule","ICON_EDIT","ICON_DELETE","ICON_LINK","ICON_ANNOTATION","iconMarkup","path","cpHtml","TtContextPadProvider","ttModeling","labelEditing","connect","selection","contextPad","startConnect","ttContextPadModule","EDITING_MARKER","MIN_EDITOR_WIDTH","TtLabelEditing","scale","viewbox","left","boxHeight","editor","fitToContent","contentHeight","done","cleanup","onKey","onBlur","commit","changed","ttLabelEditingModule","NUDGE_STEP","NUDGE_STEP_FAST","ARROW_DIRECTIONS","isTypingTarget","isShape","TtKeyboard","onKeyDown","cmd","sel","copyPaste","rules","direction","step","ttKeyboardModule","pasteIdPrefix","ttKind","TtCopyPaste","clipboard","mouse","prefix","TT_PROPS","ttCopyPasteModule","prop","tier","isOrdered","TtZOrder","ordered","a","b","wrapper","layer","ttZOrderModule","Modeler"],"sources":["../src/model/di-types.ts","../src/io/saveSvg.ts","../src/io/types.ts","../src/TtBaseViewer.ts","../src/model/TtElementFactory.ts","../src/model/index.ts","../src/theme/palette.ts","../src/draw/styles.ts","../src/draw/label-layout.ts","../src/draw/TeamTopologiesRenderer.ts","../src/draw/index.ts","../src/io/TtImporter.ts","../src/io/TtExporter.ts","../src/io/index.ts","../src/Viewer.ts","../src/NavigatedViewer.ts","../src/modeling/cmd/UpdatePropertiesHandler.ts","../src/modeling/TtModeling.ts","../src/modeling/TtLayouter.ts","../src/modeling/index.ts","../src/rules/TtRules.ts","../src/rules/index.ts","../src/behaviors/TtFlatModelBehavior.ts","../src/behaviors/TtAssociationBehavior.ts","../src/behaviors/index.ts","../src/draw/palette-icons.ts","../src/palette/TtPaletteProvider.ts","../src/palette/index.ts","../src/draw/icons.ts","../src/context-pad/TtContextPadProvider.ts","../src/context-pad/index.ts","../src/label-editing/TtLabelEditing.ts","../src/label-editing/index.ts","../src/keyboard/TtKeyboard.ts","../src/keyboard/index.ts","../src/copy-paste/TtCopyPaste.ts","../src/copy-paste/TtCopyPasteProps.ts","../src/copy-paste/index.ts","../src/zorder/TtZOrder.ts","../src/zorder/index.ts","../src/Modeler.ts"],"sourcesContent":["/**\n * diagram-js runtime model for the Team Topologies notation. Every element is a\n * placed, resizable SHAPE discriminated by `ttKind`:\n * - `team` — one of the four team types (label inside the box)\n * - `interaction` — a mode glyph (parallelogram / triangle / circle), 50%\n * transparent, overlaid on the boundary between teams\n * - `flow` — the \"flow of change\" arrow guide\n * - `annotation` — a free-text note (BPMN-style open bracket)\n *\n * The only connection is the `association`: the dashed connector from an\n * annotation to the element it is attached to.\n *\n * These runtime properties are the source of truth while editing; the exporter\n * rebuilds the canonical `TtDocument` from them.\n */\n\nimport type { Connection, Shape } from \"diagram-js/lib/model/Types\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\n\nexport type TtKind = \"team\" | \"interaction\" | \"flow\" | \"annotation\";\n\nexport interface TtTeam extends Shape {\n ttKind: \"team\";\n teamType: TeamType;\n /** Display name (separate from diagram-js `label`). */\n ttLabel?: string;\n description?: string;\n fill?: string;\n stroke?: string;\n}\n\nexport interface TtInteraction extends Shape {\n ttKind: \"interaction\";\n mode: InteractionMode;\n ttLabel?: string;\n fill?: string;\n stroke?: string;\n}\n\nexport interface TtFlow extends Shape {\n ttKind: \"flow\";\n ttLabel?: string;\n}\n\nexport interface TtAnnotation extends Shape {\n ttKind: \"annotation\";\n /** The annotation text (may contain line breaks). */\n ttLabel?: string;\n}\n\nexport interface TtAssociation extends Connection {\n ttKind: \"association\";\n}\n\nexport type TtElement = TtTeam | TtInteraction | TtFlow | TtAnnotation;\n\nconst SHAPE_KINDS: ReadonlySet<string> = new Set<TtKind>([\n \"team\",\n \"interaction\",\n \"flow\",\n \"annotation\",\n]);\n\nfunction kindOf(el: unknown): string | undefined {\n return typeof el === \"object\" && el !== null\n ? ((el as { ttKind?: unknown }).ttKind as string | undefined)\n : undefined;\n}\n\nexport function isTtElement(el: unknown): el is TtElement {\n const kind = kindOf(el);\n return kind !== undefined && SHAPE_KINDS.has(kind);\n}\n\nexport function isTtTeam(el: unknown): el is TtTeam {\n return kindOf(el) === \"team\";\n}\n\nexport function isTtInteraction(el: unknown): el is TtInteraction {\n return kindOf(el) === \"interaction\";\n}\n\nexport function isTtFlow(el: unknown): el is TtFlow {\n return kindOf(el) === \"flow\";\n}\n\nexport function isTtAnnotation(el: unknown): el is TtAnnotation {\n return kindOf(el) === \"annotation\";\n}\n\nexport function isTtAssociation(el: unknown): el is TtAssociation {\n return kindOf(el) === \"association\";\n}\n","/**\n * Serialises the current canvas into a standalone SVG (snapshot / export),\n * fitted to the content bounds and independent of the current zoom / scroll.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport { isTtElement } from \"../model/di-types.js\";\n\nconst MARGIN = 40;\n\nexport function saveSVG(canvas: Canvas, elementRegistry: ElementRegistry): { svg: string } {\n const container = canvas.getContainer();\n const source = container.querySelector(\"svg\");\n if (!source) throw new Error(\"No SVG found in the canvas container.\");\n\n // Content bounds from the team shapes (interactions sit between them).\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const el of elementRegistry.getAll()) {\n if (!isTtElement(el)) continue;\n const s = el as unknown as { x: number; y: number; width: number; height: number };\n minX = Math.min(minX, s.x);\n minY = Math.min(minY, s.y);\n maxX = Math.max(maxX, s.x + s.width);\n maxY = Math.max(maxY, s.y + s.height);\n }\n if (!Number.isFinite(minX)) {\n minX = 0;\n minY = 0;\n maxX = 100;\n maxY = 100;\n }\n\n const x = minX - MARGIN;\n const y = minY - MARGIN;\n const width = maxX - minX + MARGIN * 2;\n const height = maxY - minY + MARGIN * 2;\n\n const clone = source.cloneNode(true) as SVGSVGElement;\n clone.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n clone.setAttribute(\"viewBox\", `${x} ${y} ${width} ${height}`);\n clone.setAttribute(\"width\", String(Math.round(width)));\n clone.setAttribute(\"height\", String(Math.round(height)));\n\n // Neutralise pan/zoom: let the viewBox (above) drive the geometry.\n const viewport = clone.querySelector<SVGGElement>(\".viewport\");\n if (viewport) viewport.removeAttribute(\"transform\");\n\n const svg = new XMLSerializer().serializeToString(clone);\n return { svg: '<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n' + svg };\n}\n","/** ID of the diagram-js root element holding the Team Topologies diagram. */\nexport const ROOT_ID = \"tt-root\";\n\nexport interface ImportWarning {\n readonly message: string;\n readonly elementId?: string;\n}\n\n/** Diagram-level metadata stashed on the root element. */\nexport interface RootBusinessObject {\n title: string;\n}\n","/**\n * Shared lifecycle & DI bootstrap for every Team Topologies viewer. Subclasses\n * only override `_getModules()`. The renderer\n * is framework-agnostic — mount it into any element (e.g. a VS Code webview).\n */\n\nimport Diagram from \"diagram-js/lib/Diagram\";\nimport type { ModuleDeclaration } from \"didi\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport type { TtDocument } from \"@miragon/team-topologies-schema-model\";\nimport { saveSVG } from \"./io/saveSvg.js\";\nimport type TtImporter from \"./io/TtImporter.js\";\nimport type TtExporter from \"./io/TtExporter.js\";\nimport { ROOT_ID, type ImportWarning, type RootBusinessObject } from \"./io/types.js\";\n\nexport interface TtViewerOptions {\n /** Host element. When absent, a detached <div> is created (attach later). */\n container?: HTMLElement;\n width?: number | string;\n height?: number | string;\n /** Appended to the module list (extension point). */\n additionalModules?: ModuleDeclaration[];\n}\n\nexport type EventCallback<T = unknown> = (event: T) => void;\n\ntype RootWithMeta = Root & { businessObject?: RootBusinessObject };\n\nfunction sizeToCss(value: number | string): string {\n return typeof value === \"number\" ? `${value}px` : value;\n}\n\nexport abstract class TtBaseViewer {\n protected abstract _getModules(): ModuleDeclaration[];\n\n private _diagram: Diagram | undefined;\n private readonly _container: HTMLElement;\n private readonly _options: TtViewerOptions;\n\n constructor(options: TtViewerOptions = {}) {\n this._options = options;\n this._container = this._createContainer(options);\n }\n\n private _createContainer(options: TtViewerOptions): HTMLElement {\n const container = options.container ?? document.createElement(\"div\");\n container.classList.add(\"tt-djs-container\");\n container.style.width = sizeToCss(options.width ?? \"100%\");\n container.style.height = sizeToCss(options.height ?? (options.container ? \"100%\" : \"600px\"));\n return container;\n }\n\n private _ensureDiagram(): Diagram {\n if (!this._diagram) {\n const modules = [...this._getModules(), ...(this._options.additionalModules ?? [])];\n this._diagram = new Diagram({ canvas: { container: this._container }, modules });\n }\n return this._diagram;\n }\n\n /** Resolve a diagram-js service from the didi injector. */\n get<T>(name: string): T {\n return this._ensureDiagram().get<T>(name);\n }\n\n on<T = unknown>(event: string, callback: EventCallback<T>, priority = 1000): void {\n this.get<EventBus>(\"eventBus\").on(event, priority, callback as EventCallback);\n }\n\n off(event: string, callback: EventCallback): void {\n this.get<EventBus>(\"eventBus\").off(event, callback);\n }\n\n /** Load a document into the canvas (replaces existing content). */\n importDocument(doc: TtDocument): { warnings: ImportWarning[] } {\n const diagram = this._ensureDiagram();\n const eventBus = diagram.get<EventBus>(\"eventBus\");\n const importer = diagram.get<TtImporter>(\"ttImporter\");\n importer.clear();\n const warnings = importer.import(doc);\n this._fit();\n eventBus.fire(\"import.done\", { warnings });\n return { warnings };\n }\n\n /** Current canvas state as a canonical document. */\n exportDocument(): TtDocument {\n return this.get<TtExporter>(\"ttExporter\").export();\n }\n\n /** Update diagram-level metadata (title / flow-of-change) on the root. */\n setMeta(partial: Partial<RootBusinessObject>): void {\n const canvas = this.get<Canvas>(\"canvas\");\n let root: RootWithMeta | undefined;\n try {\n root = canvas.getRootElement() as RootWithMeta;\n } catch {\n return;\n }\n if (!root || root.id !== ROOT_ID) return;\n const current = root.businessObject ?? { title: \"Untitled team topology\" };\n root.businessObject = { ...current, ...partial };\n }\n\n /** Read diagram-level metadata (title / flow-of-change) from the root. */\n getMeta(): RootBusinessObject | undefined {\n try {\n const root = this.get<Canvas>(\"canvas\").getRootElement() as RootWithMeta;\n return root.businessObject;\n } catch {\n return undefined;\n }\n }\n\n /** Standalone, self-contained SVG snapshot. */\n saveSVG(): { svg: string } {\n return saveSVG(this.get<Canvas>(\"canvas\"), this.get<ElementRegistry>(\"elementRegistry\"));\n }\n\n /** Fit the content into the viewport, leaving room at the top for the palette. */\n private _fit(topInset = 84, pad = 56): void {\n const canvas = this.get<Canvas>(\"canvas\");\n const registry = this.get<ElementRegistry>(\"elementRegistry\");\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const el of registry.getAll()) {\n const e = el as { x?: number; y?: number; width?: number; height?: number };\n if (\n typeof e.x !== \"number\" ||\n typeof e.y !== \"number\" ||\n typeof e.width !== \"number\" ||\n typeof e.height !== \"number\"\n ) {\n continue;\n }\n minX = Math.min(minX, e.x);\n minY = Math.min(minY, e.y);\n maxX = Math.max(maxX, e.x + e.width);\n maxY = Math.max(maxY, e.y + e.height);\n }\n if (!Number.isFinite(minX)) return;\n\n const rect = this._container.getBoundingClientRect();\n const W = rect.width;\n const H = rect.height;\n const cw = Math.max(maxX - minX, 1);\n const ch = Math.max(maxY - minY, 1);\n if (!W || !H) {\n canvas.zoom(\"fit-viewport\");\n return;\n }\n const s = Math.min((W - 2 * pad) / cw, (H - topInset - pad) / ch, 1.25);\n canvas.viewbox({\n x: minX + cw / 2 - W / 2 / s,\n y: minY - topInset / s,\n width: W / s,\n height: H / s,\n });\n }\n\n /** Attach the container into `target`. */\n attachTo(target: HTMLElement): void {\n target.appendChild(this._container);\n this.get<Canvas>(\"canvas\").resized();\n }\n\n /** Detach the container from the DOM, preserving state. */\n detach(): void {\n this._container.remove();\n }\n\n clear(): void {\n this._ensureDiagram().clear();\n }\n\n destroy(): void {\n if (this._diagram) {\n this._diagram.destroy();\n this._diagram = undefined;\n }\n this._container.remove();\n }\n\n get container(): HTMLElement {\n return this._container;\n }\n}\n","/**\n * Creates diagram-js runtime elements carrying Team Topologies markers, from\n * canonical document elements (import) or from scratch (palette drag-to-create).\n * Teams, interaction glyphs, the flow arrow and annotations are shapes; the\n * annotation connector is the only connection.\n */\n\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport { getMid } from \"diagram-js/lib/layout/LayoutUtil\";\nimport {\n ANNOTATION_SPEC,\n FLOW_SPEC,\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n newId,\n} from \"@miragon/team-topologies-schema-model\";\nimport type {\n FlowShape,\n InteractionMode,\n InteractionShape,\n TeamNode,\n TeamType,\n TextAnnotation,\n} from \"@miragon/team-topologies-schema-model\";\nimport type {\n TtAnnotation,\n TtAssociation,\n TtElement,\n TtFlow,\n TtInteraction,\n TtTeam,\n} from \"./di-types.js\";\n\nexport default class TtElementFactory {\n static $inject = [\"elementFactory\"];\n\n constructor(private readonly elementFactory: ElementFactory) {}\n\n // --- from canonical document elements (import) -------------------------\n\n createTeam(node: TeamNode): TtTeam {\n return this.elementFactory.createShape({\n id: node.id,\n x: node.position.x,\n y: node.position.y,\n width: node.size.width,\n height: node.size.height,\n ttKind: \"team\",\n teamType: node.type,\n ttLabel: node.label,\n ...(node.description ? { description: node.description } : {}),\n ...(node.fill ? { fill: node.fill } : {}),\n ...(node.stroke ? { stroke: node.stroke } : {}),\n } as Partial<TtTeam>) as unknown as TtTeam;\n }\n\n createInteraction(shape: InteractionShape): TtInteraction {\n return this.elementFactory.createShape({\n id: shape.id,\n x: shape.position.x,\n y: shape.position.y,\n width: shape.size.width,\n height: shape.size.height,\n ttKind: \"interaction\",\n mode: shape.mode,\n ...(shape.label ? { ttLabel: shape.label } : {}),\n ...(shape.fill ? { fill: shape.fill } : {}),\n ...(shape.stroke ? { stroke: shape.stroke } : {}),\n } as Partial<TtInteraction>) as unknown as TtInteraction;\n }\n\n createFlow(shape: FlowShape): TtFlow {\n return this.elementFactory.createShape({\n id: shape.id,\n x: shape.position.x,\n y: shape.position.y,\n width: shape.size.width,\n height: shape.size.height,\n ttKind: \"flow\",\n ...(shape.label ? { ttLabel: shape.label } : {}),\n } as Partial<TtFlow>) as unknown as TtFlow;\n }\n\n createAnnotation(annotation: TextAnnotation): TtAnnotation {\n return this.elementFactory.createShape({\n id: annotation.id,\n x: annotation.position.x,\n y: annotation.position.y,\n width: annotation.size.width,\n height: annotation.size.height,\n ttKind: \"annotation\",\n ...(annotation.text ? { ttLabel: annotation.text } : {}),\n } as Partial<TtAnnotation>) as unknown as TtAnnotation;\n }\n\n /**\n * The connector of an imported, attached annotation. Its id is derived from\n * the annotation (connectors aren't stored in the document), so re-importing\n * the same document yields the same id.\n */\n createAssociation(annotation: TtAnnotation, target: TtElement): TtAssociation {\n return this.elementFactory.createConnection({\n id: `assoc_${annotation.id}`,\n ttKind: \"association\",\n source: annotation,\n target,\n waypoints: [getMid(annotation), getMid(target)],\n } as Partial<TtAssociation>) as unknown as TtAssociation;\n }\n\n // --- fresh, not-yet-placed shapes (palette / context-pad create) -------\n //\n // These set an explicit model-style id (`team_…`/`int_…`/`flow_…`, matching\n // the model package's factory). We must NOT fall back to diagram-js' own\n // auto-id: its counter starts at `shape_12` and is not advanced past ids that\n // come in via import, so a re-imported `shape_N` (an element created in a\n // previous session, then autosaved) collides with the next palette create —\n // the first placement after a reload then throws \"element already exists\".\n\n createNewTeam(type: TeamType, label?: string): TtTeam {\n const spec = TEAM_TYPE_SPECS[type];\n return this.elementFactory.createShape({\n id: newId(\"team\"),\n width: spec.defaultSize.width,\n height: spec.defaultSize.height,\n ttKind: \"team\",\n teamType: type,\n ttLabel: label ?? spec.label,\n } as Partial<TtTeam>) as unknown as TtTeam;\n }\n\n createNewInteraction(mode: InteractionMode): TtInteraction {\n const spec = INTERACTION_MODE_SPECS[mode];\n return this.elementFactory.createShape({\n id: newId(\"int\"),\n width: spec.defaultSize.width,\n height: spec.defaultSize.height,\n ttKind: \"interaction\",\n mode,\n } as Partial<TtInteraction>) as unknown as TtInteraction;\n }\n\n createNewFlow(): TtFlow {\n return this.elementFactory.createShape({\n id: newId(\"flow\"),\n width: FLOW_SPEC.defaultSize.width,\n height: FLOW_SPEC.defaultSize.height,\n ttKind: \"flow\",\n ttLabel: FLOW_SPEC.label,\n } as Partial<TtFlow>) as unknown as TtFlow;\n }\n\n createNewAnnotation(text?: string): TtAnnotation {\n return this.elementFactory.createShape({\n id: newId(\"ann\"),\n width: ANNOTATION_SPEC.defaultSize.width,\n height: ANNOTATION_SPEC.defaultSize.height,\n ttKind: \"annotation\",\n ...(text ? { ttLabel: text } : {}),\n } as Partial<TtAnnotation>) as unknown as TtAnnotation;\n }\n\n /** A not-yet-connected association; modeling sets its ends and waypoints. */\n createNewAssociation(): TtAssociation {\n return this.elementFactory.createConnection({\n id: newId(\"assoc\"),\n ttKind: \"association\",\n } as Partial<TtAssociation>) as unknown as TtAssociation;\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtElementFactory from \"./TtElementFactory.js\";\n\n/** Element factory with Team Topologies defaults. */\nexport const ttModelModule: ModuleDeclaration = {\n ttElementFactory: [\"type\", TtElementFactory],\n};\n\nexport { default as TtElementFactory } from \"./TtElementFactory.js\";\nexport * from \"./di-types.js\";\n","/**\n * Miragon design tokens — the single source of truth for every non-notation colour in the renderer.\n *\n * Values mirror the Miragon corporate identity: the `miragon-brand:modeler-tool-design` skill in\n * `Miragon/corporate-identity`, whose vendored `cd-tokens.generated.css` (next to this file) defines\n * the `--cd-*` custom properties, generated from `brand/tokens.json`. Re-copy that CSS from the skill\n * to update; never fork the hex values by hand. `test/theme.sync.test.ts` fails if this mirror drifts\n * from the vendored CSS.\n *\n * Pure data — no DOM, no imports — so it stays inside the P1 DOM-free discipline and can be consumed\n * by the SVG-drawing constants in `draw/styles.ts`.\n *\n * Brand rule: blue leads (`blau` — surfaces, buttons, links, selection), green accents (`gruen` — key\n * visual, highlights; a fill, never body text on white). The four Team Topologies team-type and\n * interaction colours are the official notation and live in `schema-model/notation.ts` — they are NOT\n * part of this brand ramp.\n */\n\n/** Raw Miragon brand ramp + functional layer — exact `--cd-*` values. */\nexport const MIRAGON = {\n /** Primary: surfaces, buttons, links, selection, backgrounds. */\n blau: \"#335DE5\",\n /** Deeper blue for links / accent text on white (WCAG AA, ~5.5:1). */\n blauLink: \"#2B50D4\",\n /** Lightened blue for accents on dark surfaces (unused here — the canvas is light-only). */\n blauHell: \"#6B8AFF\",\n /** Accent: key visual, highlights, the brand gradient. Bright — a fill, never text on white. */\n gruen: \"#00E676\",\n /** Calm neutral surface (warm off-white) — the paper surround. */\n grau: \"#F9F7F7\",\n /** Text on light; not pure black. */\n schwarz: \"#1D1D1D\",\n weiss: \"#FFFFFF\",\n /** Functional / status layer (own layer beside the brand palette; AA as text on white). */\n success: \"#0B7A55\",\n warning: \"#92610A\",\n danger: \"#C92A2A\",\n info: \"#2B50D4\",\n /** Signature brand gradient — brand moments only. Use verbatim. */\n gradientBrand: \"linear-gradient(120deg, #335DE5 30%, #00E676)\",\n} as const;\n\n/**\n * Every `--cd-*` token this repo depends on, mapped to the value it MUST hold. The drift test parses\n * `cd-tokens.generated.css` and asserts each entry matches, so re-copying the vendored CSS with a\n * changed value fails CI until this mirror (and `MIRAGON`) is updated too.\n */\nexport const CD_TOKENS: Record<string, string> = {\n \"--cd-blau\": MIRAGON.blau,\n \"--cd-gruen\": MIRAGON.gruen,\n \"--cd-grau\": MIRAGON.grau,\n \"--cd-schwarz\": MIRAGON.schwarz,\n \"--cd-weiss\": MIRAGON.weiss,\n \"--cd-blau-link\": MIRAGON.blauLink,\n \"--cd-blau-hell\": MIRAGON.blauHell,\n \"--cd-success\": MIRAGON.success,\n \"--cd-success-soft\": \"rgba(11, 122, 85, 0.12)\",\n \"--cd-warning\": MIRAGON.warning,\n \"--cd-warning-soft\": \"rgba(146, 97, 10, 0.12)\",\n \"--cd-danger\": MIRAGON.danger,\n \"--cd-danger-soft\": \"rgba(201, 42, 42, 0.12)\",\n \"--cd-info\": MIRAGON.info,\n \"--cd-info-soft\": \"rgba(43, 80, 212, 0.12)\",\n \"--cd-gradient-brand\": MIRAGON.gradientBrand,\n};\n","/**\n * Shared rendering constants (typography, accent, priorities) — Miragon corporate identity.\n * Colours are derived from the single source of truth in `theme/palette.ts` (`MIRAGON`), which\n * mirrors the vendored `--cd-*` brand tokens.\n */\n\nimport { MIRAGON } from \"../theme/index.js\";\n\n/** BaseRenderer default priority is 1000; 1500 wins the render.shape/connection event. */\nexport const TT_RENDER_PRIORITY = 1500;\n\n/** Selection / hover accent (Miragon blue — kept in sync with the app theme via the shared palette). */\nexport const ACCENT = MIRAGON.blau;\n\nexport const INK = MIRAGON.schwarz;\nexport const INK_SOFT = \"#5B5B5B\";\n\nexport const FONT = {\n /**\n * Set directly as the `font-family` attribute on every SVG <text> (canvas\n * labels and therefore the SVG export too) — not inherited from a CSS\n * container. Prefers the self-hosted Miragon typeface Geist (registered as\n * 'Geist Variable' by @fontsource-variable/geist, with 'Geist' as a fallback\n * name), and falls back to a system sans when the host hasn't loaded it (e.g.\n * an exported SVG opened standalone).\n */\n family:\n \"'Geist Variable', 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif\",\n label: 13.5,\n small: 11,\n annotation: 12,\n} as const;\n\n/** Paper colour used for the label halo so text stays legible over lines. */\nexport const PAPER = MIRAGON.weiss;\n","/**\n * Where and how each element's text is laid out. Shared by the SVG renderer and\n * the inline label editor, so the editor sits exactly on top of the rendered\n * label and uses the same typography.\n */\n\nimport { isTtAnnotation, isTtFlow, isTtInteraction, type TtElement } from \"../model/di-types.js\";\nimport { FONT, INK, INK_SOFT } from \"./styles.js\";\n\n/** Horizontal padding between a shape's outline and its centred label. */\nconst LABEL_INSET = 10;\nconst ANNOTATION_PADDING = { left: 10, right: 6, top: 6, bottom: 6 };\nexport const LINE_HEIGHT = 1.2;\n\nexport interface LabelBox {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface LabelLayout {\n /** The area the text is laid out in, relative to the element's top-left corner. */\n box: LabelBox;\n /** `center`: centred both ways (shape labels). `left-top`: flows from the top-left (annotations). */\n align: \"center\" | \"left-top\";\n fontSize: number;\n fontWeight: string;\n letterSpacing?: string;\n fill: string;\n}\n\n/** Width of the flow arrow's head; the label stays on the shaft. */\nexport function flowHeadWidth(width: number, height: number): number {\n return Math.min(width * 0.16, height * 1.1);\n}\n\nexport function labelLayout(element: TtElement): LabelLayout {\n const width = Math.max(element.width, 1);\n const height = Math.max(element.height, 1);\n\n if (isTtAnnotation(element)) {\n return {\n box: {\n x: ANNOTATION_PADDING.left,\n y: ANNOTATION_PADDING.top,\n width: Math.max(width - ANNOTATION_PADDING.left - ANNOTATION_PADDING.right, 1),\n height: Math.max(height - ANNOTATION_PADDING.top - ANNOTATION_PADDING.bottom, 1),\n },\n align: \"left-top\",\n fontSize: FONT.annotation,\n fontWeight: \"450\",\n fill: INK,\n };\n }\n\n if (isTtFlow(element)) {\n const shaftWidth = width - flowHeadWidth(width, height);\n return {\n box: { x: LABEL_INSET, y: 0, width: shaftWidth - 2 * LABEL_INSET, height },\n align: \"center\",\n fontSize: FONT.small,\n fontWeight: \"650\",\n letterSpacing: \"0.06em\",\n fill: INK_SOFT,\n };\n }\n\n return {\n box: { x: LABEL_INSET, y: 0, width: width - 2 * LABEL_INSET, height },\n align: \"center\",\n fontSize: isTtInteraction(element) ? FONT.small : FONT.label,\n fontWeight: isTtInteraction(element) ? \"600\" : \"640\",\n fill: INK,\n };\n}\n\n/**\n * Greedy word-wrap into lines that roughly fit `maxWidth` at the font size.\n * Explicit line breaks are kept. Character-count based (not measured), so the\n * result is identical on every platform and exported SVGs stay stable.\n */\nexport function wrapLabel(text: string, maxWidth: number, fontSize: number): string[] {\n const maxChars = Math.max(4, Math.floor(maxWidth / (fontSize * 0.58)));\n const paragraphs = text.split(/\\r?\\n/);\n const lines: string[] = [];\n for (const paragraph of paragraphs) {\n const words = paragraph.split(/\\s+/).filter(Boolean);\n let current = \"\";\n for (const word of words) {\n const candidate = current ? `${current} ${word}` : word;\n if (candidate.length > maxChars && current) {\n lines.push(current);\n current = word;\n } else {\n current = candidate;\n }\n }\n lines.push(current);\n }\n while (lines.length > 0 && lines[lines.length - 1] === \"\") lines.pop();\n while (lines.length > 0 && lines[0] === \"\") lines.shift();\n return lines;\n}\n","/**\n * SVG rendering of the Team Topologies notation (BaseRenderer subclass):\n * - teams: SOLID resizable boxes (label wrapped inside), distinguished by shape\n * as well as colour;\n * - interactions: DASHED, 50%-transparent glyphs (collaboration = parallelogram,\n * x-as-a-service = triangle, facilitating = circle) laid over team boundaries;\n * - flow: a dashed \"flow of change\" arrow;\n * - annotations: a BPMN-style open bracket with free text, and the dashed\n * association connecting an annotation to the element it is attached to.\n *\n * Colours/shapes come from the single notation source (`@miragon/team-topologies-schema-model`).\n */\n\nimport BaseRenderer from \"diagram-js/lib/draw/BaseRenderer\";\nimport { append as svgAppend, create as svgCreate, attr as svgAttr } from \"tiny-svg\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type { ConnectionLike, ElementLike, ShapeLike } from \"diagram-js/lib/model/Types\";\nimport {\n FLOW_SPEC,\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n dashArray,\n} from \"@miragon/team-topologies-schema-model\";\nimport { FONT, INK_SOFT } from \"./styles.js\";\nimport { TT_RENDER_PRIORITY } from \"./styles.js\";\nimport {\n LINE_HEIGHT,\n flowHeadWidth,\n labelLayout,\n wrapLabel,\n type LabelLayout,\n} from \"./label-layout.js\";\nimport {\n isTtAnnotation,\n isTtAssociation,\n isTtElement,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtAnnotation,\n type TtFlow,\n type TtInteraction,\n type TtTeam,\n} from \"../model/di-types.js\";\n\ntype Attrs = Record<string, string | number>;\n\nexport default class TeamTopologiesRenderer extends BaseRenderer {\n static $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n super(eventBus, TT_RENDER_PRIORITY);\n }\n\n override canRender(element: ElementLike): boolean {\n return isTtElement(element) || isTtAssociation(element);\n }\n\n override drawShape(visuals: SVGElement, element: ShapeLike): SVGElement {\n if (isTtTeam(element)) return this.drawTeam(visuals, element);\n if (isTtInteraction(element)) return this.drawInteraction(visuals, element);\n if (isTtFlow(element)) return this.drawFlow(visuals, element);\n if (isTtAnnotation(element)) return this.drawAnnotation(visuals, element);\n const rect = svgAttr(svgCreate(\"rect\"), {\n width: element.width,\n height: element.height,\n fill: \"#eee\",\n });\n svgAppend(visuals, rect);\n return rect;\n }\n\n override drawConnection(visuals: SVGElement, connection: ConnectionLike): SVGElement {\n const line = svgAttr(svgCreate(\"path\"), {\n d: waypointsPath(connection.waypoints),\n fill: \"none\",\n stroke: INK_SOFT,\n \"stroke-width\": 1.5,\n \"stroke-dasharray\": \"4 4\",\n \"stroke-linecap\": \"round\",\n });\n svgAppend(visuals, line);\n return line;\n }\n\n override getShapePath(shape: ShapeLike): string {\n const { x, y, width, height } = shape;\n return `M${x},${y}l${width},0l0,${height}l${-width},0z`;\n }\n\n override getConnectionPath(connection: ConnectionLike): string {\n return waypointsPath(connection.waypoints);\n }\n\n // --- teams ---------------------------------------------------------------\n\n private drawTeam(visuals: SVGElement, team: TtTeam): SVGElement {\n const spec = TEAM_TYPE_SPECS[team.teamType] ?? TEAM_TYPE_SPECS[\"stream-aligned\"];\n const w = Math.max(team.width, 1);\n const h = Math.max(team.height, 1);\n const sw = spec.strokeWidth;\n const dash = dashArray(spec.strokeStyle, sw);\n const outline = this.teamOutline(spec.shape, w, h, sw, {\n fill: team.fill ?? spec.fill,\n stroke: team.stroke ?? spec.stroke,\n \"stroke-width\": sw,\n ...(dash ? { \"stroke-dasharray\": dash } : {}),\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, outline);\n this.appendLabel(visuals, team.ttLabel ?? \"\", labelLayout(team));\n return outline;\n }\n\n private teamOutline(kind: string, w: number, h: number, sw: number, attrs: Attrs): SVGElement {\n const i = sw / 2;\n const iw = w - sw;\n const ih = h - sw;\n if (kind === \"octagon\") {\n const c = Math.min(iw, ih) * 0.29;\n return svgAttr(svgCreate(\"polygon\"), { points: octagon(i, iw, ih, c), ...attrs });\n }\n const rx = kind === \"rect\" ? 4 : Math.min(20, ih / 2, iw / 2);\n return svgAttr(svgCreate(\"rect\"), { x: i, y: i, width: iw, height: ih, rx, ry: rx, ...attrs });\n }\n\n // --- interactions --------------------------------------------------------\n\n private drawInteraction(visuals: SVGElement, el: TtInteraction): SVGElement {\n const spec = INTERACTION_MODE_SPECS[el.mode] ?? INTERACTION_MODE_SPECS.collaboration;\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = 2;\n const i = sw / 2;\n const common: Attrs = {\n fill: el.fill ?? spec.fill,\n \"fill-opacity\": spec.opacity,\n stroke: el.stroke ?? spec.stroke,\n \"stroke-width\": sw,\n \"stroke-dasharray\": dashArray(spec.strokeStyle, sw) || \"6 4\",\n \"stroke-linejoin\": \"round\",\n };\n\n let glyph: SVGElement;\n if (spec.shape === \"circle\") {\n glyph = svgAttr(svgCreate(\"ellipse\"), {\n cx: w / 2,\n cy: h / 2,\n rx: (w - sw) / 2,\n ry: (h - sw) / 2,\n ...common,\n });\n } else if (spec.shape === \"triangle\") {\n // Point up — the tip indicates the direction the service is provided.\n const pts = `${w / 2},${i} ${w - i},${h - i} ${i},${h - i}`;\n glyph = svgAttr(svgCreate(\"polygon\"), { points: pts, ...common });\n } else {\n const skew = Math.min(w * 0.26, h * 0.85);\n const pts = `${i + skew},${i} ${w - i},${i} ${w - i - skew},${h - i} ${i},${h - i}`;\n glyph = svgAttr(svgCreate(\"polygon\"), { points: pts, ...common });\n }\n svgAppend(visuals, glyph);\n this.appendLabel(visuals, el.ttLabel ?? \"\", labelLayout(el));\n return glyph;\n }\n\n // --- flow of change ------------------------------------------------------\n\n private drawFlow(visuals: SVGElement, el: TtFlow): SVGElement {\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = FLOW_SPEC.strokeWidth;\n const i = sw / 2;\n const head = flowHeadWidth(w, h);\n const shaft = h * 0.5;\n const top = (h - shaft) / 2;\n const bot = top + shaft;\n const pts = [\n [i, top],\n [w - head, top],\n [w - head, i],\n [w - i, h / 2],\n [w - head, h - i],\n [w - head, bot],\n [i, bot],\n ]\n .map((p) => p.join(\",\"))\n .join(\" \");\n const arrow = svgAttr(svgCreate(\"polygon\"), {\n points: pts,\n fill: \"none\",\n stroke: FLOW_SPEC.stroke,\n \"stroke-width\": sw,\n \"stroke-dasharray\": dashArray(FLOW_SPEC.strokeStyle, sw) || \"6 4\",\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, arrow);\n this.appendLabel(visuals, el.ttLabel ?? \"\", labelLayout(el));\n return arrow;\n }\n\n // --- annotations ---------------------------------------------------------\n\n private drawAnnotation(visuals: SVGElement, el: TtAnnotation): SVGElement {\n const w = Math.max(el.width, 1);\n const h = Math.max(el.height, 1);\n const sw = 1.5;\n const i = sw / 2;\n const arm = Math.min(14, w / 2);\n const bracket = svgAttr(svgCreate(\"path\"), {\n d: `M${arm},${i} L${i},${i} L${i},${h - i} L${arm},${h - i}`,\n fill: \"none\",\n stroke: INK_SOFT,\n \"stroke-width\": sw,\n \"stroke-linejoin\": \"round\",\n });\n svgAppend(visuals, bracket);\n this.appendLabel(visuals, el.ttLabel ?? \"\", labelLayout(el));\n return bracket;\n }\n\n // --- shared label rendering (wrapped, no halo) ---------------------------\n\n private appendLabel(visuals: SVGElement, text: string, layout: LabelLayout): void {\n const { box, fontSize } = layout;\n const lines = wrapLabel(text, box.width, fontSize);\n const lineHeight = fontSize * LINE_HEIGHT;\n const centred = layout.align === \"center\";\n const x = centred ? box.x + box.width / 2 : box.x;\n const startY = centred\n ? box.y + box.height / 2 - ((lines.length - 1) * lineHeight) / 2\n : box.y + lineHeight / 2;\n lines.forEach((ln, idx) => {\n if (!ln) return;\n const t = svgAttr(svgCreate(\"text\"), {\n x,\n y: startY + idx * lineHeight,\n \"font-family\": FONT.family,\n \"font-size\": fontSize,\n fill: layout.fill,\n \"text-anchor\": centred ? \"middle\" : \"start\",\n \"dominant-baseline\": \"central\",\n \"font-weight\": layout.fontWeight,\n ...(layout.letterSpacing ? { \"letter-spacing\": layout.letterSpacing } : {}),\n });\n t.textContent = ln;\n svgAppend(visuals, t);\n });\n }\n}\n\n// --- helpers ---------------------------------------------------------------\n\nfunction octagon(i: number, w: number, h: number, c: number): string {\n return [\n [i + c, i],\n [i + w - c, i],\n [i + w, i + c],\n [i + w, i + h - c],\n [i + w - c, i + h],\n [i + c, i + h],\n [i, i + h - c],\n [i, i + c],\n ]\n .map((p) => p.join(\",\"))\n .join(\" \");\n}\n\nfunction waypointsPath(waypoints: ReadonlyArray<{ x: number; y: number }>): string {\n return waypoints.map((point, idx) => `${idx === 0 ? \"M\" : \"L\"}${point.x},${point.y}`).join(\" \");\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport CroppingConnectionDocking from \"diagram-js/lib/layout/CroppingConnectionDocking\";\nimport TeamTopologiesRenderer from \"./TeamTopologiesRenderer.js\";\n\n/**\n * SVG rendering of all Team Topologies element types (BaseRenderer, priority\n * 1500), plus the docking that crops annotation connectors to the outlines of\n * the shapes they join.\n */\nexport const ttDrawModule: ModuleDeclaration = {\n __init__: [\"ttRenderer\"],\n ttRenderer: [\"type\", TeamTopologiesRenderer],\n connectionDocking: [\"type\", CroppingConnectionDocking],\n};\n\nexport { default as TeamTopologiesRenderer } from \"./TeamTopologiesRenderer.js\";\n","/**\n * Bridges the canonical `TtDocument` into the diagram-js canvas. Stacking order\n * (back → front) is flows, teams, interactions, annotations, so the translucent\n * interaction glyphs read on top of the team boxes they overlay. Attached\n * annotations get their association connector last, once both ends exist.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type ConnectionDocking from \"diagram-js/lib/layout/ConnectionDocking\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport type { TtDocument } from \"@miragon/team-topologies-schema-model\";\nimport { isTtAnnotation, isTtElement, type TtAnnotation } from \"../model/di-types.js\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\nimport { ROOT_ID, type ImportWarning, type RootBusinessObject } from \"./types.js\";\n\ntype RootWithMeta = Root & { businessObject?: RootBusinessObject };\n\nexport default class TtImporter {\n static $inject = [\n \"canvas\",\n \"elementFactory\",\n \"ttElementFactory\",\n \"eventBus\",\n \"elementRegistry\",\n \"connectionDocking\",\n ];\n\n constructor(\n private readonly canvas: Canvas,\n private readonly elementFactory: ElementFactory,\n private readonly factory: TtElementFactory,\n private readonly eventBus: EventBus,\n private readonly elementRegistry: ElementRegistry,\n private readonly connectionDocking: ConnectionDocking,\n ) {}\n\n import(doc: TtDocument): ImportWarning[] {\n const warnings: ImportWarning[] = [];\n this.eventBus.fire(\"import.render.start\", { document: doc });\n\n let existing: RootWithMeta | undefined;\n try {\n existing = this.canvas.getRootElement() as RootWithMeta;\n } catch {\n existing = undefined;\n }\n let root: RootWithMeta;\n if (existing && existing.id === ROOT_ID) {\n root = existing;\n } else {\n root = this.elementFactory.createRoot({ id: ROOT_ID }) as RootWithMeta;\n this.canvas.setRootElement(root);\n }\n root.businessObject = { title: doc.title };\n\n // Back → front: flows, teams, interactions, annotations.\n for (const flow of doc.flows) {\n this.canvas.addShape(this.factory.createFlow(flow), root);\n }\n for (const node of doc.nodes) {\n this.canvas.addShape(this.factory.createTeam(node), root);\n }\n for (const interaction of doc.interactions) {\n this.canvas.addShape(this.factory.createInteraction(interaction), root);\n }\n for (const annotation of doc.annotations) {\n this.canvas.addShape(this.factory.createAnnotation(annotation), root);\n }\n for (const annotation of doc.annotations) {\n if (!annotation.attachedTo) continue;\n const source = this.elementRegistry.get(annotation.id) as TtAnnotation;\n const target = this.elementRegistry.get(annotation.attachedTo);\n if (!isTtElement(target) || isTtAnnotation(target)) {\n warnings.push({\n message: `Annotation \"${annotation.id}\" is attached to unknown element \"${annotation.attachedTo}\"; its connector was dropped.`,\n elementId: annotation.id,\n });\n continue;\n }\n const association = this.factory.createAssociation(source, target);\n association.waypoints = this.connectionDocking.getCroppedWaypoints(association);\n this.canvas.addConnection(association, root);\n }\n\n this.eventBus.fire(\"import.render.done\", { warnings });\n return warnings;\n }\n\n /** Removes every element (for re-import). */\n clear(): void {\n const elements = this.elementRegistry.getAll().filter((el) => el.id !== ROOT_ID);\n const connections = elements.filter((el) => \"waypoints\" in el);\n const shapes = elements.filter((el) => !(\"waypoints\" in el));\n for (const connection of connections) this.canvas.removeConnection(connection.id);\n for (const shape of shapes) {\n try {\n this.canvas.removeShape(shape.id);\n } catch {\n // already removed — ignore\n }\n }\n }\n}\n","/**\n * Rebuilds a canonical `TtDocument` from the diagram-js runtime model. Position\n * and size truth are the live `x/y/width/height`; editable fields (label, type,\n * mode, colours) are read from the runtime properties. An annotation's\n * `attachedTo` comes from its association connection.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type { Root } from \"diagram-js/lib/model/Types\";\nimport { DOCUMENT_VERSION } from \"@miragon/team-topologies-schema-model\";\nimport type {\n FlowShape,\n InteractionShape,\n TeamNode,\n TextAnnotation,\n TtDocument,\n} from \"@miragon/team-topologies-schema-model\";\nimport {\n isTtAnnotation,\n isTtAssociation,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtAnnotation,\n} from \"../model/di-types.js\";\nimport { ROOT_ID, type RootBusinessObject } from \"./types.js\";\n\nexport default class TtExporter {\n static $inject = [\"elementRegistry\", \"canvas\"];\n\n constructor(\n private readonly elementRegistry: ElementRegistry,\n private readonly canvas: Canvas,\n ) {}\n\n export(): TtDocument {\n let meta: RootBusinessObject | undefined;\n try {\n const root = this.canvas.getRootElement() as Root & {\n businessObject?: RootBusinessObject;\n };\n meta = root.businessObject;\n } catch {\n meta = undefined;\n }\n\n const nodes: TeamNode[] = [];\n const interactions: InteractionShape[] = [];\n const flows: FlowShape[] = [];\n const annotations: TextAnnotation[] = [];\n\n for (const el of this.elementRegistry.getAll()) {\n if (el.id === ROOT_ID) continue;\n const geom = el as unknown as { x: number; y: number; width: number; height: number };\n const position = { x: geom.x, y: geom.y };\n const size = { width: geom.width, height: geom.height };\n\n if (isTtTeam(el)) {\n nodes.push({\n id: el.id,\n type: el.teamType,\n label: el.ttLabel ?? \"\",\n position,\n size,\n ...(el.description ? { description: el.description } : {}),\n ...(el.fill ? { fill: el.fill } : {}),\n ...(el.stroke ? { stroke: el.stroke } : {}),\n });\n } else if (isTtInteraction(el)) {\n interactions.push({\n id: el.id,\n mode: el.mode,\n position,\n size,\n ...(el.ttLabel ? { label: el.ttLabel } : {}),\n ...(el.fill ? { fill: el.fill } : {}),\n ...(el.stroke ? { stroke: el.stroke } : {}),\n });\n } else if (isTtFlow(el)) {\n flows.push({\n id: el.id,\n position,\n size,\n ...(el.ttLabel ? { label: el.ttLabel } : {}),\n });\n } else if (isTtAnnotation(el)) {\n const attachedTo = attachedElementId(el);\n annotations.push({\n id: el.id,\n text: el.ttLabel ?? \"\",\n position,\n size,\n ...(attachedTo ? { attachedTo } : {}),\n });\n }\n }\n\n return {\n version: DOCUMENT_VERSION,\n title: meta?.title ?? \"Untitled team topology\",\n nodes,\n interactions,\n flows,\n annotations,\n };\n }\n}\n\nfunction attachedElementId(annotation: TtAnnotation): string | undefined {\n const connections = [...annotation.outgoing, ...annotation.incoming];\n const association = connections.find(isTtAssociation);\n if (!association) return undefined;\n const other = association.source === annotation ? association.target : association.source;\n return other?.id;\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtImporter from \"./TtImporter.js\";\nimport TtExporter from \"./TtExporter.js\";\n\n/** Document <-> diagram-js bridge (import / export). */\nexport const ioModule: ModuleDeclaration = {\n ttImporter: [\"type\", TtImporter],\n ttExporter: [\"type\", TtExporter],\n};\n\nexport { default as TtImporter } from \"./TtImporter.js\";\nexport { default as TtExporter } from \"./TtExporter.js\";\nexport { saveSVG } from \"./saveSvg.js\";\nexport { ROOT_ID } from \"./types.js\";\nexport type { ImportWarning, RootBusinessObject } from \"./types.js\";\n","import type { ModuleDeclaration } from \"didi\";\nimport { TtBaseViewer } from \"./TtBaseViewer.js\";\nimport { ttModelModule } from \"./model/index.js\";\nimport { ttDrawModule } from \"./draw/index.js\";\nimport { ioModule } from \"./io/index.js\";\n\n/** Read-only renderer: draws a Team Topologies diagram with no interaction. */\nexport class Viewer extends TtBaseViewer {\n protected _getModules(): ModuleDeclaration[] {\n return [ttModelModule, ttDrawModule, ioModule];\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport SelectionModule from \"diagram-js/lib/features/selection\";\nimport ZoomScrollModule from \"diagram-js/lib/navigation/zoomscroll\";\nimport MoveCanvasModule from \"diagram-js/lib/navigation/movecanvas\";\nimport { Viewer } from \"./Viewer.js\";\n\n/** Read-only + navigation: zoom (scroll), pan (drag), selection. */\nexport class NavigatedViewer extends Viewer {\n protected override _getModules(): ModuleDeclaration[] {\n return [...super._getModules(), SelectionModule, ZoomScrollModule, MoveCanvasModule];\n }\n}\n","/**\n * Generic, undo-able command that sets arbitrary Team Topologies properties\n * (ttLabel, teamType, mode, fill, stroke, description). Returns the changed\n * element so the CommandStack fires `elements.changed` → re-render.\n */\n\nimport type { ElementLike } from \"diagram-js/lib/core/Types\";\nimport type CommandHandler from \"diagram-js/lib/command/CommandHandler\";\n\nexport interface UpdatePropertiesContext {\n element: ElementLike & Record<string, unknown>;\n properties: Record<string, unknown>;\n /** set internally by the handler (for revert). */\n oldProperties?: Record<string, unknown>;\n}\n\nfunction setOrDelete(obj: Record<string, unknown>, key: string, value: unknown): void {\n if (value === undefined) delete obj[key];\n else obj[key] = value;\n}\n\nexport default class UpdatePropertiesHandler implements CommandHandler {\n execute(context: UpdatePropertiesContext): ElementLike[] {\n const { element, properties } = context;\n const target = element as unknown as Record<string, unknown>;\n const old: Record<string, unknown> = {};\n for (const key of Object.keys(properties)) {\n old[key] = target[key];\n setOrDelete(target, key, properties[key]);\n }\n context.oldProperties = old;\n return [element];\n }\n\n revert(context: UpdatePropertiesContext): ElementLike[] {\n const { element, oldProperties } = context;\n const target = element as unknown as Record<string, unknown>;\n if (oldProperties) {\n for (const key of Object.keys(oldProperties)) setOrDelete(target, key, oldProperties[key]);\n }\n return [element];\n }\n}\n","/**\n * High-level Team Topologies mutations that go through the command stack\n * (undo/redo). Registers the generic property command handler.\n */\n\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type { Element, Root } from \"diagram-js/lib/model/Types\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\nimport {\n isTtAssociation,\n type TtAnnotation,\n type TtElement,\n type TtInteraction,\n type TtTeam,\n} from \"../model/di-types.js\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\nimport UpdatePropertiesHandler from \"./cmd/UpdatePropertiesHandler.js\";\n\nconst UPDATE_PROPERTIES = \"element.updateProperties\";\n\n/** Gap between an element and an annotation appended to it. */\nconst ANNOTATION_GAP = 40;\n\nexport default class TtModeling {\n static $inject = [\"commandStack\", \"modeling\", \"ttElementFactory\", \"canvas\"];\n\n constructor(\n private readonly commandStack: CommandStack,\n private readonly modeling: Modeling,\n private readonly factory: TtElementFactory,\n private readonly canvas: Canvas,\n ) {\n commandStack.registerHandler(UPDATE_PROPERTIES, UpdatePropertiesHandler);\n }\n\n updateProperties(element: TtElement, properties: Record<string, unknown>): void {\n this.commandStack.execute(UPDATE_PROPERTIES, { element, properties });\n }\n\n /** Rename / relabel any element. */\n updateLabel(element: TtElement, label: string): void {\n this.updateProperties(element, { ttLabel: label || undefined });\n }\n\n setTeamType(team: TtTeam, teamType: TeamType): void {\n this.updateProperties(team, { teamType });\n }\n\n setInteractionMode(interaction: TtInteraction, mode: InteractionMode): void {\n this.updateProperties(interaction, { mode });\n }\n\n /** Set or clear per-element colour overrides (`undefined` reverts to default). */\n setColors(\n element: TtTeam | TtInteraction,\n fill: string | undefined,\n stroke: string | undefined,\n ): void {\n this.updateProperties(element, { fill, stroke });\n }\n\n setDescription(team: TtTeam, description: string | undefined): void {\n this.updateProperties(team, { description });\n }\n\n /** Places a new annotation to the upper right of `element`, attached to it, as one undo step. */\n appendAnnotation(element: TtElement): TtAnnotation {\n const annotation = this.factory.createNewAnnotation();\n const position = {\n x: element.x + element.width + ANNOTATION_GAP + annotation.width / 2,\n y: element.y - ANNOTATION_GAP / 4,\n };\n return this.modeling.appendShape(\n element as Element,\n annotation as Element,\n position,\n this.canvas.getRootElement() as Root,\n { connection: this.factory.createNewAssociation(), connectionTarget: element },\n ) as unknown as TtAnnotation;\n }\n\n /** Removes the annotation's connector; the annotation itself stays. */\n detachAnnotation(annotation: TtAnnotation): void {\n const associations = [...annotation.incoming, ...annotation.outgoing].filter(isTtAssociation);\n if (associations.length > 0) this.modeling.removeElements(associations);\n }\n}\n","/**\n * Lays every annotation connector out as a straight line between the centres of\n * the annotation and its element (the association behaviour then crops it to\n * both outlines). The anchor hints from move / resize / connect are ignored on\n * purpose, so the connector never drifts off-centre.\n */\n\nimport BaseLayouter, { type LayoutConnectionHints } from \"diagram-js/lib/layout/BaseLayouter\";\nimport { getMid } from \"diagram-js/lib/layout/LayoutUtil\";\nimport type { Connection } from \"diagram-js/lib/model/Types\";\nimport type { Point } from \"diagram-js/lib/util/Types\";\n\nexport default class TtLayouter extends BaseLayouter {\n override layoutConnection(connection: Connection, hints: LayoutConnectionHints = {}): Point[] {\n const source = hints.source ?? connection.source;\n const target = hints.target ?? connection.target;\n if (!source || !target) return super.layoutConnection(connection, hints);\n return [getMid(source), getMid(target)];\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport ModelingModule from \"diagram-js/lib/features/modeling\";\nimport TtModeling from \"./TtModeling.js\";\nimport TtLayouter from \"./TtLayouter.js\";\n\n/**\n * High-level Team Topologies mutations + registration of the command handlers.\n * Depends on the diagram-js modeling module so our `layouter` replaces its\n * default one.\n */\nexport const ttModelingModule: ModuleDeclaration = {\n __depends__: [ModelingModule],\n __init__: [\"ttModeling\"],\n ttModeling: [\"type\", TtModeling],\n layouter: [\"type\", TtLayouter],\n};\n\nexport { default as TtModeling } from \"./TtModeling.js\";\nexport { default as TtLayouter } from \"./TtLayouter.js\";\n","/**\n * Allowed editing operations. Every Team Topologies element is a free, placed\n * shape — movable, creatable and resizable. The only connection is an\n * annotation's connector to a team, interaction or flow (the official notation\n * models interactions as overlapping shapes, not lines).\n */\n\nimport RuleProvider from \"diagram-js/lib/features/rules/RuleProvider\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtAnnotation, isTtElement } from \"../model/di-types.js\";\n\ninterface MoveContext {\n target?: { parent?: unknown } | null;\n}\n\ninterface ConnectContext {\n source?: unknown;\n target?: unknown;\n}\n\nfunction isAttachable(element: unknown): boolean {\n return isTtElement(element) && !isTtAnnotation(element);\n}\n\nexport default class TtRules extends RuleProvider {\n static override $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n super(eventBus);\n }\n\n override init(): void {\n this.addRule([\"shape.move\", \"elements.move\"], (context: MoveContext) =>\n context.target && context.target.parent ? null : true,\n );\n this.addRule(\"shape.create\", () => true);\n this.addRule(\"shape.resize\", () => true);\n this.addRule(\"element.copy\", () => true);\n this.addRule(\"connection.create\", ({ source, target }: ConnectContext) =>\n (isTtAnnotation(source) && isAttachable(target)) ||\n (isTtAnnotation(target) && isAttachable(source))\n ? { ttKind: \"association\" }\n : false,\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport RulesModule from \"diagram-js/lib/features/rules\";\nimport TtRules from \"./TtRules.js\";\n\n/** Team Topologies editing rules (connect, move, create, resize). */\nexport const ttRulesModule: ModuleDeclaration = {\n __depends__: [RulesModule],\n __init__: [\"ttRules\"],\n ttRules: [\"type\", TtRules],\n};\n\nexport { default as TtRules } from \"./TtRules.js\";\n","/**\n * Keeps the diagram flat: Team Topologies shapes overlap but never nest.\n *\n * diagram-js parents a newly created shape to whatever element it is dropped on\n * (`context.parent` defaults to the drop target). Interaction glyphs are meant\n * to be placed *over* the teams they relate to, so the natural workflow would\n * otherwise nest the interaction inside a team — gluing it so it moves along\n * with the team. Force every created shape onto the diagram root instead.\n *\n * Re-parenting on *move* is prevented separately in TtRules.\n */\n\nimport CommandInterceptor from \"diagram-js/lib/command/CommandInterceptor\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\n\nexport default class TtFlatModelBehavior extends CommandInterceptor {\n static override $inject = [\"eventBus\", \"canvas\"];\n\n constructor(eventBus: EventBus, canvas: Canvas) {\n super(eventBus);\n\n this.preExecute(\n [\"shape.create\", \"elements.create\"],\n (context: { parent?: unknown }) => {\n context.parent = canvas.getRootElement();\n },\n true,\n );\n }\n}\n","/**\n * Keeps annotation connectors tidy while editing:\n * - crops every laid-out connector to the outlines of the two shapes it joins\n * (the layouter only knows their centres);\n * - an annotation is attached to at most one element (the document stores a\n * single `attachedTo`), so connecting it again replaces the old connector.\n */\n\nimport CommandInterceptor from \"diagram-js/lib/command/CommandInterceptor\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type ConnectionDocking from \"diagram-js/lib/layout/ConnectionDocking\";\nimport type { Connection } from \"diagram-js/lib/model/Types\";\nimport { isTtAnnotation, isTtAssociation } from \"../model/di-types.js\";\n\ninterface ConnectionContext {\n connection: Connection;\n cropped?: boolean;\n}\n\nexport default class TtAssociationBehavior extends CommandInterceptor {\n static override $inject = [\"eventBus\", \"connectionDocking\", \"modeling\"];\n\n constructor(eventBus: EventBus, connectionDocking: ConnectionDocking, modeling: Modeling) {\n super(eventBus);\n\n this.executed(\n [\"connection.layout\", \"connection.create\"],\n (context: ConnectionContext) => {\n if (context.cropped || !isTtAssociation(context.connection)) return;\n context.connection.waypoints = connectionDocking.getCroppedWaypoints(context.connection);\n context.cropped = true;\n },\n true,\n );\n\n this.reverted(\n \"connection.layout\",\n (context: ConnectionContext) => {\n delete context.cropped;\n },\n true,\n );\n\n this.postExecuted(\n \"connection.create\",\n (context: ConnectionContext) => {\n const connection = context.connection;\n if (!isTtAssociation(connection)) return;\n const annotation = isTtAnnotation(connection.source)\n ? connection.source\n : connection.target;\n if (!isTtAnnotation(annotation)) return;\n const previous = [...annotation.incoming, ...annotation.outgoing].filter(\n (other) => other !== connection && isTtAssociation(other),\n );\n if (previous.length > 0) modeling.removeElements(previous);\n },\n true,\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtFlatModelBehavior from \"./TtFlatModelBehavior.js\";\nimport TtAssociationBehavior from \"./TtAssociationBehavior.js\";\n\n/**\n * Editing behaviors that keep the Team Topologies model flat (no nesting) and\n * annotation connectors cropped and one per annotation.\n */\nexport const ttBehaviorsModule: ModuleDeclaration = {\n __init__: [\"ttFlatModelBehavior\", \"ttAssociationBehavior\"],\n ttFlatModelBehavior: [\"type\", TtFlatModelBehavior],\n ttAssociationBehavior: [\"type\", TtAssociationBehavior],\n};\n\nexport { default as TtFlatModelBehavior } from \"./TtFlatModelBehavior.js\";\nexport { default as TtAssociationBehavior } from \"./TtAssociationBehavior.js\";\n","/**\n * Tiny inline-SVG glyphs for the palette entries — the same shapes the canvas\n * draws (so the palette is a faithful preview of each team type / interaction\n * mode). Returned as HTML strings for diagram-js palette `html`.\n */\n\nimport {\n INTERACTION_MODE_SPECS,\n TEAM_TYPE_SPECS,\n dashArray,\n} from \"@miragon/team-topologies-schema-model\";\nimport type { InteractionMode, TeamType } from \"@miragon/team-topologies-schema-model\";\nimport { INK_SOFT } from \"./styles.js\";\n\nfunction svg(inner: string): string {\n return `<svg class=\"tt-palette-svg\" width=\"24\" height=\"24\" viewBox=\"0 0 26 26\" aria-hidden=\"true\">${inner}</svg>`;\n}\n\nexport function teamIconSvg(type: TeamType): string {\n const s = TEAM_TYPE_SPECS[type];\n const dash = dashArray(s.strokeStyle, 1.5);\n const common =\n `fill=\"${s.fill}\" stroke=\"${s.stroke}\" stroke-width=\"1.5\"` +\n (dash ? ` stroke-dasharray=\"${dash}\"` : \"\");\n switch (s.shape) {\n case \"octagon\":\n return svg(`<polygon points=\"8,3 18,3 23,8 23,18 18,23 8,23 3,18 3,8\" ${common}/>`);\n case \"rounded-rect-vertical\":\n return svg(`<rect x=\"8\" y=\"3\" width=\"10\" height=\"20\" rx=\"4\" ${common}/>`);\n case \"rect\":\n return svg(`<rect x=\"3\" y=\"7\" width=\"20\" height=\"12\" rx=\"1.5\" ${common}/>`);\n default:\n return svg(`<rect x=\"3\" y=\"8\" width=\"20\" height=\"10\" rx=\"5\" ${common}/>`);\n }\n}\n\nexport function flowIconSvg(): string {\n return svg(\n `<g fill=\"none\" stroke=\"#6b6459\" stroke-width=\"1.5\" stroke-linejoin=\"round\" stroke-dasharray=\"3 2\">` +\n `<polygon points=\"3,9 16,9 16,5 23,13 16,21 16,17 3,17\"/></g>`,\n );\n}\n\nexport function annotationIconSvg(): string {\n return svg(\n `<g fill=\"none\" stroke=\"${INK_SOFT}\" stroke-width=\"1.5\" stroke-linecap=\"round\">` +\n `<path d=\"M10 4H5v18h5\"/><path d=\"M13 9h9M13 13h9M13 17h6\"/></g>`,\n );\n}\n\n/** Dashed selection frame with a pointer — the lasso (multi-select) tool. */\nexport function lassoIconSvg(): string {\n return svg(\n `<rect x=\"3\" y=\"3\" width=\"16\" height=\"13\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-dasharray=\"3 2\"/>` +\n `<path d=\"M14 12l9 3.6-3.8 1.4-1.4 3.8z\" fill=\"currentColor\"/>`,\n );\n}\n\nexport function interactionIconSvg(mode: InteractionMode): string {\n const s = INTERACTION_MODE_SPECS[mode];\n const dash = dashArray(s.strokeStyle, 1.5);\n const common =\n `fill=\"${s.fill}\" fill-opacity=\"${s.opacity}\" stroke=\"${s.stroke}\" stroke-width=\"1.5\"` +\n (dash ? ` stroke-dasharray=\"${dash}\"` : \"\");\n switch (s.shape) {\n case \"circle\":\n return svg(`<circle cx=\"13\" cy=\"13\" r=\"9\" ${common}/>`);\n case \"triangle\":\n return svg(`<polygon points=\"5,6 22,13 5,20\" ${common}/>`);\n default:\n return svg(`<polygon points=\"9,6 23,6 17,20 3,20\" ${common}/>`);\n }\n}\n","/**\n * The floating tool palette (styled top-centre, Excalidraw style). It starts\n * with the lasso (multi-select) tool; every other entry is drag-to-create: the\n * four team types, the three interaction-mode glyphs (placed over team\n * boundaries), the flow-of-change arrow and the text annotation.\n */\n\nimport type Palette from \"diagram-js/lib/features/palette/Palette\";\nimport type Create from \"diagram-js/lib/features/create/Create\";\nimport type LassoTool from \"diagram-js/lib/features/lasso-tool/LassoTool\";\nimport type {\n PaletteEntries,\n default as PaletteProvider,\n} from \"diagram-js/lib/features/palette/PaletteProvider\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\nimport {\n ALL_INTERACTION_SPECS,\n ALL_TEAM_SPECS,\n ANNOTATION_SPEC,\n FLOW_SPEC,\n} from \"@miragon/team-topologies-schema-model\";\nimport {\n annotationIconSvg,\n flowIconSvg,\n interactionIconSvg,\n lassoIconSvg,\n teamIconSvg,\n} from \"../draw/palette-icons.js\";\nimport type TtElementFactory from \"../model/TtElementFactory.js\";\n\n/** diagram-js highlights the active tool only inside a group named exactly `tools`. */\nconst GROUP_TOOLS = \"tools\";\nconst GROUP_TEAMS = \"tt-1-teams\";\nconst GROUP_MODES = \"tt-2-modes\";\nconst GROUP_GUIDES = \"tt-3-guides\";\n\nfunction entryHtml(icon: string, title: string, draggable = true): string {\n return `<div class=\"entry tt-palette-entry\" draggable=\"${draggable}\" title=\"${title}\">${icon}</div>`;\n}\n\nexport default class TtPaletteProvider implements PaletteProvider {\n static $inject = [\"palette\", \"create\", \"ttElementFactory\", \"lassoTool\"];\n\n constructor(\n palette: Palette,\n private readonly create: Create,\n private readonly factory: TtElementFactory,\n private readonly lassoTool: LassoTool,\n ) {\n palette.registerProvider(this);\n }\n\n getPaletteEntries(): PaletteEntries {\n const entries: PaletteEntries = {};\n\n const lassoTitle = \"Select several elements (or Shift + drag on the canvas)\";\n entries[\"lasso-tool\"] = {\n group: GROUP_TOOLS,\n title: lassoTitle,\n html: entryHtml(lassoIconSvg(), lassoTitle, false),\n action: { click: (event: Event) => this.lassoTool.activateSelection(event as MouseEvent) },\n };\n\n for (const spec of ALL_TEAM_SPECS) {\n const start = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewTeam(spec.type, spec.label) as unknown as Element,\n );\n entries[`team.${spec.type}`] = {\n group: GROUP_TEAMS,\n title: `${spec.label} team — ${spec.description}`,\n html: entryHtml(teamIconSvg(spec.type), `${spec.label} team — ${spec.description}`),\n action: { dragstart: start, click: start },\n };\n }\n\n for (const spec of ALL_INTERACTION_SPECS) {\n const start = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewInteraction(spec.mode) as unknown as Element,\n );\n entries[`mode.${spec.mode}`] = {\n group: GROUP_MODES,\n title: `${spec.label} — ${spec.description} (place over the teams it relates to)`,\n html: entryHtml(interactionIconSvg(spec.mode), `${spec.label} — ${spec.description}`),\n action: { dragstart: start, click: start },\n };\n }\n\n const startFlow = (event: Event) =>\n this.create.start(event as MouseEvent, this.factory.createNewFlow() as unknown as Element);\n entries[\"flow\"] = {\n group: GROUP_GUIDES,\n title: `${FLOW_SPEC.label} — the implied left-to-right flow`,\n html: entryHtml(flowIconSvg(), FLOW_SPEC.label),\n action: { dragstart: startFlow, click: startFlow },\n };\n\n const startAnnotation = (event: Event) =>\n this.create.start(\n event as MouseEvent,\n this.factory.createNewAnnotation() as unknown as Element,\n );\n const annotationTitle = `${ANNOTATION_SPEC.label} — a free-text note beside the diagram`;\n entries[\"annotation\"] = {\n group: GROUP_GUIDES,\n title: annotationTitle,\n html: entryHtml(annotationIconSvg(), annotationTitle),\n action: { dragstart: startAnnotation, click: startAnnotation },\n };\n\n return entries;\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport PaletteModule from \"diagram-js/lib/features/palette\";\nimport CreateModule from \"diagram-js/lib/features/create\";\nimport LassoToolModule from \"diagram-js/lib/features/lasso-tool\";\nimport TtPaletteProvider from \"./TtPaletteProvider.js\";\n\n/** Tool palette (lasso, drag-to-create teams, interactions, flows and annotations). */\nexport const ttPaletteModule: ModuleDeclaration = {\n __depends__: [PaletteModule, CreateModule, LassoToolModule],\n __init__: [\"ttPaletteProvider\"],\n ttPaletteProvider: [\"type\", TtPaletteProvider],\n};\n\nexport { default as TtPaletteProvider } from \"./TtPaletteProvider.js\";\n","/**\n * A handful of Material-style icon paths (Apache-2.0) used by the context pad,\n * exposed as HTML markup. Reusable by host chrome too.\n */\n\nexport const ICON_ARROW_FORWARD = \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\";\nexport const ICON_EDIT =\n \"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\";\nexport const ICON_DELETE =\n \"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z\";\nexport const ICON_LINK =\n \"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\";\n/** An open bracket with text lines — the annotation glyph. */\nexport const ICON_ANNOTATION = \"M4 3h5v2H6v14h3v2H4V3zm7 4h9v2h-9V7zm0 4h9v2h-9v-2zm0 4h6v2h-6v-2z\";\nexport const ICON_SWAP = \"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z\";\n\nexport function iconMarkup(path: string, size = 18): string {\n return `<svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"${path}\"/></svg>`;\n}\n","/**\n * Context-pad actions. Teams, interactions and flows: rename, add an attached\n * annotation, delete. Annotations: edit text, connect to an element, delete. An\n * annotation connector: delete. A multi-selection: delete all.\n */\n\nimport type ContextPad from \"diagram-js/lib/features/context-pad/ContextPad\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type Connect from \"diagram-js/lib/features/connect/Connect\";\nimport type Selection from \"diagram-js/lib/features/selection/Selection\";\nimport type {\n ContextPadEntries,\n ContextPadEntry,\n default as ContextPadProvider,\n} from \"diagram-js/lib/features/context-pad/ContextPadProvider\";\nimport type { Element } from \"diagram-js/lib/model/Types\";\nimport { isTtAnnotation, isTtAssociation, isTtElement, type TtElement } from \"../model/di-types.js\";\nimport type TtLabelEditing from \"../label-editing/TtLabelEditing.js\";\nimport type TtModeling from \"../modeling/TtModeling.js\";\nimport { ICON_ANNOTATION, ICON_DELETE, ICON_EDIT, ICON_LINK, iconMarkup } from \"../draw/icons.js\";\n\nfunction cpHtml(path: string, title: string): string {\n return `<div class=\"entry tt-cp-entry\" title=\"${title}\">${iconMarkup(path)}</div>`;\n}\n\nexport default class TtContextPadProvider implements ContextPadProvider {\n static $inject = [\n \"contextPad\",\n \"modeling\",\n \"ttModeling\",\n \"ttLabelEditing\",\n \"connect\",\n \"selection\",\n ];\n\n constructor(\n contextPad: ContextPad,\n private readonly modeling: Modeling,\n private readonly ttModeling: TtModeling,\n private readonly labelEditing: TtLabelEditing,\n private readonly connect: Connect,\n private readonly selection: Selection,\n ) {\n contextPad.registerProvider(this);\n }\n\n getContextPadEntries(element: Element): ContextPadEntries {\n if (isTtAssociation(element))\n return { delete: this.deleteEntry([element], \"Remove connector\") };\n if (!isTtElement(element)) return {};\n\n if (isTtAnnotation(element)) {\n const startConnect = (event: Event) => this.connect.start(event as MouseEvent, element);\n return {\n \"edit-label\": this.editEntry(element, \"Edit text\"),\n connect: {\n group: \"edit\",\n title: \"Attach to an element\",\n html: cpHtml(ICON_LINK, \"Attach to an element\"),\n action: { click: startConnect, dragstart: startConnect },\n },\n delete: this.deleteEntry([element], \"Delete\"),\n };\n }\n\n return {\n \"edit-label\": this.editEntry(element, \"Rename\"),\n \"append-annotation\": {\n group: \"edit\",\n title: \"Add annotation\",\n html: cpHtml(ICON_ANNOTATION, \"Add annotation\"),\n action: {\n click: () => {\n const annotation = this.ttModeling.appendAnnotation(element);\n this.selection.select(annotation as unknown as Element);\n this.labelEditing.activate(annotation);\n },\n },\n },\n delete: this.deleteEntry([element], \"Delete\"),\n };\n }\n\n getMultiElementContextPadEntries(elements: Element[]): ContextPadEntries {\n return { delete: this.deleteEntry(elements, `Delete ${elements.length} elements`) };\n }\n\n private editEntry(element: TtElement, title: string): ContextPadEntry {\n return {\n group: \"edit\",\n title,\n html: cpHtml(ICON_EDIT, title),\n action: { click: () => this.labelEditing.activate(element) },\n };\n }\n\n private deleteEntry(elements: Element[], title: string): ContextPadEntry {\n return {\n group: \"edit\",\n title,\n html: cpHtml(ICON_DELETE, title),\n action: { click: () => this.modeling.removeElements([...elements]) },\n };\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport ConnectModule from \"diagram-js/lib/features/connect\";\nimport ConnectionPreviewModule from \"diagram-js/lib/features/connection-preview\";\nimport ContextPadModule from \"diagram-js/lib/features/context-pad\";\nimport TtContextPadProvider from \"./TtContextPadProvider.js\";\n\n/** Per-element context actions (rename, annotate, attach, delete). */\nexport const ttContextPadModule: ModuleDeclaration = {\n __depends__: [ContextPadModule, ConnectModule, ConnectionPreviewModule],\n __init__: [\"ttContextPadProvider\"],\n ttContextPadProvider: [\"type\", TtContextPadProvider],\n};\n\nexport { default as TtContextPadProvider } from \"./TtContextPadProvider.js\";\n","/**\n * In-place label editing: a borderless, transparent <textarea> laid exactly over\n * the element's label area, in the label's own font, size, alignment and\n * wrapping, scaled with the zoom. The rendered label is hidden meanwhile, so the\n * text never shows twice. Enter (or clicking elsewhere) commits through\n * `ttModeling.updateLabel` — one undo step; Shift+Enter inserts a line break;\n * Escape discards. Double-click any element to edit its label.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtAnnotation, isTtElement, type TtElement } from \"../model/di-types.js\";\nimport type TtModeling from \"../modeling/TtModeling.js\";\nimport { LINE_HEIGHT, labelLayout } from \"../draw/label-layout.js\";\nimport { FONT } from \"../draw/styles.js\";\n\n/** Canvas marker that hides the rendered label while its editor is open. */\nconst EDITING_MARKER = \"tt-label-editing\";\n\n/** Narrow shapes (small interaction glyphs) still get an editor wide enough to type in. */\nconst MIN_EDITOR_WIDTH = 96;\n\ninterface ActiveEdit {\n commit: () => void;\n cleanup: () => void;\n}\n\nexport default class TtLabelEditing {\n static $inject = [\"eventBus\", \"canvas\", \"ttModeling\"];\n\n private active: ActiveEdit | null = null;\n\n constructor(\n eventBus: EventBus,\n private readonly canvas: Canvas,\n private readonly modeling: TtModeling,\n ) {\n eventBus.on(\"element.dblclick\", (event: { element?: unknown }) => {\n if (isTtElement(event.element)) this.activate(event.element);\n });\n // Any click/drag/pan outside the editor commits (only Escape discards).\n eventBus.on([\"element.mousedown\", \"drag.init\", \"canvas.viewbox.changing\"], () =>\n this.active?.commit(),\n );\n // A re-import replaces every element, so a pending edit has nothing left to apply to.\n eventBus.on(\"import.render.start\", () => this.cancel());\n }\n\n activate(element: TtElement): void {\n this.active?.commit();\n\n const layout = labelLayout(element);\n const centred = layout.align === \"center\";\n const scale = this.canvas.zoom();\n const viewbox = this.canvas.viewbox();\n\n const width = centred ? Math.max(layout.box.width, MIN_EDITOR_WIDTH) : layout.box.width;\n const left = element.x + layout.box.x + (layout.box.width - width) / 2;\n const top = (element.y + layout.box.y - viewbox.y) * scale;\n const boxHeight = layout.box.height * scale;\n\n const editor = document.createElement(\"textarea\");\n editor.className = \"tt-label-editor\";\n editor.value = element.ttLabel ?? \"\";\n editor.rows = 1;\n editor.setAttribute(\"aria-label\", isTtAnnotation(element) ? \"Annotation text\" : \"Label\");\n Object.assign(editor.style, {\n left: `${(left - viewbox.x) * scale}px`,\n width: `${width * scale}px`,\n fontFamily: FONT.family,\n fontSize: `${layout.fontSize * scale}px`,\n fontWeight: layout.fontWeight,\n letterSpacing: layout.letterSpacing ?? \"normal\",\n lineHeight: String(LINE_HEIGHT),\n color: layout.fill,\n textAlign: centred ? \"center\" : \"left\",\n });\n\n // Grow with the text; centred labels stay vertically centred like the rendered ones.\n const fitToContent = () => {\n editor.style.height = \"0px\";\n const contentHeight = editor.scrollHeight;\n editor.style.height = `${centred ? contentHeight : Math.max(contentHeight, boxHeight)}px`;\n editor.style.top = `${centred ? top + (boxHeight - contentHeight) / 2 : top}px`;\n };\n\n this.canvas.getContainer().appendChild(editor);\n this.canvas.addMarker(element, EDITING_MARKER);\n fitToContent();\n editor.focus();\n editor.select();\n\n let done = false;\n const cleanup = () => {\n if (done) return;\n done = true;\n editor.removeEventListener(\"keydown\", onKey);\n editor.removeEventListener(\"input\", fitToContent);\n editor.removeEventListener(\"blur\", onBlur);\n editor.remove();\n this.canvas.removeMarker(element, EDITING_MARKER);\n this.active = null;\n };\n const commit = () => {\n if (done) return;\n const value = editor.value.trim();\n const changed = value !== (element.ttLabel ?? \"\");\n cleanup();\n if (changed) this.modeling.updateLabel(element, value);\n };\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Enter\" && !e.shiftKey && !e.isComposing) {\n e.preventDefault();\n commit();\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n cleanup();\n }\n };\n const onBlur = () => commit();\n editor.addEventListener(\"keydown\", onKey);\n editor.addEventListener(\"input\", fitToContent);\n editor.addEventListener(\"blur\", onBlur);\n\n this.active = { commit, cleanup };\n }\n\n cancel(): void {\n this.active?.cleanup();\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtLabelEditing from \"./TtLabelEditing.js\";\n\n/** In-place label editing (double-click any element to edit its label or text). */\nexport const ttLabelEditingModule: ModuleDeclaration = {\n __init__: [\"ttLabelEditing\"],\n ttLabelEditing: [\"type\", TtLabelEditing],\n};\n\nexport { default as TtLabelEditing } from \"./TtLabelEditing.js\";\n","/**\n * Keyboard shortcuts: undo / redo / select all / delete-selection / copy /\n * paste / nudge the selection with the arrow keys. Bound to the document so they\n * work without first clicking (focusing) the canvas — typing inside form fields\n * (and the inline label editor) is left untouched. No container `tabindex`, so\n * the canvas never shows a focus ring.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\nimport type Selection from \"diagram-js/lib/features/selection/Selection\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type CopyPaste from \"diagram-js/lib/features/copy-paste/CopyPaste\";\nimport type Rules from \"diagram-js/lib/features/rules/Rules\";\nimport type { Element, Shape } from \"diagram-js/lib/model/Types\";\n\nconst NUDGE_STEP = 1;\nconst NUDGE_STEP_FAST = 10;\n\nconst ARROW_DIRECTIONS: Record<string, { x: number; y: number }> = {\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 },\n};\n\nfunction isTypingTarget(target: EventTarget | null): boolean {\n const el = target as HTMLElement | null;\n if (!el) return false;\n return (\n el.tagName === \"INPUT\" ||\n el.tagName === \"TEXTAREA\" ||\n el.tagName === \"SELECT\" ||\n el.isContentEditable\n );\n}\n\nfunction isShape(element: Element): element is Shape {\n return !(\"waypoints\" in element);\n}\n\nexport default class TtKeyboard {\n static $inject = [\n \"eventBus\",\n \"canvas\",\n \"elementRegistry\",\n \"commandStack\",\n \"selection\",\n \"modeling\",\n \"copyPaste\",\n \"rules\",\n ];\n\n constructor(\n eventBus: EventBus,\n canvas: Canvas,\n elementRegistry: ElementRegistry,\n commandStack: CommandStack,\n selection: Selection,\n modeling: Modeling,\n copyPaste: CopyPaste,\n rules: Rules,\n ) {\n const doc = canvas.getContainer().ownerDocument ?? document;\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (isTypingTarget(e.target)) return;\n const cmd = e.ctrlKey || e.metaKey;\n const key = e.key.toLowerCase();\n\n if (cmd && key === \"z\" && !e.shiftKey) {\n e.preventDefault();\n if (commandStack.canUndo()) commandStack.undo();\n } else if ((cmd && key === \"z\" && e.shiftKey) || (cmd && key === \"y\")) {\n e.preventDefault();\n if (commandStack.canRedo()) commandStack.redo();\n } else if (key === \"delete\" || key === \"backspace\") {\n const sel = selection.get() as Element[];\n if (sel.length) {\n e.preventDefault();\n modeling.removeElements([...sel]);\n }\n } else if (cmd && key === \"c\") {\n const sel = selection.get() as Element[];\n if (sel.length) {\n e.preventDefault();\n copyPaste.copy(sel);\n }\n } else if (cmd && key === \"v\") {\n e.preventDefault();\n copyPaste.paste();\n } else if (cmd && key === \"a\") {\n e.preventDefault();\n selection.select(elementRegistry.filter((element) => Boolean(element.parent)));\n } else if (!cmd && !e.altKey && Object.hasOwn(ARROW_DIRECTIONS, e.key)) {\n const shapes = (selection.get() as Element[]).filter(isShape);\n if (!shapes.length || !rules.allowed(\"elements.move\", { shapes })) return;\n e.preventDefault();\n const direction = ARROW_DIRECTIONS[e.key];\n const step = e.shiftKey ? NUDGE_STEP_FAST : NUDGE_STEP;\n modeling.moveElements(shapes, { x: direction.x * step, y: direction.y * step });\n }\n };\n\n doc.addEventListener(\"keydown\", onKeyDown);\n eventBus.on(\"diagram.destroy\", () => doc.removeEventListener(\"keydown\", onKeyDown));\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtKeyboard from \"./TtKeyboard.js\";\n\n/** Undo/redo + delete-selection on the canvas container. */\nexport const ttKeyboardModule: ModuleDeclaration = {\n __init__: [\"ttKeyboard\"],\n ttKeyboard: [\"type\", TtKeyboard],\n};\n\nexport { default as TtKeyboard } from \"./TtKeyboard.js\";\n","/**\n * Copy-paste for Team Topologies shapes, built on the stock diagram-js\n * CopyPaste feature. Only the id handling differs: the stock `createShape`\n * drops the descriptor id and lets diagram-js auto-assign a `shape_N` id, which\n * is the very collision hazard `TtElementFactory` avoids (its counter is not\n * advanced past ids that arrive via import). So we mint a fresh, scheme-correct\n * `team_/int_/flow_/ann_/assoc_` id instead — the custom `tt*` props are already\n * on the descriptor (added by `TtCopyPasteProps`) and pass straight through.\n * Annotation connectors are pasted only together with both of their ends.\n */\n\nimport CopyPaste from \"diagram-js/lib/features/copy-paste/CopyPaste.js\";\nimport { newId } from \"@miragon/team-topologies-schema-model\";\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type Create from \"diagram-js/lib/features/create/Create\";\nimport type Clipboard from \"diagram-js/lib/features/clipboard/Clipboard\";\nimport type ElementFactory from \"diagram-js/lib/core/ElementFactory\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport type Modeling from \"diagram-js/lib/features/modeling/Modeling\";\nimport type Mouse from \"diagram-js/lib/features/mouse/Mouse\";\nimport type Rules from \"diagram-js/lib/features/rules/Rules\";\nimport type { Connection, Shape } from \"diagram-js/lib/model/Types\";\n\n/** Maps a `ttKind` to the id prefix the model package's factory uses. */\nfunction pasteIdPrefix(ttKind: unknown): string | undefined {\n switch (ttKind) {\n case \"team\":\n return \"team\";\n case \"interaction\":\n return \"int\";\n case \"flow\":\n return \"flow\";\n case \"annotation\":\n return \"ann\";\n case \"association\":\n return \"assoc\";\n default:\n return undefined;\n }\n}\n\nexport default class TtCopyPaste extends CopyPaste {\n static override $inject = [\n \"canvas\",\n \"create\",\n \"clipboard\",\n \"elementFactory\",\n \"eventBus\",\n \"modeling\",\n \"mouse\",\n \"rules\",\n ];\n\n constructor(\n canvas: Canvas,\n create: Create,\n clipboard: Clipboard,\n private readonly elementFactory: ElementFactory,\n eventBus: EventBus,\n modeling: Modeling,\n mouse: Mouse,\n rules: Rules,\n ) {\n super(canvas, create, clipboard, elementFactory, eventBus, modeling, mouse, rules);\n }\n\n override createConnection(attrs: Record<string, unknown>): Connection {\n const prefix = pasteIdPrefix(attrs.ttKind);\n if (!prefix) {\n return super.createConnection(attrs);\n }\n return this.elementFactory.createConnection({ ...attrs, id: newId(prefix) }) as Connection;\n }\n\n override createShape(attrs: Record<string, unknown>): Shape {\n const prefix = pasteIdPrefix(attrs.ttKind);\n if (!prefix) {\n return super.createShape(attrs);\n }\n // Keep the id (unlike stock `createShape`, which strips it): a fresh\n // model-style id avoids \"element already exists\" on the next create.\n return this.elementFactory.createShape({ ...attrs, id: newId(prefix) }) as Shape;\n }\n}\n","/**\n * Carries the Team Topologies props across a copy-paste. diagram-js stores each\n * copied element as a plain descriptor whose built-in listener only records\n * geometry (`id/x/y/width/height/…`). Our domain data lives as flat attributes\n * on the shape (not a moddle businessObject), so without this the pasted copy\n * would lose its type, label, description and colours. This listener copies\n * those fields onto the descriptor; they then flow through to the new shape.\n */\n\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport { isTtAssociation, isTtElement } from \"../model/di-types.js\";\n\n/** Flat props that define a Team Topologies shape, beyond geometry. */\nconst TT_PROPS = [\n \"ttKind\",\n \"teamType\",\n \"mode\",\n \"ttLabel\",\n \"description\",\n \"fill\",\n \"stroke\",\n] as const;\n\nexport default class TtCopyPasteProps {\n static $inject = [\"eventBus\"];\n\n constructor(eventBus: EventBus) {\n eventBus.on(\n \"copyPaste.copyElement\",\n (event: { descriptor: Record<string, unknown>; element: unknown }) => {\n const { descriptor, element } = event;\n if (!isTtElement(element) && !isTtAssociation(element)) return;\n const source = element as Record<string, unknown>;\n for (const prop of TT_PROPS) {\n if (source[prop] !== undefined) descriptor[prop] = source[prop];\n }\n },\n );\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport CopyPasteModule from \"diagram-js/lib/features/copy-paste\";\nimport TtCopyPaste from \"./TtCopyPaste.js\";\nimport TtCopyPasteProps from \"./TtCopyPasteProps.js\";\n\n/**\n * Copy-paste of Team Topologies shapes: the stock diagram-js feature (clipboard,\n * cursor-follow placement) with `copyPaste` overridden to mint model-style ids\n * and a listener that preserves the flat `tt*` props across the round-trip.\n */\nexport const ttCopyPasteModule: ModuleDeclaration = {\n __depends__: [CopyPasteModule],\n __init__: [\"ttCopyPasteProps\"],\n copyPaste: [\"type\", TtCopyPaste],\n ttCopyPasteProps: [\"type\", TtCopyPasteProps],\n};\n\nexport { default as TtCopyPaste } from \"./TtCopyPaste.js\";\n","/**\n * Enforces a fixed stacking order regardless of creation order, by reordering\n * the element graphics within the canvas layer. Back → front:\n *\n * flow < stream-aligned / platform < complicated-subsystem < enabling\n * < interactions < annotations < annotation connectors\n *\n * So interaction glyphs always read on top of teams; enabling teams sit above the\n * complicated-subsystem teams, which in turn sit above the stream-aligned /\n * platform base teams they overlap. Annotation connectors come last so no shape\n * they cross on the way to their element hides them.\n */\n\nimport type Canvas from \"diagram-js/lib/core/Canvas\";\nimport type ElementRegistry from \"diagram-js/lib/core/ElementRegistry\";\nimport type EventBus from \"diagram-js/lib/core/EventBus\";\nimport {\n isTtAnnotation,\n isTtAssociation,\n isTtElement,\n isTtFlow,\n isTtInteraction,\n isTtTeam,\n type TtAssociation,\n type TtElement,\n} from \"../model/di-types.js\";\n\n/** Lower = further back. */\nfunction tier(el: TtElement | TtAssociation): number {\n if (isTtFlow(el)) return 0;\n if (isTtTeam(el)) {\n if (el.teamType === \"enabling\") return 3;\n if (el.teamType === \"complicated-subsystem\") return 2;\n return 1; // stream-aligned, platform\n }\n if (isTtInteraction(el)) return 4;\n if (isTtAnnotation(el)) return 5;\n if (isTtAssociation(el)) return 6;\n return 1;\n}\n\nfunction isOrdered(el: unknown): el is TtElement | TtAssociation {\n return isTtElement(el) || isTtAssociation(el);\n}\n\nexport default class TtZOrder {\n static $inject = [\"eventBus\", \"canvas\", \"elementRegistry\"];\n\n private importing = false;\n\n constructor(\n eventBus: EventBus,\n private readonly canvas: Canvas,\n private readonly elementRegistry: ElementRegistry,\n ) {\n eventBus.on(\"import.render.start\", () => {\n this.importing = true;\n });\n eventBus.on(\"import.render.done\", () => {\n this.importing = false;\n this.reorder();\n });\n // Covers create + team-type changes (and harmlessly re-runs on move/resize).\n eventBus.on(\"commandStack.changed\", () => {\n if (!this.importing) this.reorder();\n });\n }\n\n /** Re-append each element's graphics group in ascending tier order (back → front). */\n reorder(): void {\n const ordered = this.elementRegistry\n .getAll()\n .filter(isOrdered)\n .sort((a, b) => tier(a) - tier(b));\n for (const el of ordered) {\n const gfx = this.canvas.getGraphics(el) as SVGElement | undefined;\n const wrapper = gfx?.parentNode as (Node & ChildNode) | null;\n const layer = wrapper?.parentNode as (Node & { appendChild(n: Node): Node }) | null;\n if (wrapper && layer) layer.appendChild(wrapper);\n }\n }\n}\n","import type { ModuleDeclaration } from \"didi\";\nimport TtZOrder from \"./TtZOrder.js\";\n\n/** Keeps the fixed stacking order (interactions on top, base teams at the back). */\nexport const ttZOrderModule: ModuleDeclaration = {\n __init__: [\"ttZOrder\"],\n ttZOrder: [\"type\", TtZOrder],\n};\n\nexport { default as TtZOrder } from \"./TtZOrder.js\";\n","import type { ModuleDeclaration } from \"didi\";\nimport type CommandStack from \"diagram-js/lib/command/CommandStack\";\n\nimport LassoToolModule from \"diagram-js/lib/features/lasso-tool\";\nimport ModelingModule from \"diagram-js/lib/features/modeling\";\nimport MoveModule from \"diagram-js/lib/features/move\";\nimport OutlineModule from \"diagram-js/lib/features/outline\";\nimport ResizeModule from \"diagram-js/lib/features/resize\";\n\nimport { NavigatedViewer } from \"./NavigatedViewer.js\";\nimport { ttModelingModule } from \"./modeling/index.js\";\nimport { ttRulesModule } from \"./rules/index.js\";\nimport { ttBehaviorsModule } from \"./behaviors/index.js\";\nimport { ttPaletteModule } from \"./palette/index.js\";\nimport { ttContextPadModule } from \"./context-pad/index.js\";\nimport { ttLabelEditingModule } from \"./label-editing/index.js\";\nimport { ttKeyboardModule } from \"./keyboard/index.js\";\nimport { ttCopyPasteModule } from \"./copy-paste/index.js\";\nimport { ttZOrderModule } from \"./zorder/index.js\";\n\n/**\n * Full Team Topologies editor: palette/create, multi-selection (lasso, select\n * all) and group move, resize, annotations with connectors, context pad,\n * in-place label editing, undo/redo.\n */\nexport class Modeler extends NavigatedViewer {\n protected override _getModules(): ModuleDeclaration[] {\n return [\n ...super._getModules(),\n // diagram-js stock\n ModelingModule,\n LassoToolModule,\n MoveModule,\n OutlineModule,\n ResizeModule,\n // Team Topologies editor\n ttModelingModule,\n ttRulesModule,\n ttBehaviorsModule,\n ttPaletteModule,\n ttContextPadModule,\n ttLabelEditingModule,\n ttKeyboardModule,\n ttCopyPasteModule,\n ttZOrderModule,\n ];\n }\n\n undo(): void {\n this.get<CommandStack>(\"commandStack\").undo();\n }\n\n redo(): void {\n this.get<CommandStack>(\"commandStack\").redo();\n }\n\n canUndo(): boolean {\n return this.get<CommandStack>(\"commandStack\").canUndo();\n }\n\n canRedo(): boolean {\n return this.get<CommandStack>(\"commandStack\").canRedo();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,IAAMwB,qBAAmC,IAAI,IAAY;CACvD;CACA;CACA;CACA;AACF,CAAC;AAED,SAASC,EAAO,GAAiC;CAC/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;CAC/C,UAAU,CAAC,UAAU;CACrB,UAAU,CAAC,QAAQN,EAAQ;AAC7B,GCkBaO,KAAb,cAA6BvH,EAAgB;CAC3C,cAAsD;EACpD,OAAO;GACL,GAAG,MAAM,YAAY;GAErBjL;GACAD;GACAE;GACAC;GACAC;GAEA+L;GACAG;GACAK;GACA6B;GACAe;GACAiB;GACAc;GACAQ;GACAU;EACF;CACF;CAEA,OAAa;EACX,KAAK,IAAkB,cAAc,CAAC,CAAC,KAAK;CAC9C;CAEA,OAAa;EACX,KAAK,IAAkB,cAAc,CAAC,CAAC,KAAK;CAC9C;CAEA,UAAmB;EACjB,OAAO,KAAK,IAAkB,cAAc,CAAC,CAAC,QAAQ;CACxD;CAEA,UAAmB;EACjB,OAAO,KAAK,IAAkB,cAAc,CAAC,CAAC,QAAQ;CACxD;AACF"}
@@ -1,2 +1,2 @@
1
- .djs-parent{--color-grey-225-10-15:#22242a;--color-grey-225-10-35:#505562;--color-grey-225-10-55:#818798;--color-grey-225-10-75:#b9bcc6;--color-grey-225-10-80:#c7c9d1;--color-grey-225-10-85:#d5d7dd;--color-grey-225-10-90:#e3e4e8;--color-grey-225-10-95:#f1f2f4;--color-grey-225-10-97:#f7f7f8;--color-blue-205-100-40:#07c;--color-blue-205-100-45:#0086e6;--color-blue-205-100-45-opacity-30:#0086e64d;--color-blue-205-100-50:#0095ff;--color-blue-205-100-50-opacity-15:#0095ff26;--color-blue-205-100-70:#80caff;--color-blue-205-100-95:#e6f4ff;--color-green-150-86-44:#10d170;--color-red-360-100-40:#c00;--color-red-360-100-45:#e60000;--color-red-360-100-92:#ffd6d6;--color-red-360-100-97:#fff0f0;--color-white:#fff;--color-black:#000;--color-black-opacity-10:#0000001a;--color-black-opacity-30:#0000004d;--canvas-fill-color:var(--color-white);--accent-color:var(--color-blue-205-100-40);--bendpoint-fill-color:var(--color-blue-205-100-45);--bendpoint-stroke-color:var(--canvas-fill-color);--context-pad-entry-background-color:var(--color-white);--context-pad-entry-hover-background-color:var(--color-grey-225-10-95);--element-dragger-color:var(--accent-color);--element-hover-outline-fill-color:var(--color-blue-205-100-45);--element-selected-outline-stroke-color:var(--accent-color);--element-selected-outline-secondary-stroke-color:var(--color-blue-205-100-70);--lasso-fill-color:var(--color-blue-205-100-50-opacity-15);--lasso-stroke-color:var(--element-selected-outline-stroke-color);--palette-entry-color:var(--color-grey-225-10-15);--palette-entry-hover-color:var(--color-blue-205-100-45);--palette-entry-selected-color:var(--accent-color);--palette-separator-color:var(--color-grey-225-10-75);--palette-toggle-hover-background-color:var(--color-grey-225-10-55);--palette-background-color:var(--color-grey-225-10-97);--palette-border-color:var(--color-grey-225-10-75);--popup-font-family:"IBM Plex Sans", sans-serif;--popup-font-size:14px;--popup-secondary-font-size:.9em;--popup-header-entry-selected-color:var(--accent-color);--popup-header-font-weight:bolder;--popup-header-group-divider-color:var(--color-grey-225-10-75);--popup-background-color:var(--color-white);--popup-border-color:transparent;--popup-shadow-color:var(--color-black-opacity-30);--popup-disabled-color:var(--color-grey-225-10-35);--popup-description-color:var(--color-grey-225-10-35);--popup-no-results-color:var(--color-grey-225-10-55);--popup-entry-title-color:var(--color-grey-225-10-55);--popup-entry-hover-color:var(--color-grey-225-10-95);--popup-search-border-color:var(--color-grey-225-10-75);--popup-search-focus-border-color:var(--accent-color);--popup-search-focus-background-color:var(--color-blue-205-100-95);--popup-tab-color:var(--color-grey-225-10-55);--popup-tab-hover-color:var(--color-grey-225-10-15);--popup-tab-active-color:var(--color-grey-225-10-15);--popup-tab-active-border-color:var(--accent-color);--popup-tab-strip-border-color:var(--color-grey-225-10-90);--popup-tab-focus-border-color:var(--accent-color);--resizer-fill-color:var(--color-blue-205-100-45);--resizer-stroke-color:var(--canvas-fill-color);--search-font-family:"IBM Plex Sans", sans-serif;--search-font-size:14px;--search-container-background-color:var(--color-white);--search-shadow-color:var(--color-black-opacity-30);--search-input-border-color:var(--color-grey-225-10-75);--search-input-focus-border-color:var(--accent-color);--search-input-focus-background-color:var(--color-blue-205-100-95);--search-result-hover-background-color:var(--color-grey-225-10-95);--search-result-secondary-color:var(--color-grey-225-10-55);--search-preselected-background-color:var(--color-blue-205-100-50-opacity-15);--shape-attach-allowed-stroke-color:var(--accent-color);--shape-connect-allowed-fill-color:var(--color-grey-225-10-97);--shape-drop-allowed-fill-color:var(--color-grey-225-10-97);--shape-drop-not-allowed-fill-color:var(--color-red-360-100-97);--shape-resize-preview-stroke-color:var(--accent-color);--snap-line-stroke-color:var(--color-blue-205-100-45-opacity-30);--space-tool-crosshair-stroke-color:var(--color-black);--tooltip-error-background-color:var(--color-red-360-100-97);--tooltip-error-border-color:var(--color-red-360-100-45);--tooltip-error-color:var(--color-red-360-100-45);--hover-tooltip-font-family:"IBM Plex Sans", sans-serif;--hover-tooltip-font-size:12px;--hover-tooltip-secondary-font-size:11px;--hover-tooltip-background-color:var(--color-grey-225-10-15);--hover-tooltip-color:var(--color-white);--hover-tooltip-shadow-color:var(--color-black-opacity-10);--palette-tooltip-shortcut-background-color:var(--color-grey-225-10-35)}.djs-container svg.drop-not-ok{background:var(--shape-drop-not-allowed-fill-color)!important}.djs-container svg.new-parent{background:var(--shape-drop-allowed-fill-color)!important}.djs-container svg:focus{outline-offset:-1px}.djs-outline,.djs-selection-outline{fill:none;shape-rendering:geometricprecision;stroke-width:2px}.djs-outline{visibility:hidden}.djs-selection-outline{stroke:var(--element-selected-outline-stroke-color)}.djs-element.selected .djs-outline{visibility:visible;stroke:var(--element-selected-outline-stroke-color)}.djs-connection.selected .djs-outline{display:none}.djs-multi-select .djs-element.selected .djs-outline,.djs-dragging-active-lasso .djs-element.selected .djs-outline{stroke:var(--element-selected-outline-secondary-stroke-color);display:block}.djs-outline-hidden .djs-outline{display:none!important}.djs-shape.connect-ok .djs-visual>:first-child{fill:var(--shape-connect-allowed-fill-color)!important}.djs-shape.connect-not-ok .djs-visual>:first-child,.djs-shape.drop-not-ok .djs-visual>:first-child{fill:var(--shape-drop-not-allowed-fill-color)!important}.djs-shape.new-parent .djs-visual>:first-child{fill:var(--shape-drop-allowed-fill-color)!important}.drop-not-ok,.connect-not-ok,.drop-not-ok *,.connect-not-ok *{cursor:not-allowed!important}.drop-ok,.connect-ok,.drop-ok *,.connect-ok *{cursor:default!important}.djs-element.attach-ok .djs-visual>:first-child{stroke-width:5px!important;stroke:var(--shape-attach-allowed-stroke-color)!important}.djs-frame.connect-not-ok .djs-visual>:first-child,.djs-frame.drop-not-ok .djs-visual>:first-child{stroke-width:3px!important;stroke:var(--shape-drop-not-allowed-fill-color)!important;fill:none!important}.djs-lasso-overlay{fill:var(--lasso-fill-color);stroke:var(--lasso-stroke-color);stroke-width:2px;shape-rendering:geometricprecision;pointer-events:none}.djs-resize-overlay{fill:none;stroke-dasharray:5 1 3 1;stroke:var(--shape-resize-preview-stroke-color);pointer-events:none}.djs-resizer-hit{fill:none;pointer-events:all}.djs-resizer-visual{fill:var(--resizer-fill-color);stroke-width:1px;stroke:var(--resizer-stroke-color);shape-rendering:geometricprecision}.djs-resizer:hover .djs-resizer-visual{stroke:var(--resizer-stroke-color);stroke-opacity:1}.djs-cursor-resize-ns,.djs-resizer-n,.djs-resizer-s{cursor:ns-resize}.djs-cursor-resize-ew,.djs-resizer-e,.djs-resizer-w{cursor:ew-resize}.djs-cursor-resize-nwse,.djs-resizer-nw,.djs-resizer-se{cursor:nwse-resize}.djs-cursor-resize-nesw,.djs-resizer-ne,.djs-resizer-sw{cursor:nesw-resize}.djs-shape.djs-resizing>.djs-outline{visibility:hidden!important}.djs-shape.djs-resizing>.djs-resizer,.djs-dragger>.djs-resizer{visibility:hidden}.djs-dragger *{fill:none!important;stroke:var(--element-dragger-color)!important}.djs-dragger tspan,.djs-dragger text,.djs-dragger marker circle,.djs-dragger marker path,.djs-dragger marker polygon,.djs-dragger marker polyline,.djs-dragger marker rect{fill:var(--element-dragger-color)!important;stroke:none!important}.djs-dragger marker text,.djs-dragger marker tspan{fill:none!important;stroke:var(--element-dragger-color)!important}.djs-dragging,.djs-dragging>*{opacity:.3!important;pointer-events:none!important}.djs-visual,.djs-outline{pointer-events:none}.djs-element.attach-ok .djs-hit{stroke-width:60px!important}.djs-element>.djs-hit-all,.djs-element>.djs-hit-no-move{pointer-events:all}.djs-element>.djs-hit-stroke,.djs-element>.djs-hit-click-stroke{pointer-events:stroke}.djs-connection .djs-visual{stroke-width:2px;fill:none}.djs-cursor-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.djs-cursor-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.djs-cursor-crosshair{cursor:crosshair}.djs-cursor-move{cursor:move}.djs-cursor-resize-ns{cursor:ns-resize}.djs-cursor-resize-ew{cursor:ew-resize}.djs-snap-line{stroke:var(--snap-line-stroke-color);stroke-linecap:round;stroke-width:2px;pointer-events:none}.djs-crosshair{stroke:var(--space-tool-crosshair-stroke-color);stroke-linecap:round;stroke-width:1px;pointer-events:none;shape-rendering:geometricprecision;stroke-dasharray:5 5}.djs-palette{box-sizing:border-box;width:48px;position:absolute;top:20px;left:20px}.djs-palette .separator{border:none;border-bottom:solid 1px var(--palette-separator-color);clear:both;margin:5px;padding-top:5px}.djs-palette .entry:before{vertical-align:initial}.djs-palette .djs-palette-toggle{cursor:pointer}.djs-palette .entry,.djs-palette .djs-palette-toggle{color:var(--palette-entry-color);text-align:center;font-size:30px}.djs-palette .entry{float:left}.djs-palette .entry img{max-width:100%}.djs-palette .djs-palette-entries:after{content:"";clear:both;display:table}.djs-palette .djs-palette-toggle:hover{background:var(--palette-toggle-hover-background-color)}.djs-palette .entry:hover{color:var(--palette-entry-hover-color)}.djs-palette .highlighted-entry{color:var(--palette-entry-selected-color)!important}.djs-palette .entry,.djs-palette .djs-palette-toggle{cursor:default;width:46px;height:46px;line-height:46px}.djs-palette.two-column.open{width:94px}.djs-palette:not(.open) .djs-palette-entries{display:none}.djs-palette:not(.open){overflow:hidden}.djs-palette.open .djs-palette-toggle{display:none}.djs-hover-tooltip{z-index:1000;background-color:var(--hover-tooltip-background-color);color:var(--hover-tooltip-color);font-family:var(--hover-tooltip-font-family);font-size:var(--hover-tooltip-font-size);white-space:nowrap;pointer-events:none;box-shadow:0 1px 4px var(--hover-tooltip-shadow-color);border-radius:4px;align-items:center;gap:6px;padding:6px 10px;line-height:1.2;display:flex;position:fixed}.djs-hover-tooltip--right{transform:translateY(-50%)}.djs-hover-tooltip--top{transform:translate(-50%,-100%)}.djs-palette-tooltip-shortcut{background-color:var(--palette-tooltip-shortcut-background-color);font-family:monospace;font-size:var(--hover-tooltip-secondary-font-size);border-radius:3px;padding:1px 5px;line-height:1.2}.djs-context-pad{pointer-events:none;z-index:100;width:72px;line-height:1;display:none;position:absolute}.djs-context-pad .entry{text-align:center;cursor:default;background-color:var(--context-pad-entry-background-color);width:22px;height:22px;box-shadow:0 0 2px 1px var(--context-pad-entry-background-color);pointer-events:all;vertical-align:middle;border-radius:3px;margin:0 2px 2px 0;font-size:22px;display:inline-block}.djs-context-pad .entry:hover{background:var(--context-pad-entry-hover-background-color)}.djs-context-pad.open{display:block}.djs-popup{box-sizing:border-box;background:var(--popup-background-color);z-index:200;box-shadow:0px 2px 6px var(--popup-shadow-color);border:solid 1px var(--popup-border-color);min-width:120px;max-width:300px;line-height:1;font-size:var(--popup-font-size);font-family:var(--popup-font-family);outline:none;position:fixed;overflow:hidden}.djs-popup-search input{box-sizing:border-box;width:100%;font-size:var(--popup-font-size);border:solid 1px var(--popup-search-border-color);border-radius:2px;padding:3px 6px 3px 28px;line-height:21px}.djs-popup-search input:focus{background-color:var(--popup-search-focus-background-color);border:solid 1px var(--popup-search-focus-border-color);outline:none}.djs-popup-header{align-items:stretch;margin:10px 12px;line-height:20px;display:flex}.djs-popup-header .entry{border-radius:2px}.djs-popup button.entry{background:0 0;border:0;padding:0}.djs-popup-header .entry.active{color:var(--popup-header-entry-selected-color)}.djs-popup-header .entry.disabled{color:inherit}.djs-popup-header-group{flex-direction:row;align-items:center;margin:0;padding:0;list-style:none;display:flex}.djs-popup-header-group .entry{flex-direction:row;align-items:center;display:flex}.djs-popup-header-group+.djs-popup-header-group:before{content:"";background:var(--popup-header-group-divider-color);width:1px;height:20px;margin:0 5px}.djs-popup-search{width:auto;margin:10px 12px;position:relative}.djs-popup-tabs-container{border-bottom:solid 1px var(--popup-tab-strip-border-color);position:relative}.djs-popup-tabs-scroll{appearance:none;width:28px;color:var(--popup-tab-color);cursor:pointer;border:none;border-radius:0;align-items:center;padding:0;display:flex;position:absolute;top:0;bottom:1px}.djs-popup-tabs-scroll:hover{color:var(--popup-tab-hover-color)}.djs-popup-tabs-scroll-start{background:linear-gradient(to left, transparent, var(--popup-background-color) 60%);justify-content:flex-start;left:0}.djs-popup-tabs-scroll-end{background:linear-gradient(to right, transparent, var(--popup-background-color) 60%);justify-content:flex-end;right:0}.djs-popup-tabs-scroll-start svg{transform:rotate(180deg)}.djs-popup-tabs{scrollbar-width:none;flex-wrap:nowrap;gap:2px;padding:0 12px;scroll-padding:0 28px;display:flex;overflow:auto hidden}.djs-popup-tabs::-webkit-scrollbar{display:none}.djs-popup-tab{appearance:none;font:inherit;font-size:var(--popup-font-size);color:var(--popup-tab-color);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-bottom:2px solid #0000;border-radius:0;flex:none;padding:6px 10px}.djs-popup-tab:hover{color:var(--popup-tab-hover-color)}.djs-popup-tab:focus-visible{outline:solid 1px var(--popup-tab-focus-border-color);outline-offset:-2px}.djs-popup-tab[aria-selected=true]{color:var(--popup-tab-active-color);border-bottom-color:var(--popup-tab-active-border-color);font-weight:var(--popup-header-font-weight)}.djs-popup-title{font-size:var(--popup-font-size);font-weight:var(--popup-header-font-weight);flex:1;margin:0}.djs-popup-breadcrumbs{margin:10px 12px;line-height:20px;display:flex}.djs-popup-breadcrumbs-item{appearance:none;min-width:0;color:var(--popup-description-color);font:inherit;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;outline:none;margin:0;padding:0;display:inline-flex;overflow:hidden}.djs-popup-breadcrumbs-item--separator:before{content:"/";color:var(--popup-description-color);margin:0 4px;display:inline-block}.djs-popup-breadcrumbs-item:hover{color:inherit;text-decoration:underline}.djs-popup-breadcrumbs-item:focus-visible{outline:1px solid var(--popup-search-focus-border-color);outline-offset:2px}.djs-popup-breadcrumbs-item--back{border:1px solid var(--popup-search-border-color);border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;margin-right:6px;padding:2px 3px}.djs-popup-breadcrumbs-item--back:hover{background:#f2f3f5}.djs-popup-breadcrumbs-item--current{font-weight:var(--popup-header-font-weight);color:inherit;cursor:default}.djs-popup-breadcrumbs-item--current:hover{text-decoration:none}.djs-popup-entry-actions{flex-shrink:0;align-items:center;gap:6px;margin-left:6px;display:flex}.djs-popup-entry-chevron{color:var(--popup-description-color);align-items:center;display:flex}.djs-popup-search-icon{position:absolute;top:7px;left:8px}.djs-popup-search-count{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);margin:0 12px}.djs-popup-results{max-height:280px;margin:7px 3px 7px 12px;padding-right:9px;list-style:none;overflow:auto}.djs-popup-results:focus{outline:none}.djs-popup-group{width:100%;margin:0;padding:0}.djs-popup-body .entry,.djs-popup-body .entry-header{cursor:default;border-radius:4px;padding:5px 7px}.djs-popup-body .entry-header{font-weight:var(--popup-header-font-weight);color:var(--popup-entry-title-color);padding-left:0}.djs-popup [class*=icon] .djs-popup-label,.djs-popup-label:not(:first-child){margin-left:.5em}.djs-popup [class*=icon]:before,.djs-popup-entry-icon{vertical-align:middle;width:1em;height:1em;font-size:1.4em;display:inline-block}.djs-popup-body .entry-header:not(:first-child){margin-top:8px;margin-bottom:2px}.djs-popup-body .entry{flex-direction:row;align-items:stretch;height:min-content;display:flex}.djs-popup .entry.selected{background-color:var(--popup-entry-hover-color)}.djs-popup .entry.disabled{color:var(--popup-disabled-color);cursor:not-allowed}.djs-popup-body .entry:not(:first-child){margin-top:2px}.djs-popup-entry-content{flex-direction:column;flex:1;display:flex}.djs-popup-entry-description{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);margin-top:.25em}.djs-popup-label,.djs-popup-entry-description{line-height:1.4em}.djs-popup .entry,.djs-popup .entry-header{margin:1px}.djs-popup-body{flex-direction:column;width:auto}.djs-popup ::-webkit-scrollbar{width:6px}.djs-popup ::-webkit-scrollbar-thumb{background-color:#0003;border-radius:3px}.djs-popup ::-webkit-scrollbar-track{box-shadow:none;background:0 0;margin:0;padding:5px}.djs-popup-no-results{color:var(--popup-no-results-color);padding:0 12px 12px}.djs-popup-footer{border-top:solid 1px var(--popup-border-color);padding:5px 12px 7px;display:flex}.djs-popup-results:hover~.djs-popup-footer{display:none}.djs-popup-entry-docs{visibility:hidden;color:var(--popup-description-color);border:1px solid var(--popup-search-border-color);cursor:pointer;background:#fff;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;padding:2px 3px;transition:background-color .12s,border-color .12s,color .12s;display:flex}.djs-popup-body .entry:hover .djs-popup-entry-docs{visibility:visible}.djs-popup-body .entry .djs-popup-entry-docs:hover{background:#f2f3f5}.djs-popup-entry-docs svg{vertical-align:middle}.djs-popup-footer-docs{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);align-items:center;gap:3px;text-decoration:none;display:inline-flex}.djs-popup-footer-docs:hover{text-decoration:underline}.djs-popup-footer-docs svg{vertical-align:middle;margin:2px}.djs-palette{background:var(--palette-background-color);border:solid 1px var(--palette-border-color);border-radius:2px}.djs-segment-dragger,.djs-bendpoint{display:none}.djs-segment-dragger .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-width:1px;stroke-opacity:1;display:none}.djs-segment-dragger:hover .djs-visual{display:block}.djs-bendpoint .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-width:1px}.djs-segment-dragger:hover,.djs-bendpoints.hover .djs-segment-dragger,.djs-bendpoints.selected .djs-segment-dragger,.djs-bendpoint:hover,.djs-bendpoints.hover .djs-bendpoint,.djs-bendpoints.selected .djs-bendpoint{display:block}.djs-drag-active .djs-bendpoints *,.djs-bendpoints:not(.hover) .floating,.djs-bendpoint.floating:not(.positioned){display:none}.djs-segment-dragger:hover .djs-visual,.djs-segment-dragger.djs-dragging .djs-visual,.djs-bendpoint:hover .djs-visual,.djs-bendpoint.floating .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-opacity:1}.djs-bendpoint.floating .djs-hit{pointer-events:none}.djs-segment-dragger .djs-hit,.djs-bendpoint .djs-hit{fill:none;pointer-events:all}.djs-segment-dragger.horizontal .djs-hit{cursor:ns-resize}.djs-segment-dragger.vertical .djs-hit{cursor:ew-resize}.djs-segment-dragger.djs-dragging .djs-hit{pointer-events:none}.djs-updating,.djs-updating>*{pointer-events:none!important}.djs-updating .djs-context-pad,.djs-updating .djs-outline,.djs-updating .djs-bendpoint,.djs-multi-select .djs-bendpoint,.djs-multi-select .djs-segment-dragger,.connect-ok .djs-bendpoint,.connect-not-ok .djs-bendpoint,.drop-ok .djs-bendpoint,.drop-not-ok .djs-bendpoint{display:none!important}.djs-segment-dragger.djs-dragging,.djs-bendpoint.djs-dragging{opacity:1;display:block}.djs-tooltip-error{background:var(--tooltip-error-background-color);border:solid 1px var(--tooltip-error-border-color);width:160px;color:var(--tooltip-error-color);opacity:.75;border-radius:2px;padding:6px;font-size:12px;line-height:16px}.djs-tooltip-error:hover{opacity:1}.djs-search-open .djs-context-pad{display:none}.djs-search-open .djs-connection.selected .djs-outline{display:block}.djs-search-container{z-index:10;width:25%;min-width:300px;max-width:400px;font-family:var(--search-font-family);font-size:var(--search-font-size);box-shadow:0px 2px 6px var(--search-shadow-color);border-radius:2px;margin-left:auto;margin-right:auto;position:absolute;top:20px;left:0;right:0}.djs-search-container:not(.open){display:none}.djs-search-input{position:relative}.djs-search-input svg{position:absolute;top:7px;left:8px}.djs-search-input input{font-size:var(--search-font-size);border:1px solid var(--search-input-border-color);box-sizing:border-box;border-radius:2px;width:100%;padding:3px 6px 3px 28px;line-height:21px}.djs-search-input input:focus{background-color:var(--search-input-focus-background-color);border:solid 1px var(--search-input-focus-border-color);outline:none}.djs-search-results{background:var(--search-container-background-color);max-height:200px;position:relative;overflow-y:auto}.djs-search-result{padding:6px 8px}.djs-search-result-primary{text-overflow:ellipsis;white-space:nowrap;margin:0 0 3px;overflow:hidden}.djs-search-result-secondary{text-overflow:ellipsis;white-space:nowrap;color:var(--search-result-secondary-color);margin:0;font-family:monospace;overflow:hidden}.djs-search-result:hover,.djs-search-result-selected,.djs-search-result-selected:hover{background:var(--search-result-hover-background-color)}.djs-search-open .djs-element .djs-outline{fill:var(--search-preselected-background-color)!important}.djs-element-hidden,.djs-element-hidden .djs-hit,.djs-element-hidden .djs-outline,.djs-label-hidden .djs-label{display:none!important}.djs-element .djs-hit-stroke,.djs-element .djs-hit-click-stroke,.djs-element .djs-hit-all{cursor:move}:root{--cd-blau:#335de5;--cd-gruen:#00e676;--cd-grau:#f9f7f7;--cd-schwarz:#1d1d1d;--cd-weiss:#fff;--cd-blau-link:#2b50d4;--cd-blau-hell:#6b8aff;--cd-success:#0b7a55;--cd-success-soft:#0b7a551f;--cd-warning:#92610a;--cd-warning-soft:#92610a1f;--cd-danger:#c92a2a;--cd-danger-soft:#c92a2a1f;--cd-info:#2b50d4;--cd-info-soft:#2b50d41f;--cd-gradient-brand:linear-gradient(120deg, #335de5 30%, #00e676);--cd-gradient-format:linear-gradient(135deg, #335de5 0%, #00e676 140%);--cd-space-1:4px;--cd-space-2:8px;--cd-space-3:16px;--cd-space-4:24px;--cd-space-5:32px;--cd-space-6:48px;--cd-space-7:64px;--cd-space-8:96px;--cd-radius-sm:6px;--cd-radius-md:12px;--cd-radius-lg:16px;--cd-radius-pill:999px;--cd-shadow-1:0 1px 2px #1d1d1d0f, 0 1px 3px #1d1d1d1a;--cd-shadow-2:0 4px 12px #1d1d1d1a;--cd-shadow-3:0 12px 32px #1d1d1d29;--cd-motion-fast:.15s;--cd-motion-base:.25s;--cd-motion-slow:.4s;--cd-ease:cubic-bezier(.4, 0, .2, 1);--cd-ease-out:cubic-bezier(0, 0, .2, 1)}.tt-djs-container{--tt-accent:var(--cd-blau);--tt-accent-soft:#335de51f;--tt-line:#e6e2e2;--tt-ink:var(--cd-schwarz);--element-selected-outline-stroke-color:var(--tt-accent);--element-selected-outline-secondary-stroke-color:#335de580;--lasso-fill-color:var(--tt-accent-soft);--lasso-stroke-color:var(--tt-accent);--palette-entry-selected-color:var(--tt-accent);background-color:var(--cd-grau);background-image:radial-gradient(#1d1d1d0f .6px,#0000 .6px);background-size:22px 22px;width:100%;height:100%;font-family:Geist Variable,Geist,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;position:relative;overflow:hidden}.tt-djs-container:focus,.tt-djs-container:focus-visible,.tt-djs-container svg:focus{outline:none}.tt-djs-container .djs-element text{-webkit-user-select:none;user-select:none}.tt-djs-container .djs-element.hover .djs-visual>:first-child:not(text),.tt-djs-container .djs-element.selected .djs-visual>:first-child:not(text){stroke:var(--tt-accent)!important}.tt-djs-container .djs-outline{stroke:var(--tt-accent);stroke-dasharray:3 3}.tt-djs-container .djs-selection-outline,.tt-djs-container .djs-lasso-overlay{stroke-width:1.5px;stroke-dasharray:5 4}.tt-djs-container .djs-resizer-visual{fill:var(--cd-weiss);stroke:var(--tt-accent)}.tt-djs-container .djs-resizer-hit{fill:none}.djs-palette{background:var(--cd-weiss);border:1px solid var(--tt-line);border-radius:var(--cd-radius-md);width:auto;box-shadow:var(--cd-shadow-2);align-items:center;padding:5px 6px;display:flex;top:12px;left:50%;transform:translate(-50%)}.djs-palette .djs-palette-entries,.djs-palette .group{flex-direction:row;align-items:center;gap:2px;display:flex}.djs-palette .entry{float:none;border-radius:var(--cd-radius-sm);width:40px;height:40px;color:var(--tt-ink);line-height:normal;transition:background .12s,color .12s,box-shadow .12s;position:relative}.djs-palette .entry:hover{background:var(--tt-accent-soft);color:var(--tt-accent)}.djs-palette .group+.group{margin-left:9px;padding-left:9px;position:relative}.djs-palette .group+.group:before{content:"";background:var(--tt-line);width:1px;position:absolute;top:6px;bottom:6px;left:0}.tt-palette-entry{justify-content:center;align-items:center;width:100%;min-width:24px;height:100%;min-height:24px;line-height:1;display:flex}.tt-palette-svg{pointer-events:none;display:block}.tt-mode-entry.is-active,.djs-palette .entry.highlighted-entry{background:var(--tt-accent-soft);box-shadow:inset 0 0 0 1.5px var(--tt-accent)}.tt-djs-container .tt-cp-entry{width:100%;min-width:22px;height:100%;min-height:22px;color:var(--tt-ink);justify-content:center;align-items:center;display:flex}.tt-djs-container .djs-context-pad .entry{border-radius:var(--cd-radius-sm);box-shadow:var(--cd-shadow-1);background:var(--cd-weiss);transition:background .12s,color .12s}.tt-djs-container .djs-context-pad .entry:hover{background:var(--tt-accent-soft);color:var(--tt-accent)}.tt-djs-container .tt-label-editor{z-index:100;box-sizing:border-box;resize:none;white-space:pre-wrap;overflow-wrap:break-word;caret-color:var(--tt-accent);background:0 0;border:0;outline:none;margin:0;padding:0;position:absolute;overflow:hidden}.tt-djs-container .djs-element.tt-label-editing .djs-visual>text{visibility:hidden}
1
+ .bio-theme-parent{--bio-surface:#fff;--bio-surface-overlay:#fff;--bio-surface-subtle:#f7f7f8;--bio-surface-medium:#f1f2f4;--bio-surface-inverted:#383838;--bio-surface-inverted-subtle:#505562;--bio-text:#22242a;--bio-text-subtle:#505562;--bio-text-subtlest:#818798;--bio-text-on-inverted:#fff;--bio-border:#b9bcc6;--bio-border-disabled:#e3e4e8;--bio-primary:#07c;--bio-primary-surface:#e6f4ff;--bio-danger:#e60000;--bio-danger-surface-subtle:#fff0f0;--bio-selected-surface:var(--bio-surface-medium);--bio-selected-text:var(--bio-text);--bio-focus:#07c;--bio-focus-surface:#e6f4ff;--bio-canvas-accent:#07c;--bio-canvas-accent-subtle:#80caff;--bio-shadow:#0000004d;--bio-shadow-subtle:#0000001a;--bio-radius-sm:2px;--bio-radius-md:3px;--bio-radius-lg:4px}.djs-parent{--button-border-radius:var(--bio-radius-md);--input-border-radius:var(--bio-radius-sm);--surface-border-radius:var(--bio-radius-lg);--canvas-fill-color:var(--bio-surface);--accent-color:var(--bio-canvas-accent);--bendpoint-fill-color:var(--bio-canvas-accent);--bendpoint-stroke-color:var(--canvas-fill-color);--context-pad-entry-background-color:var(--bio-surface);--context-pad-entry-hover-background-color:var(--bio-surface-medium);--element-dragger-color:var(--accent-color);--element-selected-outline-stroke-color:var(--accent-color);--element-selected-outline-secondary-stroke-color:var(--bio-canvas-accent-subtle);--lasso-fill-color:color-mix(in srgb, var(--bio-canvas-accent) 15%, transparent);--lasso-stroke-color:var(--element-selected-outline-stroke-color);--palette-entry-color:var(--bio-text);--palette-entry-hover-color:var(--bio-primary);--palette-entry-selected-color:var(--bio-primary);--palette-separator-color:var(--bio-border);--palette-toggle-hover-background-color:var(--bio-surface-medium);--palette-background-color:var(--bio-surface-subtle);--palette-border-color:var(--bio-border);--popup-font-family:"IBM Plex Sans", sans-serif;--popup-font-size:14px;--popup-secondary-font-size:.9em;--popup-header-entry-selected-color:var(--bio-primary);--popup-header-font-weight:bolder;--popup-header-group-divider-color:var(--bio-border);--popup-background-color:var(--bio-surface-overlay);--popup-border-color:transparent;--popup-shadow-color:var(--bio-shadow);--popup-scrollbar-thumb-color:#0003;--popup-button-background-color:var(--bio-surface-overlay);--popup-button-hover-background-color:var(--bio-surface-medium);--popup-disabled-color:var(--bio-text-subtle);--popup-description-color:var(--bio-text-subtle);--popup-no-results-color:var(--bio-text-subtlest);--popup-entry-title-color:var(--bio-text-subtlest);--popup-entry-selected-background-color:var(--bio-selected-surface);--popup-entry-selected-color:var(--bio-selected-text);--popup-search-border-color:var(--bio-border);--popup-search-focus-border-color:var(--bio-focus);--popup-search-focus-background-color:var(--bio-focus-surface);--popup-tab-color:var(--bio-text-subtlest);--popup-tab-hover-color:var(--bio-text);--popup-tab-active-color:var(--bio-text);--popup-tab-active-border-color:var(--bio-primary);--popup-tab-strip-border-color:var(--bio-border-disabled);--popup-tab-focus-border-color:var(--bio-focus);--resizer-fill-color:var(--bio-canvas-accent);--resizer-stroke-color:var(--canvas-fill-color);--search-font-family:"IBM Plex Sans", sans-serif;--search-font-size:14px;--search-container-background-color:var(--bio-surface-overlay);--search-shadow-color:var(--bio-shadow);--search-input-border-color:var(--bio-border);--search-input-focus-border-color:var(--bio-focus);--search-input-focus-background-color:var(--bio-primary-surface);--search-result-hover-background-color:var(--bio-surface-medium);--search-result-secondary-color:var(--bio-text-subtlest);--search-preselected-background-color:color-mix(in srgb, var(--bio-canvas-accent) 15%, transparent);--shape-attach-allowed-stroke-color:var(--accent-color);--shape-connect-allowed-fill-color:var(--bio-surface-subtle);--shape-drop-allowed-fill-color:var(--bio-surface-subtle);--shape-drop-not-allowed-fill-color:var(--bio-danger-surface-subtle);--shape-resize-preview-stroke-color:var(--accent-color);--snap-line-stroke-color:color-mix(in srgb, var(--bio-canvas-accent) 30%, transparent);--space-tool-crosshair-stroke-color:var(--bio-text);--tooltip-error-background-color:var(--bio-danger-surface-subtle);--tooltip-error-border-color:var(--bio-danger);--tooltip-error-color:var(--bio-danger);--hover-tooltip-font-family:"IBM Plex Sans", sans-serif;--hover-tooltip-font-size:12px;--hover-tooltip-secondary-font-size:11px;--hover-tooltip-background-color:var(--bio-surface-inverted);--hover-tooltip-color:var(--bio-text-on-inverted);--hover-tooltip-shadow-color:var(--bio-shadow-subtle);--palette-tooltip-shortcut-background-color:var(--bio-surface-inverted-subtle)}.djs-container svg.drop-not-ok{background:var(--shape-drop-not-allowed-fill-color)!important}.djs-container svg.new-parent{background:var(--shape-drop-allowed-fill-color)!important}.djs-container svg:focus{outline-offset:-1px}.djs-outline,.djs-selection-outline{fill:none;shape-rendering:geometricprecision;stroke-width:2px}.djs-outline{visibility:hidden}.djs-selection-outline{stroke:var(--element-selected-outline-stroke-color)}.djs-element.selected .djs-outline{visibility:visible;stroke:var(--element-selected-outline-stroke-color)}.djs-connection.selected .djs-outline{display:none}.djs-multi-select .djs-element.selected .djs-outline,.djs-dragging-active-lasso .djs-element.selected .djs-outline{stroke:var(--element-selected-outline-secondary-stroke-color);display:block}.djs-outline-hidden .djs-outline{display:none!important}.djs-shape.connect-ok .djs-visual>:first-child{fill:var(--shape-connect-allowed-fill-color)!important}.djs-shape.connect-not-ok .djs-visual>:first-child,.djs-shape.drop-not-ok .djs-visual>:first-child{fill:var(--shape-drop-not-allowed-fill-color)!important}.djs-shape.new-parent .djs-visual>:first-child{fill:var(--shape-drop-allowed-fill-color)!important}.drop-not-ok,.connect-not-ok,.drop-not-ok *,.connect-not-ok *{cursor:not-allowed!important}.drop-ok,.connect-ok,.drop-ok *,.connect-ok *{cursor:default!important}.djs-element.attach-ok .djs-visual>:first-child{stroke-width:5px!important;stroke:var(--shape-attach-allowed-stroke-color)!important}.djs-frame.connect-not-ok .djs-visual>:first-child,.djs-frame.drop-not-ok .djs-visual>:first-child{stroke-width:3px!important;stroke:var(--shape-drop-not-allowed-fill-color)!important;fill:none!important}.djs-lasso-overlay{fill:var(--lasso-fill-color);stroke:var(--lasso-stroke-color);stroke-width:2px;shape-rendering:geometricprecision;pointer-events:none}.djs-resize-overlay{fill:none;stroke-dasharray:5 1 3 1;stroke:var(--shape-resize-preview-stroke-color);pointer-events:none}.djs-resizer-hit{fill:none;pointer-events:all}.djs-resizer-visual{fill:var(--resizer-fill-color);stroke-width:1px;stroke:var(--resizer-stroke-color);shape-rendering:geometricprecision}.djs-resizer:hover .djs-resizer-visual{stroke:var(--resizer-stroke-color);stroke-opacity:1}.djs-cursor-resize-ns,.djs-resizer-n,.djs-resizer-s{cursor:ns-resize}.djs-cursor-resize-ew,.djs-resizer-e,.djs-resizer-w{cursor:ew-resize}.djs-cursor-resize-nwse,.djs-resizer-nw,.djs-resizer-se{cursor:nwse-resize}.djs-cursor-resize-nesw,.djs-resizer-ne,.djs-resizer-sw{cursor:nesw-resize}.djs-shape.djs-resizing>.djs-outline{visibility:hidden!important}.djs-shape.djs-resizing>.djs-resizer,.djs-dragger>.djs-resizer{visibility:hidden}.djs-dragger *{fill:none!important;stroke:var(--element-dragger-color)!important}.djs-dragger tspan,.djs-dragger text,.djs-dragger marker circle,.djs-dragger marker path,.djs-dragger marker polygon,.djs-dragger marker polyline,.djs-dragger marker rect{fill:var(--element-dragger-color)!important;stroke:none!important}.djs-dragger marker text,.djs-dragger marker tspan{fill:none!important;stroke:var(--element-dragger-color)!important}.djs-dragging,.djs-dragging>*{opacity:.3!important;pointer-events:none!important}.djs-visual,.djs-outline{pointer-events:none}.djs-element.attach-ok .djs-hit{stroke-width:60px!important}.djs-element>.djs-hit-all,.djs-element>.djs-hit-no-move{pointer-events:all}.djs-element>.djs-hit-stroke,.djs-element>.djs-hit-click-stroke{pointer-events:stroke}.djs-connection .djs-visual{stroke-width:2px;fill:none}.djs-cursor-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.djs-cursor-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.djs-cursor-crosshair{cursor:crosshair}.djs-cursor-move{cursor:move}.djs-cursor-resize-ns{cursor:ns-resize}.djs-cursor-resize-ew{cursor:ew-resize}.djs-snap-line{stroke:var(--snap-line-stroke-color);stroke-linecap:round;stroke-width:2px;pointer-events:none}.djs-crosshair{stroke:var(--space-tool-crosshair-stroke-color);stroke-linecap:round;stroke-width:1px;pointer-events:none;shape-rendering:geometricprecision;stroke-dasharray:5 5}.djs-palette{box-sizing:border-box;width:48px;position:absolute;top:20px;left:20px}.djs-palette .separator{border:none;border-bottom:solid 1px var(--palette-separator-color);clear:both;margin:5px;padding-top:5px}.djs-palette .entry:before{vertical-align:initial}.djs-palette .djs-palette-toggle{cursor:pointer}.djs-palette .entry,.djs-palette .djs-palette-toggle{color:var(--palette-entry-color);text-align:center;font-size:30px}.djs-palette .entry{float:left}.djs-palette .entry img{max-width:100%}.djs-palette .djs-palette-entries:after{content:"";clear:both;display:table}.djs-palette .djs-palette-toggle:hover{background:var(--palette-toggle-hover-background-color)}.djs-palette .entry:hover{color:var(--palette-entry-hover-color)}.djs-palette .highlighted-entry{color:var(--palette-entry-selected-color)!important}.djs-palette .entry,.djs-palette .djs-palette-toggle{cursor:default;width:46px;height:46px;line-height:46px}.djs-palette.two-column.open{width:94px}.djs-palette:not(.open) .djs-palette-entries{display:none}.djs-palette:not(.open){overflow:hidden}.djs-palette.open .djs-palette-toggle{display:none}.djs-hover-tooltip{z-index:1000;border-radius:var(--surface-border-radius);background-color:var(--hover-tooltip-background-color);color:var(--hover-tooltip-color);font-family:var(--hover-tooltip-font-family);font-size:var(--hover-tooltip-font-size);white-space:nowrap;pointer-events:none;box-shadow:0 1px 4px var(--hover-tooltip-shadow-color);align-items:center;gap:6px;padding:6px 10px;line-height:1.2;display:flex;position:fixed}.djs-hover-tooltip--right{transform:translateY(-50%)}.djs-hover-tooltip--top{transform:translate(-50%,-100%)}.djs-palette-tooltip-shortcut{border-radius:var(--button-border-radius);background-color:var(--palette-tooltip-shortcut-background-color);font-family:monospace;font-size:var(--hover-tooltip-secondary-font-size);padding:1px 5px;line-height:1.2}.djs-context-pad{pointer-events:none;z-index:100;width:72px;line-height:1;display:none;position:absolute}.djs-context-pad .entry{text-align:center;cursor:default;background-color:var(--context-pad-entry-background-color);width:22px;height:22px;box-shadow:0 0 2px 1px var(--context-pad-entry-background-color);pointer-events:all;vertical-align:middle;border-radius:3px;margin:0 2px 2px 0;font-size:22px;display:inline-block}.djs-context-pad .entry:hover{background:var(--context-pad-entry-hover-background-color)}.djs-context-pad.open{display:block}.djs-popup{box-sizing:border-box;background:var(--popup-background-color);z-index:200;box-shadow:0px 2px 6px var(--popup-shadow-color);border:solid 1px var(--popup-border-color);min-width:120px;max-width:300px;line-height:1;font-size:var(--popup-font-size);font-family:var(--popup-font-family);outline:none;position:fixed;overflow:hidden}.djs-popup-search input{box-sizing:border-box;width:100%;font-size:var(--popup-font-size);border-radius:var(--input-border-radius);border:solid 1px var(--popup-search-border-color);padding:3px 6px 3px 28px;line-height:21px}.djs-popup-search input:focus{background-color:var(--popup-search-focus-background-color);border:solid 1px var(--popup-search-focus-border-color);outline:none}.djs-popup-header{align-items:stretch;margin:10px 12px;line-height:20px;display:flex}.djs-popup-header .entry{border-radius:2px}.djs-popup button.entry{background:0 0;border:0;padding:0}.djs-popup-header .entry.active{color:var(--popup-header-entry-selected-color)}.djs-popup-header .entry.disabled{color:inherit}.djs-popup-header-group{flex-direction:row;align-items:center;margin:0;padding:0;list-style:none;display:flex}.djs-popup-header-group .entry{flex-direction:row;align-items:center;display:flex}.djs-popup-header-group+.djs-popup-header-group:before{content:"";background:var(--popup-header-group-divider-color);width:1px;height:20px;margin:0 5px}.djs-popup-search{width:auto;margin:10px 12px;position:relative}.djs-popup-tabs-container{border-bottom:solid 1px var(--popup-tab-strip-border-color);position:relative}.djs-popup-tabs-scroll{appearance:none;width:28px;color:var(--popup-tab-color);cursor:pointer;border:none;border-radius:0;align-items:center;padding:0;display:flex;position:absolute;top:0;bottom:1px}.djs-popup-tabs-scroll:hover{color:var(--popup-tab-hover-color)}.djs-popup-tabs-scroll-start{background:linear-gradient(to left, transparent, var(--popup-background-color) 60%);justify-content:flex-start;left:0}.djs-popup-tabs-scroll-end{background:linear-gradient(to right, transparent, var(--popup-background-color) 60%);justify-content:flex-end;right:0}.djs-popup-tabs-scroll-start svg{transform:rotate(180deg)}.djs-popup-tabs{scrollbar-width:none;flex-wrap:nowrap;gap:2px;padding:0 12px;scroll-padding:0 28px;display:flex;overflow:auto hidden}.djs-popup-tabs::-webkit-scrollbar{display:none}.djs-popup-tab{appearance:none;font:inherit;font-size:var(--popup-font-size);color:var(--popup-tab-color);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-bottom:2px solid #0000;border-radius:0;flex:none;padding:6px 10px}.djs-popup-tab:hover{color:var(--popup-tab-hover-color)}.djs-popup-tab:focus-visible{outline:solid 1px var(--popup-tab-focus-border-color);outline-offset:-2px}.djs-popup-tab[aria-selected=true]{color:var(--popup-tab-active-color);border-bottom-color:var(--popup-tab-active-border-color);font-weight:var(--popup-header-font-weight)}.djs-popup-title{font-size:var(--popup-font-size);font-weight:var(--popup-header-font-weight);flex:1;margin:0}.djs-popup-breadcrumbs{margin:10px 12px;line-height:20px;display:flex}.djs-popup-breadcrumbs-item{appearance:none;min-width:0;color:var(--popup-description-color);font:inherit;cursor:pointer;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;outline:none;margin:0;padding:0;display:inline-flex;overflow:hidden}.djs-popup-breadcrumbs-item--separator:before{content:"/";color:var(--popup-description-color);margin:0 4px;display:inline-block}.djs-popup-breadcrumbs-item:hover{color:inherit;text-decoration:underline}.djs-popup-breadcrumbs-item:focus-visible{outline:1px solid var(--popup-search-focus-border-color);outline-offset:2px}.djs-popup-breadcrumbs-item--back{border:1px solid var(--popup-search-border-color);border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;margin-right:6px;padding:2px 3px}.djs-popup-breadcrumbs-item--back:hover{background:var(--popup-button-hover-background-color)}.djs-popup-breadcrumbs-item--current{font-weight:var(--popup-header-font-weight);color:inherit;cursor:default}.djs-popup-breadcrumbs-item--current:hover{text-decoration:none}.djs-popup-entry-actions{flex-shrink:0;align-items:center;gap:6px;margin-left:6px;display:flex}.djs-popup-entry-chevron{color:var(--popup-description-color);align-items:center;display:flex}.djs-popup-search-icon{position:absolute;top:7px;left:8px}.djs-popup-search-count{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);margin:0 12px}.djs-popup-results{max-height:280px;margin:7px 3px 7px 12px;padding-right:9px;list-style:none;overflow:auto}.djs-popup-results:focus{outline:none}.djs-popup-group{width:100%;margin:0;padding:0}.djs-popup-body .entry,.djs-popup-body .entry-header{cursor:default;border-radius:4px;padding:5px 7px}.djs-popup-body .entry-header{font-weight:var(--popup-header-font-weight);color:var(--popup-entry-title-color);padding-left:0}.djs-popup [class*=icon] .djs-popup-label,.djs-popup-label:not(:first-child){margin-left:.5em}.djs-popup [class*=icon]:before,.djs-popup-entry-icon{vertical-align:middle;width:1em;height:1em;font-size:1.4em;display:inline-block}.djs-popup-body .entry-header:not(:first-child){margin-top:8px;margin-bottom:2px}.djs-popup-body .entry{flex-direction:row;align-items:stretch;height:min-content;display:flex}.djs-popup .entry.selected{color:var(--popup-entry-selected-color);background-color:var(--popup-entry-selected-background-color)}.djs-popup .entry.disabled{color:var(--popup-disabled-color);cursor:not-allowed}.djs-popup-body .entry:not(:first-child){margin-top:2px}.djs-popup-entry-content{flex-direction:column;flex:1;display:flex}.djs-popup-entry-description{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);margin-top:.25em}.djs-popup-label,.djs-popup-entry-description{line-height:1.4em}.djs-popup .entry,.djs-popup .entry-header{margin:1px}.djs-popup-body{flex-direction:column;width:auto}.djs-popup ::-webkit-scrollbar{width:6px}.djs-popup ::-webkit-scrollbar-thumb{background-color:var(--popup-scrollbar-thumb-color);border-radius:3px}.djs-popup ::-webkit-scrollbar-track{box-shadow:none;background:0 0;margin:0;padding:5px}.djs-popup-no-results{color:var(--popup-no-results-color);padding:0 12px 12px}.djs-popup-footer{border-top:solid 1px var(--popup-border-color);padding:5px 12px 7px;display:flex}.djs-popup-results:hover~.djs-popup-footer{display:none}.djs-popup-entry-docs{visibility:hidden;color:var(--popup-description-color);background:var(--popup-button-background-color);border:1px solid var(--popup-search-border-color);cursor:pointer;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;padding:2px 3px;transition:background-color .12s,border-color .12s,color .12s;display:flex}.djs-popup-body .entry:hover .djs-popup-entry-docs{visibility:visible}.djs-popup-body .entry .djs-popup-entry-docs:hover{background:var(--popup-button-hover-background-color)}.djs-popup-entry-docs svg{vertical-align:middle}.djs-popup-footer-docs{font-size:var(--popup-secondary-font-size);color:var(--popup-description-color);align-items:center;gap:3px;text-decoration:none;display:inline-flex}.djs-popup-footer-docs:hover{text-decoration:underline}.djs-popup-footer-docs svg{vertical-align:middle;margin:2px}.djs-palette{background:var(--palette-background-color);border:solid 1px var(--palette-border-color);border-radius:var(--surface-border-radius)}.djs-segment-dragger,.djs-bendpoint{display:none}.djs-segment-dragger .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-width:1px;stroke-opacity:1;display:none}.djs-segment-dragger:hover .djs-visual{display:block}.djs-bendpoint .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-width:1px}.djs-segment-dragger:hover,.djs-bendpoints.hover .djs-segment-dragger,.djs-bendpoints.selected .djs-segment-dragger,.djs-bendpoint:hover,.djs-bendpoints.hover .djs-bendpoint,.djs-bendpoints.selected .djs-bendpoint{display:block}.djs-drag-active .djs-bendpoints *,.djs-bendpoints:not(.hover) .floating,.djs-bendpoint.floating:not(.positioned){display:none}.djs-segment-dragger:hover .djs-visual,.djs-segment-dragger.djs-dragging .djs-visual,.djs-bendpoint:hover .djs-visual,.djs-bendpoint.floating .djs-visual{fill:var(--bendpoint-fill-color);stroke:var(--bendpoint-stroke-color);stroke-opacity:1}.djs-bendpoint.floating .djs-hit{pointer-events:none}.djs-segment-dragger .djs-hit,.djs-bendpoint .djs-hit{fill:none;pointer-events:all}.djs-segment-dragger.horizontal .djs-hit{cursor:ns-resize}.djs-segment-dragger.vertical .djs-hit{cursor:ew-resize}.djs-segment-dragger.djs-dragging .djs-hit{pointer-events:none}.djs-updating,.djs-updating>*{pointer-events:none!important}.djs-updating .djs-context-pad,.djs-updating .djs-outline,.djs-updating .djs-bendpoint,.djs-multi-select .djs-bendpoint,.djs-multi-select .djs-segment-dragger,.connect-ok .djs-bendpoint,.connect-not-ok .djs-bendpoint,.drop-ok .djs-bendpoint,.drop-not-ok .djs-bendpoint{display:none!important}.djs-segment-dragger.djs-dragging,.djs-bendpoint.djs-dragging{opacity:1;display:block}.djs-tooltip-error{background:var(--tooltip-error-background-color);border:solid 1px var(--tooltip-error-border-color);border-radius:var(--surface-border-radius);width:160px;color:var(--tooltip-error-color);opacity:.75;padding:6px;font-size:12px;line-height:16px}.djs-tooltip-error:hover{opacity:1}.djs-search-open .djs-context-pad{display:none}.djs-search-open .djs-connection.selected .djs-outline{display:block}.djs-search-container{z-index:10;width:25%;min-width:300px;max-width:400px;font-family:var(--search-font-family);font-size:var(--search-font-size);border-radius:var(--surface-border-radius);box-shadow:0px 2px 6px var(--search-shadow-color);margin-left:auto;margin-right:auto;position:absolute;top:20px;left:0;right:0}.djs-search-container:not(.open){display:none}.djs-search-input{position:relative}.djs-search-input svg{position:absolute;top:7px;left:8px}.djs-search-input input{font-size:var(--search-font-size);border:1px solid var(--search-input-border-color);border-radius:var(--input-border-radius);box-sizing:border-box;width:100%;padding:3px 6px 3px 28px;line-height:21px}.djs-search-input input:focus{background-color:var(--search-input-focus-background-color);border:solid 1px var(--search-input-focus-border-color);outline:none}.djs-search-results{background:var(--search-container-background-color);max-height:200px;position:relative;overflow-y:auto}.djs-search-result{padding:6px 8px}.djs-search-result-primary{text-overflow:ellipsis;white-space:nowrap;margin:0 0 3px;overflow:hidden}.djs-search-result-secondary{text-overflow:ellipsis;white-space:nowrap;color:var(--search-result-secondary-color);margin:0;font-family:monospace;overflow:hidden}.djs-search-result:hover,.djs-search-result-selected,.djs-search-result-selected:hover{background:var(--search-result-hover-background-color)}.djs-search-open .djs-element .djs-outline{fill:var(--search-preselected-background-color)!important}.djs-element-hidden,.djs-element-hidden .djs-hit,.djs-element-hidden .djs-outline,.djs-label-hidden .djs-label{display:none!important}.djs-element .djs-hit-stroke,.djs-element .djs-hit-click-stroke,.djs-element .djs-hit-all{cursor:move}:root{--cd-blau:#335de5;--cd-gruen:#00e676;--cd-grau:#f9f7f7;--cd-schwarz:#1d1d1d;--cd-weiss:#fff;--cd-blau-link:#2b50d4;--cd-blau-hell:#6b8aff;--cd-success:#0b7a55;--cd-success-soft:#0b7a551f;--cd-warning:#92610a;--cd-warning-soft:#92610a1f;--cd-danger:#c92a2a;--cd-danger-soft:#c92a2a1f;--cd-info:#2b50d4;--cd-info-soft:#2b50d41f;--cd-gradient-brand:linear-gradient(120deg, #335de5 30%, #00e676);--cd-gradient-format:linear-gradient(135deg, #335de5 0%, #00e676 140%);--cd-space-1:4px;--cd-space-2:8px;--cd-space-3:16px;--cd-space-4:24px;--cd-space-5:32px;--cd-space-6:48px;--cd-space-7:64px;--cd-space-8:96px;--cd-radius-sm:6px;--cd-radius-md:12px;--cd-radius-lg:16px;--cd-radius-pill:999px;--cd-shadow-1:0 1px 2px #1d1d1d0f, 0 1px 3px #1d1d1d1a;--cd-shadow-2:0 4px 12px #1d1d1d1a;--cd-shadow-3:0 12px 32px #1d1d1d29;--cd-motion-fast:.15s;--cd-motion-base:.25s;--cd-motion-slow:.4s;--cd-ease:cubic-bezier(.4, 0, .2, 1);--cd-ease-out:cubic-bezier(0, 0, .2, 1)}.tt-djs-container{--tt-accent:var(--cd-blau);--tt-accent-soft:#335de51f;--tt-line:#e6e2e2;--tt-ink:var(--cd-schwarz);--element-selected-outline-stroke-color:var(--tt-accent);--element-selected-outline-secondary-stroke-color:#335de580;--lasso-fill-color:var(--tt-accent-soft);--lasso-stroke-color:var(--tt-accent);--palette-entry-selected-color:var(--tt-accent);background-color:var(--cd-grau);background-image:radial-gradient(#1d1d1d0f .6px,#0000 .6px);background-size:22px 22px;width:100%;height:100%;font-family:Geist Variable,Geist,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;position:relative;overflow:hidden}.tt-djs-container:focus,.tt-djs-container:focus-visible,.tt-djs-container svg:focus{outline:none}.tt-djs-container .djs-element text{-webkit-user-select:none;user-select:none}.tt-djs-container .djs-element.hover .djs-visual>:first-child:not(text),.tt-djs-container .djs-element.selected .djs-visual>:first-child:not(text){stroke:var(--tt-accent)!important}.tt-djs-container .djs-outline{stroke:var(--tt-accent);stroke-dasharray:3 3}.tt-djs-container .djs-selection-outline,.tt-djs-container .djs-lasso-overlay{stroke-width:1.5px;stroke-dasharray:5 4}.tt-djs-container .djs-resizer-visual{fill:var(--cd-weiss);stroke:var(--tt-accent)}.tt-djs-container .djs-resizer-hit{fill:none}.djs-palette{background:var(--cd-weiss);border:1px solid var(--tt-line);border-radius:var(--cd-radius-md);width:auto;box-shadow:var(--cd-shadow-2);align-items:center;padding:5px 6px;display:flex;top:12px;left:50%;transform:translate(-50%)}.djs-palette .djs-palette-entries,.djs-palette .group{flex-direction:row;align-items:center;gap:2px;display:flex}.djs-palette .entry{float:none;border-radius:var(--cd-radius-sm);width:40px;height:40px;color:var(--tt-ink);line-height:normal;transition:background .12s,color .12s,box-shadow .12s;position:relative}.djs-palette .entry:hover{background:var(--tt-accent-soft);color:var(--tt-accent)}.djs-palette .group+.group{margin-left:9px;padding-left:9px;position:relative}.djs-palette .group+.group:before{content:"";background:var(--tt-line);width:1px;position:absolute;top:6px;bottom:6px;left:0}.tt-palette-entry{justify-content:center;align-items:center;width:100%;min-width:24px;height:100%;min-height:24px;line-height:1;display:flex}.tt-palette-svg{pointer-events:none;display:block}.tt-mode-entry.is-active,.djs-palette .entry.highlighted-entry{background:var(--tt-accent-soft);box-shadow:inset 0 0 0 1.5px var(--tt-accent)}.tt-djs-container .tt-cp-entry{width:100%;min-width:22px;height:100%;min-height:22px;color:var(--tt-ink);justify-content:center;align-items:center;display:flex}.tt-djs-container .djs-context-pad .entry{border-radius:var(--cd-radius-sm);box-shadow:var(--cd-shadow-1);background:var(--cd-weiss);transition:background .12s,color .12s}.tt-djs-container .djs-context-pad .entry:hover{background:var(--tt-accent-soft);color:var(--tt-accent)}.tt-djs-container .tt-label-editor{z-index:100;box-sizing:border-box;resize:none;white-space:pre-wrap;overflow-wrap:break-word;caret-color:var(--tt-accent);background:0 0;border:0;outline:none;margin:0;padding:0;position:absolute;overflow:hidden}.tt-djs-container .djs-element.tt-label-editing .djs-visual>text{visibility:hidden}
2
2
  /*$vite$:1*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miragon/team-topologies-renderer",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Render and edit Team Topologies diagrams in the browser, with a framework-agnostic viewer and modeler built on diagram-js.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,7 +37,7 @@
37
37
  "test:browser": "npm --prefix ../.. run test:browser"
38
38
  },
39
39
  "dependencies": {
40
- "@miragon/team-topologies-schema-model": "0.8.0"
40
+ "@miragon/team-topologies-schema-model": "0.9.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "diagram-js": "^15.26.0",
@@ -46,13 +46,13 @@
46
46
  "zod": "^4.6.0"
47
47
  },
48
48
  "devDependencies": {
49
- "diagram-js": "15.26.0",
49
+ "diagram-js": "15.27.1",
50
50
  "didi": "11.0.0",
51
51
  "tiny-svg": "4.1.4",
52
52
  "typescript": "6.0.3",
53
- "vite": "8.3.0",
53
+ "vite": "8.3.1",
54
54
  "vite-plugin-dts": "5.1.1",
55
- "vitest": "5.0.1",
55
+ "vitest": "5.0.2",
56
56
  "zod": "4.6.5"
57
57
  }
58
58
  }