kaabalah 6.12.0 → 6.13.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/README.md +18 -2
- package/dist/chunk-5PZ7EB2E.js +3659 -0
- package/dist/chunk-5PZ7EB2E.js.map +1 -0
- package/dist/{chunk-LUHQNKKJ.js → chunk-6GDEXIDI.js} +13 -1
- package/dist/chunk-6GDEXIDI.js.map +1 -0
- package/dist/{chunk-M2FTEWY2.js → chunk-GET23WEG.js} +86 -1
- package/dist/chunk-GET23WEG.js.map +1 -0
- package/dist/{chunk-SLB2NLWI.mjs → chunk-LXJ3THNW.mjs} +12 -2
- package/dist/chunk-LXJ3THNW.mjs.map +1 -0
- package/dist/{chunk-FCAIGKB5.js → chunk-MWHMP3LI.js} +5 -5
- package/dist/{chunk-7LIIEUJB.mjs → chunk-V5KXYFHZ.mjs} +2 -2
- package/dist/{chunk-Y3TLBFPD.mjs → chunk-WER5UY5M.mjs} +85 -2
- package/dist/chunk-WER5UY5M.mjs.map +1 -0
- package/dist/chunk-ZE2KPCHT.mjs +3625 -0
- package/dist/chunk-ZE2KPCHT.mjs.map +1 -0
- package/dist/cli.js +4212 -206
- package/dist/cli.js.map +1 -1
- package/dist/{correspondence-model-JSyDWwmn.d.mts → constants-C0XjrYIG.d.mts} +1 -297
- package/dist/{correspondence-model-JSyDWwmn.d.ts → constants-C0XjrYIG.d.ts} +1 -297
- package/dist/core/index.d.mts +5 -3
- package/dist/core/index.d.ts +5 -3
- package/dist/correspondence-model-5JQwAX16.d.ts +299 -0
- package/dist/correspondence-model-QJK8AilM.d.mts +299 -0
- package/dist/{data-CdjlIcAo.d.mts → data-2Hp_b3BD.d.mts} +1 -1
- package/dist/{data-_b06lgY6.d.ts → data-BXhkIF1M.d.ts} +1 -1
- package/dist/gematria/index.d.mts +2 -1
- package/dist/gematria/index.d.ts +2 -1
- package/dist/iching/index.d.mts +912 -0
- package/dist/iching/index.d.ts +912 -0
- package/dist/iching/index.js +143 -0
- package/dist/iching/index.js.map +1 -0
- package/dist/iching/index.mjs +6 -0
- package/dist/iching/index.mjs.map +1 -0
- package/dist/index.d.mts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +292 -143
- package/dist/index.mjs +4 -3
- package/dist/semantic/index.d.mts +3 -2
- package/dist/semantic/index.d.ts +3 -2
- package/dist/semantic/index.js +21 -21
- package/dist/semantic/index.mjs +2 -2
- package/dist/swisseph.node.js +0 -0
- package/dist/swisseph.web.js +0 -0
- package/dist/tarot/index.d.mts +34 -4
- package/dist/tarot/index.d.ts +34 -4
- package/dist/tarot/index.js +29 -21
- package/dist/tarot/index.mjs +1 -1
- package/dist/{topology-CH3hsIqO.d.mts → topology-C8PdKGeK.d.ts} +2 -1
- package/dist/{topology-DXYTpDvj.d.ts → topology-sytcjXkx.d.mts} +2 -1
- package/dist/visual/index.d.mts +6 -3
- package/dist/visual/index.d.ts +6 -3
- package/dist/visual/index.js +50 -42
- package/dist/visual/index.mjs +1 -1
- package/dist/wasm/build/swisseph.node.js +0 -0
- package/dist/wasm/build/swisseph.web.js +0 -0
- package/ephe/seas_18.se1 +0 -0
- package/ephe/semo_18.se1 +0 -0
- package/ephe/sepl_18.se1 +0 -0
- package/package.json +6 -1
- package/wasm/build/swisseph.node.js +0 -0
- package/wasm/build/swisseph.web.js +0 -0
- package/dist/chunk-LUHQNKKJ.js.map +0 -1
- package/dist/chunk-M2FTEWY2.js.map +0 -1
- package/dist/chunk-SLB2NLWI.mjs.map +0 -1
- package/dist/chunk-Y3TLBFPD.mjs.map +0 -1
- /package/dist/{chunk-7LIIEUJB.mjs.map → chunk-MWHMP3LI.js.map} +0 -0
- /package/dist/{chunk-FCAIGKB5.js.map → chunk-V5KXYFHZ.mjs.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/visual/archeometer.ts","../src/visual/astro-glyph-assets.ts","../src/visual/astro-glyph-registry.ts","../src/visual/astro-wheel.ts","../src/visual/tree.ts"],"names":["id","TAU","escapeAttr","fmt","normalizeViewBox","resolvePalette","round","angleOf","deg2rad","buildRings","escapeText","polarToXY","textFontFamily","lineFromPolar","rad2deg","midpoint","arcPath"],"mappings":";;;;;;;;;;;;AAqPA,IAAM,MAAM,KAAK,KAAK;AAEf,IAAM,8BAA+D;AAAA,EAC1E,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,IAAM,gCAAgC;AAEtC,IAAM,iBAAoD;AAAA,EACxD,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AACf;AAEA,IAAM,mBAAsD;AAAA,EAC1D,aAAa;AAAA,EACb,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,aAAa;AACf;AAEA,IAAM,gBAA4C;AAAA,EAChD,OAAO;AAAA,EACP,KAAK;AAAA,EACL,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,UAAU;AAAA,EACV,WAAW;AACb;AAEO,IAAM,6CAAyF;AAAA,EACpG;AAAA,IACE,QAAQ;AAAA,IACR,WAAW,EAAE,IAAI,MAAM,QAAQ,GAAG,QAAQ,SAAS,QAAQ,IAAI,OAAO,WAAW,YAAY,aAAa,OAAO,oBAAoB;AAAA,IACrI,eAAe,EAAE,QAAQ,GAAG,OAAO,SAAS,QAAQ,IAAI;AAAA,IACxD,aAAa,EAAE,QAAQ,GAAG,MAAM,KAAK;AAAA,IACrC,YAAY,EAAE,QAAQ,GAAG,MAAM,aAAa,OAAO,SAAI;AAAA,IACvD,gBAAgB,EAAE,Q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,SAAS,WAAWJ,YAAW,QAAQ,CAAC;AAAA,EAC5G;AACA,OAAK,MAAM;AACb;AAEA,SAAS,wBACP,MACA,OACA,QACA,MACA,SACA;AACA;AAAA,IACE,eAAe,MAAM,CAAC,SAAS,MAAM,CAAC,QAAQ,MAAM,WAAWA,YAAW,cAAc,MAAM,SAAS,CAAC,CAAC,mBAAmB,OAAO;AAAA,EACrI;AACF;AAEA,SAAS,oBAAoB,MAAqC;AAChE,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,WAAO,CAAC,KAAK,CAAC,KAAK,SAAS,KAAK,CAAC,KAAK,OAAO;AAAA,EAChD;AAEA,MAAI,MAAM;AACR,WAAO,CAAC,MAAM,OAAO;AAAA,EACvB;AAEA,SAAO,CAAC,SAAS,OAAO;AAC1B;AAEA,SAASA,YAAW,OAAe;AACjC,SAAO,MACJ,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ;AAC3B","sourcesContent":["/**\n * Archeometer SVG renderer.\n */\n\nexport interface ArcheometerSvgViewBox {\n minX?: number;\n minY?: number;\n width: number;\n height: number;\n}\n\nexport interface ArcheometerPoint {\n x: number;\n y: number;\n}\n\nexport interface ArcheometerLine {\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n}\n\nexport interface ArcheometerCircleHitTarget {\n kind: \"circle\";\n cx: number;\n cy: number;\n r: number;\n}\n\nexport interface ArcheometerPolygonHitTarget {\n kind: \"polygon\";\n points: readonly ArcheometerPoint[];\n}\n\nexport type ArcheometerHitTarget = ArcheometerCircleHitTarget | ArcheometerPolygonHitTarget;\n\nexport interface ArcheometerAnchor {\n x: number;\n y: number;\n}\n\nexport type ArcheometerRingId =\n | \"degreeOuter\"\n | \"degreeInner\"\n | \"zodiacUtterance\"\n | \"planetaryUtterance\"\n | \"cosmologicalMusic\"\n | \"astralZodiac\"\n | \"astralPlanetary\"\n | \"chromicRays\"\n | \"whiteRays\"\n | \"solarCenter\";\n\nexport interface ArcheometerRing {\n id: ArcheometerRingId;\n r1: number;\n r2: number;\n}\n\nexport type ArcheometerTriangleId = \"wordJesus\" | \"mary\" | \"ether\" | \"divineFire\";\n\nexport interface ArcheometerTriangleSpec {\n id: ArcheometerTriangleId | (string & {});\n title: string;\n phrase: string;\n apex: \"north\" | \"south\" | \"east\" | \"west\" | string;\n vertices: readonly [number, number, number];\n fill: string;\n vertexFills?: readonly [string, string, string];\n stroke: string;\n}\n\nexport interface ArcheometerUtterancePoint {\n id: string;\n degree: number;\n letter: string;\n number: number | string;\n color: string;\n triangleId: ArcheometerTriangleSpec[\"id\"];\n gloss?: string;\n}\n\nexport interface ArcheometerMusicalNote {\n degree: number;\n note: string;\n color?: string;\n}\n\nexport interface ArcheometerTriangleLabel {\n degree: number;\n label: string;\n number?: number | string;\n}\n\nexport interface ArcheometerZodiacSign {\n degree: number;\n name: string;\n glyph: string;\n color?: string;\n}\n\nexport interface ArcheometerPlanetaryPoint {\n degree: number;\n name: string;\n glyph: string;\n color?: string;\n phase?: \"diurnal\" | \"nocturnal\" | string;\n}\n\nexport interface ArcheometerSectorCorrespondence {\n degree: number;\n utterance: ArcheometerUtterancePoint;\n triangleLabel: ArcheometerTriangleLabel;\n musicalNote: ArcheometerMusicalNote;\n zodiacSign: ArcheometerZodiacSign;\n planetaryPoint: ArcheometerPlanetaryPoint;\n}\n\nexport interface ArcheometerLayerOptions {\n degreeCrown?: boolean;\n zodiacUtterance?: boolean;\n planetaryUtterance?: boolean;\n cosmologicalMusic?: boolean;\n astralZodiac?: boolean;\n astralPlanetary?: boolean;\n chromicRays?: boolean;\n whiteRays?: boolean;\n solarCenter?: boolean;\n}\n\nexport interface ArcheometerPaletteOverrides {\n paper?: string;\n ink?: string;\n subtleInk?: string;\n ringStroke?: string;\n degreeTick?: string;\n degreeLabel?: string;\n whiteRay?: string;\n ringFills?: Partial<Record<ArcheometerRingId, string>>;\n}\n\nexport type ArcheometerPalette = \"color\" | ArcheometerPaletteOverrides;\n\nexport interface ResolvedArcheometerPalette {\n paper: string;\n ink: string;\n subtleInk: string;\n ringStroke: string;\n degreeTick: string;\n degreeLabel: string;\n whiteRay: string;\n ringFills: Record<ArcheometerRingId, string>;\n}\n\nexport interface ArcheometerSvgOptions {\n width?: number | string;\n height?: number | string;\n viewBox?: ArcheometerSvgViewBox;\n background?: string | \"transparent\";\n title?: string;\n palette?: ArcheometerPalette;\n padding?: number;\n /** 0° is north; positive degrees rotate clockwise. */\n rotationDegrees?: number;\n degreeLabelEvery?: number;\n layers?: ArcheometerLayerOptions;\n utterance?: readonly ArcheometerUtterancePoint[];\n triangles?: readonly ArcheometerTriangleSpec[];\n triangleLabels?: readonly ArcheometerTriangleLabel[];\n musicalNotes?: readonly ArcheometerMusicalNote[];\n zodiacSigns?: readonly ArcheometerZodiacSign[];\n planetaryPoints?: readonly ArcheometerPlanetaryPoint[];\n}\n\nexport interface ArcheometerRenderModel {\n viewBox: Required<ArcheometerSvgViewBox>;\n center: ArcheometerPoint;\n outerRadius: number;\n scale: number;\n rings: Record<ArcheometerRingId, ArcheometerRing>;\n palette: ResolvedArcheometerPalette;\n rotationDegrees: number;\n layers: Required<ArcheometerLayerOptions>;\n degreeLabelEvery: number;\n utterance: readonly ArcheometerUtterancePoint[];\n triangles: readonly ArcheometerTriangleSpec[];\n triangleLabels: readonly ArcheometerTriangleLabel[];\n musicalNotes: readonly ArcheometerMusicalNote[];\n zodiacSigns: readonly ArcheometerZodiacSign[];\n planetaryPoints: readonly ArcheometerPlanetaryPoint[];\n geometry: ArcheometerGeometry;\n}\n\nexport interface ArcheometerGeometry {\n utterancePoints: readonly ArcheometerElementGeometry<ArcheometerUtterancePoint>[];\n triangles: readonly ArcheometerTriangleGeometry[];\n triangleLabels: readonly ArcheometerElementGeometry<ArcheometerTriangleLabel>[];\n musicalNotes: readonly ArcheometerElementGeometry<ArcheometerMusicalNote>[];\n zodiacSigns: readonly ArcheometerElementGeometry<ArcheometerZodiacSign>[];\n planetaryPoints: readonly ArcheometerElementGeometry<ArcheometerPlanetaryPoint>[];\n degreeTicks: readonly ArcheometerDegreeTickGeometry[];\n rays: readonly ArcheometerRayGeometry[];\n center: ArcheometerCenterGeometry;\n}\n\nexport interface ArcheometerElementGeometry<T> {\n id: string;\n layerId: ArcheometerRingId | \"triangleLabels\";\n data: T;\n degree: number;\n anchor: ArcheometerAnchor;\n hitTarget: ArcheometerHitTarget;\n}\n\nexport interface ArcheometerTriangleGeometry {\n id: string;\n layerId: \"planetaryUtterance\" | \"chromicRays\";\n data: ArcheometerTriangleSpec;\n vertices: readonly ArcheometerPoint[];\n centroid: ArcheometerPoint;\n path: string;\n hitTarget: ArcheometerPolygonHitTarget;\n}\n\nexport interface ArcheometerDegreeTickGeometry {\n id: string;\n degree: number;\n outerAnchor: ArcheometerAnchor;\n innerAnchor: ArcheometerAnchor;\n}\n\nexport interface ArcheometerRayGeometry {\n id: string;\n degree: number;\n layerId: \"whiteRays\";\n line: ArcheometerLine;\n}\n\nexport interface ArcheometerCenterGeometry {\n id: \"solar-center\";\n anchor: ArcheometerAnchor;\n hitTarget: ArcheometerCircleHitTarget;\n}\n\nconst TAU = Math.PI * 2;\n\nexport const ARCHEOMETER_DEFAULT_VIEWBOX: Required<ArcheometerSvgViewBox> = {\n minX: 0,\n minY: 0,\n width: 912,\n height: 912,\n};\n\nconst ARCHEOMETER_OUTER_CROWN_BLEED = 22;\n\nconst DEFAULT_LAYERS: Required<ArcheometerLayerOptions> = {\n degreeCrown: true,\n zodiacUtterance: true,\n planetaryUtterance: true,\n cosmologicalMusic: true,\n astralZodiac: true,\n astralPlanetary: true,\n chromicRays: true,\n whiteRays: true,\n solarCenter: true,\n};\n\nconst COLOR_RING_FILLS: Record<ArcheometerRingId, string> = {\n degreeOuter: \"#fff8ef\",\n degreeInner: \"#fff2e1\",\n zodiacUtterance: \"#eba0be\",\n planetaryUtterance: \"#fffaf1\",\n cosmologicalMusic: \"#fffaf0\",\n astralZodiac: \"#efc0bc\",\n astralPlanetary: \"#d2e8df\",\n chromicRays: \"#fff3d4\",\n whiteRays: \"#eef1ec\",\n solarCenter: \"#f7d65b\",\n};\n\nconst COLOR_PALETTE: ResolvedArcheometerPalette = {\n paper: \"#fffaf1\",\n ink: \"#151515\",\n subtleInk: \"#605a54\",\n ringStroke: \"#171717\",\n degreeTick: \"#171717\",\n degreeLabel: \"#171717\",\n whiteRay: \"#25395a\",\n ringFills: COLOR_RING_FILLS,\n};\n\nexport const DEFAULT_ARCHEOMETER_SECTOR_CORRESPONDENCES: readonly ArcheometerSectorCorrespondence[] = [\n {\n degree: 0,\n utterance: { id: \"ph\", degree: 0, letter: \"P, Ph\", number: 80, color: \"#f2d54c\", triangleId: \"wordJesus\", gloss: \"Utterance / light\" },\n triangleLabel: { degree: 0, label: \"S, Sh\", number: 300 },\n musicalNote: { degree: 0, note: \"Si\" },\n zodiacSign: { degree: 0, name: \"Capricorn\", glyph: \"♑\" },\n planetaryPoint: { degree: 0, name: \"Saturn\", glyph: \"♄\", phase: \"diurnal\" },\n },\n {\n degree: 30,\n utterance: { id: \"za\", degree: 30, letter: \"W, OU\", number: 70, color: \"#b7d56a\", triangleId: \"ether\", gloss: \"Ether\" },\n triangleLabel: { degree: 30, label: \"D\", number: 4 },\n musicalNote: { degree: 30, note: \"Do\" },\n zodiacSign: { degree: 30, name: \"Sagittarius\", glyph: \"♐\" },\n planetaryPoint: { degree: 30, name: \"Jupiter\", glyph: \"♃\", phase: \"diurnal\" },\n },\n {\n degree: 60,\n utterance: { id: \"ma\", degree: 60, letter: \"M\", number: 40, color: \"#79bf6a\", triangleId: \"mary\", gloss: \"Mary\" },\n triangleLabel: { degree: 60, label: \"C\", number: 20 },\n musicalNote: { degree: 60, note: \"Ré\" },\n zodiacSign: { degree: 60, name: \"Scorpio\", glyph: \"♏\" },\n planetaryPoint: { degree: 60, name: \"Mars\", glyph: \"♂\", phase: \"diurnal\" },\n },\n {\n degree: 90,\n utterance: { id: \"u\", degree: 90, letter: \"L\", number: 30, color: \"#69ad74\", triangleId: \"divineFire\", gloss: \"Fire\" },\n triangleLabel: { degree: 90, label: \"\" },\n musicalNote: { degree: 90, note: \"Mi\" },\n zodiacSign: { degree: 90, name: \"Libra\", glyph: \"♎\" },\n planetaryPoint: { degree: 90, name: \"Venus\", glyph: \"♀\", phase: \"diurnal\" },\n },\n {\n degree: 120,\n utterance: { id: \"o\", degree: 120, letter: \"I, Y, J\", number: 10, color: \"#efb83e\", triangleId: \"wordJesus\", gloss: \"Voice / sound\" },\n triangleLabel: { degree: 120, label: \"Ts\", number: 90 },\n musicalNote: { degree: 120, note: \"Fa\" },\n zodiacSign: { degree: 120, name: \"Virgo\", glyph: \"♍\" },\n planetaryPoint: { degree: 120, name: \"Mercury\", glyph: \"☿\", phase: \"diurnal\" },\n },\n {\n degree: 150,\n utterance: { id: \"la\", degree: 150, letter: \"T\", number: 9, color: \"#ec8d3f\", triangleId: \"ether\", gloss: \"Ether\" },\n triangleLabel: { degree: 150, label: \"N\", number: 50 },\n musicalNote: { degree: 150, note: \"Sol\" },\n zodiacSign: { degree: 150, name: \"Leo\", glyph: \"♌\" },\n planetaryPoint: { degree: 150, name: \"Sun\", glyph: \"☉\", phase: \"diurnal\" },\n },\n {\n degree: 180,\n utterance: { id: \"ri\", degree: 180, letter: \"E, H\", number: 8, color: \"#df4d43\", triangleId: \"mary\", gloss: \"Descending R\" },\n triangleLabel: { degree: 180, label: \"B\", number: 2 },\n musicalNote: { degree: 180, note: \"La\" },\n zodiacSign: { degree: 180, name: \"Cancer\", glyph: \"♋\" },\n planetaryPoint: { degree: 180, name: \"Moon\", glyph: \"☾\", phase: \"nocturnal\" },\n },\n {\n degree: 210,\n utterance: { id: \"t\", degree: 210, letter: \"Z\", number: 7, color: \"#8b54ad\", triangleId: \"divineFire\", gloss: \"Divine fire\" },\n triangleLabel: { degree: 210, label: \"Ts\", number: 90 },\n musicalNote: { degree: 210, note: \"Si\" },\n zodiacSign: { degree: 210, name: \"Gemini\", glyph: \"♊\" },\n planetaryPoint: { degree: 210, name: \"Mercury\", glyph: \"☿\", phase: \"nocturnal\" },\n },\n {\n degree: 240,\n utterance: { id: \"y\", degree: 240, letter: \"V, OU\", number: 6, color: \"#d85c43\", triangleId: \"wordJesus\", gloss: \"Word / JeShU\" },\n triangleLabel: { degree: 240, label: \"G\", number: 3 },\n musicalNote: { degree: 240, note: \"Do\" },\n zodiacSign: { degree: 240, name: \"Taurus\", glyph: \"♉\" },\n planetaryPoint: { degree: 240, name: \"Venus\", glyph: \"♀\", phase: \"nocturnal\" },\n },\n {\n degree: 270,\n utterance: { id: \"ka\", degree: 270, letter: \"H, E\", number: 5, color: \"#3c82c2\", triangleId: \"ether\", gloss: \"Etheric power\" },\n triangleLabel: { degree: 270, label: \"C\", number: 20 },\n musicalNote: { degree: 270, note: \"Ré\" },\n zodiacSign: { degree: 270, name: \"Aries\", glyph: \"♈\" },\n planetaryPoint: { degree: 270, name: \"Mars\", glyph: \"♂\", phase: \"nocturnal\" },\n },\n {\n degree: 300,\n utterance: { id: \"h\", degree: 300, letter: \"R\", number: 200, color: \"#d4579c\", triangleId: \"mary\", gloss: \"Living waters\" },\n triangleLabel: { degree: 300, label: \"D\", number: 4 },\n musicalNote: { degree: 300, note: \"Mi\" },\n zodiacSign: { degree: 300, name: \"Pisces\", glyph: \"♓\" },\n planetaryPoint: { degree: 300, name: \"Jupiter\", glyph: \"♃\", phase: \"nocturnal\" },\n },\n {\n degree: 330,\n utterance: { id: \"hou\", degree: 330, letter: \"K\", number: 100, color: \"#7963b8\", triangleId: \"divineFire\", gloss: \"Divine fire\" },\n triangleLabel: { degree: 330, label: \"S, Sh\", number: 300 },\n musicalNote: { degree: 330, note: \"Fa\" },\n zodiacSign: { degree: 330, name: \"Aquarius\", glyph: \"♒\" },\n planetaryPoint: { degree: 330, name: \"Saturn\", glyph: \"♄\", phase: \"nocturnal\" },\n },\n] as const;\n\nexport const DEFAULT_ARCHEOMETER_UTTERANCE: readonly ArcheometerUtterancePoint[] = DEFAULT_ARCHEOMETER_SECTOR_CORRESPONDENCES.map((sector) => sector.utterance);\n\nexport const DEFAULT_ARCHEOMETER_TRIANGLE_LABELS: readonly ArcheometerTriangleLabel[] = DEFAULT_ARCHEOMETER_SECTOR_CORRESPONDENCES.map((sector) => sector.triangleLabel);\n\nexport const DEFAULT_ARCHEOMETER_TRIANGLES: readonly ArcheometerTriangleSpec[] = [\n { id: \"wordJesus\", title: \"Triangle of the Word / JeShU\", phrase: \"Y-PhO\", apex: \"north\", vertices: [0, 120, 240], fill: \"#f2cf45\", vertexFills: [\"#f2cf45\", \"#5470a5\", \"#dd3e38\"], stroke: \"#171717\" },\n { id: \"mary\", title: \"Triangle of Mary / Living Waters\", phrase: \"Ma-Ri-H\", apex: \"south\", vertices: [180, 300, 60], fill: \"#e25b61\", vertexFills: [\"#cc58a1\", \"#f28a32\", \"#78bd79\"], stroke: \"#171717\" },\n { id: \"ether\", title: \"Triangle of the Ether\", phrase: \"La-Ka-Za\", apex: \"west\", vertices: [270, 30, 150], fill: \"#78bd79\", vertexFills: [\"#e96836\", \"#b7bd58\", \"#8f69a3\"], stroke: \"#171717\" },\n { id: \"divineFire\", title: \"Triangle of Divine Fire\", phrase: \"Hou-U-T\", apex: \"east\", vertices: [90, 210, 330], fill: \"#cc58a1\", vertexFills: [\"#63a890\", \"#d45375\", \"#f0b33f\"], stroke: \"#171717\" },\n] as const;\n\nexport const DEFAULT_ARCHEOMETER_MUSICAL_NOTES: readonly ArcheometerMusicalNote[] = DEFAULT_ARCHEOMETER_SECTOR_CORRESPONDENCES.map((sector) => sector.musicalNote);\n\nexport const DEFAULT_ARCHEOMETER_ZODIAC: readonly ArcheometerZodiacSign[] = DEFAULT_ARCHEOMETER_SECTOR_CORRESPONDENCES.map((sector) => sector.zodiacSign);\n\nexport const DEFAULT_ARCHEOMETER_PLANETS: readonly ArcheometerPlanetaryPoint[] = DEFAULT_ARCHEOMETER_SECTOR_CORRESPONDENCES.map((sector) => sector.planetaryPoint);\n\nexport function getArcheometerRenderModel(options: ArcheometerSvgOptions = {}): ArcheometerRenderModel {\n const viewBox = normalizeViewBox(options.viewBox);\n const scale = Math.min(viewBox.width / ARCHEOMETER_DEFAULT_VIEWBOX.width, viewBox.height / ARCHEOMETER_DEFAULT_VIEWBOX.height);\n const padding = options.padding ?? 0;\n const center = {\n x: round(viewBox.minX + viewBox.width / 2),\n y: round(viewBox.minY + viewBox.height / 2),\n };\n const frameRadius = round(Math.max(0, Math.min(viewBox.width, viewBox.height) / 2 - padding));\n const outerRadius = round(Math.max(0, frameRadius - ARCHEOMETER_OUTER_CROWN_BLEED * scale));\n\n const rings = buildRings(outerRadius, frameRadius);\n const modelBase = {\n viewBox,\n center,\n outerRadius,\n scale,\n rings,\n palette: resolvePalette(options.palette),\n rotationDegrees: options.rotationDegrees ?? 0,\n layers: { ...DEFAULT_LAYERS, ...(options.layers ?? {}) },\n degreeLabelEvery: options.degreeLabelEvery ?? 15,\n utterance: options.utterance ?? DEFAULT_ARCHEOMETER_UTTERANCE,\n triangles: options.triangles ?? DEFAULT_ARCHEOMETER_TRIANGLES,\n triangleLabels: options.triangleLabels ?? DEFAULT_ARCHEOMETER_TRIANGLE_LABELS,\n musicalNotes: options.musicalNotes ?? DEFAULT_ARCHEOMETER_MUSICAL_NOTES,\n zodiacSigns: options.zodiacSigns ?? DEFAULT_ARCHEOMETER_ZODIAC,\n planetaryPoints: options.planetaryPoints ?? DEFAULT_ARCHEOMETER_PLANETS,\n };\n return {\n ...modelBase,\n geometry: buildArcheometerGeometry(modelBase),\n };\n}\n\nexport const DEFAULT_ARCHETYPE_UTTERANCE = DEFAULT_ARCHEOMETER_UTTERANCE;\nexport const DEFAULT_ARCHETYPE_TRIANGLES = DEFAULT_ARCHEOMETER_TRIANGLES;\nexport const DEFAULT_ARCHETYPE_MUSICAL_NOTES = DEFAULT_ARCHEOMETER_MUSICAL_NOTES;\nexport const DEFAULT_ARCHETYPE_ZODIAC = DEFAULT_ARCHEOMETER_ZODIAC;\nexport const DEFAULT_ARCHETYPE_PLANETS = DEFAULT_ARCHEOMETER_PLANETS;\n\nexport function generateArcheometerSvg(options: ArcheometerSvgOptions = {}): string {\n const model = getArcheometerRenderModel(options);\n const { viewBox, center, outerRadius, palette } = model;\n const background = options.background ?? \"transparent\";\n const lines: string[] = [];\n const push = (line: string) => lines.push(line);\n const title = options.title ?? \"The Cosmological Archeometer\";\n\n const attrs = [\n `xmlns=\"http://www.w3.org/2000/svg\"`,\n options.width !== undefined ? `width=\"${escapeAttr(String(options.width))}\"` : \"\",\n options.height !== undefined ? `height=\"${escapeAttr(String(options.height))}\"` : \"\",\n `viewBox=\"${fmt(viewBox.minX)} ${fmt(viewBox.minY)} ${fmt(viewBox.width)} ${fmt(viewBox.height)}\"`,\n `preserveAspectRatio=\"xMidYMid meet\"`,\n `role=\"img\"`,\n `aria-label=\"${escapeAttr(title)}\"`,\n ].filter(Boolean);\n\n push(`<svg ${attrs.join(\" \")}>`);\n push(`<title>${escapeText(title)}</title>`);\n\n if (background !== \"transparent\") {\n push(`<rect x=\"${fmt(viewBox.minX)}\" y=\"${fmt(viewBox.minY)}\" width=\"${fmt(viewBox.width)}\" height=\"${fmt(viewBox.height)}\" fill=\"${escapeAttr(background)}\"/>`);\n }\n\n push(`<circle cx=\"${fmt(center.x)}\" cy=\"${fmt(center.y)}\" r=\"${fmt(outerRadius)}\" fill=\"${escapeAttr(palette.paper)}\"/>`);\n renderDefs(push, model);\n renderRingGrounds(push, model);\n\n if (model.layers.chromicRays) renderChromicRays(push, model);\n if (model.layers.planetaryUtterance) renderPlanetaryUtterance(push, model);\n if (model.layers.zodiacUtterance) renderZodiacUtterance(push, model);\n if (model.layers.cosmologicalMusic) renderCosmologicalMusic(push, model);\n if (model.layers.astralZodiac) renderAstralZodiac(push, model);\n if (model.layers.astralPlanetary) renderAstralPlanetary(push, model);\n if (model.layers.solarCenter) renderSolarCenter(push, model);\n if (model.layers.whiteRays) renderWhiteRays(push, model);\n if (model.layers.degreeCrown) renderDegreeCrown(push, model);\n renderFrame(push, model);\n\n push(`</svg>`);\n return lines.join(\"\\n\");\n}\n\nfunction renderDefs(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { rings, center } = model;\n const planetaryClipOuter = planetaryTriangleClipOuterRadius(rings);\n const planetaryClipInner = planetaryTriangleClipInnerRadius(rings);\n const chromicClipOuter = chromicCoreOuterRadius(rings);\n const chromicClipInner = chromicCoreInnerRadius(rings);\n\n push(`<defs>`);\n push(\n `<clipPath id=\"archeometer-planetary-clip\"><path d=\"${annulusPath(\n center,\n planetaryClipInner,\n planetaryClipOuter\n )}\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></clipPath>`\n );\n push(\n `<clipPath id=\"archeometer-chromic-clip\"><path d=\"${annulusPath(\n center,\n chromicClipInner,\n chromicClipOuter\n )}\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"/></clipPath>`\n );\n push(`</defs>`);\n}\n\nfunction renderRingGrounds(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { rings, center, palette } = model;\n const order: ArcheometerRingId[] = [\n \"degreeOuter\",\n \"degreeInner\",\n \"zodiacUtterance\",\n \"planetaryUtterance\",\n \"cosmologicalMusic\",\n \"astralZodiac\",\n \"astralPlanetary\",\n \"chromicRays\",\n \"whiteRays\",\n ];\n\n push(`<g id=\"archeometer-ring-grounds\">`);\n for (const id of order) {\n const ring = rings[id];\n push(`<path id=\"archeometer-ring-${id}\" d=\"${annulusPath(center, ring.r1, ring.r2)}\" fill=\"${escapeAttr(palette.ringFills[id])}\" fill-rule=\"evenodd\" stroke=\"none\"/>`);\n }\n push(`</g>`);\n}\n\nfunction renderDegreeCrown(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n const outer = rings.degreeOuter;\n const inner = rings.degreeInner;\n\n push(`<g id=\"archeometer-degree-crown\" aria-label=\"dual 360 degree differential numerical protractor\">`);\n for (let degree = 0; degree < 360; degree += 30) {\n const angle = angleOf(model, degree);\n const pOuter = polarToXY(center, (outer.r1 + outer.r2) / 2, angle);\n const pInner = polarToXY(center, (inner.r1 + inner.r2) / 2, angle);\n const rot = tangentRotation(angle);\n const outerText = String(normalizeDegrees(345 + degree) || 360);\n const innerText = String(normalizeDegrees(15 - degree) || 360);\n push(textSvg(outerText, pOuter, 8.4 * scale, palette.degreeLabel, rot, \"middle\"));\n push(textSvg(innerText, pInner, 7.6 * scale, palette.degreeLabel, rot, \"middle\"));\n }\n push(`</g>`);\n}\n\nfunction renderZodiacUtterance(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n const ring = rings.zodiacUtterance;\n\n push(`<g id=\"archeometer-zodiacal-utterance\" aria-label=\"zodiacal crown of the utterance\">`);\n\n for (let i = 0; i < 12; i++) {\n const degree = i * 30;\n const sector = annularSectorPath(\n center,\n ring.r1,\n ring.r2,\n angleOf(model, degree - 15),\n angleOf(model, degree + 15),\n 30\n );\n\n push(\n `<path d=\"${sector}\" fill=\"${escapeAttr(palette.ringFills.zodiacUtterance)}\" fill-opacity=\"1\" stroke=\"${escapeAttr(\n palette.ringStroke\n )}\" stroke-opacity=\"0.34\" stroke-width=\"${fmt(0.7 * scale)}\"/>`\n );\n }\n\n for (const geometry of model.geometry.utterancePoints) {\n const point = geometry.data;\n const p = geometry.anchor;\n const shieldR = (ring.r2 - ring.r1) * 0.22;\n const letterParts = point.letter.split(\",\").map((part) => part.trim()).filter(Boolean);\n const isStacked = letterParts.length > 1;\n const letterFontSize = (isStacked ? (letterParts.length > 2 ? 8.3 : 10.6) : 14) * scale;\n const letterLineHeight = letterFontSize * (isStacked ? 1.02 : 1);\n const numberFontSize = (isStacked ? 6.6 : 7.1) * scale;\n const numberGap = (isStacked ? 4.8 : 0) * scale;\n const stackedNumberY = p.y + ((letterParts.length - 1) * letterLineHeight) / 2 + numberGap + numberFontSize * 0.42;\n const singleLetterY = p.y - shieldR * 0.48;\n const firstLineY = isStacked\n ? p.y - ((letterParts.length - 1) * letterLineHeight) / 2 - numberFontSize * 0.42\n : singleLetterY;\n const numberY = isStacked ? stackedNumberY : p.y + shieldR * 0.72;\n\n push(\n `<g class=\"archeometer-utterance-point\" data-degree=\"${fmt(normalizeDegrees(point.degree))}\" data-letter=\"${escapeAttr(\n point.letter\n )}\">`\n );\n\n for (const [index, part] of letterParts.entries()) {\n push(textSvg(part, { x: p.x, y: firstLineY + index * letterLineHeight }, letterFontSize, palette.ink, 0, \"middle\", 700));\n }\n\n push(textSvg(String(point.number), { x: p.x, y: numberY }, numberFontSize, palette.ink, 0, \"middle\"));\n push(`</g>`);\n }\n\n push(`</g>`);\n}\n\nfunction renderPlanetaryUtterance(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n const ring = rings.planetaryUtterance;\n const clipOuter = planetaryTriangleClipOuterRadius(rings);\n\n push(`<g id=\"archeometer-planetary-utterance\" aria-label=\"four trigones of the planetary utterance\">`);\n push(`<g clip-path=\"url(#archeometer-planetary-clip)\">`);\n for (const triangleGeometry of model.geometry.triangles) {\n const triangle = triangleGeometry.data;\n const vertices = triangleGeometry.vertices;\n if (triangle.vertexFills) {\n const centroid = polygonCentroid(vertices);\n const midpoints = vertices.map((vertex, index) => midpoint(vertex, vertices[(index + 1) % vertices.length]));\n for (const [index, vertex] of vertices.entries()) {\n const previousMidpoint = midpoints[(index + vertices.length - 1) % vertices.length];\n const nextMidpoint = midpoints[index];\n push(`<path class=\"archeometer-trigone-vertex-fill\" data-triangle=\"${escapeAttr(triangle.id)}\" data-degree=\"${fmt(normalizeDegrees(triangle.vertices[index]))}\" d=\"${polygonPath([vertex, nextMidpoint, centroid, previousMidpoint])}\" fill=\"${escapeAttr(triangle.vertexFills[index])}\" fill-opacity=\"0.54\" stroke=\"none\"/>`);\n }\n push(`<path class=\"archeometer-trigone\" data-triangle=\"${escapeAttr(triangle.id)}\" d=\"${triangleGeometry.path}\" fill=\"none\" stroke=\"${escapeAttr(palette.ink)}\" stroke-opacity=\"0.82\" stroke-width=\"${fmt(1.35 * scale)}\"/>`);\n } else {\n push(`<path class=\"archeometer-trigone\" data-triangle=\"${escapeAttr(triangle.id)}\" d=\"${triangleGeometry.path}\" fill=\"${escapeAttr(triangle.fill)}\" fill-opacity=\"0.52\" stroke=\"${escapeAttr(palette.ink)}\" stroke-opacity=\"0.82\" stroke-width=\"${fmt(1.35 * scale)}\"/>`);\n }\n }\n push(`</g>`);\n\n for (const labelGeometry of model.geometry.triangleLabels) {\n const label = labelGeometry.data;\n if (!label.label) continue;\n const a = angleOf(model, label.degree);\n const labelPoint = labelGeometry.anchor;\n push(textSvg(label.label, labelPoint, 12 * scale, palette.ink, 0, \"middle\", 700));\n if (label.number !== undefined) {\n const numberPoint = polarToXY(center, ring.r1 + (clipOuter - ring.r1) * 0.80, a);\n push(textSvg(String(label.number), numberPoint, 7.5 * scale, palette.ink, 0, \"middle\", 600));\n }\n }\n\n push(`</g>`);\n}\n\nfunction renderCosmologicalMusic(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n const ring = rings.cosmologicalMusic;\n const notes = sortedByDegree(model.musicalNotes);\n\n push(`<g id=\"archeometer-cosmological-music\" aria-label=\"cosmological musical crown\">`);\n push(`<path id=\"archeometer-music-backing\" d=\"${annulusPath(center, ring.r1, ring.r2)}\" fill=\"${escapeAttr(palette.paper)}\" stroke=\"${escapeAttr(palette.ringStroke)}\" stroke-opacity=\"0.58\" stroke-width=\"${fmt(0.8 * scale)}\" fill-rule=\"evenodd\"/>`);\n for (const note of notes) {\n const point = nearestUtterance(note.degree, model.utterance);\n const start = angleOf(model, note.degree - 15);\n const end = angleOf(model, note.degree + 15);\n const sector = annularSectorPath(center, ring.r1, ring.r2, start, end, 30);\n push(`<path d=\"${sector}\" fill=\"${escapeAttr(note.color ?? point?.color ?? palette.ringFills.cosmologicalMusic)}\" fill-opacity=\"0.24\" stroke=\"${escapeAttr(palette.ringStroke)}\" stroke-opacity=\"0.3\" stroke-width=\"${fmt(0.55 * scale)}\"/>`);\n }\n\n for (const note of notes) {\n const start = angleOf(model, note.degree - 5.5);\n const end = angleOf(model, note.degree + 5.5);\n for (let i = 1; i <= 5; i++) {\n const r = ring.r1 + ((ring.r2 - ring.r1) * i) / 6;\n push(`<path class=\"archeometer-music-staff-line\" data-degree=\"${fmt(normalizeDegrees(note.degree))}\" d=\"${arcSegmentPath(center, r, start, end)}\" fill=\"none\" stroke=\"${escapeAttr(palette.ink)}\" stroke-opacity=\"0.58\" stroke-width=\"${fmt(0.48 * scale)}\" stroke-linecap=\"round\"/>`);\n }\n }\n\n for (const noteGeometry of model.geometry.musicalNotes) {\n const note = noteGeometry.data;\n if (!note.note) continue;\n const p = noteGeometry.anchor;\n push(textSvg(note.note, p, 11.8 * scale, palette.ink, tangentRotation(angleOf(model, note.degree)), \"middle\", 700));\n }\n push(`</g>`);\n}\n\nfunction renderAstralZodiac(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n const ring = rings.astralZodiac;\n const ringWidth = ring.r2 - ring.r1;\n\n push(`<g id=\"archeometer-astral-zodiac\" aria-label=\"astral zodiacal crown\">`);\n\n for (const signGeometry of model.geometry.zodiacSigns) {\n const sign = signGeometry.data;\n const sector = annularSectorPath(\n center,\n ring.r1,\n ring.r2,\n angleOf(model, sign.degree - 15),\n angleOf(model, sign.degree + 15),\n 30\n );\n const pointColor =\n triangleVertexFillForDegree(model, sign.degree) ??\n sign.color ??\n nearestUtterance(sign.degree, model.utterance)?.color ??\n palette.ringFills.astralZodiac;\n\n push(\n `<path d=\"${sector}\" fill=\"${escapeAttr(pointColor)}\" fill-opacity=\"0.40\" stroke=\"${escapeAttr(\n palette.ringStroke\n )}\" stroke-opacity=\"0.32\" stroke-width=\"${fmt(0.6 * scale)}\"/>`\n );\n }\n\n const markerRadius = Math.min(ringWidth * 0.33, 13 * scale);\n const glyphSize = 17.5 * scale;\n\n for (const signGeometry of model.geometry.zodiacSigns) {\n const sign = signGeometry.data;\n const pointColor =\n triangleVertexFillForDegree(model, sign.degree) ??\n sign.color ??\n nearestUtterance(sign.degree, model.utterance)?.color ??\n palette.ringFills.astralZodiac;\n const p = signGeometry.anchor;\n\n push(\n `<g class=\"archeometer-zodiac-sign\" data-sign=\"${escapeAttr(sign.name)}\" data-degree=\"${fmt(\n normalizeDegrees(sign.degree)\n )}\">`\n );\n push(\n `<circle cx=\"${fmt(p.x)}\" cy=\"${fmt(p.y)}\" r=\"${fmt(markerRadius)}\" fill=\"${escapeAttr(\n pointColor\n )}\" fill-opacity=\"0.48\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${fmt(0.75 * scale)}\"/>`\n );\n push(textSvg(sign.glyph, p, glyphSize, palette.ink, 0, \"middle\"));\n push(`</g>`);\n }\n\n push(`</g>`);\n}\n\nfunction renderAstralPlanetary(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n const ring = rings.astralPlanetary;\n const ringWidth = ring.r2 - ring.r1;\n\n push(`<g id=\"archeometer-astral-planetary\" aria-label=\"astral planetary crown\">`);\n\n for (const planetGeometry of model.geometry.planetaryPoints) {\n const planet = planetGeometry.data;\n const pointColor =\n triangleVertexFillForDegree(model, planet.degree) ??\n planet.color ??\n nearestUtterance(planet.degree, model.utterance)?.color ??\n palette.ringFills.astralPlanetary;\n\n const sector = annularSectorPath(\n center,\n ring.r1,\n ring.r2,\n angleOf(model, planet.degree - 15),\n angleOf(model, planet.degree + 15),\n 30\n );\n\n push(\n `<path class=\"archeometer-astral-planetary-sector\" data-degree=\"${fmt(\n normalizeDegrees(planet.degree)\n )}\" d=\"${sector}\" fill=\"${escapeAttr(pointColor)}\" fill-opacity=\"0.36\" stroke=\"none\"/>`\n );\n }\n\n for (let degree = 15; degree < 360; degree += 30) {\n const line = lineFromPolar(center, ring.r1, ring.r2, angleOf(model, degree));\n push(lineSvg(line, palette.ringStroke, 0.6 * scale, 0.42, \"archeometer-astral-planetary-divider\", ` data-degree=\"${fmt(degree)}\"`));\n }\n\n const markerRadius = Math.min(ringWidth * 0.33, 13 * scale);\n\n for (const planetGeometry of model.geometry.planetaryPoints) {\n const planet = planetGeometry.data;\n const p = planetGeometry.anchor;\n const color =\n triangleVertexFillForDegree(model, planet.degree) ??\n planet.color ??\n nearestUtterance(planet.degree, model.utterance)?.color ??\n palette.ink;\n\n const glyphSize = (planet.name === \"Moon\" ? 17 : 18.5) * scale;\n\n push(\n `<g class=\"archeometer-planet\" data-planet=\"${escapeAttr(planet.name)}\" data-degree=\"${fmt(\n normalizeDegrees(planet.degree)\n )}\">`\n );\n push(\n `<circle cx=\"${fmt(p.x)}\" cy=\"${fmt(p.y)}\" r=\"${fmt(markerRadius)}\" fill=\"${escapeAttr(\n color\n )}\" fill-opacity=\"0.44\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${fmt(0.8 * scale)}\"/>`\n );\n push(textSvg(planet.glyph, p, glyphSize, palette.ink, 0, \"middle\"));\n push(`</g>`);\n }\n\n push(`</g>`);\n}\n\nfunction renderChromicRays(push: (line: string) => void, model: ArcheometerRenderModel) {\n push(`<g id=\"archeometer-chromic-rays\" aria-label=\"dodecagonal crown of chromic circum-solar rays\">`);\n push(`<g clip-path=\"url(#archeometer-chromic-clip)\">`);\n renderChromicTriangleCore(push, model);\n push(`</g>`);\n push(`</g>`);\n}\n\nfunction renderChromicTriangleCore(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n const trianglesById = new Map(model.triangles.map((triangle) => [triangle.id, triangle]));\n const wordJesus = trianglesById.get(\"wordJesus\");\n const mary = trianglesById.get(\"mary\");\n const ether = trianglesById.get(\"ether\");\n const divineFire = trianglesById.get(\"divineFire\");\n const chromicOuter = chromicCoreOuterRadius(rings);\n const chromic = (x: number, y: number) => scaleArcheometerReferencePoint(center, chromicOuter, x, y);\n\n const path = (...commands: string[]) => commands.join(\" \");\n const move = (x: number, y: number) => {\n const p = chromic(x, y);\n return `M ${fmt(p.x)} ${fmt(p.y)}`;\n };\n const line = (x: number, y: number) => {\n const p = chromic(x, y);\n return `L ${fmt(p.x)} ${fmt(p.y)}`;\n };\n const cubic = (x1: number, y1: number, x2: number, y2: number, x: number, y: number) => {\n const c1 = chromic(x1, y1);\n const c2 = chromic(x2, y2);\n const p = chromic(x, y);\n return `C ${fmt(c1.x)} ${fmt(c1.y)} ${fmt(c2.x)} ${fmt(c2.y)} ${fmt(p.x)} ${fmt(p.y)}`;\n };\n const strokeWidth = fmt(1.4 * scale);\n const facetStrokeWidth = fmt(0.85 * scale);\n const primaryFacetStrokeWidth = fmt(0.95 * scale);\n const primaryStroke = wordJesus?.stroke ?? palette.ink;\n\n push(`<g id=\"archeometer-chromic-triangle-core\" aria-label=\"inner chromic primary triangle core\">`);\n push(`<path class=\"archeometer-chromic-foundation\" data-triangle=\"ether\" d=\"${path(move(1.3999, 137.047), line(204.875, 19.5703), line(204.875, 254.523), \"Z\")}\" fill=\"${escapeAttr(ether?.fill ?? \"#78BD79\")}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${strokeWidth}\"/>`);\n push(`<path class=\"archeometer-chromic-foundation\" data-triangle=\"divineFire\" d=\"${path(move(272.7, 137.047), line(69.2251, 254.523), line(69.2251, 19.5703), \"Z\")}\" fill=\"${escapeAttr(divineFire?.fill ?? \"#CC58A1\")}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${strokeWidth}\"/>`);\n push(`<path class=\"archeometer-chromic-foundation\" data-triangle=\"mary\" d=\"${path(move(137.05, 272.702), line(19.5737, 69.2266), line(254.527, 69.2266), \"Z\")}\" fill=\"${escapeAttr(mary?.fill ?? \"#E25B61\")}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${strokeWidth}\"/>`);\n for (const triangle of [ether, divineFire, mary]) {\n if (!triangle?.vertexFills) continue;\n const vertices = triangle.vertices.map((degree) => polarToXY(center, chromicOuter, angleOf(model, degree)));\n const centroid = polygonCentroid(vertices);\n const midpoints = vertices.map((vertex, index) => midpoint(vertex, vertices[(index + 1) % vertices.length]));\n for (const [index, vertex] of vertices.entries()) {\n const previousMidpoint = midpoints[(index + vertices.length - 1) % vertices.length];\n const nextMidpoint = midpoints[index];\n push(`<path class=\"archeometer-chromic-trigone-facet\" data-triangle=\"${escapeAttr(triangle.id)}\" data-degree=\"${fmt(normalizeDegrees(triangle.vertices[index]))}\" d=\"${polygonPath([vertex, nextMidpoint, centroid, previousMidpoint])}\" fill=\"${escapeAttr(triangle.vertexFills[index])}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-opacity=\"0.72\" stroke-width=\"${facetStrokeWidth}\"/>`);\n }\n }\n push(`<path class=\"archeometer-chromic-primary-facet\" data-triangle=\"wordJesus\" data-degree=\"120\" d=\"${path(move(137.05, 204.874), line(254.527, 204.874), line(195.789, 103.136), cubic(195.789, 103.136, 215.377, 136.525, 195.789, 170.699), cubic(176.2, 204.874, 137.05, 204.874, 137.05, 204.874), \"Z\")}\" fill=\"${escapeAttr(wordJesus?.vertexFills?.[1] ?? \"#5470A5\")}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-opacity=\"0.78\" stroke-width=\"${primaryFacetStrokeWidth}\"/>`);\n push(`<path class=\"archeometer-chromic-primary-facet\" data-triangle=\"wordJesus\" data-degree=\"240\" d=\"${path(move(19.5737, 204.874), line(137.05, 204.874), cubic(137.05, 204.874, 94.7002, 203.927, 78.312, 170.699), cubic(61.9238, 137.472, 78.312, 103.136, 78.312, 103.136), line(19.5737, 204.874), \"Z\")}\" fill=\"${escapeAttr(wordJesus?.vertexFills?.[2] ?? \"#DD3E38\")}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-opacity=\"0.78\" stroke-width=\"${primaryFacetStrokeWidth}\"/>`);\n push(`<path class=\"archeometer-chromic-primary-facet\" data-triangle=\"wordJesus\" data-degree=\"0\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"${path(move(195.789, 103.136), line(137.05, 1.39844), line(78.312, 103.136), cubic(78.312, 103.136, 100.9, 71.1992, 137.05, 71.1992), cubic(173.2, 71.1992, 195.789, 103.136, 195.789, 103.136), \"Z\")}\" fill=\"${escapeAttr(wordJesus?.vertexFills?.[0] ?? \"#F2CF45\")}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-opacity=\"0.78\" stroke-width=\"${primaryFacetStrokeWidth}\"/>`);\n push(`<path class=\"archeometer-chromic-primary-outline\" data-triangle=\"wordJesus\" d=\"${path(\n move(137.05, 204.874),\n line(254.527, 204.874),\n line(195.789, 103.136),\n move(137.05, 204.874),\n line(19.5737, 204.874),\n line(78.312, 103.136),\n move(137.05, 204.874),\n cubic(137.05, 204.874, 94.7002, 203.927, 78.312, 170.699),\n cubic(61.9238, 137.472, 78.312, 103.136, 78.312, 103.136),\n move(137.05, 204.874),\n cubic(137.05, 204.874, 176.2, 204.874, 195.789, 170.699),\n cubic(215.377, 136.525, 195.789, 103.136, 195.789, 103.136),\n move(195.789, 103.136),\n line(137.05, 1.39844),\n line(78.312, 103.136),\n move(195.789, 103.136),\n cubic(195.789, 103.136, 173.2, 71.1992, 137.05, 71.1992),\n cubic(100.9, 71.1992, 78.312, 103.136, 78.312, 103.136)\n )}\" fill=\"none\" stroke=\"${escapeAttr(primaryStroke)}\" stroke-width=\"${strokeWidth}\"/>`);\n push(`</g>`);\n}\n\nfunction renderWhiteRays(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n const solarRadius = rings.solarCenter.r2;\n const sunCenterCircleRadiusWithPadding = 3 + 0.3;\n\n push(`<g id=\"archeometer-white-rays\" aria-label=\"crown of white rays and musical staff\">`);\n\n for (let degree = 0; degree < 180; degree += 30) {\n // skip horizontal lines\n if (degree === 90 || degree === 270) continue;\n\n push(lineSvg(lineFromPolar(center, solarRadius, sunCenterCircleRadiusWithPadding, angleOf(model, degree)), palette.whiteRay, 1.55 * scale, 0.92));\n push(lineSvg(lineFromPolar(center, solarRadius, sunCenterCircleRadiusWithPadding, angleOf(model, degree + 180)), palette.whiteRay, 1.55 * scale, 0.92));\n }\n push(`</g>`);\n}\n\nfunction renderSolarCenter(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n const r = rings.solarCenter.r2;\n const innerR = r * 0.68;\n const arcStart = polarToXY(center, innerR * 0.72, deg2rad(240));\n const arcEnd = polarToXY(center, innerR * 0.72, deg2rad(300));\n const paddingTop = 22;\n const sunCenterCircleRadius = 3;\n\n push(`<g id=\"archeometer-solar-center\" aria-label=\"solar center Mi\">`);\n push(`<circle cx=\"${fmt(center.x)}\" cy=\"${fmt(center.y)}\" r=\"${fmt(r)}\" fill=\"none\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${fmt(1.2 * scale)}\"/>`);\n\n push(lineSvg({ x1: center.x - innerR - 13, x2: center.x + innerR + 13, y1: center.y - 1.5, y2: center.y - 1.5 }, palette.whiteRay, 1.55 * scale, 0.92));\n push(lineSvg({ x1: center.x - innerR - 13, x2: center.x + innerR + 13, y1: center.y, y2: center.y }, palette.whiteRay, 1.55 * scale, 0.92));\n push(lineSvg({ x1: center.x - innerR - 13, x2: center.x + innerR + 13, y1: center.y + 1.5, y2: center.y + 1.5 }, palette.whiteRay, 1.55 * scale, 0.92));\n \n push(`<line x1=\"${fmt(center.x - innerR - 2.5)}\" y1=\"${fmt(center.y + 8 + paddingTop)}\" x2=\"${fmt(center.x + innerR + 2.5)}\" y2=\"${fmt(center.y + 8 + paddingTop)}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${fmt(1.1 * scale)}\"/>`);\n push(`<line x1=\"${fmt(center.x - innerR - 7.5)}\" y1=\"${fmt(center.y + paddingTop)}\" x2=\"${fmt(center.x + innerR + 7.5)}\" y2=\"${fmt(center.y + paddingTop)}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${fmt(1.1 * scale)}\"/>`);\n push(`<line x1=\"${fmt(center.x - innerR - 11)}\" y1=\"${fmt(center.y - 8 + paddingTop)}\" x2=\"${fmt(center.x + innerR + 11)}\" y2=\"${fmt(center.y - 8 + paddingTop)}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${fmt(1.1 * scale)}\"/>`);\n push(`<path d=\"M ${fmt(arcStart.x)} ${fmt(arcStart.y)} A ${fmt(innerR * 0.72)} ${fmt(innerR * 0.72)} 0 0 1 ${fmt(arcEnd.x)} ${fmt(arcEnd.y)}\" fill=\"none\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${fmt(1.1 * scale)}\"/>`);\n push(`<circle cx=\"${fmt(center.x)}\" cy=\"${fmt(center.y)}\" r=\"${fmt(sunCenterCircleRadius)}\" fill=\"${escapeAttr(palette.paper)}\" stroke=\"${escapeAttr(palette.ink)}\" stroke-width=\"${fmt(0.5 * scale)}\"/>`);\n push(`</g>`);\n}\n\nfunction renderFrame(push: (line: string) => void, model: ArcheometerRenderModel) {\n const { center, rings, palette, scale } = model;\n\n const radii = Array.from(\n new Map(\n [\n rings.degreeOuter.r2,\n rings.degreeOuter.r1,\n rings.degreeInner.r1,\n rings.zodiacUtterance.r1,\n rings.planetaryUtterance.r1,\n rings.cosmologicalMusic.r1,\n rings.astralZodiac.r1,\n rings.astralPlanetary.r1,\n rings.chromicRays.r1,\n rings.solarCenter.r2,\n ].map((radius) => [fmt(radius), radius])\n ).values()\n );\n\n push(`<g id=\"archeometer-frame\" aria-hidden=\"true\">`);\n\n for (const radius of radii) {\n if (radius <= 0) continue;\n push(\n `<circle cx=\"${fmt(center.x)}\" cy=\"${fmt(center.y)}\" r=\"${fmt(radius)}\" fill=\"none\" stroke=\"${escapeAttr(\n palette.ringStroke\n )}\" stroke-opacity=\"0.82\" stroke-width=\"${fmt(0.85 * scale)}\"/>`\n );\n }\n\n push(\n `<circle cx=\"${fmt(center.x)}\" cy=\"${fmt(center.y)}\" r=\"${fmt(\n rings.degreeOuter.r2\n )}\" fill=\"none\" stroke=\"${escapeAttr(palette.ringStroke)}\" stroke-width=\"${fmt(2.2 * scale)}\"/>`\n );\n\n push(`</g>`);\n}\n\nfunction buildArcheometerGeometry(\n model: Omit<ArcheometerRenderModel, \"geometry\">\n): ArcheometerGeometry {\n const { center, rings, scale } = model;\n const utteranceRing = rings.zodiacUtterance;\n const triangleLabelRing = rings.planetaryUtterance;\n const musicRing = rings.cosmologicalMusic;\n const zodiacRing = rings.astralZodiac;\n const planetRing = rings.astralPlanetary;\n const planetaryClipOuter = planetaryTriangleClipOuterRadius(rings);\n const whiteRaySolarRadius = rings.solarCenter.r2;\n const pointHitRadius = Math.max(11 * scale, 8);\n\n const element = <T extends { degree: number }>(\n layerId: ArcheometerElementGeometry<T>[\"layerId\"],\n idPrefix: string,\n item: T,\n radius: number,\n hitRadius = pointHitRadius\n ): ArcheometerElementGeometry<T> => {\n const anchor = polarToXY(center, radius, angleOf(model, item.degree));\n return {\n id: `${idPrefix}-${slugForGeometry((item as { id?: string; name?: string; note?: string; label?: string }).id ?? (item as { name?: string }).name ?? (item as { note?: string }).note ?? (item as { label?: string }).label ?? item.degree)}`,\n layerId,\n data: item,\n degree: normalizeDegrees(item.degree),\n anchor,\n hitTarget: { kind: \"circle\", cx: anchor.x, cy: anchor.y, r: hitRadius },\n };\n };\n\n const triangles = model.triangles.map((triangle) => {\n const vertices = triangle.vertices.map((degree) =>\n polarToXY(center, planetaryClipOuter, angleOf(model, degree))\n );\n const centroid = polygonCentroid(vertices);\n return {\n id: `triangle-${slugForGeometry(triangle.id)}`,\n layerId: \"planetaryUtterance\" as const,\n data: triangle,\n vertices,\n centroid,\n path: polygonPath(vertices),\n hitTarget: { kind: \"polygon\" as const, points: vertices },\n };\n });\n\n const degreeTicks = Array.from({ length: 12 }, (_, index) => {\n const degree = index * 30;\n const angle = angleOf(model, degree);\n return {\n id: `degree-${degree}`,\n degree,\n outerAnchor: polarToXY(center, (rings.degreeOuter.r1 + rings.degreeOuter.r2) / 2, angle),\n innerAnchor: polarToXY(center, (rings.degreeInner.r1 + rings.degreeInner.r2) / 2, angle),\n };\n });\n\n const rays = Array.from({ length: 12 }, (_, index) => index * 30)\n .filter((degree) => degree !== 90 && degree !== 270)\n .map((degree) => ({\n id: `white-ray-${degree}`,\n degree,\n layerId: \"whiteRays\" as const,\n line: lineFromPolar(center, whiteRaySolarRadius, 3.3, angleOf(model, degree)),\n }));\n\n return {\n utterancePoints: sortedByDegree(model.utterance).map((point) =>\n element(\"zodiacUtterance\", \"utterance\", point, utteranceRing.r1 + (utteranceRing.r2 - utteranceRing.r1) * 0.58)\n ),\n triangles,\n triangleLabels: sortedByDegree(model.triangleLabels).map((label) =>\n element(\"triangleLabels\", \"triangle-label\", label, triangleLabelRing.r1 + (planetaryClipOuter - triangleLabelRing.r1) * 0.56)\n ),\n musicalNotes: sortedByDegree(model.musicalNotes).map((note) =>\n element(\"cosmologicalMusic\", \"music\", note, (musicRing.r1 + musicRing.r2) / 2)\n ),\n zodiacSigns: sortedByDegree(model.zodiacSigns).map((sign) =>\n element(\"astralZodiac\", \"zodiac\", sign, (zodiacRing.r1 + zodiacRing.r2) / 2, Math.min((zodiacRing.r2 - zodiacRing.r1) * 0.33, 13 * scale))\n ),\n planetaryPoints: sortedByDegree(model.planetaryPoints).map((planet) =>\n element(\"astralPlanetary\", \"planet\", planet, (planetRing.r1 + planetRing.r2) / 2, Math.min((planetRing.r2 - planetRing.r1) * 0.33, 13 * scale))\n ),\n degreeTicks,\n rays,\n center: {\n id: \"solar-center\",\n anchor: center,\n hitTarget: { kind: \"circle\", cx: center.x, cy: center.y, r: rings.solarCenter.r2 },\n },\n };\n}\n\nfunction buildRings(contentRadius: number, frameRadius = contentRadius): Record<ArcheometerRingId, ArcheometerRing> {\n const ring = (id: ArcheometerRingId, r1: number, r2: number, radius = contentRadius): ArcheometerRing => ({\n id,\n r1: round(radius * r1),\n r2: round(radius * r2),\n });\n\n return {\n degreeOuter: ring(\"degreeOuter\", 0.955, 1.0, frameRadius),\n degreeInner: {\n id: \"degreeInner\",\n r1: round(contentRadius * 0.955),\n r2: round(frameRadius * 0.955),\n },\n zodiacUtterance: ring(\"zodiacUtterance\", 0.800, 0.955),\n planetaryUtterance: ring(\"planetaryUtterance\", 0.461, 0.800),\n cosmologicalMusic: ring(\"cosmologicalMusic\", 0.395, 0.461),\n astralZodiac: ring(\"astralZodiac\", 0.297, 0.395),\n astralPlanetary: ring(\"astralPlanetary\", 0.198, 0.297),\n chromicRays: ring(\"chromicRays\", 0.198, 0.395),\n whiteRays: ring(\"whiteRays\", 0.120, 0.198),\n solarCenter: ring(\"solarCenter\", 0.000, 0.099),\n };\n}\n\nfunction planetaryTriangleClipInnerRadius(rings: Record<ArcheometerRingId, ArcheometerRing>) {\n return rings.planetaryUtterance.r1;\n}\n\nfunction planetaryTriangleClipOuterRadius(rings: Record<ArcheometerRingId, ArcheometerRing>) {\n return rings.planetaryUtterance.r2;\n}\n\nfunction chromicCoreInnerRadius(rings: Record<ArcheometerRingId, ArcheometerRing>) {\n return rings.solarCenter.r2;\n}\n\nfunction chromicCoreOuterRadius(rings: Record<ArcheometerRingId, ArcheometerRing>) {\n return rings.whiteRays.r2;\n}\n\nfunction resolvePalette(palette?: ArcheometerPalette): ResolvedArcheometerPalette {\n const base = COLOR_PALETTE;\n const overrides = typeof palette === \"object\" ? palette : {};\n return {\n paper: overrides.paper ?? base.paper,\n ink: overrides.ink ?? base.ink,\n subtleInk: overrides.subtleInk ?? base.subtleInk,\n ringStroke: overrides.ringStroke ?? base.ringStroke,\n degreeTick: overrides.degreeTick ?? base.degreeTick,\n degreeLabel: overrides.degreeLabel ?? base.degreeLabel,\n whiteRay: overrides.whiteRay ?? base.whiteRay,\n ringFills: { ...base.ringFills, ...(overrides.ringFills ?? {}) },\n };\n}\n\nfunction normalizeViewBox(viewBox?: ArcheometerSvgViewBox): Required<ArcheometerSvgViewBox> {\n return {\n minX: viewBox?.minX ?? ARCHEOMETER_DEFAULT_VIEWBOX.minX,\n minY: viewBox?.minY ?? ARCHEOMETER_DEFAULT_VIEWBOX.minY,\n width: viewBox?.width ?? ARCHEOMETER_DEFAULT_VIEWBOX.width,\n height: viewBox?.height ?? ARCHEOMETER_DEFAULT_VIEWBOX.height,\n };\n}\n\nfunction angleOf(model: Pick<ArcheometerRenderModel, \"rotationDegrees\">, degree: number) {\n return deg2rad(degree + model.rotationDegrees - 90);\n}\n\nfunction polarToXY(center: ArcheometerPoint, radius: number, angleRad: number): ArcheometerPoint {\n return {\n x: round(center.x + Math.cos(angleRad) * radius),\n y: round(center.y + Math.sin(angleRad) * radius),\n };\n}\n\nfunction scaleArcheometerReferencePoint(center: ArcheometerPoint, radius: number, x: number, y: number): ArcheometerPoint {\n const referenceCenter = 137.05;\n const referenceRadius = 135.652;\n const scale = radius / referenceRadius;\n return {\n x: round(center.x + (x - referenceCenter) * scale),\n y: round(center.y + (y - referenceCenter) * scale),\n };\n}\n\nfunction lineFromPolar(center: ArcheometerPoint, r1: number, r2: number, angleRad: number): ArcheometerLine {\n const p1 = polarToXY(center, r1, angleRad);\n const p2 = polarToXY(center, r2, angleRad);\n return { x1: p1.x, y1: p1.y, x2: p2.x, y2: p2.y };\n}\n\nfunction lineSvg(line: ArcheometerLine, color: string, strokeWidth: number, opacity = 1, className?: string, attributes = \"\") {\n const classAttr = className ? ` class=\"${escapeAttr(className)}\"` : \"\";\n return `<line${classAttr}${attributes} x1=\"${fmt(line.x1)}\" y1=\"${fmt(line.y1)}\" x2=\"${fmt(line.x2)}\" y2=\"${fmt(line.y2)}\" stroke=\"${escapeAttr(color)}\" stroke-opacity=\"${fmt(opacity)}\" stroke-width=\"${fmt(strokeWidth)}\" stroke-linecap=\"round\"/>`;\n}\n\nfunction textSvg(\n value: string,\n p: ArcheometerPoint,\n fontSize: number,\n color: string,\n rotation = 0,\n anchor: \"start\" | \"middle\" | \"end\" = \"middle\",\n weight?: number,\n className?: string,\n attributes = \"\"\n) {\n const transform = rotation ? ` transform=\"rotate(${fmt(rotation)} ${fmt(p.x)} ${fmt(p.y)})\"` : \"\";\n const weightAttr = weight ? ` font-weight=\"${weight}\"` : \"\";\n const classAttr = className ? ` class=\"${escapeAttr(className)}\"` : \"\";\n return `<text${classAttr}${attributes} x=\"${fmt(p.x)}\" y=\"${fmt(p.y)}\"${transform} font-family=\"${textFontFamily()}\" font-size=\"${fmt(fontSize)}\" text-anchor=\"${anchor}\" dominant-baseline=\"middle\" fill=\"${escapeAttr(color)}\"${weightAttr}>${escapeText(value)}</text>`;\n}\n\nfunction annulusPath(center: ArcheometerPoint, r1: number, r2: number) {\n return [\n `M ${fmt(center.x)} ${fmt(center.y - r2)}`,\n `A ${fmt(r2)} ${fmt(r2)} 0 1 1 ${fmt(center.x)} ${fmt(center.y + r2)}`,\n `A ${fmt(r2)} ${fmt(r2)} 0 1 1 ${fmt(center.x)} ${fmt(center.y - r2)}`,\n `M ${fmt(center.x)} ${fmt(center.y - r1)}`,\n `A ${fmt(r1)} ${fmt(r1)} 0 1 0 ${fmt(center.x)} ${fmt(center.y + r1)}`,\n `A ${fmt(r1)} ${fmt(r1)} 0 1 0 ${fmt(center.x)} ${fmt(center.y - r1)}`,\n `Z`,\n ].join(\" \");\n}\n\nfunction annularSectorPath(center: ArcheometerPoint, r1: number, r2: number, startAngle: number, endAngle: number, spanDegrees: number) {\n const outerStart = polarToXY(center, r2, startAngle);\n const outerEnd = polarToXY(center, r2, endAngle);\n const innerEnd = polarToXY(center, r1, endAngle);\n const innerStart = polarToXY(center, r1, startAngle);\n const largeArc = Math.abs(spanDegrees) > 180 ? 1 : 0;\n const sweep = spanDegrees >= 0 ? 1 : 0;\n const inverseSweep = sweep ? 0 : 1;\n\n return [\n `M ${fmt(outerStart.x)} ${fmt(outerStart.y)}`,\n `A ${fmt(r2)} ${fmt(r2)} 0 ${largeArc} ${sweep} ${fmt(outerEnd.x)} ${fmt(outerEnd.y)}`,\n `L ${fmt(innerEnd.x)} ${fmt(innerEnd.y)}`,\n `A ${fmt(r1)} ${fmt(r1)} 0 ${largeArc} ${inverseSweep} ${fmt(innerStart.x)} ${fmt(innerStart.y)}`,\n `Z`,\n ].join(\" \");\n}\n\nfunction arcSegmentPath(center: ArcheometerPoint, radius: number, startAngle: number, endAngle: number) {\n const start = polarToXY(center, radius, startAngle);\n const end = polarToXY(center, radius, endAngle);\n return `M ${fmt(start.x)} ${fmt(start.y)} A ${fmt(radius)} ${fmt(radius)} 0 0 1 ${fmt(end.x)} ${fmt(end.y)}`;\n}\n\nfunction polygonPath(points: readonly ArcheometerPoint[]) {\n if (points.length === 0) return \"\";\n const [first, ...rest] = points;\n return [`M ${fmt(first.x)} ${fmt(first.y)}`, ...rest.map((p) => `L ${fmt(p.x)} ${fmt(p.y)}`), \"Z\"].join(\" \");\n}\n\nfunction midpoint(a: ArcheometerPoint, b: ArcheometerPoint): ArcheometerPoint {\n return { x: round((a.x + b.x) / 2), y: round((a.y + b.y) / 2) };\n}\n\nfunction polygonCentroid(points: readonly ArcheometerPoint[]): ArcheometerPoint {\n const total = points.reduce(\n (sum, point) => ({ x: sum.x + point.x, y: sum.y + point.y }),\n { x: 0, y: 0 }\n );\n return { x: round(total.x / points.length), y: round(total.y / points.length) };\n}\n\nfunction sortedByDegree<T extends { degree: number }>(items: readonly T[]): T[] {\n return [...items].sort((a, b) => normalizeDegrees(a.degree) - normalizeDegrees(b.degree));\n}\n\nfunction slugForGeometry(value: string | number) {\n return String(value)\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\") || \"item\";\n}\n\nfunction nearestUtterance(degree: number, utterance: readonly ArcheometerUtterancePoint[]) {\n let best: ArcheometerUtterancePoint | undefined;\n let bestDelta = Number.POSITIVE_INFINITY;\n for (const point of utterance) {\n const delta = Math.abs(shortestAngularDistance(degree, point.degree));\n if (delta < bestDelta) {\n best = point;\n bestDelta = delta;\n }\n }\n return best;\n}\n\nfunction triangleVertexFillForDegree(model: ArcheometerRenderModel, degree: number) {\n for (const triangle of model.triangles) {\n if (!triangle.vertexFills) continue;\n for (const [index, vertexDegree] of triangle.vertices.entries()) {\n if (Math.abs(shortestAngularDistance(degree, vertexDegree)) < 0.001) {\n return triangle.vertexFills[index];\n }\n }\n }\n return undefined;\n}\n\nfunction tangentRotation(angleRad: number) {\n let degrees = rad2deg(angleRad) + 90;\n degrees = ((degrees % 360) + 360) % 360;\n if (degrees > 90 && degrees < 270) degrees += 180;\n return ((degrees % 360) + 360) % 360;\n}\n\nfunction shortestAngularDistance(a: number, b: number) {\n return ((normalizeDegrees(a) - normalizeDegrees(b) + 540) % 360) - 180;\n}\n\nfunction normalizeDegrees(value: number) {\n return ((value % 360) + 360) % 360;\n}\n\nfunction deg2rad(degrees: number) {\n return degrees * (TAU / 360);\n}\n\nfunction rad2deg(radians: number) {\n return radians * (360 / TAU);\n}\n\nfunction round(value: number) {\n return Math.round(value * 1000) / 1000;\n}\n\nfunction fmt(value: number) {\n if (!Number.isFinite(value)) return \"0\";\n return Number.isInteger(value) ? String(value) : value.toFixed(3).replace(/0+$/, \"\").replace(/\\.$/, \"\");\n}\n\nfunction escapeAttr(value: string) {\n return escapeText(value).replace(/\"/g, \""\");\n}\n\nfunction escapeText(value: string) {\n return String(value).replace(/&/g, \"&\").replace(/</g, \"<\").replace(/>/g, \">\");\n}\n\nfunction textFontFamily() {\n return \"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Symbols 2', 'Noto Sans Symbols', 'Segoe UI Symbol', 'Apple Symbols', sans-serif\";\n}\n","import type {\n AstroGlyphPrimitive,\n AstroWheelAspectGlyphKey,\n AstroWheelPlanetGlyphKey,\n AstroWheelZodiacSign,\n} from \"./astro-glyph-types\";\n\nconst rawGlyph = (markup: string): readonly AstroGlyphPrimitive[] => [\n { kind: \"raw\", markup },\n];\n\nconst raw100 = (markup: string): readonly AstroGlyphPrimitive[] =>\n rawGlyph(`<g transform=\"scale(0.01)\">${markup}</g>`);\n\nexport const GLYPH_FILL = \"var(--astro-glyph-fill, #fff)\";\n\nconst rawPlanet = (markup: string): readonly AstroGlyphPrimitive[] =>\n rawGlyph(\n `<g transform=\"scale(0.01)\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${markup}</g>`\n );\n\nconst SOURCE_POINT_TEXT_GLYPH = (text: string): readonly AstroGlyphPrimitive[] =>\n rawGlyph(\n `<g transform=\"scale(0.01)\"><text x=\"0\" y=\"0\" text-anchor=\"middle\" dominant-baseline=\"central\" font-family=\"Arial Narrow, Liberation Sans Narrow, Arial, Helvetica, sans-serif\" font-size=\"90\" font-weight=\"500\" fill=\"currentColor\" stroke=\"none\">${text}</text></g>`\n );\n\nexport const SOURCE_ZODIAC_GLYPH_PRIMITIVES = {\n \"Aries\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0172864) translate(-66.624999 -71.429581)\\\"><path d=\\\"M 64.28125,95.179581 L 64.28125,91.398331 C 64.281226,88.419171 63.635393,83.106676 62.34375,75.460831 C 61.760395,71.856687 60.802062,68.106691 59.46875,64.210831 C 58.114565,60.252532 56.6979,57.148369 55.21875,54.898331 C 54.072902,53.190039 52.70832,52.335874 51.125,52.335831 C 49.333324,52.335874 48.083325,53.023373 47.375,54.398331 C 46.72916,55.669204 46.406243,57.054619 46.40625,58.554581 C 46.406243,61.721281 47.541659,64.585861 49.8125,67.148331 L 44.5,67.148331 C 42.666664,64.335862 41.749998,61.367115 41.75,58.242081 C 41.749998,54.971288 42.624997,52.40879 44.375,50.554581 C 46.187494,48.637961 48.385408,47.679628 50.96875,47.679581 C 54.302069,47.679628 56.906233,49.054627 58.78125,51.804581 C 60.906229,54.908788 62.67706,58.679617 64.09375,63.117081 C 65.093725,66.346276 65.937474,69.919189 66.625,73.835831 C 67.312472,69.919189 68.156222,66.346276 69.15625,63.117081 C 70.489553,58.783784 72.260384,55.012954 74.46875,51.804581 C 76.343713,49.054627 78.947878,47.679628 82.28125,47.679581 C 84.864538,47.679628 87.062453,48.637961 88.875,50.554581 C 90.624949,52.40879 91.499948,54.971288 91.5,58.242081 C 91.499948,61.367115 90.583283,64.335862 88.75,67.148331 L 83.4375,67.148331 C 85.708287,64.585861 86.843703,61.721281 86.84375,58.554581 C 86.843703,57.054619 86.520787,55.669204 85.875,54.398331 C 85.166621,53.023373 83.916623,52.335874 82.125,52.335831 C 80.541626,52.335874 79.177044,53.190039 78.03125,54.898331 C 76.552047,57.148369 75.135381,60.252532 73.78125,64.210831 C 72.447884,68.106691 71.489552,71.856687 70.90625,75.460831 C 69.614554,83.106676 68.968721,88.419171 68.96875,91.398331 L 68.96875,95.179581 L 64.28125,95.179581\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Taurus\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0175287) translate(-155.375000 -71.429581)\\\"><path d=\\\"M 140.9375,59.023331 C 140.37499,57.690034 139.57291,56.502535 138.53125,55.460831 C 137.57291,54.502537 136.39583,53.710871 135,53.085831 C 133.79166,52.544206 132.40625,52.273373 130.84375,52.273331 L 130.84375,47.585831 C 132.98958,47.585877 134.96874,47.971294 136.78125,48.742081 C 138.67707,49.554626 140.36457,50.690041 141.84375,52.148331 C 143.34374,53.627538 144.48957,55.325453 145.28125,57.242081 C 145.84373,58.57545 146.64582,59.762949 147.6875,60.804581 C 148.64581,61.762947 149.8229,62.554613 151.21875,63.179581 C 152.42706,63.721278 153.81247,63.992111 155.375,63.992081 C 156.87497,63.992111 158.26039,63.721278 159.53125,63.179581 C 160.86455,62.617112 162.04163,61.825447 163.0625,60.804581 C 164.10413,59.762949 164.90621,58.57545 165.46875,57.242081 C 166.26038,55.325453 167.40621,53.627538 168.90625,52.148331 C 170.38537,50.690041 172.07287,49.554626 173.96875,48.742081 C 175.7812,47.971294 177.76037,47.585877 179.90625,47.585831 L 179.90625,52.273331 C 178.3437,52.273373 176.95828,52.544206 175.75,53.085831 C 174.35412,53.710871 173.17704,54.502537 172.21875,55.460831 C 171.17704,56.502535 170.37496,57.690034 169.8125,59.023331 C 169.02079,60.919197 167.87496,62.617112 166.375,64.117081 C 165.6458,64.846277 164.69788,65.585859 163.53125,66.335831 C 164.69788,67.085858 165.6458,67.825441 166.375,68.554581 C 167.87496,70.054605 169.02079,71.75252 169.8125,73.648331 C 170.58329,75.52335 170.96871,77.533764 170.96875,79.679581 C 170.96871,81.762927 170.58329,83.742091 169.8125,85.617081 C 168.99996,87.533754 167.85413,89.231669 166.375,90.710831 C 164.8958,92.169166 163.2083,93.304582 161.3125,94.117081 C 159.49997,94.887914 157.5208,95.27333 155.375,95.273331 C 153.12498,95.27333 151.14581,94.887914 149.4375,94.117081 C 147.45831,93.221249 145.77082,92.085833 144.375,90.710831 C 142.89582,89.231669 141.74999,87.533754 140.9375,85.617081 C 140.16666,83.742091 139.78124,81.762927 139.78125,79.679581 C 139.78124,77.533764 140.16666,75.52335 140.9375,73.648331 C 141.77082,71.62752 142.91665,69.929605 144.375,68.554581 C 145.27082,67.700441 146.22915,66.960858 147.25,66.335831 C 146.20832,65.710859 145.24998,64.971277 144.375,64.117081 C 142.91665,62.700446 141.77082,61.002531 140.9375,59.023331 M 159.53125,69.492081 C 158.26039,68.950439 156.87497,68.679606 155.375,68.679581 C 153.87497,68.679606 152.48956,68.950439 151.21875,69.492081 C 149.92706,70.075438 148.74998,70.867104 147.6875,71.867081 C 146.60415,72.992102 145.80207,74.179601 145.28125,75.429581 C 144.73957,76.742098 144.46873,78.158764 144.46875,79.679581 C 144.46873,81.137927 144.73957,82.523343 145.28125,83.835831 C 145.80207,85.08584 146.60415,86.273339 147.6875,87.398331 C 148.74998,88.398337 149.92706,89.190003 151.21875,89.773331 C 152.48956,90.315001 153.87497,90.585834 155.375,90.585831 C 156.87497,90.585834 158.26039,90.315001 159.53125,89.773331 C 160.82288,89.190003 161.99997,88.398337 163.0625,87.398331 C 164.1458,86.273339 164.94788,85.08584 165.46875,83.835831 C 166.01038,82.523343 166.28121,81.137927 166.28125,79.679581 C 166.28121,78.158764 166.01038,76.742098 165.46875,75.429581 C 164.94788,74.179601 164.1458,72.992102 163.0625,71.867081 C 161.99997,70.867104 160.82288,70.075438 159.53125,69.492081\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Gemini\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0177663) translate(-244.125000 -71.429581)\\\"><path d=\\\"M 257.25,89.007706 C 260.72912,89.486878 264.12495,90.143127 267.4375,90.976456 L 267.4375,95.632706 C 260.06246,93.77854 252.29163,92.851458 244.125,92.851456 C 235.95831,92.851458 228.18749,93.77854 220.8125,95.632706 L 220.8125,90.976456 C 224.12499,90.143127 227.52082,89.486878 231,89.007706 L 231,53.851456 C 227.52082,53.37233 224.12499,52.716081 220.8125,51.882706 L 220.8125,47.226456 C 228.18749,49.080668 235.95831,50.00775 244.125,50.007706 C 252.29163,50.00775 260.06246,49.080668 267.4375,47.226456 L 267.4375,51.882706 C 264.12495,52.716081 260.72912,53.37233 257.25,53.851456 L 257.25,89.007706 M 252.5625,54.351456 C 249.79163,54.580663 246.97914,54.695246 244.125,54.695206 C 241.27081,54.695246 238.45831,54.580663 235.6875,54.351456 L 235.6875,88.507706 C 238.45831,88.278545 241.27081,88.163962 244.125,88.163956 C 246.97914,88.163962 249.79163,88.278545 252.5625,88.507706 L 252.5625,54.351456\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Cancer\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0190187) translate(-332.875000 -71.429584)\\\"><path d=\\\"M 310.26562,78.913956 C 312.16145,80.122304 313.98437,81.101469 315.73438,81.851456 C 320.19269,83.788967 325.14061,84.757716 330.57812,84.757706 C 333.99476,84.757716 337.23434,84.372299 340.29688,83.601456 C 340.02601,83.3723 339.77601,83.143134 339.54688,82.913956 C 338.60934,81.955635 337.92184,80.934803 337.48438,79.851456 C 337.02601,78.726472 336.79684,77.528556 336.79688,76.257706 C 336.79684,75.007725 337.02601,73.820227 337.48438,72.695206 C 337.96351,71.507729 338.65101,70.486897 339.54688,69.632706 C 340.52601,68.695232 341.53642,68.007732 342.57812,67.570206 C 343.66142,67.1119 344.84892,66.882734 346.14062,66.882706 C 347.49475,66.882734 348.68225,67.1119 349.70312,67.570206 C 350.91141,68.111899 351.92183,68.799398 352.73438,69.632706 C 353.67183,70.591063 354.35933,71.611896 354.79688,72.695206 C 355.25516,73.820227 355.48433,75.007725 355.48438,76.257706 C 355.48433,77.507723 355.25516,78.705638 354.79688,79.851456 C 354.29683,81.101469 353.50516,82.174385 352.42188,83.070206 C 350.901,84.320216 349.16142,85.361882 347.20312,86.195206 C 342.11976,88.361879 336.57809,89.445211 330.57812,89.445206 C 324.43227,89.445211 318.89061,88.361879 313.95312,86.195206 C 312.68229,85.632715 311.45312,85.038965 310.26562,84.413956 L 310.26562,78.913956 M 344.35938,80.632706 C 344.901,80.861886 345.49475,80.976469 346.14062,80.976456 C 346.78642,80.976469 347.38017,80.861886 347.92188,80.632706 C 348.48433,80.38272 348.99475,80.03897 349.45312,79.601456 C 349.86975,79.184805 350.2135,78.674388 350.48438,78.070206 C 350.7135,77.507723 350.82808,76.903557 350.82812,76.257706 C 350.82808,75.632725 350.7135,75.038975 350.48438,74.476456 C 350.25516,73.93481 349.91141,73.424394 349.45312,72.945206 C 349.05725,72.549395 348.54683,72.205645 347.92188,71.913956 C 347.38017,71.684812 346.78642,71.570229 346.14062,71.570206 C 345.49475,71.570229 344.901,71.684812 344.35938,71.913956 C 343.79684,72.163978 343.28642,72.507728 342.82812,72.945206 C 342.41142,73.361894 342.06767,73.87231 341.79688,74.476456 C 341.56767,75.038975 341.45309,75.632725 341.45312,76.257706 C 341.45309,76.903557 341.56767,77.507723 341.79688,78.070206 C 342.02601,78.611889 342.36976,79.122305 342.82812,79.601456 C 343.22392,79.997304 343.73434,80.341053 344.35938,80.632706 M 355.48438,63.945206 C 353.58849,62.736904 351.76558,61.757739 350.01562,61.007706 C 345.55725,59.070241 340.60934,58.101492 335.17188,58.101456 C 331.75518,58.101492 328.5156,58.486909 325.45312,59.257706 C 325.72394,59.486908 325.97394,59.716074 326.20312,59.945206 C 327.1406,60.903573 327.8281,61.924405 328.26562,63.007706 C 328.72394,64.132736 328.9531,65.330652 328.95312,66.601456 C 328.9531,67.851483 328.72394,69.038981 328.26562,70.163956 C 327.78644,71.351479 327.09894,72.372311 326.20312,73.226456 C 325.22394,74.163976 324.21352,74.851476 323.17188,75.288956 C 322.08853,75.747308 320.90103,75.976474 319.60938,75.976456 C 318.2552,75.976474 317.0677,75.747308 316.04688,75.288956 C 314.83853,74.747309 313.82812,74.05981 313.01562,73.226456 C 312.07812,72.268145 311.39062,71.247313 310.95312,70.163956 C 310.49479,69.038981 310.26562,67.851483 310.26562,66.601456 C 310.26562,65.351485 310.49479,64.15357 310.95312,63.007706 C 311.45312,61.757739 312.24479,60.684823 313.32812,59.788956 C 314.84895,58.538992 316.58853,57.497326 318.54688,56.663956 C 323.63019,54.497329 329.17185,53.413997 335.17188,53.413956 C 341.31767,53.413997 346.85933,54.497329 351.79688,56.663956 C 353.06766,57.226493 354.29683,57.820243 355.48438,58.445206 L 355.48438,63.945206 M 321.39062,62.226456 C 320.84894,61.997322 320.25519,61.882739 319.60938,61.882706 C 318.96353,61.882739 318.36978,61.997322 317.82812,62.226456 C 317.26561,62.476488 316.7552,62.820238 316.29688,63.257706 C 315.8802,63.674403 315.53645,64.18482 315.26562,64.788956 C 315.03645,65.351485 314.92187,65.955651 314.92188,66.601456 C 314.92187,67.226483 315.03645,67.820233 315.26562,68.382706 C 315.49478,68.924398 315.83853,69.434814 316.29688,69.913956 C 316.6927,70.309813 317.20311,70.653563 317.82812,70.945206 C 318.36978,71.174396 318.96353,71.288979 319.60938,71.288956 C 320.25519,71.288979 320.84894,71.174396 321.39062,70.945206 C 321.95311,70.69523 322.46353,70.35148 322.92188,69.913956 C 323.33852,69.497314 323.68227,68.986898 323.95312,68.382706 C 324.18227,67.820233 324.29686,67.226483 324.29688,66.601456 C 324.29686,65.955651 324.18227,65.351485 323.95312,64.788956 C 323.72394,64.24732 323.38019,63.736903 322.92188,63.257706 C 322.52603,62.861904 322.01561,62.518155 321.39062,62.226456\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Leo\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0177663) translate(-66.624996 -181.929585)\\\"><path d=\\\"M 74.09375,195.41396 C 73.906216,196.14313 73.812466,196.7473 73.8125,197.22646 C 73.812466,197.95563 73.906216,198.54938 74.09375,199.00771 C 74.343715,199.54938 74.635382,199.97646 74.96875,200.28896 C 75.343714,200.64313 75.760381,200.92438 76.21875,201.13271 C 76.677046,201.34104 77.385379,201.44521 78.34375,201.44521 C 79.197877,201.44521 79.947876,201.29938 80.59375,201.00771 C 81.406208,200.65354 82.093708,200.20563 82.65625,199.66396 L 85.96875,202.97646 C 85.052038,203.85146 83.843706,204.64312 82.34375,205.35146 C 81.260375,205.87229 79.927043,206.1327 78.34375,206.13271 C 76.739546,206.1327 75.447881,205.91396 74.46875,205.47646 C 73.343716,204.97646 72.406217,204.35146 71.65625,203.60146 C 70.822885,202.76812 70.197886,201.84104 69.78125,200.82021 C 69.364554,199.77854 69.156221,198.58063 69.15625,197.22646 C 69.156221,195.7473 69.37497,194.45563 69.8125,193.35146 C 71.395802,189.45564 72.937467,186.51814 74.4375,184.53896 C 76.312463,182.05981 77.760379,179.4244 78.78125,176.63271 C 79.239544,175.40357 79.46871,174.00774 79.46875,172.44521 C 79.46871,170.75774 79.239544,169.35149 78.78125,168.22646 C 78.343711,167.14316 77.656212,166.12233 76.71875,165.16396 C 75.906214,164.33066 74.895798,163.64316 73.6875,163.10146 C 72.666634,162.64316 71.479135,162.414 70.125,162.41396 C 68.833304,162.414 67.645805,162.64316 66.5625,163.10146 C 65.520807,163.539 64.510392,164.2265 63.53125,165.16396 C 62.635394,166.01816 61.947894,167.03899 61.46875,168.22646 C 61.010395,169.35149 60.781229,170.54941 60.78125,171.82021 C 60.781229,173.1744 61.010395,174.3619 61.46875,175.38271 C 62.031228,176.6119 62.83331,178.15357 63.875,180.00771 C 65.270808,182.44523 65.968724,184.75773 65.96875,186.94521 C 65.968724,188.19522 65.739557,189.38272 65.28125,190.50771 C 64.843725,191.59105 64.156226,192.61188 63.21875,193.57021 C 62.406227,194.40355 61.395812,195.09105 60.1875,195.63271 C 59.166647,196.09105 57.979148,196.32021 56.625,196.32021 C 55.333318,196.32021 54.145819,196.09105 53.0625,195.63271 C 52.020821,195.19522 51.010405,194.50772 50.03125,193.57021 C 49.135407,192.71605 48.447908,191.69522 47.96875,190.50771 C 47.510409,189.38272 47.281242,188.19522 47.28125,186.94521 C 47.281242,185.67439 47.510409,184.47648 47.96875,183.35146 C 48.406241,182.26815 49.093741,181.24731 50.03125,180.28896 C 50.843739,179.45565 51.854154,178.76815 53.0625,178.22646 C 54.083319,177.76815 55.270818,177.53898 56.625,177.53896 L 57.15625,177.53896 C 56.4479,175.93482 56.093734,174.03899 56.09375,171.85146 C 56.093734,169.83066 56.437483,168.01816 57.125,166.41396 C 57.874982,164.664 58.906231,163.13275 60.21875,161.82021 C 61.531228,160.50775 63.05206,159.48692 64.78125,158.75771 C 66.406223,158.07025 68.187471,157.7265 70.125,157.72646 C 72.166634,157.7265 73.947882,158.07025 75.46875,158.75771 C 77.281212,159.57025 78.802044,160.59108 80.03125,161.82021 C 81.406208,163.19525 82.437457,164.7265 83.125,166.41396 C 83.812456,168.10149 84.156205,170.12232 84.15625,172.47646 C 84.156205,174.80982 83.812456,176.7994 83.125,178.44521 C 81.833291,181.59106 80.239543,184.48689 78.34375,187.13271 C 76.19788,190.19522 74.781215,192.95563 74.09375,195.41396 M 58.40625,182.57021 C 57.864565,182.34106 57.270816,182.22648 56.625,182.22646 C 55.97915,182.22648 55.385401,182.34106 54.84375,182.57021 C 54.281235,182.82023 53.770819,183.16398 53.3125,183.60146 C 52.854153,184.08064 52.510404,184.59106 52.28125,185.13271 C 52.052071,185.69523 51.937488,186.29939 51.9375,186.94521 C 51.937488,187.57022 52.052071,188.16397 52.28125,188.72646 C 52.510404,189.26814 52.854153,189.77855 53.3125,190.25771 C 53.770819,190.69522 54.281235,191.03897 54.84375,191.28896 C 55.385401,191.51814 55.97915,191.63272 56.625,191.63271 C 57.270816,191.63272 57.864565,191.51814 58.40625,191.28896 C 58.968731,191.03897 59.479147,190.69522 59.9375,190.25771 C 60.395813,189.77855 60.739562,189.26814 60.96875,188.72646 C 61.197895,188.16397 61.312478,187.57022 61.3125,186.94521 C 61.312478,186.29939 61.197895,185.69523 60.96875,185.13271 C 60.739562,184.59106 60.395813,184.08064 59.9375,183.60146 C 59.479147,183.16398 58.968731,182.82023 58.40625,182.57021\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Virgo\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0144235) translate(-155.375000 -181.929580)\\\"><path d=\\\"M 168.35938,197.39833 C 170.67183,195.065 172.44267,192.40875 173.67188,189.42958 C 174.901,186.42959 175.51558,183.26293 175.51562,179.92958 C 175.51558,177.03377 175.3385,174.92961 174.98438,173.61708 C 174.44266,171.59628 173.69266,170.58586 172.73438,170.58583 C 172.19267,170.58586 171.43225,171.56503 170.45312,173.52333 C 169.05725,176.31502 168.35934,179.44002 168.35938,182.89833 L 168.35938,197.39833 M 164.60938,206.02333 C 163.71351,206.50249 162.79684,206.95041 161.85938,207.36708 C 159.54684,208.38791 157.02601,209.04415 154.29688,209.33583 L 154.29688,204.61708 C 156.35935,204.32541 158.28643,203.79416 160.07812,203.02333 C 161.36976,202.46083 162.58851,201.815 163.73438,201.08583 C 163.69267,200.60666 163.67184,200.10666 163.67188,199.58583 L 163.67188,170.83583 C 163.67184,167.12753 163.45309,164.32545 163.01562,162.42958 C 162.34893,159.51295 161.52601,158.05462 160.54688,158.05458 C 159.54684,158.05462 158.16143,159.9192 156.39062,163.64833 C 154.99477,166.58586 154.29685,169.71086 154.29688,173.02333 L 154.29688,199.61708 L 149.60938,199.61708 L 149.60938,170.83583 C 149.60935,167.14836 149.3906,164.34628 148.95312,162.42958 C 148.30727,159.51295 147.48436,158.05462 146.48438,158.05458 C 145.48436,158.05462 144.09894,159.9192 142.32812,163.64833 C 140.93228,166.58586 140.23436,169.71086 140.23438,173.02333 L 140.23438,199.61708 L 135.54688,199.61708 L 135.54688,170.83583 C 135.54687,166.4817 134.98437,162.61712 133.85938,159.24208 C 133.21354,157.30462 132.10937,155.34629 130.54688,153.36708 L 135.35938,153.36708 C 136.17187,154.17963 136.89062,155.17963 137.51562,156.36708 C 138.22395,157.74212 138.78645,159.28379 139.20312,160.99208 C 139.82811,159.13795 140.66145,157.53379 141.70312,156.17958 C 143.80728,153.47129 145.52603,152.11713 146.85938,152.11708 C 148.33852,152.11713 149.91144,153.53379 151.57812,156.36708 C 152.22394,157.45046 152.78643,158.99212 153.26562,160.99208 C 153.8906,159.13795 154.72393,157.53379 155.76562,156.17958 C 157.86976,153.47129 159.69268,152.11713 161.23438,152.11708 C 162.71351,152.11713 164.28642,153.53379 165.95312,156.36708 C 166.84892,157.86712 167.41142,159.40879 167.64062,160.99208 C 167.95309,163.17962 168.16142,165.6692 168.26562,168.46083 C 168.68225,167.6067 169.20309,166.80461 169.82812,166.05458 C 171.34892,164.24212 172.68225,163.33587 173.82812,163.33583 C 175.49475,163.33587 176.94266,164.9817 178.17188,168.27333 C 179.52599,171.89836 180.20307,175.78377 180.20312,179.92958 C 180.20307,183.9921 179.47391,187.75251 178.01562,191.21083 C 176.43224,194.96084 174.25516,198.19 171.48438,200.89833 C 170.60933,201.7525 169.69267,202.55458 168.73438,203.30458 C 168.9635,204.28374 169.26559,205.23166 169.64062,206.14833 C 170.45308,208.12749 171.7135,209.99207 173.42188,211.74208 L 167.35938,211.74208 C 166.42184,210.24207 165.73434,208.97124 165.29688,207.92958 C 165.04684,207.30457 164.81767,206.66916 164.60938,206.02333\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Libra\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0184450) translate(-244.125000 -181.929585)\\\"><path d=\\\"M 238.65625,189.07021 L 220.8125,189.07021 L 220.8125,184.38271 L 231.5625,184.38271 C 230.81249,183.4244 230.18749,182.38273 229.6875,181.25771 C 228.91666,179.4869 228.53124,177.6119 228.53125,175.63271 C 228.53124,173.59107 228.91666,171.68482 229.6875,169.91396 C 230.49999,168.08066 231.64582,166.46608 233.125,165.07021 C 234.60415,163.67441 236.29165,162.59108 238.1875,161.82021 C 239.99998,161.09108 241.97914,160.7265 244.125,160.72646 C 246.37497,160.7265 248.35414,161.09108 250.0625,161.82021 C 252.04163,162.67442 253.72913,163.75775 255.125,165.07021 C 256.60413,166.46608 257.74996,168.08066 258.5625,169.91396 C 259.33329,171.68482 259.71871,173.59107 259.71875,175.63271 C 259.71871,177.6119 259.33329,179.4869 258.5625,181.25771 C 258.06246,182.38273 257.43746,183.4244 256.6875,184.38271 L 267.4375,184.38271 L 267.4375,189.07021 L 249.5625,189.07021 L 249.5625,184.38271 C 250.35413,183.94523 251.10413,183.41398 251.8125,182.78896 C 252.8333,181.89315 253.63538,180.78898 254.21875,179.47646 C 254.76038,178.24732 255.03121,176.95565 255.03125,175.60146 C 255.03121,174.22649 254.76038,172.92441 254.21875,171.69521 C 253.65621,170.46607 252.85413,169.36191 251.8125,168.38271 C 250.8333,167.48691 249.65622,166.74733 248.28125,166.16396 C 247.09372,165.664 245.7083,165.414 244.125,165.41396 C 242.62497,165.414 241.23956,165.664 239.96875,166.16396 C 238.65623,166.68483 237.47915,167.42441 236.4375,168.38271 C 235.39582,169.36191 234.59373,170.46607 234.03125,171.69521 C 233.48957,172.92441 233.21873,174.22649 233.21875,175.60146 C 233.21873,176.95565 233.48957,178.24732 234.03125,179.47646 C 234.59373,180.70565 235.39582,181.80981 236.4375,182.78896 C 237.08331,183.39315 237.8229,183.92439 238.65625,184.38271 L 238.65625,189.07021 M 220.8125,203.13271 L 220.8125,198.44521 L 267.4375,198.44521 L 267.4375,203.13271 L 220.8125,203.13271\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Scorpio\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0142149) translate(-332.875000 -181.929580)\\\"><path d=\\\"M 349.8125,208.08583 C 348.20829,208.08582 346.91663,207.86707 345.9375,207.42958 C 344.81246,206.92957 343.87496,206.30457 343.125,205.55458 C 342.29163,204.72124 341.66663,203.79416 341.25,202.77333 C 340.8333,201.73166 340.62497,200.52333 340.625,199.14833 L 340.625,170.39833 C 340.62497,166.69003 340.40622,163.88795 339.96875,161.99208 C 339.30205,159.07545 338.47913,157.61712 337.5,157.61708 C 336.49997,157.61712 335.11455,159.4817 333.34375,163.21083 C 331.94789,166.14836 331.24998,169.27336 331.25,172.58583 L 331.25,199.17958 L 326.5625,199.17958 L 326.5625,170.39833 C 326.56248,166.71086 326.34373,163.90878 325.90625,161.99208 C 325.2604,159.07545 324.43748,157.61712 323.4375,157.61708 C 322.43748,157.61712 321.05207,159.4817 319.28125,163.21083 C 317.88541,166.14836 317.18749,169.27336 317.1875,172.58583 L 317.1875,199.17958 L 312.5,199.17958 L 312.5,170.39833 C 312.49999,166.0442 311.93749,162.17962 310.8125,158.80458 C 310.16666,156.86712 309.0625,154.90879 307.5,152.92958 L 312.3125,152.92958 C 313.12499,153.74213 313.84374,154.74213 314.46875,155.92958 C 315.17707,157.30462 315.73957,158.84629 316.15625,160.55458 C 316.78124,158.70045 317.61457,157.09629 318.65625,155.74208 C 320.7604,153.03379 322.47915,151.67963 323.8125,151.67958 C 325.29165,151.67963 326.86456,153.09629 328.53125,155.92958 C 329.17706,157.01296 329.73956,158.55462 330.21875,160.55458 C 330.84373,158.70045 331.67706,157.09629 332.71875,155.74208 C 334.82289,153.03379 336.6458,151.67963 338.1875,151.67958 C 339.66663,151.67963 341.23955,153.09629 342.90625,155.92958 C 343.80205,157.42962 344.36455,158.97129 344.59375,160.55458 C 345.01038,163.45045 345.21871,165.94003 345.21875,168.02333 L 345.21875,199.17958 C 345.21871,199.97125 345.31246,200.565 345.5,200.96083 C 345.74996,201.5025 346.04163,201.92958 346.375,202.24208 C 346.74996,202.59624 347.16663,202.87749 347.625,203.08583 C 348.08329,203.29416 348.79162,203.39833 349.75,203.39833 L 351.5625,203.39833 L 351.5625,199.33583 L 358.25,205.74208 L 351.5625,212.17958 L 351.5625,208.08583 L 349.8125,208.08583\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Sagittarius\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0218934) translate(-66.625000 -292.429565)\\\"><path d=\\\"M 81.5625,280.82019 L 64.6875,297.69519 L 73.15625,306.16394 L 69.84375,309.47644 L 61.375,301.00769 L 50.3125,312.07019 L 47,308.75769 L 58.0625,297.69519 L 49.59375,289.22644 L 52.90625,285.91394 L 61.375,294.38269 L 78.28125,277.47644 L 65.4375,277.47644 L 65.4375,272.78894 L 86.25,272.78894 L 86.25,293.60144 L 81.5625,293.60144 L 81.5625,280.82019\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Capricorn\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0176523) translate(-155.375000 -292.429565)\\\"><path d=\\\"M 156.70312,301.82019 C 156.3281,301.2577 155.97393,300.66396 155.64062,300.03894 C 153.9531,296.87229 153.10935,293.38271 153.10938,289.57019 L 153.10938,286.94519 C 153.10935,283.23689 152.8906,280.43481 152.45312,278.53894 C 151.78643,275.62231 150.96352,274.16398 149.98438,274.16394 C 148.98435,274.16398 147.59894,276.02856 145.82812,279.75769 C 144.43228,282.69522 143.73436,285.82022 143.73438,289.13269 L 143.73438,296.97644 L 139.04688,296.97644 L 139.04688,286.94519 C 139.04686,283.25772 138.77603,280.45564 138.23438,278.53894 C 137.40103,275.62231 135.74478,274.16398 133.26562,274.16394 L 131.01562,274.16394 L 131.01562,268.22644 L 133.64062,268.22644 C 136.78645,268.22649 139.1927,269.64315 140.85938,272.47644 C 141.77603,274.03898 142.39061,275.58065 142.70312,277.10144 C 143.32811,275.24731 144.16144,273.64315 145.20312,272.28894 C 147.30727,269.58065 149.13019,268.22649 150.67188,268.22644 C 152.15102,268.22649 153.72393,269.64315 155.39062,272.47644 C 156.28643,273.97648 156.84893,275.51815 157.07812,277.10144 C 157.49476,279.99731 157.7031,282.48689 157.70312,284.57019 L 157.70312,288.03894 C 157.7031,291.01813 158.09893,293.57021 158.89062,295.69519 C 159.66143,294.00771 160.53643,292.66396 161.51562,291.66394 C 162.45309,290.70563 163.70309,289.91397 165.26562,289.28894 C 166.51559,288.78897 167.9635,288.53897 169.60938,288.53894 C 171.00517,288.53897 172.29683,288.78897 173.48438,289.28894 C 174.69266,289.78897 175.78641,290.52855 176.76562,291.50769 C 177.72391,292.46605 178.46349,293.57021 178.98438,294.82019 C 179.48432,296.04938 179.73432,297.35146 179.73438,298.72644 C 179.73432,300.08062 179.48432,301.37229 178.98438,302.60144 C 178.46349,303.85145 177.72391,304.95562 176.76562,305.91394 C 175.86974,306.80978 174.776,307.54937 173.48438,308.13269 C 172.38016,308.6327 170.98433,308.8827 169.29688,308.88269 C 167.5885,308.8827 165.98434,308.6327 164.48438,308.13269 C 162.96351,307.6327 161.55726,306.86187 160.26562,305.82019 C 159.91143,306.73687 159.53643,307.60145 159.14062,308.41394 C 158.22393,310.24728 157.13018,311.69519 155.85938,312.75769 C 154.21352,314.13269 152.68227,315.09102 151.26562,315.63269 C 149.55727,316.29936 147.76561,316.63269 145.89062,316.63269 L 144.14062,316.63269 L 144.14062,311.94519 L 145.89062,311.94519 C 147.28644,311.94519 148.47394,311.72644 149.45312,311.28894 C 150.66144,310.76811 151.65102,310.14311 152.42188,309.41394 C 153.29685,308.62228 154.02602,307.6952 154.60938,306.63269 C 155.27601,305.42437 155.97393,303.8202 156.70312,301.82019 M 162.01562,300.60144 C 163.57809,302.30979 165.0885,303.37229 166.54688,303.78894 C 167.48434,304.05979 168.41142,304.1952 169.32812,304.19519 C 170.30725,304.1952 171.09892,304.05979 171.70312,303.78894 C 172.36975,303.49729 172.9635,303.10145 173.48438,302.60144 C 173.98433,302.10145 174.39058,301.5077 174.70312,300.82019 C 174.97391,300.21604 175.10933,299.51812 175.10938,298.72644 C 175.10933,297.97646 174.97391,297.26813 174.70312,296.60144 C 174.45308,295.97646 174.04683,295.38271 173.48438,294.82019 C 172.9635,294.32021 172.36975,293.92438 171.70312,293.63269 C 171.07808,293.36188 170.39058,293.22646 169.64062,293.22644 C 168.93225,293.22646 168.19267,293.36188 167.42188,293.63269 C 166.56767,293.94521 165.92184,294.34105 165.48438,294.82019 C 164.00517,296.48688 162.84892,298.41396 162.01562,300.60144\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Aquarius\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0172973) translate(-244.125000 -292.429570)\\\"><path d=\\\"M 236.04688,288.74207 L 232.42188,282.49207 L 221.60938,288.74207 L 219.26562,284.71082 L 234.17188,276.11707 L 237.76562,282.36707 L 248.60938,276.11707 L 252.20312,282.36707 L 263.04688,276.11707 L 268.98438,286.39832 L 264.92188,288.74207 L 261.29688,282.49207 L 250.48438,288.74207 L 246.85938,282.49207 L 236.04688,288.74207 M 236.04688,308.74207 L 232.42188,302.49207 L 221.60938,308.74207 L 219.26562,304.71082 L 234.17188,296.11707 L 237.76562,302.36707 L 248.60938,296.11707 L 252.20312,302.36707 L 263.04688,296.11707 L 268.98438,306.39832 L 264.92188,308.74207 L 261.29688,302.49207 L 250.48438,308.74207 L 246.85938,302.49207 L 236.04688,308.74207\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n \"Pisces\": [{ kind: \"raw\", markup: \"<g transform=\\\"scale(0.0184327) translate(-332.875000 -292.429565)\\\"><path d=\\\"M 337.78125,294.78894 L 327.96875,294.78894 C 327.71873,298.91396 326.85415,302.7577 325.375,306.32019 C 324.02082,309.59103 322.06248,312.73686 319.5,315.75769 L 313.03125,315.75769 C 316.84374,312.04936 319.5104,308.29936 321.03125,304.50769 C 322.28123,301.42437 323.02082,298.18479 323.25,294.78894 L 313.96875,294.78894 L 313.96875,290.10144 L 323.25,290.10144 C 323.02082,286.70564 322.28123,283.46606 321.03125,280.38269 C 319.48957,276.59106 316.82291,272.83065 313.03125,269.10144 L 319.5,269.10144 C 322.04165,272.12232 323.99998,275.27856 325.375,278.57019 C 326.87498,282.13272 327.73956,285.97647 327.96875,290.10144 L 337.78125,290.10144 C 338.01038,285.97647 338.87497,282.13272 340.375,278.57019 C 341.74996,275.27856 343.7083,272.12232 346.25,269.10144 L 352.71875,269.10144 C 348.92704,272.83065 346.26038,276.59106 344.71875,280.38269 C 343.46871,283.46606 342.72913,286.70564 342.5,290.10144 L 351.46875,290.10144 L 351.46875,294.78894 L 342.5,294.78894 C 342.72913,298.18479 343.46871,301.42437 344.71875,304.50769 C 346.23954,308.29936 348.90621,312.04936 352.71875,315.75769 L 346.25,315.75769 C 343.68746,312.73686 341.72913,309.59103 340.375,306.32019 C 338.8958,302.6952 338.03122,298.85146 337.78125,294.78894\\\" fill=\\\"currentColor\\\" stroke=\\\"none\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></g>\" }],\n} satisfies Record<AstroWheelZodiacSign, readonly AstroGlyphPrimitive[]>;\n\nexport const SOURCE_PLANET_GLYPH_PRIMITIVES = {\n \"sun\": rawPlanet(\n `<circle cx=\"0\" cy=\"0\" r=\"34\" fill=\"${GLYPH_FILL}\"/><circle cx=\"0\" cy=\"0\" r=\"8.5\" fill=\"currentColor\" stroke=\"none\"/>`\n ),\n\n \"moon\": rawPlanet(\n `<path d=\"M-16,-38 C6,-34 24,-17 24,0 C24,17 6,34 -16,38 C-4,27 2,14 2,0 C2,-14 -4,-27 -16,-38 Z\" fill=\"${GLYPH_FILL}\"/>`\n ),\n\n \"mercury\": rawPlanet(\n `<path d=\"M-20,-40 C-10,-18 10,-18 20,-40\" fill=\"none\"/><circle cx=\"0\" cy=\"0\" r=\"22\" fill=\"${GLYPH_FILL}\"/><path d=\"M0,22 L0,48 M-14,38 L14,38\" fill=\"none\"/>`\n ),\n\n \"venus\": rawPlanet(\n `<circle cx=\"0\" cy=\"-12\" r=\"25\" fill=\"${GLYPH_FILL}\"/><path d=\"M0,13 L0,48 M-17,34 L17,34\" fill=\"none\"/>`\n ),\n\n \"mars\": rawPlanet(\n `<circle cx=\"-10\" cy=\"10\" r=\"25\" fill=\"${GLYPH_FILL}\"/><path d=\"M8,-8 L38,-38 M20,-38 L38,-38 L38,-20\" fill=\"none\"/>`\n ),\n\n \"jupiter\": rawGlyph(`<g transform=\"scale(0.0209524) translate(-165.000000 -115.000000)\"><path d=\"M 174,95 L 174,134\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M 180,124 L 151,124\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M 154,109 C 153,109 151,108 151,104 C 151,100 155,96 159,96 C 163,96 167,99 167,106 C 167,113 162,124 152,124\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M 156 109.5 A 0.5 0.5 0 1 1 155,109.5 A 0.5 0.5 0 1 1 156 109.5 z\" transform=\"matrix(3.85432,0,0,3.99998,-445.3468,-329.9978)\" fill=\"currentColor\" stroke=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></g>`),\n\n \"saturn\": rawGlyph(`<g transform=\"scale(0.0209524) translate(-226.000000 -116.000000)\"><path d=\"M 226,98 L 226,127\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M 222,104 L 234,104\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M 240,133 C 239,134 238,135 237,135 C 236,135 234,134 234,132 C 234,130 235,128 237,126 C 239,124 241,120 241,116 C 241,112 239,108 235,108 C 231.21681,108 228,110 226,114\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></g>`),\n\n \"uranus\": rawPlanet(\n `<path d=\"M0,-42 L0,22 M-30,-25 L30,-25 M-40,-42 L-40,8 M40,-42 L40,8 M-40,-10 L-26,-10 M26,-10 L40,-10\" fill=\"none\"/><circle cx=\"0\" cy=\"37\" r=\"12\" fill=\"${GLYPH_FILL}\"/>`\n ),\n\n \"neptune\": rawPlanet(\n `<path d=\"M-34,-38 C-38,-4 -21,10 0,10 C21,10 38,-4 34,-38\" fill=\"none\"/><path d=\"M0,-42 L0,48 M-18,34 L18,34\" fill=\"none\"/>`\n ),\n\n \"pluto\": rawPlanet(\n `<circle cx=\"0\" cy=\"-26\" r=\"17\" fill=\"${GLYPH_FILL}\"/><path d=\"M-34,-26 C-31,0 31,0 34,-26\" fill=\"none\"/><path d=\"M0,-9 L0,48 M-20,30 L20,30\" fill=\"none\"/>`\n ),\n\n \"earth\": rawPlanet(\n `<circle cx=\"0\" cy=\"0\" r=\"34\" fill=\"${GLYPH_FILL}\"/><path d=\"M-34,0 L34,0 M0,-34 L0,34\" fill=\"none\"/>`\n ),\n\n \"chiron\": rawPlanet(\n `<circle cx=\"0\" cy=\"28\" r=\"19\" fill=\"${GLYPH_FILL}\"/><path d=\"M0,9 L0,-48 M0,-22 L28,-48 M0,-22 L28,4\" fill=\"none\"/>`\n ),\n\n \"north node\": rawPlanet(\n `<path d=\"M-30,18 C-39,-14 -29,-43 0,-43 C29,-43 39,-14 30,18\" fill=\"none\"/><circle cx=\"-30\" cy=\"31\" r=\"10\" fill=\"${GLYPH_FILL}\"/><circle cx=\"30\" cy=\"31\" r=\"10\" fill=\"${GLYPH_FILL}\"/>`\n ),\n\n \"south node\": rawPlanet(\n `<path d=\"M-30,-18 C-39,14 -29,43 0,43 C29,43 39,14 30,-18\" fill=\"none\"/><circle cx=\"-30\" cy=\"-31\" r=\"10\" fill=\"${GLYPH_FILL}\"/><circle cx=\"30\" cy=\"-31\" r=\"10\" fill=\"${GLYPH_FILL}\"/>`\n ),\n\n \"lilith\": rawPlanet(\n `<path d=\"M15,-44 C-10,-40 -30,-18 -30,4 C-30,23 -15,36 4,38 C-12,19 -10,-14 20,-38 C26,-43 23,-48 15,-44 Z\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M0,36 L0,50 M-15,44 L15,44\" fill=\"none\"/>`\n ),\n\n \"pars fortunae\": rawPlanet(\n `<circle cx=\"0\" cy=\"0\" r=\"34\" fill=\"${GLYPH_FILL}\"/><path d=\"M-24,-24 L24,24 M24,-24 L-24,24\" fill=\"none\"/>`\n ),\n\n \"ascendant\": SOURCE_POINT_TEXT_GLYPH(\"AC\"),\n \"midheaven\": SOURCE_POINT_TEXT_GLYPH(\"MC\"),\n \"descendant\": SOURCE_POINT_TEXT_GLYPH(\"DC\"),\n \"nadir\": SOURCE_POINT_TEXT_GLYPH(\"IC\"),\n \"vertex\": SOURCE_POINT_TEXT_GLYPH(\"Vx\"),\n \"retrograde\": SOURCE_POINT_TEXT_GLYPH(\"Rx\"),\n} satisfies Record<AstroWheelPlanetGlyphKey, readonly AstroGlyphPrimitive[]>;\n\nexport const SOURCE_ASPECT_GLYPH_PRIMITIVES = {\n \"conjunction\": raw100(\n `<circle cx=\"-18\" cy=\"22\" r=\"13\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\"/><path d=\"M-9,13 L30,-40\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linecap=\"round\"/>`\n ),\n \"opposition\": raw100(\n `<circle cx=\"-26\" cy=\"26\" r=\"11\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\"/><circle cx=\"26\" cy=\"-26\" r=\"11\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\"/><path d=\"M-18,18 L18,-18\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linecap=\"round\"/>`\n ),\n \"square\": raw100(\n `<rect x=\"-32\" y=\"-32\" width=\"64\" height=\"64\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linejoin=\"miter\"/>`\n ),\n \"trine\": raw100(\n `<path d=\"M0,-36 L36,32 L-36,32 Z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linejoin=\"miter\"/>`\n ),\n \"sextile\": raw100(\n `<path d=\"M0,-38 L0,38 M-33,-19 L33,19 M33,-19 L-33,19\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`\n ),\n \"semisquare\": raw100(\n `<path d=\"M-32,34 L8,34 L32,-34\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linecap=\"square\" stroke-linejoin=\"miter\"/>`\n ),\n \"sesquisquare\": raw100(\n `<path d=\"M-30,-34 L30,-34 L30,22 L-30,22 L-30,-34 M0,22 L0,42 L30,42\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linejoin=\"miter\" stroke-linecap=\"square\"/>`\n ),\n \"semisextile\": raw100(\n `<path d=\"M-34,34 L34,34 M-24,-32 L0,28 L24,-32\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`\n ),\n \"inconjunct\": raw100(\n `<path d=\"M-34,-32 L34,-32 M-24,-26 L-8,36 M24,-26 L8,36\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"7\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`\n ),\n} satisfies Record<AstroWheelAspectGlyphKey, readonly AstroGlyphPrimitive[]>;","import {\n SOURCE_ASPECT_GLYPH_PRIMITIVES,\n SOURCE_PLANET_GLYPH_PRIMITIVES,\n SOURCE_ZODIAC_GLYPH_PRIMITIVES,\n} from \"./astro-glyph-assets\";\nimport type {\n AstroGlyphCategory,\n AstroGlyphDefinition,\n AstroGlyphPrimitive,\n AstroWheelAngleGlyphKey,\n AstroWheelAspectGlyphKey,\n AstroWheelPlanetGlyphKey,\n AstroWheelZodiacSign,\n} from \"./astro-glyph-types\";\n\nexport const ZODIAC_GLYPH_PRIMITIVES = SOURCE_ZODIAC_GLYPH_PRIMITIVES;\n\nexport const PLANET_GLYPH_PRIMITIVES = SOURCE_PLANET_GLYPH_PRIMITIVES;\n\nexport const ASPECT_GLYPH_PRIMITIVES = SOURCE_ASPECT_GLYPH_PRIMITIVES;\n\nexport const ANGLE_GLYPH_PRIMITIVES = {\n asc: SOURCE_PLANET_GLYPH_PRIMITIVES.ascendant,\n mc: SOURCE_PLANET_GLYPH_PRIMITIVES.midheaven,\n dsc: SOURCE_PLANET_GLYPH_PRIMITIVES.descendant,\n ic: SOURCE_PLANET_GLYPH_PRIMITIVES.nadir,\n vertex: SOURCE_PLANET_GLYPH_PRIMITIVES.vertex,\n} satisfies Record<AstroWheelAngleGlyphKey, readonly AstroGlyphPrimitive[]>;\n\nconst PLANET_ALIASES: Partial<Record<AstroWheelPlanetGlyphKey, readonly string[]>> = {\n \"north node\": [\"mean node\", \"true node\", \"ascending node\", \"north lunar node\", \"☊\"],\n \"south node\": [\"descending node\", \"south lunar node\", \"☋\"],\n lilith: [\"black moon lilith\", \"mean lilith\", \"true lilith\", \"lilith mean\", \"lilith true\", \"⚸\"],\n \"pars fortunae\": [\"part of fortune\", \"lot of fortune\", \"wheel of fortune\", \"fortune\", \"⊗\"],\n ascendant: [\"asc\", \"ac\"],\n midheaven: [\"mc\", \"medium coeli\"],\n descendant: [\"dsc\", \"dc\"],\n nadir: [\"ic\", \"imum coeli\"],\n vertex: [\"vx\", \"vtx\"],\n retrograde: [\"rx\"],\n};\n\nconst ASPECT_ALIASES: Partial<Record<AstroWheelAspectGlyphKey, readonly string[]>> = {\n semisquare: [\"semi-square\", \"octile\"],\n sesquisquare: [\"sesqui-square\", \"sesquiquadrate\", \"trioctile\"],\n semisextile: [\"semi-sextile\", \"duodecile\"],\n inconjunct: [\"quincunx\"],\n};\n\nexport const ZODIAC_GLYPHS: Record<AstroWheelZodiacSign, AstroGlyphDefinition> =\n mapGlyphRecord<AstroWheelZodiacSign>(\n ZODIAC_GLYPH_PRIMITIVES,\n (key, primitives) => ({\n key: normalizeGlyphKey(key),\n label: key,\n category: \"zodiac\",\n primitives,\n })\n );\n\nexport const PLANET_GLYPHS: Record<AstroWheelPlanetGlyphKey, AstroGlyphDefinition> =\n mapGlyphRecord<AstroWheelPlanetGlyphKey>(\n PLANET_GLYPH_PRIMITIVES,\n (key, primitives) => ({\n key,\n label: titleCaseGlyphKey(key),\n category: \"planet\",\n primitives,\n aliases: PLANET_ALIASES[key],\n })\n );\n\nexport const ASPECT_GLYPHS: Record<AstroWheelAspectGlyphKey, AstroGlyphDefinition> =\n mapGlyphRecord<AstroWheelAspectGlyphKey>(\n ASPECT_GLYPH_PRIMITIVES,\n (key, primitives) => ({\n key,\n label: titleCaseGlyphKey(key),\n category: \"aspect\",\n primitives,\n aliases: ASPECT_ALIASES[key],\n })\n );\n\nfunction mapGlyphRecord<K extends string>(\n source: Record<K, readonly AstroGlyphPrimitive[]>,\n mapper: (key: K, primitives: readonly AstroGlyphPrimitive[]) => AstroGlyphDefinition\n): Record<K, AstroGlyphDefinition> {\n const result = {} as Record<K, AstroGlyphDefinition>;\n\n for (const key of typedKeys(source)) {\n result[key] = mapper(key, source[key]);\n }\n\n return result;\n}\n\nfunction typedKeys<K extends string, V>(object: Record<K, V>): K[] {\n return Object.keys(object) as K[];\n}\n\nexport const ANGLE_GLYPHS: Record<AstroWheelAngleGlyphKey, AstroGlyphDefinition> = {\n asc: {\n key: \"asc\",\n label: \"ASC\",\n category: \"angle\",\n primitives: ANGLE_GLYPH_PRIMITIVES.asc,\n aliases: [\"ac\"],\n },\n mc: {\n key: \"mc\",\n label: \"MC\",\n category: \"angle\",\n primitives: ANGLE_GLYPH_PRIMITIVES.mc,\n },\n dsc: {\n key: \"dsc\",\n label: \"DSC\",\n category: \"angle\",\n primitives: ANGLE_GLYPH_PRIMITIVES.dsc,\n aliases: [\"dc\"],\n },\n ic: {\n key: \"ic\",\n label: \"IC\",\n category: \"angle\",\n primitives: ANGLE_GLYPH_PRIMITIVES.ic,\n },\n vertex: {\n key: \"vertex\",\n label: \"Vertex\",\n category: \"angle\",\n primitives: ANGLE_GLYPH_PRIMITIVES.vertex,\n aliases: [\"vx\", \"vtx\"],\n },\n};\n\nexport const ASTRO_GLYPHS: Record<string, AstroGlyphDefinition> = buildAstroGlyphRegistry();\n\nexport function getAstroGlyph(key: string): AstroGlyphDefinition | undefined {\n return ASTRO_GLYPHS[normalizeGlyphKey(key)];\n}\n\nexport function listAstroGlyphs(category?: AstroGlyphCategory): AstroGlyphDefinition[] {\n const seen = new Set<string>();\n return Object.values(ASTRO_GLYPHS).filter((glyph) => {\n const id = `${glyph.category}:${glyph.key}`;\n if (seen.has(id)) return false;\n seen.add(id);\n return category ? glyph.category === category : true;\n });\n}\n\nfunction buildAstroGlyphRegistry(): Record<string, AstroGlyphDefinition> {\n const registry: Record<string, AstroGlyphDefinition> = {};\n for (const glyph of [\n ...Object.values(ZODIAC_GLYPHS),\n ...Object.values(PLANET_GLYPHS),\n ...Object.values(ASPECT_GLYPHS),\n ...Object.values(ANGLE_GLYPHS),\n ]) {\n registry[normalizeGlyphKey(glyph.key)] = glyph;\n registry[normalizeGlyphKey(glyph.label)] = glyph;\n for (const alias of glyph.aliases ?? []) {\n registry[normalizeGlyphKey(alias)] = glyph;\n }\n }\n return registry;\n}\n\nfunction normalizeGlyphKey(value: string) {\n return value\n .trim()\n .toLocaleLowerCase()\n .replace(/[_-]+/g, \" \")\n .replace(/\\s+/g, \" \");\n}\n\nfunction titleCaseGlyphKey(value: string) {\n return normalizeGlyphKey(value)\n .split(\" \")\n .map((part) => part.charAt(0).toLocaleUpperCase() + part.slice(1))\n .join(\" \");\n}\n","import type {\n AspectEdge,\n AspectName,\n AspectSpec,\n BirthChart,\n HydratedNode,\n HydratedPlanet,\n ZodiacPosition,\n} from \"../astrology\";\nimport { GLYPH_FILL } from \"./astro-glyph-assets\";\nimport {\n ANGLE_GLYPHS,\n PLANET_GLYPHS,\n ZODIAC_GLYPHS,\n getAstroGlyph,\n} from \"./astro-glyph-registry\";\nimport type {\n AstroGlyphDefinition,\n AstroGlyphPrimitive,\n AstroWheelPlanetGlyphKey,\n AstroWheelZodiacSign,\n} from \"./astro-glyph-types\";\n\nexport type { AspectSpec };\n\nexport interface AstroWheelViewBox {\n minX?: number;\n minY?: number;\n width: number;\n height: number;\n}\n\nexport type AstroWheelElement = \"fire\" | \"earth\" | \"air\" | \"water\";\n\nexport interface AstroWheelPaletteOverrides {\n ringStroke?: string;\n label?: string;\n subtle?: string;\n zodiacStroke?: string;\n zodiacGlyph?: string;\n houseLine?: string;\n houseLabel?: string;\n angleLine?: string;\n angleLabel?: string;\n planetGlyph?: string;\n planetTick?: string;\n glyphHalo?: string;\n aspectGuide?: string;\n signColors?: Partial<Record<AstroWheelZodiacSign, string>>;\n elementColors?: Partial<Record<AstroWheelElement, string>>;\n aspects?: Partial<Record<AspectName | (string & {}), string>>;\n}\n\nexport type AstroWheelPalette = \"default\" | \"monochrome\" | AstroWheelPaletteOverrides;\n\nexport interface AstroWheelAspectOptions {\n enabled?: boolean;\n /**\n * Explicit aspect edges to render. When omitted, the renderer uses\n * `chart.aspects`; if `aspectSpecs` is supplied it recomputes planet aspects.\n */\n edges?: readonly AspectEdge[];\n /** Recompute aspects from chart planets with caller-controlled orbs. */\n aspectSpecs?: readonly AspectSpec[];\n}\n\nexport interface AstroWheelZodiacOptions {\n segments?: boolean;\n glyphs?: boolean;\n ticks?: boolean;\n}\n\nexport interface AstroWheelHouseOptions {\n labels?: boolean;\n cuspLines?: boolean;\n angles?: boolean;\n}\n\nexport type AstroWheelPointConnectorMode = \"auto\" | \"always\" | \"never\";\n\nexport interface AstroWheelLayoutOptions {\n rings?: Partial<Record<AstroWheelRing[\"id\"], number>>;\n pointConnectors?: AstroWheelPointConnectorMode;\n maxPointDisplacementDegrees?: number;\n rails?: AstroWheelRailVisibilityPreset | AstroWheelRailVisibility;\n}\n\nexport interface AstroWheelPointOptions {\n enabled?: boolean;\n nodes?: boolean;\n vertex?: boolean;\n collisionThresholdDegrees?: number;\n}\n\nexport interface AstroWheelPointSource {\n key?: string;\n name: string;\n longitude: number;\n kind?: AstroWheelPointKind;\n glyph?: string;\n retrograde?: boolean;\n zodiacPosition?: ZodiacPosition;\n}\n\ninterface AstroWheelPointGroupInput {\n id: string;\n label?: string;\n chart?: BirthChart;\n points?: readonly AstroWheelPointSource[];\n color?: string;\n tickColor?: string;\n radius?: number | \"inner\" | \"base\" | \"outer\" | \"external\";\n radiusOffset?: number;\n glyphScale?: number;\n rails?: AstroWheelRailVisibilityPreset | AstroWheelRailVisibility;\n collisionThresholdDegrees?: number;\n nodes?: boolean;\n vertex?: boolean;\n}\n\ninterface AstroWheelAspectGroupInput {\n id: string;\n label?: string;\n chart?: BirthChart;\n edges?: readonly AspectEdge[];\n aspectSpecs?: readonly AspectSpec[];\n color?: string;\n colors?: Partial<Record<AspectName | (string & {}), string>>;\n radius?: number;\n radiusScale?: number;\n strokeWidth?: number;\n opacityScale?: number;\n}\n\nexport interface AstroWheelSvgOptions {\n width?: number | string;\n height?: number | string;\n viewBox?: AstroWheelViewBox;\n background?: string | \"transparent\";\n palette?: AstroWheelPalette;\n zodiac?: boolean | AstroWheelZodiacOptions;\n aspects?: boolean | AstroWheelAspectOptions;\n houses?: boolean | AstroWheelHouseOptions;\n points?: boolean | AstroWheelPointOptions;\n excludeBodies?: readonly string[];\n padding?: number;\n title?: string;\n layout?: AstroWheelLayoutOptions;\n}\n\nexport interface AstroWheelCoordinate {\n x: number;\n y: number;\n}\n\nexport interface AstroWheelLine {\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n}\n\nexport interface AstroWheelCircleHitTarget {\n kind: \"circle\";\n cx: number;\n cy: number;\n r: number;\n}\n\nexport interface AstroWheelArcConnector {\n startAngle: number;\n endAngle: number;\n radius: number;\n path: string;\n}\n\nexport interface AstroWheelRing {\n id: \"aspects\" | \"planets\" | \"zodiac\" | \"houses\";\n r1: number;\n r2: number;\n}\n\nexport interface AstroWheelZodiacSegment {\n sign: AstroWheelZodiacSign;\n glyph: string;\n element: AstroWheelElement;\n longitudeStart: number;\n longitudeEnd: number;\n angleStart: number;\n angleEnd: number;\n path: string;\n fill: string;\n labelPosition: AstroWheelCoordinate;\n labelFontSize: number;\n}\n\nexport interface AstroWheelHouseCusp {\n house: number;\n longitude: number;\n sign: string;\n line: AstroWheelLine;\n labelPosition: AstroWheelCoordinate;\n labelFontSize: number;\n}\n\nexport type AstroWheelPositionRailId = \"degree\" | \"sign\" | \"minutes\" | \"retrograde\";\nexport type AstroWheelRailVisibilityPreset = \"full\" | \"compact\" | \"glyph-only\";\nexport type AstroWheelRailVisibility = Partial<Record<AstroWheelPositionRailId, boolean>>;\n\ninterface AstroWheelPositionRail {\n id: AstroWheelPositionRailId;\n label: string;\n radius: number;\n visible: boolean;\n}\n\nexport interface AstroWheelPointRailLabel {\n railId: AstroWheelPositionRailId;\n text: string;\n sign?: AstroWheelZodiacSign;\n position: AstroWheelCoordinate;\n angle: number;\n fontSize: number;\n glyphScale?: number;\n visible: boolean;\n}\n\nexport interface AstroWheelAngleMarker {\n key: \"ASC\" | \"MC\" | \"DSC\" | \"IC\";\n longitude: number;\n zodiacPosition: ZodiacPosition;\n line: AstroWheelLine;\n labelPosition: AstroWheelCoordinate;\n labelFontSize: number;\n labelRotation: number;\n}\n\nexport type AstroWheelPointKind = \"planet\" | \"node\" | \"vertex\";\n\nexport interface AstroWheelPoint {\n groupId: string;\n key: string;\n name: string;\n kind: AstroWheelPointKind;\n glyph: string;\n glyphKey?: string;\n longitude: number;\n displayLongitude: number;\n trueAnchor: AstroWheelCoordinate;\n trueAngle: number;\n displayAngle: number;\n house?: number;\n nearestCuspHouse?: number;\n nearestCuspDistanceDegrees?: number;\n zodiacPosition?: ZodiacPosition;\n tickLine: AstroWheelLine;\n leaderArc?: AstroWheelArcConnector;\n leaderLine?: AstroWheelLine;\n glyphPosition: AstroWheelCoordinate;\n labelAngle: number;\n glyphFontSize: number;\n glyphScale: number;\n railLabels: readonly AstroWheelPointRailLabel[];\n hitTarget: AstroWheelCircleHitTarget;\n connector?: AstroWheelLine;\n retrograde?: boolean;\n color: string;\n tickColor: string;\n}\n\nexport interface AstroWheelAspectLine {\n groupId: string;\n planetA: string;\n planetB: string;\n planetAKey: string;\n planetBKey: string;\n aspect: AspectName | (string & {});\n aspectAngle: number;\n delta: number;\n orb: number;\n color: string;\n opacity: number;\n line: AstroWheelLine;\n strokeWidth: number;\n}\n\ninterface AstroWheelPointGroup {\n id: string;\n label?: string;\n color: string;\n tickColor: string;\n radius: number;\n rails: readonly AstroWheelPositionRail[];\n points: readonly AstroWheelPoint[];\n}\n\ninterface AstroWheelAspectGroup {\n id: string;\n label?: string;\n aspectLines: readonly AstroWheelAspectLine[];\n}\n\ninterface AstroWheelSvgModel {\n viewBox: Required<AstroWheelViewBox>;\n center: AstroWheelCoordinate;\n outerRadius: number;\n scale: number;\n ascendantLongitude: number;\n rings: Record<AstroWheelRing[\"id\"], AstroWheelRing>;\n zodiacSegments: readonly AstroWheelZodiacSegment[];\n houseCusps: readonly AstroWheelHouseCusp[];\n angleMarkers: readonly AstroWheelAngleMarker[];\n points: readonly AstroWheelPoint[];\n pointByKey: Record<string, AstroWheelPoint>;\n aspectLines: readonly AstroWheelAspectLine[];\n pointGroups: readonly AstroWheelPointGroup[];\n aspectGroups: readonly AstroWheelAspectGroup[];\n positionRails: readonly AstroWheelPositionRail[];\n palette: ResolvedAstroWheelPalette;\n}\n\ninterface ResolvedZodiacOptions {\n segments: boolean;\n glyphs: boolean;\n ticks: boolean;\n}\n\ninterface ResolvedHouseOptions {\n labels: boolean;\n cuspLines: boolean;\n angles: boolean;\n}\n\ninterface ResolvedAspectOptions {\n enabled: boolean;\n edges?: readonly AspectEdge[];\n aspectSpecs?: readonly AspectSpec[];\n}\n\nexport interface ResolvedAstroWheelPalette {\n ringStroke: string;\n label: string;\n subtle: string;\n zodiacStroke: string;\n zodiacGlyph: string;\n houseLine: string;\n houseLabel: string;\n angleLine: string;\n angleLabel: string;\n planetGlyph: string;\n planetTick: string;\n glyphHalo: string;\n aspectGuide: string;\n signColors: Partial<Record<AstroWheelZodiacSign, string>>;\n elementColors: Record<AstroWheelElement, string>;\n aspects: Record<string, string>;\n}\n\ninterface ResolvedPointOptions {\n enabled: boolean;\n nodes: boolean;\n vertex: boolean;\n collisionThresholdDegrees?: number;\n}\n\nconst TAU = Math.PI * 2;\nconst GLYPH_OUTLINE_FILTER_ID = \"astro-wheel-glyph-outline\";\nconst DEFAULT_ASTRO_WHEEL_RING_FRACTIONS: Record<AstroWheelRing[\"id\"], number> = {\n houses: 7,\n zodiac: 13,\n planets: 27,\n aspects: 53,\n};\nconst DEFAULT_POINT_DISPLACEMENT_DEGREES = 20;\n\nexport const ASTRO_WHEEL_DEFAULT_VIEWBOX: Required<AstroWheelViewBox> = {\n minX: 0,\n minY: 0,\n width: 600,\n height: 600,\n};\n\nexport const ASTRO_WHEEL_DEFAULT_ASPECT_SPECS = [\n { name: \"conjunction\", angle: 0, orb: 8 },\n { name: \"duodecile\", angle: 30, orb: 2 },\n { name: \"octile\", angle: 45, orb: 3 },\n { name: \"sextile\", angle: 60, orb: 5 },\n { name: \"square\", angle: 90, orb: 6 },\n { name: \"trine\", angle: 120, orb: 7 },\n { name: \"trioctile\", angle: 135, orb: 3 },\n { name: \"quincunx\", angle: 150, orb: 3 },\n { name: \"opposition\", angle: 180, orb: 8 },\n] as const satisfies readonly AspectSpec[];\n\nexport const ASTRO_WHEEL_ZODIAC_SIGNS = [\n { sign: \"Aries\", glyph: \"♈\", element: \"fire\" },\n { sign: \"Taurus\", glyph: \"♉\", element: \"earth\" },\n { sign: \"Gemini\", glyph: \"♊\", element: \"air\" },\n { sign: \"Cancer\", glyph: \"♋\", element: \"water\" },\n { sign: \"Leo\", glyph: \"♌\", element: \"fire\" },\n { sign: \"Virgo\", glyph: \"♍\", element: \"earth\" },\n { sign: \"Libra\", glyph: \"♎\", element: \"air\" },\n { sign: \"Scorpio\", glyph: \"♏\", element: \"water\" },\n { sign: \"Sagittarius\", glyph: \"♐\", element: \"fire\" },\n { sign: \"Capricorn\", glyph: \"♑\", element: \"earth\" },\n { sign: \"Aquarius\", glyph: \"♒\", element: \"air\" },\n { sign: \"Pisces\", glyph: \"♓\", element: \"water\" },\n] as const satisfies readonly {\n sign: AstroWheelZodiacSign;\n glyph: string;\n element: AstroWheelElement;\n}[];\n\nexport const ASTRO_WHEEL_POINT_GLYPHS: Record<string, string> = {\n sun: \"☉\",\n moon: \"☽\",\n mercury: \"☿\",\n venus: \"♀\",\n mars: \"♂\",\n jupiter: \"♃\",\n saturn: \"♄\",\n uranus: \"♅\",\n neptune: \"♆\",\n pluto: \"♇\",\n earth: \"⊕\",\n chiron: \"⚷\",\n \"mean node\": \"☊\",\n \"true node\": \"☊\",\n \"north node\": \"☊\",\n \"south node\": \"☋\",\n lilith: \"⚸\",\n \"lilith mean\": \"⚸\",\n \"lilith true\": \"⚸\",\n \"black moon lilith\": \"⚸\",\n \"wheel of fortune\": \"⊗\",\n \"part of fortune\": \"⊗\",\n \"pars fortunae\": \"⊗\",\n \"lot of fortune\": \"⊗\",\n ascendant: \"AC\",\n midheaven: \"MC\",\n descendant: \"DC\",\n nadir: \"IC\",\n vertex: \"Vx\",\n retrograde: \"Rx\",\n};\n\nconst DEFAULT_PALETTE: ResolvedAstroWheelPalette = {\n ringStroke: \"#1f2933\",\n label: \"#111827\",\n subtle: \"#9a9189\",\n zodiacStroke: \"#1f2933\",\n zodiacGlyph: \"#111827\",\n houseLine: \"#8f877f\",\n houseLabel: \"#111827\",\n angleLine: \"#0f172a\",\n angleLabel: \"#0f172a\",\n planetGlyph: \"#111827\",\n planetTick: \"#111827\",\n glyphHalo: \"#0a1628\",\n aspectGuide: \"#d7d0c6\",\n elementColors: {\n fire: \"#e27657\",\n earth: \"#c9bd72\",\n air: \"#78b985\",\n water: \"#6594d0\",\n },\n signColors: {},\n aspects: {\n conjunction: \"#6b7280\",\n duodecile: \"#9a8f7a\",\n octile: \"#f97316\",\n sextile: \"#2563eb\",\n square: \"#dc2626\",\n trine: \"#16a34a\",\n trioctile: \"#f97316\",\n quincunx: \"#7c3aed\",\n opposition: \"#dc2626\",\n },\n};\n\nconst MONOCHROME_PALETTE: ResolvedAstroWheelPalette = {\n ringStroke: \"#222222\",\n label: \"#222222\",\n subtle: \"#9a9a9a\",\n zodiacStroke: \"#222222\",\n zodiacGlyph: \"#222222\",\n houseLine: \"#777777\",\n houseLabel: \"#222222\",\n angleLine: \"#111111\",\n angleLabel: \"#111111\",\n planetGlyph: \"#111111\",\n planetTick: \"#111111\",\n glyphHalo: \"#0a1628\",\n aspectGuide: \"#c9c9c9\",\n elementColors: {\n fire: \"#ececec\",\n earth: \"#d8d8d8\",\n air: \"#f5f5f5\",\n water: \"#e3e3e3\",\n },\n signColors: {},\n aspects: {\n conjunction: \"#666666\",\n duodecile: \"#999999\",\n octile: \"#777777\",\n sextile: \"#777777\",\n square: \"#555555\",\n trine: \"#777777\",\n trioctile: \"#777777\",\n quincunx: \"#888888\",\n opposition: \"#555555\",\n },\n};\n\nexport interface GlyphSvgOptions {\n size?: number;\n color?: string;\n strokeWidth?: number;\n fill?: \"none\" | string;\n background?: string | \"transparent\";\n}\n\nexport function generateGlyphSvg(\n primitives: readonly AstroGlyphPrimitive[],\n options: GlyphSvgOptions = {}\n): string {\n const size = options.size ?? 48;\n const color = options.color ?? \"#111827\";\n const sw = options.strokeWidth ?? 0.14;\n const fillVal = options.fill ?? \"none\";\n const bg = options.background ?? \"transparent\";\n const scale = size / 2;\n const cx = size / 2;\n const cy = size / 2;\n const lines: string[] = [];\n const push = (s: string) => lines.push(s);\n\n push(`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${size}\" height=\"${size}\" viewBox=\"0 0 ${size} ${size}\">`);\n if (bg !== \"transparent\") {\n push(`<rect width=\"${size}\" height=\"${size}\" fill=\"${escapeAttr(bg)}\"/>`);\n }\n const glyphFill = bg === \"transparent\" ? \"#fff\" : bg;\n push(`<g transform=\"translate(${cx} ${cy}) scale(${fmt(scale)})\" color=\"${escapeAttr(color)}\" fill=\"${escapeAttr(fillVal)}\" stroke=\"${escapeAttr(color)}\" stroke-width=\"${fmt(sw)}\" stroke-linecap=\"round\" stroke-linejoin=\"round\">`);\n renderGlyphPrimitives(push, primitives, { color, fill: fillVal, glyphFill });\n push(`</g>`);\n push(`</svg>`);\n return lines.join(\"\\n\");\n}\n\nexport function generateAstroGlyphSvg(\n keyOrGlyph: string | AstroGlyphDefinition,\n options: GlyphSvgOptions = {}\n): string {\n const glyph = typeof keyOrGlyph === \"string\" ? getAstroGlyph(keyOrGlyph) : keyOrGlyph;\n if (!glyph) {\n throw new Error(`Unknown astrology glyph: ${String(keyOrGlyph)}`);\n }\n const svg = generateGlyphSvg(glyph.primitives, options);\n return svg.replace(\"<svg \", `<svg data-astro-glyph=\"${escapeAttr(glyph.key)}\" data-astro-glyph-category=\"${glyph.category}\" `);\n}\n\nfunction buildAstroWheelSvgModel(\n chart: BirthChart,\n options: AstroWheelSvgOptions = {}\n): AstroWheelSvgModel {\n const viewBox = normalizeViewBox(options.viewBox);\n const palette = resolvePalette(options.palette, options.background ?? \"transparent\");\n const excludedBodies = resolveExcludedBodies(options.excludeBodies);\n const scale = Math.min(\n viewBox.width / ASTRO_WHEEL_DEFAULT_VIEWBOX.width,\n viewBox.height / ASTRO_WHEEL_DEFAULT_VIEWBOX.height\n );\n const padding = options.padding ?? round(18 * scale + getExternalPointPadding(options, scale));\n const center = {\n x: round(viewBox.minX + viewBox.width / 2),\n y: round(viewBox.minY + viewBox.height / 2),\n };\n const outerRadius = round(Math.max(0, Math.min(viewBox.width, viewBox.height) / 2 - padding));\n const angleOf = (longitude: number) =>\n deg2rad(clamp360(180 + chart.houses.ascendant.longitude - longitude));\n const rings = buildRings(outerRadius, options.layout?.rings);\n const pointConnectorMode = options.layout?.pointConnectors ?? \"auto\";\n const maxPointDisplacementDegrees = options.layout?.maxPointDisplacementDegrees\n ?? DEFAULT_POINT_DISPLACEMENT_DEGREES;\n const railVisibility = resolveRailVisibility(options.layout?.rails);\n const resolvedPoints = resolvePointOptions(options.points);\n const resolvedHouses = resolveHouseOptions(options.houses);\n const resolvedAspects = resolveAspectOptions(options.aspects);\n const zodiacSegments = buildZodiacSegments({ center, angleOf, rings, scale, palette });\n const houseCusps = resolvedHouses.cuspLines || resolvedHouses.labels\n ? buildHouseCusps({\n houses: chart.houses.houses,\n center,\n angleOf,\n rings,\n scale,\n })\n : [];\n const angleMarkers = resolvedHouses.angles\n ? buildAngleMarkers({\n chart,\n center,\n angleOf,\n rings,\n scale,\n })\n : [];\n const basePointGroup = buildPointGroup({\n layer: {\n id: \"birth\",\n label: \"Birth\",\n chart,\n color: palette.planetGlyph,\n tickColor: palette.planetTick,\n radius: \"base\",\n nodes: resolvedPoints.nodes,\n vertex: resolvedPoints.vertex,\n collisionThresholdDegrees: resolvedPoints.collisionThresholdDegrees,\n },\n center,\n angleOf,\n rings,\n scale,\n palette,\n excludedBodies,\n pointConnectorMode,\n maxDisplacementDegrees: maxPointDisplacementDegrees,\n railVisibility,\n });\n const pointGroups = [\n ...(resolvedPoints.enabled ? [basePointGroup] : []),\n ];\n const points = pointGroups.flatMap((layer) => [...layer.points]);\n const pointByKey = Object.fromEntries(points.map((point) => [point.key, point]));\n const baseAspectGroup = resolvedAspects.enabled\n ? buildAspectGroup({\n layer: {\n id: \"birth\",\n label: \"Birth aspects\",\n chart,\n edges: resolvedAspects.edges,\n aspectSpecs: resolvedAspects.aspectSpecs,\n },\n chart,\n pointByKey,\n center,\n angleOf,\n rings,\n palette,\n excludedBodies,\n })\n : null;\n const aspectGroups = [\n ...(baseAspectGroup ? [baseAspectGroup] : []),\n ];\n const aspectLines = aspectGroups.flatMap((layer) => [...layer.aspectLines]);\n const positionRails = basePointGroup.rails;\n\n return {\n viewBox,\n center,\n outerRadius,\n scale,\n ascendantLongitude: normalizeAngle(chart.houses.ascendant.longitude),\n rings,\n zodiacSegments,\n houseCusps,\n angleMarkers,\n points,\n pointByKey,\n aspectLines,\n pointGroups,\n aspectGroups,\n positionRails,\n palette,\n };\n}\n\nexport function generateAstroWheelSvg(\n chart: BirthChart,\n options: AstroWheelSvgOptions = {}\n): string {\n const model = buildAstroWheelSvgModel(chart, options);\n const viewBox = model.viewBox;\n const zodiacOptions = resolveZodiacOptions(options.zodiac);\n const houseOptions = resolveHouseOptions(options.houses);\n const background = options.background ?? \"transparent\";\n const lines: string[] = [];\n const push = (line: string) => lines.push(line);\n const svgAttributes = [\n `xmlns=\"http://www.w3.org/2000/svg\"`,\n options.width !== undefined ? `width=\"${escapeAttr(String(options.width))}\"` : \"\",\n options.height !== undefined ? `height=\"${escapeAttr(String(options.height))}\"` : \"\",\n `viewBox=\"${fmt(viewBox.minX)} ${fmt(viewBox.minY)} ${fmt(viewBox.width)} ${fmt(viewBox.height)}\"`,\n `preserveAspectRatio=\"xMidYMid meet\"`,\n `role=\"img\"`,\n `aria-label=\"${escapeAttr(options.title ?? \"Astrological birth chart wheel\")}\"`,\n ].filter(Boolean);\n\n push(`<svg ${svgAttributes.join(\" \")}>`);\n push(`<title>${escapeText(options.title ?? \"Astrological birth chart wheel\")}</title>`);\n\n renderSvgDefs(push, model);\n\n if (background !== \"transparent\") {\n push(\n `<rect x=\"${fmt(viewBox.minX)}\" y=\"${fmt(viewBox.minY)}\" width=\"${fmt(viewBox.width)}\" height=\"${fmt(viewBox.height)}\" fill=\"${escapeAttr(background)}\"/>`\n );\n }\n\n renderAspectBoundary(push, model);\n renderAspects(push, model);\n renderZodiac(push, model, zodiacOptions);\n renderHouses(push, model, houseOptions);\n renderPlanets(push, model);\n renderGlyphOverlay(push, model);\n push(`</svg>`);\n\n return lines.join(\"\\n\");\n}\n\nfunction renderSvgDefs(\n push: (line: string) => void,\n model: AstroWheelSvgModel\n) {\n push(`<defs>`);\n push(\n `<filter id=\"${GLYPH_OUTLINE_FILTER_ID}\" x=\"-45%\" y=\"-45%\" width=\"190%\" height=\"190%\">`\n );\n push(\n `<feMorphology in=\"SourceAlpha\" operator=\"dilate\" radius=\"${fmt(1.75 * model.scale)}\" result=\"dilated\"/>`\n );\n push(\n `<feFlood flood-color=\"${escapeAttr(model.palette.glyphHalo)}\" result=\"haloColor\"/>`\n );\n push(\n `<feComposite in=\"haloColor\" in2=\"dilated\" operator=\"in\" result=\"outline\"/>`\n );\n push(`<feMerge>`);\n push(`<feMergeNode in=\"outline\"/>`);\n push(`<feMergeNode in=\"SourceGraphic\"/>`);\n push(`</feMerge>`);\n push(`</filter>`);\n push(`</defs>`);\n}\n\nfunction renderAspects(\n push: (line: string) => void,\n model: AstroWheelSvgModel\n) {\n if (model.aspectGroups.length === 0) {\n return;\n }\n\n push(`<g id=\"astro-wheel-aspects\" aria-label=\"aspects\">`);\n\n for (const layer of model.aspectGroups) {\n push(`<g class=\"astro-wheel-aspect-group\" data-aspect-group=\"${escapeAttr(layer.id)}\"${layer.label ? ` aria-label=\"${escapeAttr(layer.label)}\"` : \"\"}>`);\n\n for (const aspect of layer.aspectLines) {\n push(\n `<line data-aspect-group=\"${escapeAttr(aspect.groupId)}\" data-aspect=\"${escapeAttr(aspect.aspect)}\" data-planet-a=\"${escapeAttr(aspect.planetA)}\" data-planet-b=\"${escapeAttr(aspect.planetB)}\" x1=\"${fmt(aspect.line.x1)}\" y1=\"${fmt(aspect.line.y1)}\" x2=\"${fmt(aspect.line.x2)}\" y2=\"${fmt(aspect.line.y2)}\" stroke=\"${escapeAttr(aspect.color)}\" stroke-opacity=\"${fmt(aspect.opacity)}\" stroke-width=\"${fmt(aspect.strokeWidth * model.scale)}\" stroke-linecap=\"round\"/>`\n );\n }\n\n push(`</g>`);\n }\n\n push(\n `<circle cx=\"${fmt(model.center.x)}\" cy=\"${fmt(model.center.y)}\" r=\"${fmt(4 * model.scale)}\" fill=\"${escapeAttr(model.palette.aspectGuide)}\" fill-opacity=\"0.75\" stroke=\"none\"/>`\n );\n\n push(`</g>`);\n}\n\nfunction renderAspectBoundary(\n push: (line: string) => void,\n model: AstroWheelSvgModel\n) {\n push(\n `<circle id=\"astro-wheel-aspect-boundary\" cx=\"${fmt(model.center.x)}\" cy=\"${fmt(model.center.y)}\" r=\"${fmt(model.rings.aspects.r2)}\" fill=\"none\" stroke=\"${escapeAttr(model.palette.aspectGuide)}\" stroke-opacity=\"0.9\" stroke-width=\"${fmt(1.25 * model.scale)}\"/>`\n );\n}\n\nfunction renderZodiac(\n push: (line: string) => void,\n model: AstroWheelSvgModel,\n options: ResolvedZodiacOptions\n) {\n if (!options.segments && !options.glyphs && !options.ticks) {\n return;\n }\n\n const tickEvery = 1;\n const { center, rings, palette, scale } = model;\n const thickness = rings.zodiac.r2 - rings.zodiac.r1;\n const angleOf = (longitude: number) =>\n deg2rad(clamp360(180 + model.ascendantLongitude - longitude));\n\n push(`<g id=\"astro-wheel-zodiac\" aria-label=\"zodiac\">`);\n if (options.segments) {\n for (const segment of model.zodiacSegments) {\n push(\n `<path data-zodiac-sign=\"${escapeAttr(segment.sign)}\" data-zodiac-element=\"${escapeAttr(segment.element)}\" d=\"${segment.path}\" fill=\"${escapeAttr(segment.fill)}\" fill-opacity=\"0.82\" stroke=\"${escapeAttr(palette.zodiacStroke)}\" stroke-width=\"${fmt(model.scale)}\"/>`\n );\n }\n }\n\n if (options.glyphs) {\n for (const segment of model.zodiacSegments) {\n renderZodiacGlyph(push, segment, palette);\n }\n }\n\n if (options.ticks) {\n for (let index = 0; index < 360 / tickEvery; index++) {\n const longitude = index * tickEvery;\n const signDegree = longitude % 30;\n const angle = angleOf(longitude);\n\n const isSignBoundary = signDegree === 0;\n const isTen = signDegree % 10 === 0;\n const isFive = signDegree % 5 === 0;\n\n const length = isSignBoundary\n ? thickness * 0.58\n : isTen\n ? thickness * 0.42\n : isFive\n ? thickness * 0.29\n : thickness * 0.18;\n\n const strokeWidth = isSignBoundary\n ? 2.2 * scale\n : isTen\n ? 1.55 * scale\n : isFive\n ? 1.1 * scale\n : 0.75 * scale;\n\n const opacity = isSignBoundary ? 0.95 : isFive ? 0.82 : 0.62;\n\n const inner = polarToXY(center.x, center.y, rings.zodiac.r2 - length, angle);\n const outer = polarToXY(center.x, center.y, rings.zodiac.r2, angle);\n\n push(\n `<line data-zodiac-tick=\"${longitude}\" x1=\"${fmt(inner.x)}\" y1=\"${fmt(inner.y)}\" x2=\"${fmt(outer.x)}\" y2=\"${fmt(outer.y)}\" stroke=\"${escapeAttr(palette.zodiacStroke)}\" stroke-opacity=\"${fmt(opacity)}\" stroke-width=\"${fmt(strokeWidth)}\"/>`\n );\n }\n }\n\n push(`</g>`);\n}\n\nfunction renderZodiacGlyph(\n push: (line: string) => void,\n segment: AstroWheelZodiacSegment,\n palette: ResolvedAstroWheelPalette\n) {\n const glyph = ZODIAC_GLYPHS[segment.sign];\n const glyphScale = segment.labelFontSize * 0.72;\n const strokeWidth = clamp(0.11 / Math.max(glyphScale / 10, 0.6), 0.08, 0.16);\n\n push(\n `<g class=\"astro-wheel-glyph\" data-astro-glyph=\"${escapeAttr(glyph.key)}\" data-astro-glyph-category=\"${glyph.category}\" data-zodiac-glyph=\"${escapeAttr(segment.sign)}\" data-zodiac-symbol=\"${escapeAttr(segment.glyph)}\" transform=\"translate(${fmt(segment.labelPosition.x)} ${fmt(segment.labelPosition.y)}) scale(${fmt(glyphScale)})\" color=\"${escapeAttr(palette.zodiacGlyph)}\" fill=\"none\" stroke=\"${escapeAttr(palette.zodiacGlyph)}\" stroke-width=\"${fmt(strokeWidth)}\" stroke-linecap=\"round\" stroke-linejoin=\"round\">`\n );\n push(`<title>${escapeText(`${segment.sign} ${segment.glyph}`)}</title>`);\n renderGlyphPrimitives(push, glyph.primitives, { color: palette.zodiacGlyph });\n push(`</g>`);\n}\n\nfunction renderHouses(\n push: (line: string) => void,\n model: AstroWheelSvgModel,\n options: ResolvedHouseOptions\n) {\n if (!options.cuspLines && !options.labels && !options.angles) {\n return;\n }\n\n push(`<g id=\"astro-wheel-houses\" aria-label=\"houses\">`);\n if (options.cuspLines) {\n for (const cusp of model.houseCusps) {\n const isAngleHouse = cusp.house === 1 || cusp.house === 4 || cusp.house === 7 || cusp.house === 10;\n\n push(\n `<line data-house-cusp=\"${cusp.house}\" x1=\"${fmt(cusp.line.x1)}\" y1=\"${fmt(cusp.line.y1)}\" x2=\"${fmt(cusp.line.x2)}\" y2=\"${fmt(cusp.line.y2)}\" stroke=\"${escapeAttr(model.palette.houseLine)}\" stroke-opacity=\"${fmt(isAngleHouse ? 0.72 : 0.42)}\" stroke-width=\"${fmt(isAngleHouse ? 1.8 * model.scale : 0.95 * model.scale)}\"/>`\n );\n }\n }\n\n if (options.labels) {\n for (const cusp of model.houseCusps) {\n push(\n `<text data-house-label=\"${cusp.house}\" x=\"${fmt(cusp.labelPosition.x)}\" y=\"${fmt(cusp.labelPosition.y)}\" font-family=\"${textFontFamily()}\" font-size=\"${fmt(cusp.labelFontSize)}\" text-anchor=\"middle\" dominant-baseline=\"middle\" fill=\"${escapeAttr(model.palette.houseLabel)}\">${cusp.house}</text>`\n );\n }\n }\n\n // Angle axes are drawn by the thicker house-cusp spokes (houses 1/4/7/10); the angle\n // markers only contribute their degree/minutes label (rendered in the glyph overlay), with\n // no extra outer-rim tick.\n push(`</g>`);\n}\n\nfunction renderPlanets(\n push: (line: string) => void,\n model: AstroWheelSvgModel\n) {\n if (model.pointGroups.length === 0) {\n return;\n }\n\n push(`<g id=\"astro-wheel-planets\" aria-label=\"planets\">`);\n\n for (const layer of model.pointGroups) {\n renderPointGroupGuide(push, layer, model);\n }\n\n for (const layer of model.pointGroups) {\n push(`<g class=\"astro-wheel-point-group\" data-point-group=\"${escapeAttr(layer.id)}\"${layer.label ? ` aria-label=\"${escapeAttr(layer.label)}\"` : \"\"}>`);\n\n for (const point of layer.points) {\n push(\n `<g class=\"astro-wheel-point\" data-point-group=\"${escapeAttr(point.groupId)}\" data-point-key=\"${escapeAttr(point.key)}\" data-point-name=\"${escapeAttr(point.name)}\" data-point-kind=\"${point.kind}\" data-longitude=\"${fmt(point.longitude)}\">`\n );\n\n push(`<title>${escapeText(point.name)} ${fmt(point.longitude)}°</title>`);\n\n push(\n `<line x1=\"${fmt(point.tickLine.x1)}\" y1=\"${fmt(point.tickLine.y1)}\" x2=\"${fmt(point.tickLine.x2)}\" y2=\"${fmt(point.tickLine.y2)}\" stroke=\"${escapeAttr(point.tickColor)}\" stroke-opacity=\"0.82\" stroke-width=\"${fmt(model.scale)}\" stroke-linecap=\"round\"/>`\n );\n\n if (point.leaderArc) {\n push(\n `<path class=\"astro-wheel-point-leader\" d=\"${escapeAttr(point.leaderArc.path)}\" fill=\"none\" stroke=\"${escapeAttr(point.tickColor)}\" stroke-opacity=\"0.52\" stroke-width=\"${fmt(0.9 * model.scale)}\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`\n );\n } else if (point.leaderLine) {\n push(\n `<line class=\"astro-wheel-point-leader\" x1=\"${fmt(point.leaderLine.x1)}\" y1=\"${fmt(point.leaderLine.y1)}\" x2=\"${fmt(point.leaderLine.x2)}\" y2=\"${fmt(point.leaderLine.y2)}\" stroke=\"${escapeAttr(point.tickColor)}\" stroke-opacity=\"0.52\" stroke-width=\"${fmt(0.9 * model.scale)}\" stroke-linecap=\"round\"/>`\n );\n }\n\n push(`</g>`);\n }\n\n push(`</g>`);\n }\n\n push(`</g>`);\n}\n\nfunction renderPointGroupGuide(\n push: (line: string) => void,\n layer: AstroWheelPointGroup,\n model: AstroWheelSvgModel\n) {\n const isExternal = layer.radius > model.rings.houses.r2 + model.scale;\n if (!isExternal) {\n return;\n }\n\n push(\n `<circle class=\"astro-wheel-external-point-ring\" data-point-group=\"${escapeAttr(layer.id)}\" cx=\"${fmt(model.center.x)}\" cy=\"${fmt(model.center.y)}\" r=\"${fmt(layer.radius)}\" fill=\"none\" stroke=\"${escapeAttr(layer.tickColor)}\" stroke-opacity=\"0.32\" stroke-width=\"${fmt(1.15 * model.scale)}\"/>`\n );\n}\n\nfunction renderGlyphOverlay(\n push: (line: string) => void,\n model: AstroWheelSvgModel\n) {\n if (model.angleMarkers.length === 0 && model.pointGroups.length === 0) {\n return;\n }\n\n push(`<g id=\"astro-wheel-glyph-layer\" aria-label=\"chart glyphs\">`);\n\n if (model.angleMarkers.length > 0) {\n push(`<g id=\"astro-wheel-angle-glyphs\" aria-label=\"angle glyphs\">`);\n for (const marker of model.angleMarkers) {\n renderAngleGlyph(push, marker, model);\n }\n push(`</g>`);\n }\n\n if (model.pointGroups.length > 0) {\n push(`<g id=\"astro-wheel-point-glyphs\" aria-label=\"planet glyphs\">`);\n for (const layer of model.pointGroups) {\n push(`<g class=\"astro-wheel-point-glyph-layer\" data-point-group=\"${escapeAttr(layer.id)}\"${layer.label ? ` aria-label=\"${escapeAttr(layer.label)} glyphs\"` : \"\"}>`);\n for (const point of layer.points) {\n renderPointLabelGroup(push, point, model);\n }\n push(`</g>`);\n }\n push(`</g>`);\n }\n\n push(`</g>`);\n}\n\nfunction renderAngleGlyph(\n push: (line: string) => void,\n marker: AstroWheelAngleMarker,\n model: AstroWheelSvgModel\n) {\n const label = angleDisplayLabel(marker.key);\n const position = formatInlinePosition(marker.zodiacPosition);\n\n // Angle axes (AC/DC/MC/IC) are already identified by their thicker house-cusp spokes, so\n // the marker only needs its degree and minutes — no key text, no sign glyph.\n const positionFontSize = clamp(marker.labelFontSize * 0.62, 6 * model.scale, 10 * model.scale);\n const gap = clamp(3 * model.scale, 2, 5);\n\n const degreeWidth = estimateTextWidth(position.degreesText, positionFontSize);\n const minutesWidth = estimateTextWidth(position.minutesText, positionFontSize);\n const totalWidth = degreeWidth + gap + minutesWidth;\n const startX = -totalWidth / 2;\n\n const degreeX = startX;\n const minutesX = degreeX + degreeWidth + gap;\n\n push(\n `<g class=\"astro-wheel-angle-glyph-label\" data-angle-marker=\"${marker.key}\" data-longitude=\"${fmt(marker.longitude)}\" transform=\"translate(${fmt(marker.labelPosition.x)} ${fmt(marker.labelPosition.y)}) rotate(${fmt(marker.labelRotation)})\" filter=\"url(#${GLYPH_OUTLINE_FILTER_ID})\">`\n );\n\n push(`<title>${escapeText(`${label} ${position.degreesText} ${position.sign} ${position.minutesText}`)}</title>`);\n\n push(\n `<text class=\"astro-wheel-angle-degree\" x=\"${fmt(degreeX)}\" y=\"0\" font-family=\"${textFontFamily()}\" font-size=\"${fmt(positionFontSize)}\" text-anchor=\"start\" dominant-baseline=\"middle\" fill=\"${escapeAttr(model.palette.angleLabel)}\">${escapeText(position.degreesText)}</text>`\n );\n\n push(\n `<text class=\"astro-wheel-angle-minutes\" x=\"${fmt(minutesX)}\" y=\"0\" font-family=\"${textFontFamily()}\" font-size=\"${fmt(positionFontSize)}\" text-anchor=\"start\" dominant-baseline=\"middle\" fill=\"${escapeAttr(model.palette.angleLabel)}\">${escapeText(position.minutesText)}</text>`\n );\n\n push(`</g>`);\n}\n\nfunction angleDisplayLabel(key: AstroWheelAngleMarker[\"key\"]) {\n if (key === \"ASC\") return \"AC\";\n if (key === \"DSC\") return \"DC\";\n return key;\n}\n\nfunction renderPointLabelGroup(\n push: (line: string) => void,\n point: AstroWheelPoint,\n model: AstroWheelSvgModel\n) {\n push(\n `<g class=\"astro-wheel-point-label\" data-point-group=\"${escapeAttr(point.groupId)}\" data-point-key=\"${escapeAttr(point.key)}\" data-point-name=\"${escapeAttr(point.name)}\" data-point-kind=\"${point.kind}\" data-longitude=\"${fmt(point.longitude)}\" data-display-longitude=\"${fmt(point.displayLongitude)}\" data-house=\"${point.house ?? \"\"}\" transform=\"translate(${fmt(point.glyphPosition.x)} ${fmt(point.glyphPosition.y)})\" filter=\"url(#${GLYPH_OUTLINE_FILTER_ID})\">`\n );\n\n push(`<title>${escapeText(pointLabelTitle(point))}</title>`);\n\n renderPointGlyph(push, point, 0, 0, point.glyphScale, model.palette.glyphHalo);\n push(`</g>`);\n\n for (const label of point.railLabels) {\n if (!label.visible) continue;\n push(\n `<g class=\"astro-wheel-position-rail-label\" data-point-group=\"${escapeAttr(point.groupId)}\" data-point-key=\"${escapeAttr(point.key)}\" data-point-name=\"${escapeAttr(point.name)}\" data-position-rail=\"${label.railId}\" transform=\"translate(${fmt(label.position.x)} ${fmt(label.position.y)})\" filter=\"url(#${GLYPH_OUTLINE_FILTER_ID})\">`\n );\n if (label.railId === \"sign\" && label.sign) {\n renderInlineSignGlyph(push, label.sign, 0, 0, label.glyphScale ?? label.fontSize, point.color);\n } else if (label.railId === \"retrograde\") {\n renderRetrogradeMarker(push, 0, 0, label.fontSize, point.color);\n } else {\n push(\n `<text class=\"astro-wheel-point-${label.railId}\" x=\"0\" y=\"0\" font-family=\"${textFontFamily()}\" font-size=\"${fmt(label.fontSize)}\" text-anchor=\"middle\" dominant-baseline=\"middle\" fill=\"${escapeAttr(point.color)}\" fill-opacity=\"0.9\">${escapeText(label.text)}</text>`\n );\n }\n push(`</g>`);\n }\n}\n\nfunction renderPointGlyph(\n push: (line: string) => void,\n point: AstroWheelPoint,\n x: number,\n y: number,\n glyphScale: number,\n glyphFill: string\n) {\n const glyph = point.glyphKey ? getAstroGlyph(point.glyphKey) : resolvePointGlyph(point.name);\n\n if (glyph) {\n const strokeWidth = clamp(0.12 / Math.max(glyphScale / 10, 0.6), 0.1, 0.18);\n push(\n `<g class=\"astro-wheel-glyph\" data-astro-glyph=\"${escapeAttr(glyph.key)}\" data-astro-glyph-category=\"${glyph.category}\" data-point-glyph=\"${escapeAttr(point.name)}\" transform=\"translate(${fmt(x)} ${fmt(y)}) scale(${fmt(glyphScale)})\" color=\"${escapeAttr(point.color)}\" fill=\"none\" stroke=\"${escapeAttr(point.color)}\" stroke-width=\"${fmt(strokeWidth)}\" stroke-linecap=\"round\" stroke-linejoin=\"round\">`\n );\n renderGlyphPrimitives(push, glyph.primitives, { color: point.color, glyphFill });\n push(`</g>`);\n } else {\n push(\n `<text class=\"astro-wheel-glyph\" data-point-glyph=\"${escapeAttr(point.name)}\" x=\"${fmt(x)}\" y=\"${fmt(y)}\" font-family=\"${symbolFontFamily()}\" font-size=\"${fmt(point.glyphFontSize)}\" text-anchor=\"middle\" dominant-baseline=\"middle\" fill=\"${escapeAttr(point.color)}\">${escapeText(point.glyph)}</text>`\n );\n }\n}\n\nfunction renderRetrogradeMarker(\n push: (line: string) => void,\n x: number,\n y: number,\n fontSize: number,\n color: string\n) {\n const glyph = resolvePointGlyph(\"retrograde\");\n\n if (glyph) {\n const glyphScale = fontSize * 0.62;\n const strokeWidth = clamp(0.12 / Math.max(glyphScale / 10, 0.6), 0.1, 0.18);\n\n push(\n `<g class=\"astro-wheel-point-retrograde\" data-astro-glyph=\"${escapeAttr(glyph.key)}\" data-astro-glyph-category=\"${glyph.category}\" transform=\"translate(${fmt(x)} ${fmt(y)}) scale(${fmt(glyphScale)})\" color=\"${escapeAttr(color)}\" fill=\"none\" stroke=\"${escapeAttr(color)}\" stroke-width=\"${fmt(strokeWidth)}\" stroke-linecap=\"round\" stroke-linejoin=\"round\">`\n );\n renderGlyphPrimitives(push, glyph.primitives, { color });\n push(`</g>`);\n return;\n }\n\n push(\n `<text class=\"astro-wheel-point-retrograde\" x=\"${fmt(x)}\" y=\"${fmt(y)}\" font-family=\"${textFontFamily()}\" font-size=\"${fmt(fontSize)}\" text-anchor=\"middle\" dominant-baseline=\"middle\" fill=\"${escapeAttr(color)}\" font-weight=\"700\">R</text>`\n );\n}\n\nfunction renderInlineSignGlyph(\n push: (line: string) => void,\n sign: string,\n x: number,\n y: number,\n glyphScale: number,\n color: string\n) {\n const glyph = ZODIAC_GLYPHS[sign as AstroWheelZodiacSign];\n\n if (glyph) {\n const strokeWidth = clamp(0.11 / Math.max(glyphScale / 10, 0.6), 0.08, 0.16);\n push(\n `<g class=\"astro-wheel-point-sign-glyph\" data-astro-glyph=\"${escapeAttr(glyph.key)}\" data-astro-glyph-category=\"${glyph.category}\" data-zodiac-glyph=\"${escapeAttr(sign)}\" transform=\"translate(${fmt(x)} ${fmt(y)}) scale(${fmt(glyphScale)})\" color=\"${escapeAttr(color)}\" fill=\"none\" stroke=\"${escapeAttr(color)}\" stroke-width=\"${fmt(strokeWidth)}\" stroke-linecap=\"round\" stroke-linejoin=\"round\">`\n );\n renderGlyphPrimitives(push, glyph.primitives, { color });\n push(`</g>`);\n return;\n }\n\n push(\n `<text class=\"astro-wheel-point-sign-glyph\" x=\"${fmt(x)}\" y=\"${fmt(y)}\" font-family=\"${symbolFontFamily()}\" font-size=\"${fmt(glyphScale)}\" text-anchor=\"middle\" dominant-baseline=\"middle\" fill=\"${escapeAttr(color)}\">${escapeText(sign.charAt(0).toUpperCase())}</text>`\n );\n}\n\ninterface PointInlinePosition {\n sign: string;\n degreesText: string;\n minutesText: string;\n}\n\nfunction formatInlinePosition(position: ZodiacPosition): PointInlinePosition {\n let degrees = Math.floor(position.decimalDegrees);\n let minutes = Math.round((position.decimalDegrees - degrees) * 60);\n\n if (minutes === 60) {\n degrees += 1;\n minutes = 0;\n }\n\n return {\n sign: position.sign,\n degreesText: `${degrees}°`,\n minutesText: `${String(minutes).padStart(2, \"0\")}'`,\n };\n}\n\nfunction pointLabelTitle(point: AstroWheelPoint) {\n const position = point.zodiacPosition ? formatInlinePosition(point.zodiacPosition) : null;\n if (!position) {\n return `${point.name} ${fmt(point.longitude)}°`;\n }\n\n const retrograde = point.retrograde ? \" Rx\" : \"\";\n return `${point.name} ${position.degreesText} ${position.sign} ${position.minutesText}${retrograde}`;\n}\n\nfunction estimateTextWidth(value: string, fontSize: number) {\n return value.length * fontSize * 0.56;\n}\n\nconst POINT_GLYPH_ALIASES: Record<string, AstroWheelPlanetGlyphKey> = {\n \"mean node\": \"north node\",\n \"true node\": \"north node\",\n \"ascending node\": \"north node\",\n \"north lunar node\": \"north node\",\n \"descending node\": \"south node\",\n \"south lunar node\": \"south node\",\n \"wheel of fortune\": \"pars fortunae\",\n \"part of fortune\": \"pars fortunae\",\n \"lot of fortune\": \"pars fortunae\",\n \"fortune\": \"pars fortunae\",\n \"black moon lilith\": \"lilith\",\n \"mean lilith\": \"lilith\",\n \"true lilith\": \"lilith\",\n \"lilith mean\": \"lilith\",\n \"lilith true\": \"lilith\",\n \"asc\": \"ascendant\",\n \"ac\": \"ascendant\",\n \"mc\": \"midheaven\",\n \"medium coeli\": \"midheaven\",\n \"dsc\": \"descendant\",\n \"dc\": \"descendant\",\n \"ic\": \"nadir\",\n \"imum coeli\": \"nadir\",\n \"vx\": \"vertex\",\n \"vtx\": \"vertex\",\n \"rx\": \"retrograde\",\n};\n\nfunction resolvePointGlyph(name: string): AstroGlyphDefinition | null {\n const key = name.trim().toLocaleLowerCase().replace(/[_-]+/g, \" \").replace(/\\s+/g, \" \");\n const resolved = POINT_GLYPH_ALIASES[key] ?? key;\n return PLANET_GLYPHS[resolved as AstroWheelPlanetGlyphKey] ?? ANGLE_GLYPHS[resolved as keyof typeof ANGLE_GLYPHS] ?? null;\n}\n\nfunction getExternalPointPadding(options: AstroWheelSvgOptions, scale: number) {\n void options;\n void scale;\n return 0;\n}\n\nfunction buildZodiacSegments(params: {\n center: AstroWheelCoordinate;\n angleOf: (longitude: number) => number;\n rings: Record<AstroWheelRing[\"id\"], AstroWheelRing>;\n scale: number;\n palette: ResolvedAstroWheelPalette;\n}): AstroWheelZodiacSegment[] {\n const { center, angleOf, rings, scale, palette } = params;\n const boundaries = unwrapAngles(\n Array.from({ length: ASTRO_WHEEL_ZODIAC_SIGNS.length + 1 }, (_, index) =>\n angleOf(index * 30)\n ),\n \"dec\"\n );\n const thickness = rings.zodiac.r2 - rings.zodiac.r1;\n const labelFontSize = clamp(thickness * 0.58, 12 * scale, 28 * scale);\n\n return ASTRO_WHEEL_ZODIAC_SIGNS.map((entry, index) => {\n const angleStart = boundaries[index];\n const angleEnd = boundaries[index + 1];\n const labelPosition = polarToXY(\n center.x,\n center.y,\n (rings.zodiac.r1 + rings.zodiac.r2) / 2,\n angleOf(index * 30 + 15)\n );\n return {\n sign: entry.sign,\n glyph: entry.glyph,\n element: entry.element,\n longitudeStart: index * 30,\n longitudeEnd: index === 11 ? 360 : (index + 1) * 30,\n angleStart,\n angleEnd,\n path: arcPath(center.x, center.y, rings.zodiac.r1, rings.zodiac.r2, angleStart, angleEnd),\n fill: palette.signColors[entry.sign] ?? palette.elementColors[entry.element],\n labelPosition,\n labelFontSize,\n };\n });\n}\n\nfunction buildHouseCusps(params: {\n houses: readonly ZodiacPosition[];\n center: AstroWheelCoordinate;\n angleOf: (longitude: number) => number;\n rings: Record<AstroWheelRing[\"id\"], AstroWheelRing>;\n scale: number;\n}): AstroWheelHouseCusp[] {\n const { houses, center, angleOf, rings, scale } = params;\n const ring = rings.houses;\n const spokeInnerRadius = rings.aspects.r2;\n const spokeOuterRadius = ring.r2 + 4 * scale;\n // Keep house numbers on the wheel's outer band (just outside the zodiac colours) rather\n // than floating in the margin, where external transit/synastry rings and their labels\n // collide with them.\n const labelRadius = (ring.r1 + ring.r2) / 2;\n const labelFontSize = clamp((ring.r2 - ring.r1) * 0.48, 10 * scale, 19 * scale);\n\n return houses.map((house, index) => {\n const angle = angleOf(house.longitude);\n const next = houses[(index + 1) % houses.length];\n const span = clamp360(next.longitude - house.longitude);\n const labelLongitude = clamp360(house.longitude + span / 2);\n\n return {\n house: index + 1,\n longitude: normalizeAngle(house.longitude),\n sign: house.sign,\n line: lineFromPolar(center, spokeInnerRadius, spokeOuterRadius, angle),\n labelPosition: polarToXY(center.x, center.y, labelRadius, angleOf(labelLongitude)),\n labelFontSize,\n };\n });\n}\n\nfunction buildAngleMarkers(params: {\n chart: BirthChart;\n center: AstroWheelCoordinate;\n angleOf: (longitude: number) => number;\n rings: Record<AstroWheelRing[\"id\"], AstroWheelRing>;\n scale: number;\n}): AstroWheelAngleMarker[] {\n const { chart, center, angleOf, rings, scale } = params;\n const ring = rings.houses;\n const labelFontSize = clamp((ring.r2 - ring.r1) * 0.32, 8 * scale, 18 * scale);\n // Sit the degree/minutes inside the colored sign band (between the inner and outer zodiac\n // circles), slightly below the sign-glyph row so the two don't clash.\n const labelRadius = rings.zodiac.r1 + (rings.zodiac.r2 - rings.zodiac.r1) * 0.32;\n\n const markers = [\n { key: \"ASC\" as const, position: chart.houses.ascendant },\n { key: \"MC\" as const, position: chart.houses.mc },\n { key: \"DSC\" as const, position: chart.houses.dc },\n { key: \"IC\" as const, position: chart.houses.ic },\n ];\n\n return markers.map((marker) => {\n const angle = angleOf(marker.position.longitude);\n const angleDeg = clamp360(angle * (180 / Math.PI));\n let labelRotation = angleDeg;\n if (labelRotation > 90 && labelRotation < 270) {\n labelRotation -= 180;\n }\n\n return {\n key: marker.key,\n longitude: normalizeAngle(marker.position.longitude),\n zodiacPosition: marker.position,\n line: lineFromPolar(center, ring.r1 + 4 * scale, ring.r2 - 4 * scale, angle),\n labelPosition: polarWithNudge(\n center.x,\n center.y,\n labelRadius,\n angle,\n 0,\n 0\n ),\n labelFontSize,\n labelRotation,\n };\n });\n}\n\nfunction buildPointGroup(params: {\n layer: AstroWheelPointGroupInput;\n center: AstroWheelCoordinate;\n angleOf: (longitude: number) => number;\n rings: Record<AstroWheelRing[\"id\"], AstroWheelRing>;\n scale: number;\n palette: ResolvedAstroWheelPalette;\n excludedBodies: ReadonlySet<string>;\n pointConnectorMode: AstroWheelPointConnectorMode;\n maxDisplacementDegrees: number;\n railVisibility: Required<AstroWheelRailVisibility>;\n}): AstroWheelPointGroup {\n const {\n layer,\n center,\n angleOf,\n rings,\n scale,\n palette,\n excludedBodies,\n pointConnectorMode,\n maxDisplacementDegrees,\n railVisibility,\n } = params;\n const ring = rings.planets;\n const requestedRadius = resolvePointGroupRadius(layer, rings);\n const requestedExternalLayer = requestedRadius > rings.houses.r2 + scale;\n\n const thickness = ring.r2 - ring.r1;\n const glyphFontSize = clamp(thickness * 0.68, 14 * scale, 30 * scale) * (layer.glyphScale ?? 1);\n\n const autoPlanetRail = layer.radius === undefined || layer.radius === \"base\";\n const radius = !requestedExternalLayer && autoPlanetRail\n ? clamp(\n ring.r2 - glyphFontSize * 0.58 - Math.max(3 * scale, 2),\n ring.r1 + glyphFontSize * 0.65,\n ring.r2 - glyphFontSize * 0.48\n )\n : requestedRadius;\n\n const isExternalLayer = radius > rings.houses.r2 + scale;\n const tickLength = Math.min(14 * scale, thickness * 0.34);\n const layerRailVisibility = resolveLayerRailVisibility({\n layer,\n fallback: railVisibility,\n external: isExternalLayer,\n });\n const rails = buildPositionRails({\n ring,\n scale,\n visibility: layerRailVisibility,\n layerRadius: radius,\n external: isExternalLayer,\n glyphFontSize,\n });\n\n const collisionPadding = Math.max(2 * scale, 1.5);\n const zodiacKeepOutGap = Math.max(5 * scale, 4);\n const labelMaxRadius = isExternalLayer\n ? Number.POSITIVE_INFINITY\n : rings.zodiac.r1 - zodiacKeepOutGap;\n const seeds = getPointSeeds(layer, excludedBodies);\n const color = layer.color ?? palette.planetGlyph;\n const tickColor = layer.tickColor ?? color;\n const pointIntents = seeds.map((seed) => {\n const tickAngle = angleOf(seed.longitude);\n const trueAnchor = polarToXY(center.x, center.y, rings.aspects.r2, tickAngle);\n const pointGlyphFontSize = seed.kind === \"vertex\"\n ? glyphFontSize * 0.82\n : glyphFontSize;\n\n const rawGlyphRadius = radius;\n const glyphRadius = isExternalLayer\n ? rawGlyphRadius\n : clamp(\n rawGlyphRadius,\n rings.aspects.r2 + pointGlyphFontSize * 0.65,\n labelMaxRadius - pointGlyphFontSize * 0.5\n );\n\n const connectorRadius = glyphRadius;\n const glyphClearance = pointGlyphFontSize * 0.34;\n const tickLine = isExternalLayer\n ? lineFromPolar(\n center,\n Math.max(rings.aspects.r1, rings.aspects.r2 - tickLength * 0.5),\n rings.aspects.r2 + tickLength * 0.5,\n tickAngle\n )\n : lineFromPolar(\n center,\n Math.min(ring.r2, connectorRadius + tickLength),\n Math.min(ring.r2, connectorRadius + glyphClearance),\n tickAngle\n );\n\n const idealPosition = polarToXY(center.x, center.y, glyphRadius, tickAngle);\n const point = makeAstroWheelPoint({\n layer,\n seed,\n tickLine,\n trueAngle: tickAngle,\n displayAngle: tickAngle,\n trueAnchor,\n labelAngle: tickAngle,\n glyphPosition: idealPosition,\n glyphFontSize: pointGlyphFontSize,\n rails,\n houses: layer.chart?.houses.houses,\n center,\n color,\n tickColor,\n });\n // Minimum tangential gap between adjacent glyph centres. A glyph is only ~0.45×fontSize\n // wide, so this keeps clusters tight while still preventing glyphs from overlapping.\n const labelTangentDemandPx = pointGlyphFontSize * 0.72;\n const configuredTangentDemandPx = layer.collisionThresholdDegrees\n ? deg2rad(clamp(layer.collisionThresholdDegrees, 0, 30)) * glyphRadius\n : 0;\n const tangentDemandPx = Math.max(labelTangentDemandPx, configuredTangentDemandPx);\n\n return {\n seed,\n tickAngle,\n tickLine,\n trueAnchor,\n connectorRadius,\n glyphRadius,\n pointGlyphFontSize,\n tangentDemandPx,\n };\n });\n\n const solvedLabels = solveCircularLabelAngles(\n pointIntents.map((intent) => ({\n item: intent,\n idealAngle: intent.tickAngle,\n radius: intent.glyphRadius,\n tangentDemandPx: intent.tangentDemandPx,\n })),\n {\n paddingPx: collisionPadding,\n maxDisplacementRad: deg2rad(clamp(maxDisplacementDegrees, 0, 180)),\n }\n );\n const visualAngleByKey = Object.fromEntries(\n solvedLabels.map(({ item, visualAngle }) => [item.seed.key, visualAngle])\n );\n\n const points = pointIntents.map((intent) => {\n const visualAngle = visualAngleByKey[intent.seed.key] ?? intent.tickAngle;\n let glyphPosition = polarToXY(center.x, center.y, intent.glyphRadius, visualAngle);\n let point = makeAstroWheelPoint({\n layer,\n seed: intent.seed,\n tickLine: intent.tickLine,\n trueAngle: intent.tickAngle,\n displayAngle: visualAngle,\n trueAnchor: intent.trueAnchor,\n labelAngle: visualAngle,\n glyphPosition,\n glyphFontSize: intent.pointGlyphFontSize,\n rails,\n houses: layer.chart?.houses.houses,\n center,\n color,\n tickColor,\n });\n\n const leaderArc = buildPointConnector({\n center,\n tickAngle: intent.tickAngle,\n labelAngle: visualAngle,\n connectorRadius: intent.connectorRadius,\n glyphPosition,\n mode: pointConnectorMode,\n });\n const connector = buildPointLineConnector({\n trueAnchor: point.trueAnchor,\n glyphPosition,\n mode: pointConnectorMode,\n tickAngle: intent.tickAngle,\n displayAngle: visualAngle,\n });\n\n return {\n ...point,\n leaderArc,\n connector,\n };\n });\n return {\n id: layer.id,\n label: layer.label,\n color,\n tickColor,\n radius,\n rails,\n points,\n };\n}\n\nfunction makeAstroWheelPoint(params: {\n layer: AstroWheelPointGroupInput;\n seed: PointSeed;\n tickLine: AstroWheelLine;\n trueAngle: number;\n displayAngle: number;\n trueAnchor: AstroWheelCoordinate;\n labelAngle: number;\n glyphPosition: AstroWheelCoordinate;\n glyphFontSize: number;\n rails: readonly AstroWheelPositionRail[];\n houses?: readonly ZodiacPosition[];\n center: AstroWheelCoordinate;\n color: string;\n tickColor: string;\n}): AstroWheelPoint {\n const {\n layer,\n seed,\n tickLine,\n trueAngle,\n displayAngle,\n trueAnchor,\n labelAngle,\n glyphPosition,\n glyphFontSize,\n rails,\n houses,\n center,\n color,\n tickColor,\n } = params;\n const houseContext = houses ? getHouseContext(seed.longitude, houses) : {};\n const railLabels = buildPointRailLabels({\n seed,\n rails,\n center,\n displayAngle,\n color,\n glyphFontSize,\n });\n const glyphScale = glyphFontSize * 0.66;\n return {\n groupId: layer.id,\n key: seed.key,\n name: seed.name,\n kind: seed.kind,\n glyph: seed.glyph,\n glyphKey: seed.glyphKey,\n longitude: normalizeAngle(seed.longitude),\n displayLongitude: normalizeAngle(seed.longitude + rad2deg(signedAngleDelta(displayAngle, trueAngle))),\n trueAnchor,\n trueAngle,\n displayAngle,\n house: houseContext.house,\n nearestCuspHouse: houseContext.nearestCuspHouse,\n nearestCuspDistanceDegrees: houseContext.nearestCuspDistanceDegrees,\n zodiacPosition: seed.zodiacPosition,\n tickLine,\n labelAngle,\n leaderArc: undefined,\n leaderLine: undefined,\n glyphPosition,\n glyphFontSize,\n glyphScale,\n railLabels,\n hitTarget: {\n kind: \"circle\",\n cx: glyphPosition.x,\n cy: glyphPosition.y,\n r: round(glyphScale * 0.72),\n },\n retrograde: seed.retrograde,\n color,\n tickColor,\n };\n}\n\nfunction resolveRailVisibility(\n input: AstroWheelRailVisibilityPreset | AstroWheelRailVisibility | undefined\n): Required<AstroWheelRailVisibility> {\n if (!input || input === \"glyph-only\") {\n return { degree: false, sign: false, minutes: false, retrograde: false };\n }\n if (input === \"compact\") {\n return { degree: true, sign: true, minutes: false, retrograde: true };\n }\n if (input === \"full\") {\n return { degree: true, sign: true, minutes: true, retrograde: true };\n }\n return {\n degree: input.degree ?? true,\n sign: input.sign ?? true,\n minutes: input.minutes ?? true,\n retrograde: input.retrograde ?? true,\n };\n}\n\nfunction resolveLayerRailVisibility(params: {\n layer: AstroWheelPointGroupInput;\n fallback: Required<AstroWheelRailVisibility>;\n external: boolean;\n}): Required<AstroWheelRailVisibility> {\n if (params.layer.rails) {\n return resolveRailVisibility(params.layer.rails);\n }\n if (params.external) {\n // External rings (transits/synastry) are already dense. Keep only the degree rail by\n // default — sign and minutes crowd neighbouring points. Callers can opt back in via\n // the per-layer `rails` option.\n return {\n degree: params.fallback.degree,\n sign: false,\n minutes: false,\n retrograde: false,\n };\n }\n return params.fallback;\n}\n\nfunction buildPositionRails(params: {\n ring: AstroWheelRing;\n scale: number;\n visibility: Required<AstroWheelRailVisibility>;\n layerRadius: number;\n external: boolean;\n glyphFontSize: number;\n}): AstroWheelPositionRail[] {\n const { ring, scale, visibility, layerRadius, external, glyphFontSize } = params;\n\n // Rails read outward/inward from the glyph in the conventional position order:\n // degree (nearest the glyph) → sign → minutes → retrograde.\n if (external) {\n const gap = Math.max(2.4 * scale, 2);\n const step = Math.max(glyphFontSize * 0.22, 4.2 * scale);\n const firstRailRadius = layerRadius + glyphFontSize * 0.42 + gap;\n return [\n { id: \"degree\", label: \"Degree\", radius: round(firstRailRadius), visible: visibility.degree },\n { id: \"minutes\", label: \"Minutes\", radius: round(firstRailRadius + step * 2), visible: visibility.minutes },\n { id: \"sign\", label: \"Sign\", radius: round(firstRailRadius + step), visible: visibility.sign },\n { id: \"retrograde\", label: \"Retrograde\", radius: round(firstRailRadius + step * 3), visible: visibility.retrograde },\n ];\n }\n\n const thickness = ring.r2 - ring.r1;\n const inset = Math.max(2 * scale, 1.5);\n return [\n { id: \"degree\", label: \"Degree\", radius: round(ring.r1 + thickness * 0.52 + inset), visible: visibility.degree },\n { id: \"minutes\", label: \"Minutes\", radius: round(ring.r1 + thickness * 0.24 + inset), visible: visibility.minutes },\n { id: \"sign\", label: \"Sign\", radius: round(ring.r1 + thickness * 0.38 + inset), visible: visibility.sign },\n { id: \"retrograde\", label: \"Retrograde\", radius: round(ring.r1 + thickness * 0.10 + inset), visible: visibility.retrograde },\n ];\n}\n\nfunction buildPointRailLabels(params: {\n seed: PointSeed;\n rails: readonly AstroWheelPositionRail[];\n center: AstroWheelCoordinate;\n displayAngle: number;\n color: string;\n glyphFontSize: number;\n}): AstroWheelPointRailLabel[] {\n const position = params.seed.zodiacPosition ? formatInlinePosition(params.seed.zodiacPosition) : null;\n const fontSize = clamp(params.glyphFontSize * 0.25, 5, 8);\n return params.rails.flatMap((rail) => {\n let text = \"\";\n let sign: AstroWheelZodiacSign | undefined;\n let glyphScale: number | undefined;\n if (rail.id === \"degree\") text = position?.degreesText ?? \"\";\n if (rail.id === \"sign\") {\n sign = position?.sign as AstroWheelZodiacSign | undefined;\n text = sign ? ASTRO_WHEEL_ZODIAC_SIGNS.find((entry) => entry.sign === sign)?.glyph ?? sign : \"\";\n glyphScale = fontSize * 0.78;\n }\n if (rail.id === \"minutes\") text = position?.minutesText ?? \"\";\n if (rail.id === \"retrograde\") text = params.seed.retrograde ? \"R\" : \"\";\n if (!text) return [];\n return [{\n railId: rail.id,\n text,\n sign,\n position: polarToXY(params.center.x, params.center.y, rail.radius, params.displayAngle),\n angle: params.displayAngle,\n fontSize,\n glyphScale,\n visible: rail.visible,\n }];\n });\n}\n\nfunction getHouseContext(longitude: number, houses: readonly ZodiacPosition[]) {\n if (houses.length === 0) {\n return {};\n }\n const lon = normalizeAngle(longitude);\n let house = houses.length;\n let nearestCuspHouse = 1;\n let nearestCuspDistanceDegrees = Number.POSITIVE_INFINITY;\n\n for (let index = 0; index < houses.length; index++) {\n const cusp = normalizeAngle(houses[index].longitude);\n const next = normalizeAngle(houses[(index + 1) % houses.length].longitude);\n const span = clamp360(next - cusp);\n const offset = clamp360(lon - cusp);\n const distance = Math.abs(shortestLongitudeDistance(lon, cusp));\n if (offset < span || Math.abs(offset - span) < 0.0001) {\n house = index + 1;\n }\n if (distance < nearestCuspDistanceDegrees) {\n nearestCuspDistanceDegrees = distance;\n nearestCuspHouse = index + 1;\n }\n }\n\n return {\n house,\n nearestCuspHouse,\n nearestCuspDistanceDegrees: round(nearestCuspDistanceDegrees),\n };\n}\n\nfunction buildPointLineConnector(params: {\n trueAnchor: AstroWheelCoordinate;\n glyphPosition: AstroWheelCoordinate;\n mode: AstroWheelPointConnectorMode;\n tickAngle: number;\n displayAngle: number;\n}): AstroWheelLine | undefined {\n if (params.mode === \"never\") return undefined;\n if (params.mode === \"auto\" && circularAngleDistance(params.tickAngle, params.displayAngle) < deg2rad(0.35)) {\n return undefined;\n }\n return {\n x1: params.trueAnchor.x,\n y1: params.trueAnchor.y,\n x2: params.glyphPosition.x,\n y2: params.glyphPosition.y,\n };\n}\n\nfunction buildAspectGroup(params: {\n layer: AstroWheelAspectGroupInput;\n chart: BirthChart;\n pointByKey: Record<string, AstroWheelPoint>;\n center: AstroWheelCoordinate;\n angleOf: (longitude: number) => number;\n rings: Record<AstroWheelRing[\"id\"], AstroWheelRing>;\n palette: ResolvedAstroWheelPalette;\n excludedBodies: ReadonlySet<string>;\n}): AstroWheelAspectGroup {\n const { layer, chart, pointByKey, center, angleOf, rings, palette, excludedBodies } = params;\n const sourceEdges = layer.edges\n ? layer.edges\n : getSourceAspectEdges(chart, {\n enabled: true,\n edges: layer.edges,\n aspectSpecs: layer.aspectSpecs,\n });\n const aspectRadius = layer.radius ?? rings.aspects.r2 * (layer.radiusScale ?? 0.96);\n\n const aspectLines = sourceEdges.flatMap((edge) => {\n if (isExcludedBody(edge.planetA, excludedBodies) || isExcludedBody(edge.planetB, excludedBodies)) {\n return [];\n }\n\n const planetAKey = normalizePointKey(edge.planetA);\n const planetBKey = normalizePointKey(edge.planetB);\n const planetA = pointByKey[planetAKey];\n const planetB = pointByKey[planetBKey];\n\n if (!planetA || !planetB) {\n return [];\n }\n\n const spec = findAspectSpec(edge.aspect, layer.aspectSpecs);\n const maxOrb = spec?.orb ?? 8;\n const opacity = clamp((1 - edge.orb / Math.max(maxOrb, 0.001)) * (layer.opacityScale ?? 1), 0.25, 0.92);\n const a = layer.radius || layer.radiusScale\n ? polarToXY(center.x, center.y, aspectRadius, angleOf(planetA.longitude))\n : planetA.trueAnchor;\n const b = layer.radius || layer.radiusScale\n ? polarToXY(center.x, center.y, aspectRadius, angleOf(planetB.longitude))\n : planetB.trueAnchor;\n\n return [{\n groupId: layer.id,\n planetA: planetA.name,\n planetB: planetB.name,\n planetAKey,\n planetBKey,\n aspect: edge.aspect,\n aspectAngle: edge.aspectAngle,\n delta: edge.delta,\n orb: edge.orb,\n color: layer.color ?? layer.colors?.[edge.aspect] ?? palette.aspects[edge.aspect] ?? palette.label,\n opacity,\n line: {\n x1: a.x,\n y1: a.y,\n x2: b.x,\n y2: b.y,\n },\n strokeWidth: layer.strokeWidth ?? 1.25,\n }];\n });\n\n return {\n id: layer.id,\n label: layer.label,\n aspectLines,\n };\n}\n\nfunction getPointSeeds(\n layer: AstroWheelPointGroupInput,\n excludedBodies: ReadonlySet<string>\n): PointSeed[] {\n const seeds: PointSeed[] = [];\n const chart = layer.chart;\n\n if (chart) {\n seeds.push(\n ...Object.entries(chart.planets).map(([key, planet]) =>\n planetSeed(key, planet, layer.id)\n )\n );\n }\n\n if (layer.points) {\n seeds.push(\n ...layer.points.map((point) => pointSeed(point, layer.id))\n );\n }\n\n if (chart && layer.nodes !== false) {\n for (const [key, node] of Object.entries(chart.nodes)) {\n seeds.push(nodeSeed(key, node, layer.id));\n }\n }\n\n if (chart && layer.vertex !== false && chart.houses.ascmc?.vertex) {\n seeds.push({\n key: layerPointKey(layer.id, \"vertex\"),\n name: \"Vertex\",\n kind: \"vertex\",\n glyph: ASTRO_WHEEL_POINT_GLYPHS.vertex,\n glyphKey: \"vertex\",\n longitude: chart.houses.ascmc.vertex.longitude,\n zodiacPosition: chart.houses.ascmc.vertex,\n });\n }\n\n return seeds\n .filter((seed) => !isExcludedBody(seed.name, excludedBodies))\n .sort((a, b) => normalizeAngle(a.longitude) - normalizeAngle(b.longitude));\n}\n\ninterface PointSeed {\n key: string;\n name: string;\n kind: AstroWheelPointKind;\n glyph: string;\n glyphKey?: string;\n longitude: number;\n retrograde?: boolean;\n zodiacPosition?: ZodiacPosition;\n}\n\ninterface CircularLabelItem<T> {\n item: T;\n idealAngle: number;\n radius: number;\n tangentDemandPx: number;\n}\n\ninterface SolvedCircularLabelItem<T> extends CircularLabelItem<T> {\n visualAngle: number;\n}\n\nfunction planetSeed(key: string, planet: HydratedPlanet, groupId: string): PointSeed {\n return {\n key: layerPointKey(groupId, key || planet.name),\n name: planet.name,\n kind: \"planet\",\n glyph: pointGlyph(planet.name),\n glyphKey: pointGlyphKey(planet.name),\n longitude: planet.longitude,\n retrograde: (planet.longitudeSpeed ?? 0) < 0,\n zodiacPosition: planet.zodiacPosition,\n };\n}\n\nfunction nodeSeed(key: string, node: HydratedNode, groupId: string): PointSeed {\n return {\n key: layerPointKey(groupId, node.name || key),\n name: node.name,\n kind: \"node\",\n glyph: pointGlyph(node.name),\n glyphKey: pointGlyphKey(node.name),\n longitude: node.longitude,\n zodiacPosition: node,\n };\n}\n\nfunction pointSeed(point: AstroWheelPointSource, groupId: string): PointSeed {\n return {\n key: layerPointKey(groupId, point.key ?? point.name),\n name: point.name,\n kind: point.kind ?? \"planet\",\n glyph: point.glyph ?? pointGlyph(point.name),\n glyphKey: point.glyph ? undefined : pointGlyphKey(point.name),\n longitude: point.longitude,\n retrograde: point.retrograde,\n zodiacPosition: point.zodiacPosition,\n };\n}\n\nfunction solveCircularLabelAngles<T>(\n items: readonly CircularLabelItem<T>[],\n options: { paddingPx: number; maxDisplacementRad: number }\n): SolvedCircularLabelItem<T>[] {\n const { paddingPx, maxDisplacementRad } = options;\n if (items.length === 0) {\n return [];\n }\n\n const normalized = seedExactAngleClusters(items, { paddingPx, maxDisplacementRad })\n .map((item) => ({\n ...item,\n idealAngle: clampRad(item.idealAngle),\n }))\n .sort((a, b) => a.idealAngle - b.idealAngle);\n\n if (normalized.length === 1) {\n return [{ ...normalized[0], visualAngle: normalized[0].idealAngle }];\n }\n\n let largestGap = -Infinity;\n let seamIndex = 0;\n\n for (let i = 0; i < normalized.length; i++) {\n const current = normalized[i];\n const next = normalized[(i + 1) % normalized.length];\n const nextAngle = i === normalized.length - 1 ? next.idealAngle + TAU : next.idealAngle;\n const gap = nextAngle - current.idealAngle;\n\n if (gap > largestGap) {\n largestGap = gap;\n seamIndex = (i + 1) % normalized.length;\n }\n }\n\n const linear = [\n ...normalized.slice(seamIndex),\n ...normalized.slice(0, seamIndex),\n ].map((item, index) => {\n const wrapped = seamIndex > 0 && index >= normalized.length - seamIndex;\n return {\n ...item,\n idealAngle: item.idealAngle + (wrapped ? TAU : 0),\n };\n });\n\n for (let i = 1; i < linear.length; i++) {\n while (linear[i].idealAngle <= linear[i - 1].idealAngle) {\n linear[i] = {\n ...linear[i],\n idealAngle: linear[i].idealAngle + TAU,\n };\n }\n }\n\n const solved = linear.map((item) => ({\n ...item,\n visualAngle: item.visualAngleSeed ?? item.idealAngle,\n })).sort((a, b) => a.visualAngle - b.visualAngle);\n\n for (let iteration = 0; iteration < 50; iteration++) {\n const forces = new Array(solved.length).fill(0) as number[];\n let maxForce = 0;\n\n for (let i = 0; i < solved.length; i++) {\n const j = (i + 1) % solved.length;\n const current = solved[i];\n const next = solved[j];\n const nextAngle = j === 0 ? next.visualAngle + TAU : next.visualAngle;\n const gap = nextAngle - current.visualAngle;\n const minGap =\n labelAngularHalfDemand(current, paddingPx) +\n labelAngularHalfDemand(next, paddingPx);\n\n if (gap >= minGap) {\n continue;\n }\n\n const push = (minGap - gap) / 2;\n forces[i] -= push;\n forces[j] += push;\n maxForce = Math.max(maxForce, push);\n }\n\n if (maxForce < 0.0001) {\n break;\n }\n\n for (let i = 0; i < solved.length; i++) {\n const movement = clamp(forces[i], -deg2rad(2), deg2rad(2));\n const moved = solved[i].visualAngle + movement;\n solved[i].visualAngle = clampAngleAroundIdeal(\n moved,\n solved[i].idealAngle,\n maxDisplacementRad\n );\n }\n\n solved.sort((a, b) => a.visualAngle - b.visualAngle);\n for (let i = 1; i < solved.length; i++) {\n while (solved[i].visualAngle <= solved[i - 1].visualAngle) {\n solved[i].visualAngle += TAU;\n }\n }\n }\n\n return solved.map((item) => ({\n ...item,\n visualAngle: clampRad(item.visualAngle),\n }));\n}\n\nfunction seedExactAngleClusters<T>(\n items: readonly CircularLabelItem<T>[],\n options: { paddingPx: number; maxDisplacementRad: number }\n): Array<CircularLabelItem<T> & { visualAngleSeed?: number }> {\n const seeded = items.map((item) => ({\n ...item,\n idealAngle: clampRad(item.idealAngle),\n }));\n const groups = new Map<string, Array<CircularLabelItem<T> & { visualAngleSeed?: number }>>();\n\n for (const item of seeded) {\n const key = item.idealAngle.toFixed(6);\n const group = groups.get(key);\n if (group) {\n group.push(item);\n } else {\n groups.set(key, [item]);\n }\n }\n\n for (const group of groups.values()) {\n if (group.length < 2) {\n continue;\n }\n\n const center = group[0].idealAngle;\n const largestDemand = Math.max(\n ...group.map((item) => labelAngularHalfDemand(item, options.paddingPx) * 2)\n );\n const maxStep = group.length > 1\n ? (options.maxDisplacementRad * 2) / (group.length - 1)\n : largestDemand;\n const step = Math.min(largestDemand, maxStep);\n const midpoint = (group.length - 1) / 2;\n\n group.forEach((item, index) => {\n item.visualAngleSeed = center + (index - midpoint) * step;\n });\n }\n\n return seeded;\n}\n\nfunction clampAngleAroundIdeal(value: number, ideal: number, maxDistance: number) {\n if (!Number.isFinite(maxDistance) || maxDistance >= Math.PI) {\n return value;\n }\n\n const delta = signedAngleDelta(ideal, value);\n return ideal + clamp(delta, -maxDistance, maxDistance);\n}\n\nfunction signedAngleDelta(from: number, to: number) {\n let delta = clampRad(to) - clampRad(from);\n if (delta > Math.PI) {\n delta -= TAU;\n } else if (delta < -Math.PI) {\n delta += TAU;\n }\n return delta;\n}\n\nfunction labelAngularHalfDemand<T>(\n item: Pick<CircularLabelItem<T>, \"radius\" | \"tangentDemandPx\">,\n paddingPx: number\n) {\n return (item.tangentDemandPx / 2 + paddingPx) / Math.max(item.radius, 1);\n}\n\nfunction clampRad(value: number) {\n return ((value % TAU) + TAU) % TAU;\n}\n\nfunction circularAngleDistance(a: number, b: number) {\n const delta = Math.abs(clampRad(a) - clampRad(b));\n return Math.min(delta, TAU - delta);\n}\n\nfunction rad2deg(radians: number) {\n return radians * (360 / TAU);\n}\n\nfunction buildPointConnector(params: {\n center: AstroWheelCoordinate;\n tickAngle: number;\n labelAngle: number;\n connectorRadius: number;\n glyphPosition: AstroWheelCoordinate;\n mode: AstroWheelPointConnectorMode;\n}): AstroWheelArcConnector | undefined {\n const { center, tickAngle, labelAngle, connectorRadius, glyphPosition, mode } = params;\n const displacement = circularAngleDistance(tickAngle, labelAngle);\n\n if (mode === \"never\" || (mode === \"auto\" && displacement < deg2rad(0.35))) {\n return undefined;\n }\n\n const path = arcConnectorPath({\n center,\n startAngle: tickAngle,\n endAngle: labelAngle,\n radius: connectorRadius,\n end: glyphPosition,\n });\n\n return {\n startAngle: tickAngle,\n endAngle: labelAngle,\n radius: connectorRadius,\n path,\n };\n}\n\nfunction getSourceAspectEdges(\n chart: BirthChart,\n options: ResolvedAspectOptions\n): readonly AspectEdge[] {\n if (options.edges) {\n return options.edges;\n }\n\n if (options.aspectSpecs) {\n return computeAspectEdges(chart.planets, options.aspectSpecs);\n }\n\n return chart.aspects?.length\n ? chart.aspects\n : computeAspectEdges(chart.planets, ASTRO_WHEEL_DEFAULT_ASPECT_SPECS);\n}\n\nfunction computeAspectEdges(\n planets: Record<string, { longitude: number }>,\n specs: readonly AspectSpec[]\n): AspectEdge[] {\n const keys = Object.keys(planets);\n const edges: AspectEdge[] = [];\n\n for (let i = 0; i < keys.length; i++) {\n for (let j = i + 1; j < keys.length; j++) {\n const planetA = planets[keys[i]];\n const planetB = planets[keys[j]];\n const match = getAspectMatch(planetA.longitude, planetB.longitude, specs);\n if (!match) {\n continue;\n }\n\n edges.push({\n planetA: keys[i],\n planetB: keys[j],\n longitudeA: normalizeAngle(planetA.longitude),\n longitudeB: normalizeAngle(planetB.longitude),\n aspect: match.spec.name,\n aspectAngle: match.spec.angle,\n delta: match.delta,\n orb: match.orb,\n });\n }\n }\n\n return edges;\n}\n\nfunction getAspectMatch(\n lonA: number,\n lonB: number,\n specs: readonly AspectSpec[]\n): { spec: AspectSpec; orb: number; delta: number } | null {\n const delta = Math.min(\n normalizeAngle(lonB - lonA),\n normalizeAngle(lonA - lonB)\n );\n\n for (const spec of specs) {\n const orb = Math.abs(delta - spec.angle);\n if (orb <= spec.orb) {\n return { spec, orb, delta };\n }\n }\n\n return null;\n}\n\nfunction shortestLongitudeDistance(a: number, b: number) {\n return ((normalizeAngle(a) - normalizeAngle(b) + 540) % 360) - 180;\n}\n\nfunction findAspectSpec(\n aspect: string,\n specs: readonly AspectSpec[] = ASTRO_WHEEL_DEFAULT_ASPECT_SPECS\n) {\n return specs.find((spec) => spec.name === aspect);\n}\n\nfunction buildRings(\n outerRadius: number,\n ringFractions: AstroWheelLayoutOptions[\"rings\"] = {}\n): Record<AstroWheelRing[\"id\"], AstroWheelRing> {\n const fractions = {\n ...DEFAULT_ASTRO_WHEEL_RING_FRACTIONS,\n ...ringFractions,\n };\n const ringMap = buildRingMap(outerRadius, [\n { id: \"houses\", fr: fractions.houses },\n { id: \"zodiac\", fr: fractions.zodiac },\n { id: \"planets\", fr: fractions.planets },\n { id: \"aspects\", fr: fractions.aspects },\n ]);\n\n return {\n aspects: ringMap.aspects,\n planets: ringMap.planets,\n zodiac: ringMap.zodiac,\n houses: ringMap.houses,\n };\n}\n\nfunction buildRingMap(\n radius: number,\n defs: readonly { id: AstroWheelRing[\"id\"]; fr: number }[]\n): Record<AstroWheelRing[\"id\"], AstroWheelRing> {\n const normalizedDefs = defs.map((def) => ({\n ...def,\n fr: Number.isFinite(def.fr) && def.fr > 0 ? def.fr : DEFAULT_ASTRO_WHEEL_RING_FRACTIONS[def.id],\n }));\n const frTotal = normalizedDefs.reduce((sum, def) => sum + def.fr, 0);\n let cursor = radius;\n const result = {} as Record<AstroWheelRing[\"id\"], AstroWheelRing>;\n\n for (const def of normalizedDefs) {\n const thickness = (radius * def.fr) / frTotal;\n const r2 = cursor;\n const r1 = cursor - thickness;\n result[def.id] = {\n id: def.id,\n r1: round(r1),\n r2: round(r2),\n };\n cursor = r1;\n }\n\n return result;\n}\n\nfunction resolvePalette(\n palette: AstroWheelPalette = \"default\",\n background: string | \"transparent\" = \"transparent\"\n): ResolvedAstroWheelPalette {\n const base = palette === \"monochrome\" ? MONOCHROME_PALETTE : DEFAULT_PALETTE;\n if (palette === \"default\" || palette === \"monochrome\") {\n return {\n ...clonePalette(base),\n glyphHalo: defaultGlyphHalo(background),\n };\n }\n\n return {\n ...base,\n ...palette,\n glyphHalo: palette.glyphHalo ?? defaultGlyphHalo(background),\n signColors: {\n ...base.signColors,\n ...(palette.signColors ?? {}),\n },\n elementColors: {\n ...base.elementColors,\n ...(palette.elementColors ?? {}),\n },\n aspects: {\n ...base.aspects,\n ...(palette.aspects ?? {}),\n },\n };\n}\n\nfunction defaultGlyphHalo(background: string | \"transparent\") {\n return background === \"transparent\" ? \"#fff\" : background;\n}\n\nfunction clonePalette(palette: ResolvedAstroWheelPalette): ResolvedAstroWheelPalette {\n return {\n ...palette,\n signColors: { ...palette.signColors },\n elementColors: { ...palette.elementColors },\n aspects: { ...palette.aspects },\n };\n}\n\nfunction resolveZodiacOptions(options: boolean | AstroWheelZodiacOptions | undefined): ResolvedZodiacOptions {\n if (options === false) {\n return { segments: false, glyphs: false, ticks: false };\n }\n\n if (options === true || options === undefined) {\n return { segments: true, glyphs: true, ticks: true };\n }\n\n return {\n segments: options.segments ?? true,\n glyphs: options.glyphs ?? true,\n ticks: options.ticks ?? true,\n };\n}\n\nfunction resolveHouseOptions(options: boolean | AstroWheelHouseOptions | undefined): ResolvedHouseOptions {\n if (options === false) {\n return { labels: false, cuspLines: false, angles: false };\n }\n\n if (options === true || options === undefined) {\n return { labels: true, cuspLines: true, angles: true };\n }\n\n return {\n labels: options.labels ?? true,\n cuspLines: options.cuspLines ?? true,\n angles: options.angles ?? true,\n };\n}\n\nfunction resolvePointOptions(options: boolean | AstroWheelPointOptions | undefined): ResolvedPointOptions {\n if (options === false) {\n return { enabled: false, nodes: false, vertex: false };\n }\n\n if (options === true || options === undefined) {\n return { enabled: true, nodes: true, vertex: true };\n }\n\n return {\n enabled: options.enabled ?? true,\n nodes: options.nodes ?? true,\n vertex: options.vertex ?? true,\n collisionThresholdDegrees: options.collisionThresholdDegrees,\n };\n}\n\nfunction resolveAspectOptions(options: boolean | AstroWheelAspectOptions | undefined): ResolvedAspectOptions {\n if (options === false) {\n return { enabled: false };\n }\n\n if (options === true || options === undefined) {\n return { enabled: true };\n }\n\n return {\n enabled: options.enabled ?? true,\n edges: options.edges,\n aspectSpecs: options.aspectSpecs,\n };\n}\n\nfunction resolvePointGroupRadius(\n layer: AstroWheelPointGroupInput,\n rings: Record<AstroWheelRing[\"id\"], AstroWheelRing>\n) {\n const ring = rings.planets;\n\n if (layer.radius === \"external\") {\n return rings.houses.r2 + (layer.radiusOffset ?? 18);\n }\n\n const base = (ring.r1 + ring.r2) / 2;\n const radius = layer.radius === \"inner\"\n ? ring.r1\n : layer.radius === \"outer\"\n ? ring.r2\n : typeof layer.radius === \"number\"\n ? layer.radius\n : base;\n\n return radius + (layer.radiusOffset ?? 0);\n}\n\nfunction normalizeViewBox(viewBox: AstroWheelViewBox | undefined): Required<AstroWheelViewBox> {\n return {\n minX: viewBox?.minX ?? ASTRO_WHEEL_DEFAULT_VIEWBOX.minX,\n minY: viewBox?.minY ?? ASTRO_WHEEL_DEFAULT_VIEWBOX.minY,\n width: viewBox?.width ?? ASTRO_WHEEL_DEFAULT_VIEWBOX.width,\n height: viewBox?.height ?? ASTRO_WHEEL_DEFAULT_VIEWBOX.height,\n };\n}\n\nfunction pointGlyph(name: string) {\n return ASTRO_WHEEL_POINT_GLYPHS[normalizePointKey(name)] ?? name.charAt(0).toUpperCase();\n}\n\nfunction pointGlyphKey(name: string) {\n const key = normalizePointKey(name);\n return POINT_GLYPH_ALIASES[key] ?? key;\n}\n\nfunction resolveExcludedBodies(excludeBodies: readonly string[] | undefined) {\n return new Set((excludeBodies ?? []).map((body) => normalizePointKey(body)));\n}\n\nfunction isExcludedBody(name: string, excludedBodies: ReadonlySet<string>) {\n return excludedBodies.has(normalizePointKey(name));\n}\n\nfunction normalizePointKey(value: string) {\n return value\n .trim()\n .toLocaleLowerCase()\n .replace(/[_-]+/g, \" \")\n .replace(/\\s+/g, \" \");\n}\n\nfunction layerPointKey(groupId: string, value: string) {\n const key = normalizePointKey(value);\n return groupId === \"birth\" ? key : `${groupId}:${key}`;\n}\n\nfunction renderGlyphPrimitives(\n push: (line: string) => void,\n primitives: readonly AstroGlyphPrimitive[],\n options: { color: string; fill?: string; glyphFill?: string }\n) {\n for (const p of primitives) {\n if (p.kind === \"path\") {\n push(`<path d=\"${escapeAttr(p.d)}\"/>`);\n } else if (p.kind === \"circle\") {\n push(`<circle cx=\"${fmt(p.cx)}\" cy=\"${fmt(p.cy)}\" r=\"${fmt(p.r)}\"/>`);\n } else if (p.kind === \"line\") {\n push(`<line x1=\"${fmt(p.x1)}\" y1=\"${fmt(p.y1)}\" x2=\"${fmt(p.x2)}\" y2=\"${fmt(p.y2)}\"/>`);\n } else if (p.kind === \"polyline\") {\n push(`<polyline points=\"${escapeAttr(p.points)}\"/>`);\n } else if (p.kind === \"text\") {\n push(\n `<text x=\"${fmt(p.x ?? 0)}\" y=\"${fmt(p.y ?? 0)}\" font-family=\"${textFontFamily()}\" font-size=\"${fmt(p.fontSize ?? 0.72)}\" font-weight=\"${escapeAttr(String(p.fontWeight ?? 500))}\" text-anchor=\"middle\" dominant-baseline=\"middle\" fill=\"${escapeAttr(options.color)}\" stroke=\"none\">${escapeText(p.text)}</text>`\n );\n } else {\n let markup = p.markup;\n if (options.glyphFill) {\n markup = markup.split(GLYPH_FILL).join(options.glyphFill);\n }\n push(markup);\n }\n }\n}\n\nfunction normalizeAngle(value: number) {\n return clamp360(value);\n}\n\nfunction clamp360(value: number) {\n return ((value % 360) + 360) % 360;\n}\n\nfunction deg2rad(degrees: number) {\n return (degrees * Math.PI) / 180;\n}\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.max(min, Math.min(max, value));\n}\n\nfunction polarToXY(cx: number, cy: number, radius: number, angleRad: number): AstroWheelCoordinate {\n return {\n x: round(cx + radius * Math.cos(angleRad)),\n y: round(cy + radius * Math.sin(angleRad)),\n };\n}\n\nfunction polarWithNudge(\n cx: number,\n cy: number,\n radius: number,\n angleRad: number,\n radialOffset = 0,\n tangentOffset = 0\n): AstroWheelCoordinate {\n const x = cx + (radius + radialOffset) * Math.cos(angleRad);\n const y = cy + (radius + radialOffset) * Math.sin(angleRad);\n const tangentX = -Math.sin(angleRad);\n const tangentY = Math.cos(angleRad);\n\n return {\n x: round(x + tangentX * tangentOffset),\n y: round(y + tangentY * tangentOffset),\n };\n}\n\nfunction lineFromPolar(\n center: AstroWheelCoordinate,\n r1: number,\n r2: number,\n angleRad: number\n): AstroWheelLine {\n const p1 = polarToXY(center.x, center.y, r1, angleRad);\n const p2 = polarToXY(center.x, center.y, r2, angleRad);\n return {\n x1: p1.x,\n y1: p1.y,\n x2: p2.x,\n y2: p2.y,\n };\n}\n\nfunction arcPath(\n cx: number,\n cy: number,\n innerRadius: number,\n outerRadius: number,\n angleStart: number,\n angleEnd: number\n) {\n const p0 = polarToXY(cx, cy, outerRadius, angleStart);\n const p1 = polarToXY(cx, cy, outerRadius, angleEnd);\n const p2 = polarToXY(cx, cy, innerRadius, angleEnd);\n const p3 = polarToXY(cx, cy, innerRadius, angleStart);\n const large = Math.abs(angleEnd - angleStart) % TAU > Math.PI ? 1 : 0;\n const sweep = angleEnd > angleStart ? 1 : 0;\n\n return [\n `M ${fmt(p0.x)},${fmt(p0.y)}`,\n `A ${fmt(outerRadius)},${fmt(outerRadius)} 0 ${large} ${sweep} ${fmt(p1.x)},${fmt(p1.y)}`,\n `L ${fmt(p2.x)},${fmt(p2.y)}`,\n `A ${fmt(innerRadius)},${fmt(innerRadius)} 0 ${large} ${sweep ? 0 : 1} ${fmt(p3.x)},${fmt(p3.y)}`,\n \"Z\",\n ].join(\" \");\n}\n\nfunction arcConnectorPath(params: {\n center: AstroWheelCoordinate;\n startAngle: number;\n endAngle: number;\n radius: number;\n end: AstroWheelCoordinate;\n}) {\n const { center, startAngle, endAngle, radius, end } = params;\n const start = polarToXY(center.x, center.y, radius, startAngle);\n const arcEnd = polarToXY(center.x, center.y, radius, endAngle);\n const delta = signedAngleDelta(startAngle, endAngle);\n const large = Math.abs(delta) > Math.PI ? 1 : 0;\n const sweep = delta >= 0 ? 1 : 0;\n const commands = [\n `M ${fmt(start.x)},${fmt(start.y)}`,\n `A ${fmt(radius)},${fmt(radius)} 0 ${large} ${sweep} ${fmt(arcEnd.x)},${fmt(arcEnd.y)}`,\n ];\n\n if (Math.hypot(arcEnd.x - end.x, arcEnd.y - end.y) > 0.5) {\n commands.push(`L ${fmt(end.x)},${fmt(end.y)}`);\n }\n\n return commands.join(\" \");\n}\n\nfunction unwrapAngles(angles: readonly number[], direction: \"inc\" | \"dec\" = \"inc\") {\n const unwrapped: number[] = [];\n if (angles.length === 0) {\n return unwrapped;\n }\n\n unwrapped[0] = angles[0];\n for (let index = 1; index < angles.length; index++) {\n let angle = angles[index];\n if (direction === \"inc\") {\n while (angle <= unwrapped[index - 1]) {\n angle += TAU;\n }\n } else {\n while (angle >= unwrapped[index - 1]) {\n angle -= TAU;\n }\n }\n unwrapped.push(angle);\n }\n\n return unwrapped;\n}\n\nfunction round(value: number) {\n return Math.round((value + Number.EPSILON) * 100) / 100;\n}\n\nfunction fmt(value: number) {\n const rounded = round(value);\n if (Object.is(rounded, -0)) {\n return \"0\";\n }\n return String(rounded);\n}\n\nfunction escapeAttr(value: string) {\n return value\n .replace(/&/g, \"&\")\n .replace(/\"/g, \""\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\");\n}\n\nfunction escapeText(value: string) {\n return value\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\");\n}\n\nfunction symbolFontFamily() {\n return escapeAttr(\"'Apple Symbols', 'Arial Unicode MS', 'Noto Sans Symbols 2', 'Noto Sans Symbols', 'Segoe UI Symbol', serif, sans-serif\");\n}\n\nfunction textFontFamily() {\n return escapeAttr(\"Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\");\n}\n","import {\n createTree,\n id,\n KaabalahTypes,\n MiscTypes,\n parseId,\n TREE_TOPOLOGY_PATH_IDS,\n TREE_TOPOLOGY_SPHERE_IDS,\n TREE_TOPOLOGY_SPHERE_NAMES,\n type NodeId,\n type SystemKey,\n type TreeTopologyRoute,\n type TreeTopologySphereName,\n} from \"../core\";\n\nexport interface TreeSvgViewBox {\n minX?: number;\n minY?: number;\n width: number;\n height: number;\n}\n\nexport interface TreeLayoutCoordinate {\n x: number;\n y: number;\n}\n\nexport type TreeTargetState = \"active\" | \"hovered\" | \"selected\" | \"inactive\";\n\nexport type TreeSphereName = TreeTopologySphereName;\n\nexport type TreeSphereId = NodeId<KaabalahTypes.SPHERE>;\nexport type TreePathId = NodeId<KaabalahTypes.PATH>;\n\nexport interface TreeLayoutPath {\n fromId: TreeSphereId;\n toId: TreeSphereId;\n from: TreeLayoutCoordinate;\n to: TreeLayoutCoordinate;\n}\n\nexport interface TreeLayoutMap {\n spheres: Record<TreeSphereId, TreeLayoutCoordinate>;\n paths: Record<TreePathId, TreeLayoutPath>;\n}\n\nexport interface TreeLayout {\n system: SystemKey;\n viewBox: Required<TreeSvgViewBox>;\n sphereOrder: TreeSphereId[];\n pathOrder: TreePathId[];\n percentages: TreeLayoutMap;\n viewBoxUnits: TreeLayoutMap;\n}\n\nexport interface TreeSvgCustomPalette {\n defaultSphereFill?: string;\n defaultPathColor?: string;\n sphereFills?: Partial<Record<TreeSphereId, string | string[]>>;\n pathColors?: Partial<Record<TreePathId, string>>;\n pathEdgeColor?: string;\n sphereStrokeColor?: string;\n sphereStrokeWidth?: number;\n pathHighlightColor?: string;\n pathHighlightOpacity?: number;\n specialSphereMode?: \"preserve\" | \"plain\";\n}\n\nexport type TreeSvgPalette = \"color\" | \"monochrome\" | TreeSvgCustomPalette;\nexport type TreeSvgDaathLayer = \"front\" | \"back\";\n\nexport interface TreeSvgHighlights {\n paths?: Partial<Record<TreePathId, string>>;\n spheres?: Partial<Record<TreeSphereId, string | string[]>>;\n specialSphereMode?: \"preserve\" | \"plain\";\n}\n\nexport interface TreeTargetActivationInput {\n targetId: TreeSphereId | TreePathId;\n targetType: \"sphere\" | \"path\";\n count: number;\n total: number;\n strength?: number;\n state?: TreeTargetState;\n color?: string;\n}\n\nexport interface TreeRenderAnchor {\n x: number;\n y: number;\n vertical: \"above\" | \"below\";\n}\n\nexport interface TreeRenderCircleHitTarget {\n kind: \"circle\";\n cx: number;\n cy: number;\n r: number;\n}\n\nexport interface TreeRenderLineHitTarget {\n kind: \"line\";\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n strokeWidth: number;\n}\n\nexport type TreeRenderHitTarget = TreeRenderCircleHitTarget | TreeRenderLineHitTarget;\n\nexport interface TreeRenderActivationState {\n state: TreeTargetState;\n count: number;\n total: number;\n strength: number;\n canonicalColor: string;\n displayColor: string;\n colorOverride?: string;\n mutedColor: string;\n visible: boolean;\n emphasis: number;\n}\n\nexport interface TreeRenderSphereGeometry {\n percentages: {\n center: TreeLayoutCoordinate;\n anchor: TreeRenderAnchor;\n };\n viewBoxUnits: {\n center: TreeLayoutCoordinate;\n anchor: TreeRenderAnchor;\n hitTarget: TreeRenderCircleHitTarget;\n };\n radius: {\n viewBoxUnits: number;\n };\n}\n\nexport interface TreeRenderPathGeometry {\n percentages: {\n from: TreeLayoutCoordinate;\n to: TreeLayoutCoordinate;\n anchor: TreeRenderAnchor;\n };\n viewBoxUnits: {\n from: TreeLayoutCoordinate;\n to: TreeLayoutCoordinate;\n anchor: TreeRenderAnchor;\n hitTarget: TreeRenderLineHitTarget;\n };\n widths: {\n edge: number;\n main: number;\n highlight: number;\n hitTarget: number;\n };\n}\n\nexport interface TreeRenderSphere {\n id: TreeSphereId;\n name: TreeSphereName;\n slug: string;\n canonicalColor: string;\n displayFill: string | string[];\n geometry: TreeRenderSphereGeometry;\n material: {\n kind: \"standard\" | \"special\";\n specialSphereName?: Extract<TreeSphereName, \"Kether\" | \"Chokhmah\" | \"Daath\" | \"Malkuth\">;\n preserveOnActivation: boolean;\n };\n activation: TreeRenderActivationState | null;\n}\n\nexport interface TreeRenderPath {\n id: TreePathId;\n geometry: TreeRenderPathGeometry;\n canonicalColor: string;\n displayColor: string;\n activation: TreeRenderActivationState | null;\n}\n\nexport interface TreeRenderLayer {\n name: \"background\" | \"paths\" | \"spheres-behind-paths\" | \"spheres\" | \"hit-targets\";\n order: number;\n description: string;\n}\n\nexport interface TreeRenderModel {\n system: SystemKey;\n viewBox: Required<TreeSvgViewBox>;\n scale: number;\n layout: TreeLayout;\n layerOrder: readonly TreeRenderLayer[\"name\"][];\n layers: readonly TreeRenderLayer[];\n spheres: readonly TreeRenderSphere[];\n paths: readonly TreeRenderPath[];\n sphereById: Record<TreeSphereId, TreeRenderSphere>;\n pathById: Record<TreePathId, TreeRenderPath>;\n}\n\nexport interface TreeSvgOptions {\n width?: number | string;\n height?: number | string;\n viewBox?: TreeSvgViewBox;\n background?: string | \"transparent\";\n palette?: TreeSvgPalette;\n system?: SystemKey;\n daathLayer?: TreeSvgDaathLayer;\n highlights?: TreeSvgHighlights;\n activations?: readonly TreeTargetActivationInput[];\n}\n\nexport interface RouteActivationOptions {\n state?: TreeTargetState;\n color?: string;\n strength?: number;\n}\n\nexport const TREE_SVG_SUPPORTED_SYSTEM = \"kaabalah\" as const;\n\nexport function getUnsupportedTreeSvgSystemMessage(system: SystemKey): string {\n return `tree:svg is only supported for the Melkitzedeki system ('${TREE_SVG_SUPPORTED_SYSTEM}'); received '${system}'.`;\n}\n\nfunction assertTreeSvgSupportedSystem(system: SystemKey): void {\n if (system !== TREE_SVG_SUPPORTED_SYSTEM) {\n throw new Error(getUnsupportedTreeSvgSystemMessage(system));\n }\n}\n\nexport const TREE_SVG_DEFAULT_VIEWBOX: Required<TreeSvgViewBox> = {\n minX: 0,\n minY: 0,\n width: 286,\n height: 561,\n};\n\nexport const TREE_SPHERE_NAMES = [\n ...TREE_TOPOLOGY_SPHERE_NAMES,\n] as const satisfies readonly TreeSphereName[];\n\nconst CANONICAL_X_PERCENTAGES = { left: 13.25, mid: 49.94, right: 86.66 } as const;\nconst CANONICAL_ROW_Y_PERCENTAGES = [\n 6.83,\n 17.68,\n 28.42,\n 39.26,\n 50.06,\n 60.85,\n 71.68,\n 93.2,\n] as const;\n\nconst DEFAULT_SPHERE_RADIUS = 30;\nconst DEFAULT_PATH_EDGE_WIDTH = 26;\nconst DEFAULT_PATH_MAIN_WIDTH = 22;\nconst DEFAULT_PATH_HIGHLIGHT_WIDTH = 8;\nconst DEFAULT_SPHERE_HIT_RADIUS = DEFAULT_SPHERE_RADIUS + 8;\nconst DEFAULT_PATH_HIT_STROKE_WIDTH = DEFAULT_PATH_EDGE_WIDTH + 8;\nconst MUTED_TARGET_COLOR = \"#AAA\";\n\n// The solid-colour spheres now share their colour with the paths leaving them,\n// so they get a small inner rim in a darker shade of their own fill to stay\n// visually distinct. Special spheres (Kether/Chokhmah/Daath/Malkuth) and Binah\n// keep their own treatment.\nconst INNER_BORDER_SPHERE_NAMES = new Set<TreeSphereName>([\"Tiphareth\"]);\n\nconst NAZAR_NACRE = \"__nacre__\";\nconst NAZAR_IRIS = \"#33a6dd\";\nconst NAZAR_PUPIL = \"#0b0b12\";\n\nconst sphereId = (name: TreeSphereName) =>\n id(KaabalahTypes.SPHERE, name) as TreeSphereId;\n\nconst pathId = (value: string) => id(KaabalahTypes.PATH, value) as TreePathId;\n\n// Paths drawn with a hard split gradient: each half takes the colour of its\n// adjacent sphere, so the path visibly bridges the two. Start with one path\n// while we tune the look, then extend.\nconst SPLIT_GRADIENT_PATH_IDS = new Set<TreePathId>(\n Array.from({ length: 22 }, (_, index) => pathId(String(index + 1)))\n);\n// Width (in % of the path length) of the soft blend band across the midpoint\n// where the two adjacent-sphere colours grade into each other.\nconst SPLIT_GRADIENT_BLEND = 34;\n\n// The special spheres render with multi-tone materials (nacre, iridescence,\n// sliced disc) so their single \"canonical\" colour doesn't match what's drawn.\n// For split gradients we grade toward a representative colour chosen to blend\n// with each sphere's rendered border instead. (Daath has no paths.)\nconst SPECIAL_SPHERE_PATH_COLORS: Partial<Record<TreeSphereName, string>> = {\n Kether: \"#cfe0f2\",\n Chokhmah: \"#e6d6ef\",\n Malkuth: \"#8a6a52\",\n};\n\n// Chokhmah renders as an iridescent disc whose colour at angle θ maps to\n// t = (θ + 90) / 360 through IRIDESCENT_STOPS. Paths touching it sample that\n// same wheel: the contact point matches the disc exactly, then the ribbon\n// sweeps onward through the spectrum — so the path feels like the same\n// iridescent material flowing outward.\nconst CHOKHMAH_SWEEP_SPAN = 0.42; // fraction of the colour wheel a ribbon spans\nconst CHOKHMAH_SWEEP_SAMPLES = 12;\n\nfunction iridescentColorAt(t: number) {\n const frac = ((t % 1) + 1) % 1;\n return interpolateColorStops(IRIDESCENT_STOPS, frac);\n}\n\n// Wheel position of the disc colour seen looking from `center` toward `toward`.\nfunction iridescentContactT(\n center: TreeLayoutCoordinate,\n toward: TreeLayoutCoordinate\n) {\n const degrees = (Math.atan2(toward.y - center.y, toward.x - center.x) * 180) / Math.PI;\n return (((degrees + 90) / 360) % 1 + 1) % 1;\n}\n\n// Endpoints of a path shortened by `radius` at each end, i.e. the points where\n// the line emerges from under each sphere.\nfunction edgeAnchoredVector(\n from: TreeLayoutCoordinate,\n to: TreeLayoutCoordinate,\n radius: number\n) {\n const length = Math.hypot(to.x - from.x, to.y - from.y) || 1;\n const ux = (to.x - from.x) / length;\n const uy = (to.y - from.y) / length;\n return {\n x1: round(from.x + ux * radius),\n y1: round(from.y + uy * radius),\n x2: round(to.x - ux * radius),\n y2: round(to.y - uy * radius),\n };\n}\n\nexport const TREE_SPHERE_IDS = [...TREE_TOPOLOGY_SPHERE_IDS] as TreeSphereId[];\nexport const TREE_PATH_IDS = [...TREE_TOPOLOGY_PATH_IDS] as TreePathId[];\n\nconst CANONICAL_SPHERE_PERCENTAGES = {\n [sphereId(\"Kether\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[0] },\n [sphereId(\"Chokhmah\")]: { x: CANONICAL_X_PERCENTAGES.right, y: CANONICAL_ROW_Y_PERCENTAGES[1] },\n [sphereId(\"Binah\")]: { x: CANONICAL_X_PERCENTAGES.left, y: CANONICAL_ROW_Y_PERCENTAGES[1] },\n [sphereId(\"Daath\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[2] },\n [sphereId(\"Chesed\")]: { x: CANONICAL_X_PERCENTAGES.right, y: CANONICAL_ROW_Y_PERCENTAGES[3] },\n [sphereId(\"Geburah\")]: { x: CANONICAL_X_PERCENTAGES.left, y: CANONICAL_ROW_Y_PERCENTAGES[3] },\n [sphereId(\"Tiphareth\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[4] },\n [sphereId(\"Netzach\")]: { x: CANONICAL_X_PERCENTAGES.right, y: CANONICAL_ROW_Y_PERCENTAGES[5] },\n [sphereId(\"Hod\")]: { x: CANONICAL_X_PERCENTAGES.left, y: CANONICAL_ROW_Y_PERCENTAGES[5] },\n [sphereId(\"Yesod\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[6] },\n [sphereId(\"Malkuth\")]: { x: CANONICAL_X_PERCENTAGES.mid, y: CANONICAL_ROW_Y_PERCENTAGES[7] },\n} as Record<TreeSphereId, TreeLayoutCoordinate>;\n\ninterface ResolvedPalette {\n mode: \"color\" | \"monochrome\" | \"custom\";\n defaultSphereFill: string;\n defaultPathColor: string;\n sphereFills: Partial<Record<TreeSphereId, string | string[]>>;\n pathColors: Partial<Record<TreePathId, string>>;\n pathEdgeColor: string;\n pathEdgeUseFilter: boolean;\n sphereStrokeColor?: string;\n sphereStrokeWidth?: number;\n pathHighlightColor: string;\n pathHighlightOpacity: number;\n specialSphereMode: \"preserve\" | \"plain\";\n}\n\ninterface ResolvedHighlights {\n pathColors: Partial<Record<TreePathId, string>>;\n sphereFills: Partial<Record<TreeSphereId, string | string[]>>;\n specialSphereMode: \"preserve\" | \"plain\";\n}\n\nexport function getTreeLayout(system: SystemKey = \"kaabalah\"): TreeLayout {\n const tree = createTree({ system });\n const percentages = buildLayoutMap(tree, CANONICAL_SPHERE_PERCENTAGES);\n const viewBoxUnits = buildLayoutMap(\n tree,\n scaleCoordinates(CANONICAL_SPHERE_PERCENTAGES, TREE_SVG_DEFAULT_VIEWBOX)\n );\n\n return {\n system,\n viewBox: { ...TREE_SVG_DEFAULT_VIEWBOX },\n sphereOrder: [...TREE_SPHERE_IDS],\n pathOrder: [...TREE_PATH_IDS],\n percentages,\n viewBoxUnits,\n };\n}\n\nexport function getRouteActivations(\n route: TreeTopologyRoute,\n options: RouteActivationOptions = {}\n): TreeTargetActivationInput[] {\n const { state = \"active\", color, strength } = options;\n\n return route.targets.map((target) => ({\n targetId: target.targetId,\n targetType: target.targetType,\n count: 1,\n total: 1,\n state,\n ...(color !== undefined ? { color } : {}),\n ...(strength !== undefined ? { strength } : {}),\n }));\n}\n\nexport function getTreeRenderModel(options: TreeSvgOptions = {}): TreeRenderModel {\n const system = options.system ?? \"kaabalah\";\n const tree = createTree({ system, parts: [\"colors\"] });\n const viewBox = normalizeViewBox(options.viewBox);\n const palette = resolvePalette(options.palette);\n const highlights = resolveHighlights(options.highlights);\n const activationMap = resolveActivationMap(options.activations);\n const layout = getTreeLayout(system);\n const spherePositions = scaleCoordinates(CANONICAL_SPHERE_PERCENTAGES, viewBox);\n const viewBoxLayout = buildLayoutMap(tree, spherePositions);\n const scale = Math.min(\n viewBox.width / TREE_SVG_DEFAULT_VIEWBOX.width,\n viewBox.height / TREE_SVG_DEFAULT_VIEWBOX.height\n );\n const radius = round(DEFAULT_SPHERE_RADIUS * scale);\n const pathEdgeWidth = round(DEFAULT_PATH_EDGE_WIDTH * scale);\n const pathMainWidth = round(DEFAULT_PATH_MAIN_WIDTH * scale);\n const pathHighlightWidth = round(DEFAULT_PATH_HIGHLIGHT_WIDTH * scale);\n const sphereHitRadius = round(DEFAULT_SPHERE_HIT_RADIUS * scale);\n const pathHitStrokeWidth = round(DEFAULT_PATH_HIT_STROKE_WIDTH * scale);\n const layers: TreeRenderLayer[] = [\n { name: \"background\" as const, order: 0, description: \"Background rectangle when requested.\" },\n ...(options.daathLayer === \"back\"\n ? [{ name: \"spheres-behind-paths\" as const, order: 1, description: \"Daath behind the paths.\" }]\n : []),\n { name: \"paths\" as const, order: options.daathLayer === \"back\" ? 2 : 1, description: \"Canonical paths and activation emphasis.\" },\n { name: \"spheres\" as const, order: options.daathLayer === \"back\" ? 3 : 2, description: \"Canonical sphere material and activation halos.\" },\n { name: \"hit-targets\" as const, order: options.daathLayer === \"back\" ? 4 : 3, description: \"Invisible anchors for interaction.\" },\n ];\n const layerOrder = layers.map((layer) => layer.name);\n const spheres = TREE_SPHERE_NAMES.map((sphereName) => {\n const sphereIdValue = sphereId(sphereName);\n const canonicalColor = resolveSphereCanonicalColor({\n palette,\n sphereId: sphereIdValue,\n tree,\n });\n const point = spherePositions[sphereIdValue];\n const activation = resolveTargetActivation({\n activation: activationMap.get(sphereIdValue),\n canonicalColor,\n });\n const activeFill = resolveSphereDisplayFill({\n palette,\n highlights,\n sphereId: sphereIdValue,\n canonicalColor,\n activation,\n });\n return {\n id: sphereIdValue,\n name: sphereName,\n slug: sphereName.toLowerCase(),\n canonicalColor,\n geometry: {\n percentages: {\n center: { ...layout.percentages.spheres[sphereIdValue] },\n anchor: getPercentageAnchor(layout.percentages.spheres[sphereIdValue]),\n },\n viewBoxUnits: {\n center: { ...point },\n anchor: getViewBoxAnchor(point, viewBox),\n hitTarget: {\n kind: \"circle\" as const,\n cx: point.x,\n cy: point.y,\n r: sphereHitRadius,\n },\n },\n radius: {\n viewBoxUnits: radius,\n },\n },\n material: getSphereMaterial({\n sphereName,\n preserveSpecialMaterial: shouldPreserveSpecialRenderer({\n palette,\n highlights,\n hasPaintOverride:\n activation !== null || highlights.sphereFills[sphereIdValue] !== undefined,\n activation,\n }),\n }),\n activation,\n displayFill: activeFill,\n };\n });\n\n const paths = TREE_PATH_IDS.map((pathIdValue) => {\n const canonicalColor = resolvePathCanonicalColor({\n palette,\n tree,\n pathId: pathIdValue,\n });\n const path = viewBoxLayout.paths[pathIdValue];\n const activation = resolveTargetActivation({\n activation: activationMap.get(pathIdValue),\n canonicalColor,\n });\n const displayColor = activation\n ? resolvePathDisplayColor({\n canonicalColor,\n activation,\n })\n : resolvePathBaseColor({\n canonicalColor,\n highlights,\n pathId: pathIdValue,\n });\n return {\n id: pathIdValue,\n canonicalColor,\n geometry: {\n percentages: {\n from: { ...layout.percentages.paths[pathIdValue].from },\n to: { ...layout.percentages.paths[pathIdValue].to },\n anchor: getPercentagePathAnchor(layout.percentages.paths[pathIdValue]),\n },\n viewBoxUnits: {\n from: { ...path.from },\n to: { ...path.to },\n anchor: getViewBoxPathAnchor(path, viewBox),\n hitTarget: {\n kind: \"line\" as const,\n x1: path.from.x,\n y1: path.from.y,\n x2: path.to.x,\n y2: path.to.y,\n strokeWidth: pathHitStrokeWidth,\n },\n },\n widths: {\n edge: pathEdgeWidth,\n main: pathMainWidth,\n highlight: pathHighlightWidth,\n hitTarget: pathHitStrokeWidth,\n },\n },\n activation,\n displayColor,\n };\n });\n\n return {\n system,\n viewBox,\n scale,\n layout,\n layerOrder,\n layers,\n spheres,\n paths,\n sphereById: Object.fromEntries(spheres.map((entry) => [entry.id, entry])) as Record<TreeSphereId, TreeRenderSphere>,\n pathById: Object.fromEntries(paths.map((entry) => [entry.id, entry])) as Record<TreePathId, TreeRenderPath>,\n };\n}\n\nexport function generateTreeSvg(options: TreeSvgOptions = {}): string {\n const system = options.system ?? \"kaabalah\";\n assertTreeSvgSupportedSystem(system);\n const daathLayer = options.daathLayer ?? \"front\";\n const tree = createTree({ system, parts: [\"colors\"] });\n const viewBox = normalizeViewBox(options.viewBox);\n const palette = resolvePalette(options.palette);\n const highlights = resolveHighlights(options.highlights);\n const activationMap = resolveActivationMap(options.activations);\n const spherePositions = scaleCoordinates(CANONICAL_SPHERE_PERCENTAGES, viewBox);\n const layout = buildLayoutMap(tree, spherePositions);\n const scale = Math.min(\n viewBox.width / TREE_SVG_DEFAULT_VIEWBOX.width,\n viewBox.height / TREE_SVG_DEFAULT_VIEWBOX.height\n );\n\n const radius = round(DEFAULT_SPHERE_RADIUS * scale);\n const pathEdgeWidth = round(DEFAULT_PATH_EDGE_WIDTH * scale);\n const pathMainWidth = round(DEFAULT_PATH_MAIN_WIDTH * scale);\n const pathHighlightWidth = round(DEFAULT_PATH_HIGHLIGHT_WIDTH * scale);\n const sphereStrokeWidth = palette.sphereStrokeWidth\n ? round(palette.sphereStrokeWidth * scale)\n : undefined;\n\n const lines: string[] = [];\n const push = (line: string) => lines.push(line);\n const svgAttributes = [\n `xmlns=\"http://www.w3.org/2000/svg\"`,\n options.width !== undefined ? `width=\"${escapeAttr(String(options.width))}\"` : \"\",\n options.height !== undefined ? `height=\"${escapeAttr(String(options.height))}\"` : \"\",\n `viewBox=\"${viewBox.minX} ${viewBox.minY} ${viewBox.width} ${viewBox.height}\"`,\n `preserveAspectRatio=\"xMidYMid meet\"`,\n ].filter(Boolean);\n\n push(`<svg ${svgAttributes.join(\" \")}>`);\n push(`<defs>`);\n push(`<filter id=\"pathDarken\">\n <feComponentTransfer>\n <feFuncR type=\"linear\" slope=\"0.65\"/>\n <feFuncG type=\"linear\" slope=\"0.65\"/>\n <feFuncB type=\"linear\" slope=\"0.65\"/>\n </feComponentTransfer>\n</filter>`);\n\n for (const sphereName of TREE_SPHERE_NAMES) {\n const currentSphereId = sphereId(sphereName);\n const slug = sphereName.toLowerCase();\n const point = spherePositions[currentSphereId];\n if (!point) {\n continue;\n }\n\n push(`<radialGradient id=\"spec-${slug}\" cx=\"30%\" cy=\"25%\" r=\"55%\" fx=\"30%\" fy=\"25%\">\n <stop offset=\"0%\" stop-color=\"white\" stop-opacity=\"0.95\"/>\n <stop offset=\"25%\" stop-color=\"white\" stop-opacity=\"0.45\"/>\n <stop offset=\"50%\" stop-color=\"white\" stop-opacity=\"0.08\"/>\n <stop offset=\"100%\" stop-color=\"white\" stop-opacity=\"0\"/>\n</radialGradient>`);\n\n push(`<radialGradient id=\"shad-${slug}\" cx=\"78%\" cy=\"80%\" r=\"55%\" fx=\"78%\" fy=\"80%\">\n <stop offset=\"0%\" stop-color=\"black\" stop-opacity=\"0.32\"/>\n <stop offset=\"40%\" stop-color=\"black\" stop-opacity=\"0.12\"/>\n <stop offset=\"100%\" stop-color=\"black\" stop-opacity=\"0\"/>\n</radialGradient>`);\n\n push(\n `<clipPath id=\"clip-${slug}\"><circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${radius}\"/></clipPath>`\n );\n }\n\n if (palette.mode === \"color\") {\n for (const splitPathId of SPLIT_GRADIENT_PATH_IDS) {\n const splitPath = layout.paths[splitPathId];\n // Skip paths the caller is explicitly recolouring (highlight/activation):\n // those keep their solid override instead of the split gradient.\n if (\n !splitPath ||\n highlights.pathColors[splitPathId] !== undefined ||\n activationMap.get(splitPathId) !== undefined\n ) {\n continue;\n }\n const fromColor = resolveSplitEndpointColor({\n palette,\n sphereId: splitPath.fromId,\n tree,\n });\n const toColor = resolveSplitEndpointColor({\n palette,\n sphereId: splitPath.toId,\n tree,\n });\n const blendStart = round(50 - SPLIT_GRADIENT_BLEND / 2);\n const blendEnd = round(50 + SPLIT_GRADIENT_BLEND / 2);\n const fromName = parseId(splitPath.fromId) as TreeSphereName;\n const toName = parseId(splitPath.toId) as TreeSphereName;\n // Wheel position where the ribbon meets the iridescent disc, looking from\n // Chokhmah's centre toward the other sphere.\n const contactT =\n toName === \"Chokhmah\"\n ? iridescentContactT(splitPath.to, splitPath.from)\n : fromName === \"Chokhmah\"\n ? iridescentContactT(splitPath.from, splitPath.to)\n : null;\n const stops = buildSplitGradientStops({\n fromName,\n toName,\n fromColor,\n toColor,\n blendStart,\n blendEnd,\n contactT,\n });\n // The path line runs centre-to-centre but each end is hidden under its\n // sphere. Anchor the gradient to the visible sphere-edge contact points so\n // offset 0%/100% land where the ribbon actually emerges (matters most for\n // the Chokhmah contact colour).\n const edge = edgeAnchoredVector(splitPath.from, splitPath.to, radius);\n push(\n `<linearGradient id=\"path-grad-${parseId(splitPathId)}\" gradientUnits=\"userSpaceOnUse\" x1=\"${edge.x1}\" y1=\"${edge.y1}\" x2=\"${edge.x2}\" y2=\"${edge.y2}\">\n${stops}\n</linearGradient>`\n );\n }\n }\n\n push(`</defs>`);\n\n const background = options.background ?? \"white\";\n if (background !== \"transparent\") {\n push(\n `<rect x=\"${viewBox.minX}\" y=\"${viewBox.minY}\" width=\"${viewBox.width}\" height=\"${viewBox.height}\" fill=\"${escapeAttr(background)}\"/>`\n );\n }\n\n if (daathLayer === \"back\") {\n push(`<g id=\"spheres-behind-paths\">`);\n renderSphere(push, {\n highlights,\n activation: resolveTargetActivation({\n activation: activationMap.get(sphereId(\"Daath\")),\n canonicalColor: resolveSphereCanonicalColor({\n palette,\n sphereId: sphereId(\"Daath\"),\n tree,\n }),\n }),\n tree,\n palette,\n radius,\n sphereStrokeWidth,\n spherePositions,\n sphereName: \"Daath\",\n });\n push(`</g>`);\n }\n\n push(`<g id=\"paths\">`);\n for (const currentPathId of TREE_PATH_IDS) {\n const path = layout.paths[currentPathId];\n const canonicalColor = resolvePathCanonicalColor({\n palette,\n tree,\n pathId: currentPathId,\n });\n const baseColor = resolvePathBaseColor({\n canonicalColor,\n highlights,\n pathId: currentPathId,\n });\n const activation = resolveTargetActivation({\n activation: activationMap.get(currentPathId),\n canonicalColor,\n });\n const useSplitGradient =\n palette.mode === \"color\" &&\n !activation &&\n highlights.pathColors[currentPathId] === undefined &&\n SPLIT_GRADIENT_PATH_IDS.has(currentPathId);\n // Solid colour used both when no gradient applies and as the fallback layer\n // for renderers that don't support gradients.\n const solidColor = activation\n ? resolvePathDisplayColor({ canonicalColor, activation })\n : baseColor;\n const solidEdgeColor = resolvePathEdgeColor({ palette, pathColor: solidColor });\n const gradientRef = useSplitGradient\n ? `url(#path-grad-${parseId(currentPathId)})`\n : null;\n const color = gradientRef ?? solidColor;\n const edgeColor = gradientRef ?? solidEdgeColor;\n const edgeFilter = palette.pathEdgeUseFilter ? ` filter=\"url(#pathDarken)\"` : \"\";\n\n if (gradientRef) {\n // Solid fallback drawn underneath; the gradient lines fully cover it when\n // gradients are supported.\n push(\n `<line x1=\"${path.from.x}\" y1=\"${path.from.y}\" x2=\"${path.to.x}\" y2=\"${path.to.y}\" stroke=\"${escapeAttr(solidEdgeColor)}\" stroke-width=\"${pathEdgeWidth}\" stroke-linecap=\"round\"${edgeFilter}/>`\n );\n }\n\n push(\n `<line x1=\"${path.from.x}\" y1=\"${path.from.y}\" x2=\"${path.to.x}\" y2=\"${path.to.y}\" stroke=\"${escapeAttr(edgeColor)}\" stroke-width=\"${pathEdgeWidth}\" stroke-linecap=\"round\"${edgeFilter}/>`\n );\n if (activation?.visible && activation.emphasis > 0) {\n push(\n `<line x1=\"${path.from.x}\" y1=\"${path.from.y}\" x2=\"${path.to.x}\" y2=\"${path.to.y}\" stroke=\"${escapeAttr(color)}\" stroke-opacity=\"${round(0.18 + activation.emphasis * 0.28)}\" stroke-width=\"${round(pathEdgeWidth + activation.emphasis * 10)}\" stroke-linecap=\"round\"/>`\n );\n }\n if (gradientRef) {\n push(\n `<line x1=\"${path.from.x}\" y1=\"${path.from.y}\" x2=\"${path.to.x}\" y2=\"${path.to.y}\" stroke=\"${escapeAttr(solidColor)}\" stroke-width=\"${pathMainWidth}\" stroke-linecap=\"round\"/>`\n );\n }\n push(\n `<line x1=\"${path.from.x}\" y1=\"${path.from.y}\" x2=\"${path.to.x}\" y2=\"${path.to.y}\" stroke=\"${escapeAttr(color)}\" stroke-width=\"${pathMainWidth}\" stroke-linecap=\"round\"/>`\n );\n push(\n `<line x1=\"${path.from.x}\" y1=\"${path.from.y}\" x2=\"${path.to.x}\" y2=\"${path.to.y}\" stroke=\"${escapeAttr(palette.pathHighlightColor)}\" stroke-opacity=\"${palette.pathHighlightOpacity}\" stroke-width=\"${pathHighlightWidth}\" stroke-linecap=\"round\"/>`\n );\n }\n push(`</g>`);\n\n const frontSphereNames =\n daathLayer === \"back\"\n ? TREE_SPHERE_NAMES.filter((name): name is Exclude<TreeSphereName, \"Daath\"> => name !== \"Daath\")\n : TREE_SPHERE_NAMES;\n\n push(`<g id=\"spheres\">`);\n for (const sphereName of frontSphereNames) {\n const currentSphereId = sphereId(sphereName);\n const canonicalColor = resolveSphereCanonicalColor({\n palette,\n sphereId: currentSphereId,\n tree,\n });\n renderSphere(push, {\n highlights,\n activation: resolveTargetActivation({\n activation: activationMap.get(currentSphereId),\n canonicalColor,\n }),\n tree,\n palette,\n radius,\n sphereStrokeWidth,\n spherePositions,\n sphereName,\n });\n }\n push(`</g>`);\n if (daathLayer === \"back\") {\n const daathPoint = spherePositions[sphereId(\"Daath\")];\n push(\n `<circle id=\"sphere-daath-hit-area\" data-node-id=\"sphere:Daath\" cx=\"${daathPoint.x}\" cy=\"${daathPoint.y}\" r=\"${radius}\" fill=\"transparent\" pointer-events=\"all\"/>`\n );\n }\n push(`</svg>`);\n\n return lines.join(\"\\n\");\n}\n\nfunction renderSphere(\n push: (line: string) => void,\n params: {\n highlights: ResolvedHighlights;\n activation: TreeRenderActivationState | null;\n tree: ReturnType<typeof createTree>;\n palette: ResolvedPalette;\n radius: number;\n sphereStrokeWidth?: number;\n spherePositions: Record<TreeSphereId, TreeLayoutCoordinate>;\n sphereName: TreeSphereName;\n }\n) {\n const currentSphereId = sphereId(params.sphereName);\n const point = params.spherePositions[currentSphereId];\n const slug = params.sphereName.toLowerCase();\n const colorData =\n params.tree.relatedFirst(currentSphereId, MiscTypes.COLOR)?.data?.colorHexCodes ?? [];\n const sphereFill = resolveSphereFill({\n palette: params.palette,\n sphereId: currentSphereId,\n defaultColors: colorData,\n });\n const activationFill = params.activation\n && (params.activation.state === \"inactive\" || params.activation.colorOverride)\n ? params.activation.displayColor\n : undefined;\n const highlightFill = activationFill ?? params.highlights.sphereFills[currentSphereId];\n const activeFill = params.activation ? params.activation.displayColor : highlightFill ?? sphereFill;\n const preserveSpecialRenderer =\n shouldPreserveSpecialRenderer({\n palette: params.palette,\n highlights: params.highlights,\n hasPaintOverride: highlightFill !== undefined,\n activation: params.activation,\n });\n\n if (params.activation?.visible && params.activation.emphasis > 0) {\n const haloStrokeWidth = round(3.2 + params.activation.emphasis * 4.8);\n const haloRadius = round(params.radius + haloStrokeWidth / 2 + 0.7);\n const haloColor = params.activation.displayColor;\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${haloRadius}\" fill=\"none\" stroke=\"${escapeAttr(haloColor)}\" stroke-opacity=\"${round(0.24 + params.activation.emphasis * 0.28)}\" stroke-width=\"${haloStrokeWidth}\"/>`\n );\n }\n push(`<g id=\"sphere-${slug}\" clip-path=\"url(#clip-${slug})\">`);\n if (preserveSpecialRenderer) {\n if (params.sphereName === \"Kether\") {\n renderKether(\n push,\n point,\n params.radius,\n highlightFill ? toPrimaryFill(highlightFill, \"#e0e0e0\") : undefined\n );\n } else if (params.sphereName === \"Chokhmah\") {\n renderIridescent(push, point, params.radius);\n if (highlightFill) {\n renderSphereTintOverlay(push, point, params.radius, highlightFill, 0.62);\n }\n } else if (params.sphereName === \"Daath\") {\n renderYinYang(push, point, params.radius, highlightFill);\n } else if (params.sphereName === \"Malkuth\" && colorData.length >= 4) {\n const slicedColors = resolveMalkuthColors({\n highlightFill,\n paletteFill: sphereFill,\n defaultColors: colorData.slice(0, 4),\n });\n renderSlicedSphere(push, point, params.radius, slicedColors, -135);\n } else {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"${escapeAttr(toPrimaryFill(activeFill, params.palette.defaultSphereFill))}\"/>`\n );\n }\n } else {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"${escapeAttr(toPrimaryFill(activeFill, params.palette.defaultSphereFill))}\"/>`\n );\n }\n\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"url(#spec-${slug})\"/>`\n );\n if (\n !preserveSpecialRenderer ||\n (params.sphereName !== \"Kether\" && params.sphereName !== \"Chokhmah\")\n ) {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"url(#shad-${slug})\"/>`\n );\n }\n push(`</g>`);\n if (params.palette.sphereStrokeColor && params.sphereStrokeWidth) {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${params.radius}\" fill=\"none\" stroke=\"${escapeAttr(params.palette.sphereStrokeColor)}\" stroke-width=\"${params.sphereStrokeWidth}\"/>`\n );\n } else if (INNER_BORDER_SPHERE_NAMES.has(params.sphereName)) {\n // Inner rim: a darker shade of the sphere's own colour, inset so it sits\n // just inside the edge and separates the sphere from its same-coloured paths.\n const borderWidth = round(params.radius * 0.05);\n const borderColor = interpolateColor(\n toPrimaryFill(activeFill, params.palette.defaultSphereFill),\n \"#000000\",\n 0.2\n );\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${round(params.radius - borderWidth / 2)}\" fill=\"none\" stroke=\"${escapeAttr(borderColor)}\" stroke-width=\"${borderWidth}\"/>`\n );\n }\n}\n\nfunction buildLayoutMap(\n tree: ReturnType<typeof createTree>,\n spherePositions: Record<TreeSphereId, TreeLayoutCoordinate>\n): TreeLayoutMap {\n const paths = {} as Record<TreePathId, TreeLayoutPath>;\n\n for (const currentPathId of TREE_PATH_IDS) {\n const path = tree.getNode(currentPathId);\n const fromId = path?.data?.from as TreeSphereId | undefined;\n const toId = path?.data?.to as TreeSphereId | undefined;\n\n if (!fromId || !toId) {\n throw new Error(`Tree path ${currentPathId} is missing endpoints.`);\n }\n\n const from = spherePositions[fromId];\n const to = spherePositions[toId];\n\n if (!from || !to) {\n throw new Error(\n `Tree path ${currentPathId} references unknown layout spheres: ${fromId}, ${toId}.`\n );\n }\n\n paths[currentPathId] = {\n fromId,\n toId,\n from: { ...from },\n to: { ...to },\n };\n }\n\n return {\n spheres: cloneCoordinateMap(spherePositions),\n paths,\n };\n}\n\nfunction cloneCoordinateMap(\n coordinates: Record<TreeSphereId, TreeLayoutCoordinate>\n): Record<TreeSphereId, TreeLayoutCoordinate> {\n const clone = {} as Record<TreeSphereId, TreeLayoutCoordinate>;\n for (const currentSphereId of TREE_SPHERE_IDS) {\n const point = coordinates[currentSphereId];\n clone[currentSphereId] = { ...point };\n }\n return clone;\n}\n\nfunction scaleCoordinates(\n coordinates: Record<TreeSphereId, TreeLayoutCoordinate>,\n viewBox: Required<TreeSvgViewBox>\n): Record<TreeSphereId, TreeLayoutCoordinate> {\n const scaled = {} as Record<TreeSphereId, TreeLayoutCoordinate>;\n\n for (const currentSphereId of TREE_SPHERE_IDS) {\n const point = coordinates[currentSphereId];\n scaled[currentSphereId] = {\n x: round(viewBox.minX + (point.x / 100) * viewBox.width),\n y: round(viewBox.minY + (point.y / 100) * viewBox.height),\n };\n }\n\n return scaled;\n}\n\nfunction normalizeViewBox(\n viewBox: TreeSvgViewBox | undefined\n): Required<TreeSvgViewBox> {\n return {\n minX: viewBox?.minX ?? TREE_SVG_DEFAULT_VIEWBOX.minX,\n minY: viewBox?.minY ?? TREE_SVG_DEFAULT_VIEWBOX.minY,\n width: viewBox?.width ?? TREE_SVG_DEFAULT_VIEWBOX.width,\n height: viewBox?.height ?? TREE_SVG_DEFAULT_VIEWBOX.height,\n };\n}\n\nfunction resolveActivationMap(\n activations: readonly TreeTargetActivationInput[] | undefined\n) {\n const map = new Map<TreeSphereId | TreePathId, TreeTargetActivationInput>();\n\n for (const activation of activations ?? []) {\n map.set(activation.targetId, activation);\n }\n\n return map;\n}\n\nfunction resolveTargetActivation(params: {\n activation: TreeTargetActivationInput | undefined;\n canonicalColor: string;\n}): TreeRenderActivationState | null {\n if (!params.activation) {\n return null;\n }\n\n const state = params.activation.state ?? (params.activation.count > 0 ? \"active\" : \"inactive\");\n const strength = clamp01(\n params.activation.strength ?? (params.activation.total > 0 ? params.activation.count / params.activation.total : 0)\n );\n const displayColor =\n state === \"inactive\"\n ? params.activation.color ?? MUTED_TARGET_COLOR\n : params.activation.color ?? params.canonicalColor;\n\n return {\n state,\n count: params.activation.count,\n total: params.activation.total,\n strength,\n canonicalColor: params.canonicalColor,\n displayColor,\n colorOverride: params.activation.color,\n mutedColor: MUTED_TARGET_COLOR,\n visible: state !== \"inactive\",\n emphasis: state === \"selected\"\n ? clamp01(Math.max(strength, 0.9))\n : state === \"hovered\"\n ? clamp01(Math.max(strength, 0.72))\n : state === \"active\"\n ? clamp01(Math.max(strength, 0.56))\n : 0,\n };\n}\n\nfunction resolveSplitEndpointColor(params: {\n palette: ResolvedPalette;\n sphereId: TreeSphereId;\n tree: ReturnType<typeof createTree>;\n}) {\n const name = parseId(params.sphereId) as TreeSphereName;\n return (\n SPECIAL_SPHERE_PATH_COLORS[name] ??\n resolveSphereCanonicalColor(params)\n );\n}\n\nfunction buildSplitGradientStops(params: {\n fromName: TreeSphereName;\n toName: TreeSphereName;\n fromColor: string;\n toColor: string;\n blendStart: number;\n blendEnd: number;\n contactT: number | null;\n}): string {\n const { fromName, toName, fromColor, toColor, blendStart, blendEnd, contactT } =\n params;\n const stop = (offset: number, color: string) =>\n ` <stop offset=\"${round(offset)}%\" stop-color=\"${escapeAttr(color)}\"/>`;\n // Iridescent sweep emitted across [start, end] in increasing offset order.\n // `t0` is the wheel position where the ribbon meets the disc; `along` is the\n // distance from that contact end, so the sweep walks the wheel outward.\n const sweep = (start: number, end: number, t0: number, sphereAtEnd: boolean) =>\n Array.from({ length: CHOKHMAH_SWEEP_SAMPLES }, (_, index) => {\n const f = index / (CHOKHMAH_SWEEP_SAMPLES - 1);\n const offset = start + f * (end - start);\n const along = sphereAtEnd ? 1 - f : f;\n return stop(offset, iridescentColorAt(t0 + along * CHOKHMAH_SWEEP_SPAN));\n });\n\n // Chokhmah at the `to` end (offset 100): solid fromColor, blend into the\n // iridescent sweep that meets the disc at its contact colour.\n if (toName === \"Chokhmah\" && contactT !== null) {\n return [\n stop(0, fromColor),\n stop(blendStart, fromColor),\n ...sweep(blendEnd, 100, contactT, true),\n ].join(\"\\n\");\n }\n\n // Chokhmah at the `from` end (offset 0): iridescent sweep, blend into toColor.\n if (fromName === \"Chokhmah\" && contactT !== null) {\n return [\n ...sweep(0, blendStart, contactT, false),\n stop(blendEnd, toColor),\n stop(100, toColor),\n ].join(\"\\n\");\n }\n\n // Standard two-colour split with a soft midpoint blend.\n return [\n stop(0, fromColor),\n stop(blendStart, fromColor),\n stop(blendEnd, toColor),\n stop(100, toColor),\n ].join(\"\\n\");\n}\n\nfunction resolveSphereCanonicalColor(params: {\n palette: ResolvedPalette;\n sphereId: TreeSphereId;\n tree: ReturnType<typeof createTree>;\n}) {\n const override = params.palette.sphereFills[params.sphereId];\n if (override) {\n return toPrimaryFill(override, params.palette.defaultSphereFill);\n }\n\n if (params.palette.mode === \"monochrome\" || params.palette.mode === \"custom\") {\n return params.palette.defaultSphereFill;\n }\n\n const treeColor =\n params.tree.relatedFirst(params.sphereId, MiscTypes.COLOR)?.data?.colorHexCodes?.[0];\n\n return treeColor ?? params.palette.defaultSphereFill;\n}\n\nfunction resolvePathCanonicalColor(params: {\n palette: ResolvedPalette;\n tree: ReturnType<typeof createTree>;\n pathId: TreePathId;\n}) {\n const override = params.palette.pathColors[params.pathId];\n if (override) {\n return override;\n }\n\n if (params.palette.mode === \"monochrome\" || params.palette.mode === \"custom\") {\n return params.palette.defaultPathColor;\n }\n\n const treeColor =\n params.tree.relatedFirst(params.pathId, MiscTypes.COLOR)?.data?.colorHexCodes?.[0];\n\n return treeColor ?? params.palette.defaultPathColor;\n}\n\nfunction resolvePathBaseColor(params: {\n canonicalColor: string;\n highlights: ResolvedHighlights;\n pathId: TreePathId;\n}) {\n const highlightOverride = params.highlights.pathColors[params.pathId];\n if (highlightOverride) {\n return highlightOverride;\n }\n\n return params.canonicalColor;\n}\n\nfunction resolveSphereDisplayFill(params: {\n palette: ResolvedPalette;\n highlights: ResolvedHighlights;\n sphereId: TreeSphereId;\n canonicalColor: string | string[];\n activation: TreeRenderActivationState | null;\n}) {\n const highlightOverride = params.highlights.sphereFills[params.sphereId];\n const fallbackFill = Array.isArray(params.canonicalColor)\n ? params.canonicalColor[0] ?? params.palette.defaultSphereFill\n : params.canonicalColor;\n\n if (params.activation) {\n if (params.activation.state !== \"inactive\" && !params.activation.colorOverride) {\n return params.canonicalColor ?? fallbackFill;\n }\n\n return params.activation.displayColor;\n }\n\n if (highlightOverride) {\n return highlightOverride;\n }\n\n return params.canonicalColor ?? fallbackFill;\n}\n\nfunction resolvePathDisplayColor(params: {\n canonicalColor: string;\n activation: TreeRenderActivationState | null;\n}) {\n if (!params.activation) {\n return params.canonicalColor;\n }\n\n return params.activation.displayColor;\n}\n\nfunction getPercentageAnchor(point: TreeLayoutCoordinate): TreeRenderAnchor {\n return {\n x: point.x,\n y: point.y,\n vertical: point.y < 18 ? \"below\" : \"above\",\n };\n}\n\nfunction getViewBoxAnchor(\n point: TreeLayoutCoordinate,\n viewBox: Required<TreeSvgViewBox>\n): TreeRenderAnchor {\n return {\n x: point.x,\n y: point.y,\n vertical: point.y - viewBox.minY < viewBox.height * 0.18 ? \"below\" : \"above\",\n };\n}\n\nfunction getPercentagePathAnchor(path: TreeLayoutPath): TreeRenderAnchor {\n const y = round((path.from.y + path.to.y) / 2);\n return {\n x: round((path.from.x + path.to.x) / 2),\n y,\n vertical: y < 18 ? \"below\" : \"above\",\n };\n}\n\nfunction getViewBoxPathAnchor(\n path: TreeLayoutPath,\n viewBox: Required<TreeSvgViewBox>\n): TreeRenderAnchor {\n const y = round((path.from.y + path.to.y) / 2);\n return {\n x: round((path.from.x + path.to.x) / 2),\n y,\n vertical: y - viewBox.minY < viewBox.height * 0.18 ? \"below\" : \"above\",\n };\n}\n\nfunction shouldPreserveSpecialRenderer(params: {\n palette: ResolvedPalette;\n highlights: ResolvedHighlights;\n hasPaintOverride: boolean;\n activation: TreeRenderActivationState | null;\n}) {\n return (\n params.palette.specialSphereMode === \"preserve\"\n && (\n params.activation !== null\n || !params.hasPaintOverride\n || params.highlights.specialSphereMode === \"preserve\"\n )\n );\n}\n\nfunction getSphereMaterial(params: {\n sphereName: TreeSphereName;\n preserveSpecialMaterial: boolean;\n}) {\n if (!params.preserveSpecialMaterial) {\n return {\n kind: \"standard\" as const,\n preserveOnActivation: false,\n };\n }\n\n if (params.sphereName === \"Kether\") {\n return {\n kind: \"special\" as const,\n specialSphereName: \"Kether\" as const,\n preserveOnActivation: true,\n };\n }\n\n if (params.sphereName === \"Chokhmah\") {\n return {\n kind: \"special\" as const,\n specialSphereName: \"Chokhmah\" as const,\n preserveOnActivation: true,\n };\n }\n\n if (params.sphereName === \"Daath\") {\n return {\n kind: \"special\" as const,\n specialSphereName: \"Daath\" as const,\n preserveOnActivation: true,\n };\n }\n\n if (params.sphereName === \"Malkuth\") {\n return {\n kind: \"special\" as const,\n specialSphereName: \"Malkuth\" as const,\n preserveOnActivation: true,\n };\n }\n\n return {\n kind: \"standard\" as const,\n preserveOnActivation: false,\n };\n}\n\nfunction clamp01(value: number) {\n return Math.max(0, Math.min(1, value));\n}\n\nfunction resolvePalette(palette: TreeSvgPalette | undefined): ResolvedPalette {\n if (palette === undefined || palette === \"color\") {\n return {\n mode: \"color\",\n defaultSphereFill: \"#888888\",\n defaultPathColor: \"#888888\",\n sphereFills: {},\n pathColors: {},\n pathEdgeColor: \"#888888\",\n pathEdgeUseFilter: true,\n pathHighlightColor: \"white\",\n pathHighlightOpacity: 0.25,\n specialSphereMode: \"preserve\",\n };\n }\n\n if (palette === \"monochrome\") {\n return {\n mode: \"monochrome\",\n defaultSphereFill: \"#e6ddd0\",\n defaultPathColor: \"#e0d7ca\",\n sphereFills: {},\n pathColors: {},\n pathEdgeColor: \"#2f271e\",\n pathEdgeUseFilter: false,\n sphereStrokeColor: \"#2f271e\",\n sphereStrokeWidth: 2.4,\n pathHighlightColor: \"white\",\n pathHighlightOpacity: 0.2,\n specialSphereMode: \"plain\",\n };\n }\n\n return {\n mode: \"custom\",\n defaultSphereFill: palette.defaultSphereFill ?? \"#111111\",\n defaultPathColor: palette.defaultPathColor ?? \"#111111\",\n sphereFills: palette.sphereFills ?? {},\n pathColors: palette.pathColors ?? {},\n pathEdgeColor: palette.pathEdgeColor ?? (palette.defaultPathColor ?? \"#111111\"),\n pathEdgeUseFilter: false,\n sphereStrokeColor: palette.sphereStrokeColor,\n sphereStrokeWidth: palette.sphereStrokeWidth,\n pathHighlightColor: palette.pathHighlightColor ?? \"white\",\n pathHighlightOpacity: palette.pathHighlightOpacity ?? 0.18,\n specialSphereMode: palette.specialSphereMode ?? \"plain\",\n };\n}\n\nfunction resolveHighlights(\n highlights: TreeSvgHighlights | undefined\n): ResolvedHighlights {\n return {\n pathColors: highlights?.paths ?? {},\n sphereFills: highlights?.spheres ?? {},\n specialSphereMode: highlights?.specialSphereMode ?? \"preserve\",\n };\n}\n\nfunction resolvePathColor(params: {\n highlights: ResolvedHighlights;\n palette: ResolvedPalette;\n tree: ReturnType<typeof createTree>;\n pathId: TreePathId;\n}) {\n const highlightOverride = params.highlights.pathColors[params.pathId];\n if (highlightOverride) {\n return highlightOverride;\n }\n\n const override = params.palette.pathColors[params.pathId];\n if (override) {\n return override;\n }\n\n if (params.palette.mode === \"monochrome\" || params.palette.mode === \"custom\") {\n return params.palette.defaultPathColor;\n }\n\n const treeColor =\n params.tree.relatedFirst(params.pathId, MiscTypes.COLOR)?.data?.colorHexCodes?.[0];\n\n return treeColor ?? params.palette.defaultPathColor;\n}\n\nfunction resolvePathEdgeColor(params: {\n palette: ResolvedPalette;\n pathColor: string;\n}) {\n if (params.palette.mode === \"color\") {\n return params.pathColor;\n }\n\n return params.palette.pathEdgeColor;\n}\n\nfunction resolveSphereFill(params: {\n palette: ResolvedPalette;\n sphereId: TreeSphereId;\n defaultColors: string[];\n}) {\n const override = params.palette.sphereFills[params.sphereId];\n if (override) {\n return override;\n }\n\n if (params.palette.mode === \"monochrome\" || params.palette.mode === \"custom\") {\n return params.palette.defaultSphereFill;\n }\n\n if (params.defaultColors.length > 0) {\n return params.defaultColors;\n }\n\n return params.palette.defaultSphereFill;\n}\n\nfunction toPrimaryFill(fill: string | string[], fallback: string) {\n if (Array.isArray(fill)) {\n return fill[0] ?? fallback;\n }\n\n return fill;\n}\n\nfunction resolveMalkuthColors(params: {\n highlightFill?: string | string[];\n paletteFill: string | string[];\n defaultColors: string[];\n}) {\n if (params.highlightFill) {\n return expandColors(\n params.highlightFill,\n params.defaultColors.length,\n params.defaultColors\n );\n }\n\n if (Array.isArray(params.paletteFill)) {\n return expandColors(\n params.paletteFill,\n params.defaultColors.length,\n params.defaultColors\n );\n }\n\n return params.defaultColors;\n}\n\nfunction expandColors(\n fill: string | string[],\n count: number,\n fallbackColors: string[]\n) {\n if (Array.isArray(fill)) {\n if (fill.length === 0) {\n return fallbackColors.slice(0, count);\n }\n\n return Array.from({ length: count }, (_, index) => {\n return fill[index] ?? fill[fill.length - 1];\n });\n }\n\n return Array.from({ length: count }, () => fill);\n}\n\nfunction round(value: number) {\n return Math.round(value * 100) / 100;\n}\n\nfunction polarToCartesian(\n cx: number,\n cy: number,\n radius: number,\n degrees: number\n) {\n const radians = (Math.PI / 180) * degrees;\n return {\n x: round(cx + radius * Math.cos(radians)),\n y: round(cy + radius * Math.sin(radians)),\n };\n}\n\nfunction arcPath(\n cx: number,\n cy: number,\n radius: number,\n startDegrees: number,\n endDegrees: number\n) {\n const start = polarToCartesian(cx, cy, radius, startDegrees);\n const end = polarToCartesian(cx, cy, radius, endDegrees);\n const largeArc = endDegrees - startDegrees <= 180 ? 0 : 1;\n return `M ${cx} ${cy} L ${start.x} ${start.y} A ${radius} ${radius} 0 ${largeArc} 1 ${end.x} ${end.y} Z`;\n}\n\nfunction renderKether(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number,\n baseFill = NAZAR_NACRE\n) {\n const { x, y } = point;\n // Mother-of-pearl (madrepérola) nazar: nacreous disc, light-blue iris, black pupil.\n renderIridescent(push, point, radius, NACRE_STOPS);\n if (baseFill !== NAZAR_NACRE) {\n // Activation / highlight recolour tints the pearly disc.\n renderSphereTintOverlay(push, point, radius, baseFill, 0.5);\n }\n push(\n `<circle cx=\"${x}\" cy=\"${y}\" r=\"${round(radius * 0.42)}\" fill=\"${escapeAttr(NAZAR_IRIS)}\"/>`\n );\n push(\n `<circle cx=\"${x}\" cy=\"${y}\" r=\"${round(radius * 0.2)}\" fill=\"${escapeAttr(NAZAR_PUPIL)}\"/>`\n );\n}\n\nfunction renderSlicedSphere(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number,\n colors: string[],\n startAngle: number\n) {\n const segmentCount = colors.length;\n const step = 360 / segmentCount;\n let currentAngle = startAngle;\n\n for (let index = 0; index < segmentCount; index++) {\n const path = arcPath(point.x, point.y, radius * 0.96, currentAngle, currentAngle + step);\n push(`<path d=\"${path}\" fill=\"${escapeAttr(colors[index])}\" stroke=\"none\"/>`);\n currentAngle += step;\n }\n}\n\nconst IRIDESCENT_STOPS: [number, string][] = [\n [0.0, \"#F0E8EE\"],\n [0.1, \"#ffa3e6\"],\n [0.22, \"#a7e0ff\"],\n [0.34, \"#baff9a\"],\n [0.46, \"#ffe28a\"],\n [0.58, \"#c6a4ff\"],\n [0.7, \"#9ad6ff\"],\n [0.82, \"#ffa3e6\"],\n [1.0, \"#F0E8EE\"],\n];\n\n// Soft blue/white/lilac/mint sheen for the mother-of-pearl (madrepérola) look.\nconst NACRE_STOPS: [number, string][] = [\n [0.0, \"#eaf6f6\"],\n [0.12, \"#a8d6ec\"],\n [0.25, \"#c3b6ec\"],\n [0.4, \"#a6ecec\"],\n [0.55, \"#dfe6fb\"],\n [0.7, \"#a6cdf0\"],\n [0.82, \"#cbb4ec\"],\n [1.0, \"#eaf6f6\"],\n];\n\nfunction renderIridescent(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number,\n stops: [number, string][] = IRIDESCENT_STOPS\n) {\n const slices = 72;\n const sphereRadius = round(radius * 0.96);\n\n for (let index = 0; index < slices; index++) {\n const t = index / slices;\n const color = interpolateColorStops(stops, t);\n const startDegrees = t * 360 - 90;\n const endDegrees = startDegrees + 360 / slices + 0.5;\n const path = arcPath(point.x, point.y, sphereRadius, startDegrees, endDegrees);\n push(`<path d=\"${path}\" fill=\"${color}\" stroke=\"none\"/>`);\n }\n}\n\nfunction interpolateColorStops(stops: [number, string][], t: number): string {\n let lower = stops[0];\n let upper = stops[stops.length - 1];\n\n for (let index = 0; index < stops.length - 1; index++) {\n if (t >= stops[index][0] && t <= stops[index + 1][0]) {\n lower = stops[index];\n upper = stops[index + 1];\n break;\n }\n }\n\n const range = upper[0] - lower[0] || 1;\n return interpolateColor(lower[1], upper[1], (t - lower[0]) / range);\n}\n\nfunction interpolateColor(start: string, end: string, factor: number) {\n const parse = (hex: string) => {\n const match = hex.match(/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);\n return match\n ? [\n Number.parseInt(match[1], 16),\n Number.parseInt(match[2], 16),\n Number.parseInt(match[3], 16),\n ]\n : [0, 0, 0];\n };\n\n const [r1, g1, b1] = parse(start);\n const [r2, g2, b2] = parse(end);\n const mix = (left: number, right: number) =>\n Math.round(left + (right - left) * factor);\n\n return `#${mix(r1, r2).toString(16).padStart(2, \"0\")}${mix(g1, g2)\n .toString(16)\n .padStart(2, \"0\")}${mix(b1, b2).toString(16).padStart(2, \"0\")}`;\n}\n\nfunction renderYinYang(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number,\n fill?: string | string[]\n) {\n const scale = radius / 50;\n const circleRadius = round(48 * scale);\n const halfRadius = round(24 * scale);\n const dotRadius = round(6 * scale);\n const [lightFill, darkFill] = resolveDualToneFill(fill);\n\n push(`<g transform=\"rotate(180 ${point.x} ${point.y})\">`);\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${circleRadius}\" fill=\"${escapeAttr(lightFill)}\"/>`\n );\n push(\n `<path d=\"M${point.x},${round(point.y - circleRadius)} A${circleRadius},${circleRadius} 0 1,1 ${point.x},${round(point.y + circleRadius)} A${halfRadius},${halfRadius} 0 1,0 ${point.x},${point.y} A${halfRadius},${halfRadius} 0 1,1 ${point.x},${round(point.y - circleRadius)}\" fill=\"${escapeAttr(darkFill)}\"/>`\n );\n push(\n `<circle cx=\"${point.x}\" cy=\"${round(point.y - halfRadius)}\" r=\"${dotRadius}\" fill=\"${escapeAttr(lightFill)}\"/>`\n );\n push(\n `<circle cx=\"${point.x}\" cy=\"${round(point.y + halfRadius)}\" r=\"${dotRadius}\" fill=\"${escapeAttr(darkFill)}\"/>`\n );\n push(`</g>`);\n}\n\nfunction renderSphereTintOverlay(\n push: (line: string) => void,\n point: TreeLayoutCoordinate,\n radius: number,\n fill: string | string[],\n opacity: number\n) {\n push(\n `<circle cx=\"${point.x}\" cy=\"${point.y}\" r=\"${radius}\" fill=\"${escapeAttr(toPrimaryFill(fill, \"#ffffff\"))}\" fill-opacity=\"${opacity}\"/>`\n );\n}\n\nfunction resolveDualToneFill(fill: string | string[] | undefined) {\n if (Array.isArray(fill)) {\n return [fill[0] ?? \"white\", fill[1] ?? \"black\"] as const;\n }\n\n if (fill) {\n return [fill, \"black\"] as const;\n }\n\n return [\"white\", \"black\"] as const;\n}\n\nfunction escapeAttr(value: string) {\n return value\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\");\n}\n"]}
|