kaabalah 6.2.4 → 6.4.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.
Files changed (62) hide show
  1. package/README.md +71 -0
  2. package/dist/{chunk-S4EJ3ZY7.mjs → chunk-6P2CJUTH.mjs} +3 -3
  3. package/dist/{chunk-S4EJ3ZY7.mjs.map → chunk-6P2CJUTH.mjs.map} +1 -1
  4. package/dist/chunk-7WG6PUEN.js +1741 -0
  5. package/dist/chunk-7WG6PUEN.js.map +1 -0
  6. package/dist/{chunk-O3ZBG566.js → chunk-COPYH3O2.js} +23 -23
  7. package/dist/{chunk-O3ZBG566.js.map → chunk-COPYH3O2.js.map} +1 -1
  8. package/dist/{chunk-RZBVUDBM.mjs → chunk-EFZUZI22.mjs} +81 -73
  9. package/dist/chunk-EFZUZI22.mjs.map +1 -0
  10. package/dist/chunk-EMMXVM35.mjs +511 -0
  11. package/dist/chunk-EMMXVM35.mjs.map +1 -0
  12. package/dist/{chunk-2RGUI5FG.mjs → chunk-MTI2SOQ6.mjs} +4 -4
  13. package/dist/{chunk-2RGUI5FG.mjs.map → chunk-MTI2SOQ6.mjs.map} +1 -1
  14. package/dist/{chunk-TMN4PYVG.js → chunk-OKZUVGA3.js} +9 -9
  15. package/dist/{chunk-TMN4PYVG.js.map → chunk-OKZUVGA3.js.map} +1 -1
  16. package/dist/{chunk-Y4PTMABP.js → chunk-PAKYKIZH.js} +4 -4
  17. package/dist/{chunk-Y4PTMABP.js.map → chunk-PAKYKIZH.js.map} +1 -1
  18. package/dist/chunk-PBPYXWX4.mjs +1721 -0
  19. package/dist/chunk-PBPYXWX4.mjs.map +1 -0
  20. package/dist/{chunk-HAMDOCS5.js → chunk-S6KNERP7.js} +81 -73
  21. package/dist/chunk-S6KNERP7.js.map +1 -0
  22. package/dist/chunk-WGYXJEG5.js +518 -0
  23. package/dist/chunk-WGYXJEG5.js.map +1 -0
  24. package/dist/{chunk-G76K6OVQ.mjs → chunk-WIKUOEOB.mjs} +3 -3
  25. package/dist/{chunk-G76K6OVQ.mjs.map → chunk-WIKUOEOB.mjs.map} +1 -1
  26. package/dist/{chunk-WSSELKIB.js → chunk-XTE5DSDO.js} +23 -23
  27. package/dist/{chunk-WSSELKIB.js.map → chunk-XTE5DSDO.js.map} +1 -1
  28. package/dist/{chunk-NBP75BAH.mjs → chunk-ZKIJAZ6B.mjs} +3 -3
  29. package/dist/{chunk-NBP75BAH.mjs.map → chunk-ZKIJAZ6B.mjs.map} +1 -1
  30. package/dist/cli.js +954 -104
  31. package/dist/cli.js.map +1 -1
  32. package/dist/core/index.js +43 -43
  33. package/dist/core/index.mjs +2 -2
  34. package/dist/gematria/index.js +5 -5
  35. package/dist/gematria/index.mjs +2 -2
  36. package/dist/index.d.mts +2 -1
  37. package/dist/index.d.ts +2 -1
  38. package/dist/index.js +191 -114
  39. package/dist/index.mjs +8 -7
  40. package/dist/numerology/index.js +18 -18
  41. package/dist/numerology/index.mjs +3 -3
  42. package/dist/semantic/index.d.mts +150 -2
  43. package/dist/semantic/index.d.ts +150 -2
  44. package/dist/semantic/index.js +65 -10
  45. package/dist/semantic/index.mjs +7 -4
  46. package/dist/tarot/index.js +23 -23
  47. package/dist/tarot/index.mjs +3 -3
  48. package/dist/visual/index.d.mts +64 -0
  49. package/dist/visual/index.d.ts +64 -0
  50. package/dist/visual/index.js +35 -0
  51. package/dist/visual/index.js.map +1 -0
  52. package/dist/visual/index.mjs +6 -0
  53. package/dist/visual/index.mjs.map +1 -0
  54. package/dist/webassembly.md +127 -0
  55. package/package.json +6 -1
  56. package/wasm/build/webassembly.md +127 -0
  57. package/dist/chunk-3KJSW6ZP.js +0 -850
  58. package/dist/chunk-3KJSW6ZP.js.map +0 -1
  59. package/dist/chunk-HAMDOCS5.js.map +0 -1
  60. package/dist/chunk-RWX6HFS5.mjs +0 -843
  61. package/dist/chunk-RWX6HFS5.mjs.map +0 -1
  62. package/dist/chunk-RZBVUDBM.mjs.map +0 -1
@@ -1,843 +0,0 @@
1
- import { getTarotArchetype, ARKANNUS } from './chunk-2RGUI5FG.mjs';
2
- import { getCanonicalTree } from './chunk-NBP75BAH.mjs';
3
- import { WESTERN_HOUSES, parseId, id } from './chunk-RZBVUDBM.mjs';
4
-
5
- // src/semantic/index.ts
6
- var OCCULT_THEME_STOPWORDS = [
7
- "the",
8
- "and",
9
- "for",
10
- "with",
11
- "that",
12
- "this",
13
- "was",
14
- "were",
15
- "been",
16
- "have",
17
- "has",
18
- "had",
19
- "just",
20
- "from",
21
- "into",
22
- "about",
23
- "over",
24
- "under",
25
- "very",
26
- "more",
27
- "less",
28
- "then",
29
- "than",
30
- "when",
31
- "what",
32
- "where",
33
- "which",
34
- "while",
35
- "would",
36
- "could",
37
- "should",
38
- "again",
39
- "still",
40
- "really",
41
- "gotta",
42
- "lota",
43
- "lotta",
44
- "para",
45
- "com",
46
- "sem",
47
- "por",
48
- "uma",
49
- "um",
50
- "uns",
51
- "das",
52
- "dos",
53
- "del",
54
- "que",
55
- "n\xE3o",
56
- "nao",
57
- "isso",
58
- "essa",
59
- "este",
60
- "esta",
61
- "como",
62
- "mais",
63
- "menos",
64
- "muito",
65
- "muita",
66
- "their",
67
- "your",
68
- "mine",
69
- "ours",
70
- "onto",
71
- "sobre",
72
- "entre",
73
- "depois",
74
- "antes"
75
- ];
76
- var canonicalTree = getCanonicalTree({
77
- system: "kaabalah",
78
- parts: ["westernAstrology", "tarot"]
79
- });
80
- var HOUSE_LABELS_BY_NUMBER = [
81
- WESTERN_HOUSES.ASCENDANT,
82
- WESTERN_HOUSES.SECOND_HOUSE,
83
- WESTERN_HOUSES.THIRD_HOUSE,
84
- WESTERN_HOUSES.IMUM_COELI,
85
- WESTERN_HOUSES.FIFTH_HOUSE,
86
- WESTERN_HOUSES.SIXTH_HOUSE,
87
- WESTERN_HOUSES.DESCENDANT,
88
- WESTERN_HOUSES.EIGHTH_HOUSE,
89
- WESTERN_HOUSES.NINTH_HOUSE,
90
- WESTERN_HOUSES.MEDIUM_COELI,
91
- WESTERN_HOUSES.ELEVENTH_HOUSE,
92
- WESTERN_HOUSES.TWELFTH_HOUSE
93
- ];
94
- var HOUSE_THEME_SEEDS = {
95
- 1: {
96
- primaryLabel: "Images",
97
- scope: "personal",
98
- aliases: [
99
- "First House",
100
- "House 1",
101
- "Casa 1",
102
- "Imagens",
103
- "Como me vejo e como outros me veem",
104
- "Self-image"
105
- ],
106
- keywords: [
107
- "images",
108
- "imagens",
109
- "identity",
110
- "self-image",
111
- "appearance",
112
- "body",
113
- "personality",
114
- "first impression",
115
- "persona",
116
- "character",
117
- "personagem",
118
- "how I see myself",
119
- "how others see me"
120
- ]
121
- },
122
- 2: {
123
- primaryLabel: "Money",
124
- scope: "personal",
125
- aliases: ["Second House", "House 2", "Casa 2", "Dinheiro", "Resources"],
126
- keywords: [
127
- "money",
128
- "dinheiro",
129
- "resources",
130
- "income",
131
- "finances",
132
- "possessions",
133
- "values",
134
- "material values",
135
- "self-worth"
136
- ]
137
- },
138
- 3: {
139
- primaryLabel: "Communication",
140
- scope: "personal",
141
- aliases: ["Third House", "House 3", "Casa 3", "Comunica\xE7\xE3o", "Comunica\xE7\xF5es"],
142
- keywords: [
143
- "communication",
144
- "comunica\xE7\xE3o",
145
- "comunica\xE7\xF5es",
146
- "siblings",
147
- "writing",
148
- "language",
149
- "study",
150
- "neighborhood",
151
- "short trips",
152
- "early education",
153
- "mind"
154
- ]
155
- },
156
- 4: {
157
- primaryLabel: "Family",
158
- scope: "personal",
159
- aliases: [
160
- "Fourth House",
161
- "House 4",
162
- "Casa 4",
163
- "IC",
164
- "Home Angle",
165
- "Fam\xEDlia",
166
- "Fam\xEDlias",
167
- "Family (not only blood)",
168
- "Familia (n\xE3o s\xF3 de sangue)"
169
- ],
170
- keywords: [
171
- "family",
172
- "familia",
173
- "families",
174
- "fam\xEDlias",
175
- "home",
176
- "roots",
177
- "belonging",
178
- "kinship",
179
- "chosen family",
180
- "vida \xEDntima",
181
- "inner foundation",
182
- "private life"
183
- ]
184
- },
185
- 5: {
186
- primaryLabel: "Hobbies",
187
- scope: "personal",
188
- aliases: ["Fifth House", "House 5", "Casa 5", "Hobbies", "Lazer", "Pleasures"],
189
- keywords: [
190
- "hobbies",
191
- "hobby",
192
- "lazer",
193
- "pleasure",
194
- "fun",
195
- "games",
196
- "creative leisure",
197
- "creativity",
198
- "children",
199
- "romance",
200
- "speculation"
201
- ]
202
- },
203
- 6: {
204
- primaryLabel: "Health",
205
- scope: "personal",
206
- aliases: ["Sixth House", "House 6", "Casa 6", "Sa\xFAde", "Health"],
207
- keywords: [
208
- "health",
209
- "sa\xFAde",
210
- "routine",
211
- "service",
212
- "care",
213
- "wellbeing",
214
- "body maintenance",
215
- "daily work",
216
- "pets"
217
- ]
218
- },
219
- 7: {
220
- primaryLabel: "Associations",
221
- scope: "transition",
222
- aliases: [
223
- "Seventh House",
224
- "House 7",
225
- "Casa 7",
226
- "Associa\xE7\xF5es",
227
- "Partnerships",
228
- "Associations"
229
- ],
230
- keywords: [
231
- "associations",
232
- "associa\xE7\xF5es",
233
- "partnerships",
234
- "partners",
235
- "alliances",
236
- "cooperation",
237
- "the other",
238
- "relationships",
239
- "marriage",
240
- "contracts",
241
- "open enemies"
242
- ]
243
- },
244
- 8: {
245
- primaryLabel: "Sex and Initiations",
246
- scope: "transpersonal",
247
- aliases: [
248
- "Eighth House",
249
- "House 8",
250
- "Casa 8",
251
- "Sexo",
252
- "Inicia\xE7\xF5es",
253
- "Sexo / Inicia\xE7\xF5es"
254
- ],
255
- keywords: [
256
- "sex",
257
- "sexo",
258
- "initiations",
259
- "inicia\xE7\xF5es",
260
- "transformation",
261
- "transmutations",
262
- "taboo",
263
- "death",
264
- "shared resources",
265
- "sexuality",
266
- "occult",
267
- "death rebirth"
268
- ]
269
- },
270
- 9: {
271
- primaryLabel: "Travel and Knowledge",
272
- scope: "transpersonal",
273
- aliases: [
274
- "Ninth House",
275
- "House 9",
276
- "Casa 9",
277
- "Viagens",
278
- "Travel",
279
- "Travel, Religion, Philosophy, Knowledge"
280
- ],
281
- keywords: [
282
- "travel",
283
- "viagens",
284
- "religion",
285
- "religi\xE3o",
286
- "philosophy",
287
- "filosofia",
288
- "knowledge",
289
- "conhecimento",
290
- "higher studies",
291
- "higher education",
292
- "publishing",
293
- "law"
294
- ]
295
- },
296
- 10: {
297
- primaryLabel: "Career and Work",
298
- scope: "transpersonal",
299
- aliases: [
300
- "Tenth House",
301
- "House 10",
302
- "Casa 10",
303
- "Midheaven",
304
- "MC",
305
- "Carreira",
306
- "Trabalho"
307
- ],
308
- keywords: [
309
- "career",
310
- "carreira",
311
- "work",
312
- "trabalho",
313
- "profession",
314
- "reputation",
315
- "vocation",
316
- "public life",
317
- "public image",
318
- "ambition",
319
- "authority",
320
- "legacy"
321
- ]
322
- },
323
- 11: {
324
- primaryLabel: "Friends",
325
- scope: "transpersonal",
326
- aliases: ["Eleventh House", "House 11", "Casa 11", "Friends", "Amigos", "Rela\xE7\xF5es"],
327
- keywords: [
328
- "friends",
329
- "amigos",
330
- "friendships",
331
- "relations",
332
- "network",
333
- "community",
334
- "groups",
335
- "projects",
336
- "ideals",
337
- "hopes",
338
- "humanitarian goals"
339
- ]
340
- },
341
- 12: {
342
- primaryLabel: "Past Lives",
343
- scope: "transpersonal",
344
- aliases: [
345
- "Twelfth House",
346
- "House 12",
347
- "Casa 12",
348
- "Vida passada",
349
- "Vidas passadas",
350
- "Past life",
351
- "Past lives",
352
- "Oculto"
353
- ],
354
- keywords: [
355
- "past life",
356
- "past lives",
357
- "vida passada",
358
- "vidas passadas",
359
- "karma",
360
- "occult",
361
- "hidden",
362
- "unconscious",
363
- "spiritual memory",
364
- "isolation",
365
- "spirituality",
366
- "hidden enemies",
367
- "self undoing"
368
- ]
369
- }
370
- };
371
- var TAROT_SUIT_ALIASES = {
372
- wands: ["Rods", "Staves", "Paus"],
373
- cups: ["Chalices", "Copas"],
374
- swords: ["Blades", "Espadas"],
375
- pentacles: ["Coins", "Disks", "Discs", "Ouros"]
376
- };
377
- var TAROT_SUIT_THEME_KEYWORDS = {
378
- wands: [
379
- "paus",
380
- "fire",
381
- "will",
382
- "inspiration",
383
- "creation",
384
- "force",
385
- "vigor",
386
- "initiative",
387
- "progress",
388
- "thinking",
389
- "associating ideas",
390
- "seeking results",
391
- "politicians",
392
- "workers",
393
- "producers",
394
- "salamanders"
395
- ],
396
- cups: [
397
- "copas",
398
- "water",
399
- "feelings",
400
- "emotions",
401
- "receptivity",
402
- "sensitivity",
403
- "ideals",
404
- "love",
405
- "artistic creation",
406
- "feeling",
407
- "affective",
408
- "relational",
409
- "emotional",
410
- "clergy",
411
- "spiritual class",
412
- "ondines",
413
- "mermaids"
414
- ],
415
- swords: [
416
- "espadas",
417
- "air",
418
- "thought",
419
- "intelligence",
420
- "exchanges",
421
- "cooperation of opposites",
422
- "maturity",
423
- "balance",
424
- "intuition",
425
- "sixth sense",
426
- "imagination",
427
- "future vision",
428
- "military",
429
- "warriors",
430
- "police",
431
- "sylphs",
432
- "giants"
433
- ],
434
- pentacles: [
435
- "ouros",
436
- "earth",
437
- "concretization",
438
- "manifestation",
439
- "practical intelligence",
440
- "effort",
441
- "study",
442
- "gains",
443
- "business",
444
- "sensation",
445
- "five senses",
446
- "concrete perception",
447
- "present",
448
- "bourgeoisie",
449
- "finances",
450
- "commerce",
451
- "gnomes"
452
- ]
453
- };
454
- var TAROT_COURT_RANK_THEME_KEYWORDS = {
455
- king: ["dynamic", "active", "lordly", "cardinal"],
456
- queen: ["stable", "receptive", "contained", "fixed"],
457
- knight: ["volatile", "mutant", "active", "mutable"],
458
- page: ["nascent", "fragile", "beginning", "starting"]
459
- };
460
- var TAROT_MINOR_PIP_STAGE_KEYWORDS = {
461
- ace: ["will", "pure potential", "something new emerging", "first spark"],
462
- two: ["imagining", "visualizing", "formulating the idea"],
463
- three: ["speaking", "understanding", "verbalizing", "giving form"],
464
- four: ["expanding", "planning", "growth", "good feelings"],
465
- five: ["restricting", "discipline", "justice", "pruning", "confronting limits"],
466
- six: ["harmonizing", "beauty", "ethics", "balance", "heart"],
467
- seven: ["winning silently", "emotional control", "quiet victory", "endurance"],
468
- eight: ["connecting", "rational control", "linking concepts", "strategy"],
469
- nine: ["foundations", "worthy", "solid base"],
470
- ten: ["manifesting", "materialized", "completion"]
471
- };
472
- var houseThemeProfilesCache;
473
- var tarotThemeProfilesCache;
474
- function getHouseThemeAxis(houseNumber) {
475
- const axisPairs = {
476
- 1: { key: "self-other", label: "Self and Other", oppositeHouseNumber: 7 },
477
- 2: { key: "resources-initiation", label: "Resources and Initiation", oppositeHouseNumber: 8 },
478
- 3: { key: "communication-journey", label: "Communication and Journey", oppositeHouseNumber: 9 },
479
- 4: { key: "private-public", label: "Private and Public Life", oppositeHouseNumber: 10 },
480
- 5: { key: "pleasure-friendship", label: "Pleasure and Friendship", oppositeHouseNumber: 11 },
481
- 6: { key: "health-occult", label: "Health and the Occult", oppositeHouseNumber: 12 },
482
- 7: { key: "self-other", label: "Self and Other", oppositeHouseNumber: 1 },
483
- 8: { key: "resources-initiation", label: "Resources and Initiation", oppositeHouseNumber: 2 },
484
- 9: { key: "communication-journey", label: "Communication and Journey", oppositeHouseNumber: 3 },
485
- 10: { key: "private-public", label: "Private and Public Life", oppositeHouseNumber: 4 },
486
- 11: { key: "pleasure-friendship", label: "Pleasure and Friendship", oppositeHouseNumber: 5 },
487
- 12: { key: "health-occult", label: "Health and the Occult", oppositeHouseNumber: 6 }
488
- };
489
- return axisPairs[houseNumber];
490
- }
491
- function normalizeThemeText(value) {
492
- return value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
493
- }
494
- function uniqueStrings(values) {
495
- const seen = /* @__PURE__ */ new Set();
496
- const result = [];
497
- for (const value of values) {
498
- const trimmed = value?.trim();
499
- if (!trimmed || seen.has(trimmed)) {
500
- continue;
501
- }
502
- seen.add(trimmed);
503
- result.push(trimmed);
504
- }
505
- return result;
506
- }
507
- function titleCase(value) {
508
- return value.split(" ").map((part) => part ? `${part[0].toUpperCase()}${part.slice(1)}` : part).join(" ");
509
- }
510
- function humanizeTarotFilename(filename) {
511
- return titleCase(
512
- filename.replace(/^\d+_/, "").replace(/_/g, " ")
513
- );
514
- }
515
- function getNodeDisplayLabel(node) {
516
- const parsedId = parseId(node.id);
517
- if (node.type === "path" /* PATH */) {
518
- return `Path ${parsedId}`;
519
- }
520
- if (node.type === "tarotSuit" /* TAROT_SUIT */) {
521
- return titleCase(parsedId);
522
- }
523
- return node.name ?? titleCase(parsedId);
524
- }
525
- function getNodeTextCandidates(node) {
526
- const data = node.data;
527
- return uniqueStrings([
528
- getNodeDisplayLabel(node),
529
- parseId(node.id),
530
- typeof data?.englishName === "string" ? data.englishName : void 0,
531
- typeof data?.meaning === "string" ? data.meaning : void 0
532
- ]);
533
- }
534
- function getCorrespondenceRefs(nodeId, type, depth) {
535
- return canonicalTree.getCorrespondences(nodeId, { type, depth }).map((match) => ({
536
- id: match.node.id,
537
- label: getNodeDisplayLabel(match.node),
538
- distance: match.distance
539
- }));
540
- }
541
- function collectCorrespondenceTexts(correspondences) {
542
- const texts = [];
543
- for (const correspondence of correspondences) {
544
- const node = canonicalTree.getNode(correspondence.id);
545
- if (!node) {
546
- continue;
547
- }
548
- texts.push(...getNodeTextCandidates(node));
549
- }
550
- return texts;
551
- }
552
- function freezeCorrespondences(correspondences) {
553
- correspondences.forEach((correspondence) => Object.freeze(correspondence));
554
- return Object.freeze(correspondences);
555
- }
556
- function createTokenSurface(values) {
557
- return tokenizeOccultThemeText([...values]);
558
- }
559
- function getHouseLabelFromLookup(lookup) {
560
- if (typeof lookup === "number") {
561
- return HOUSE_LABELS_BY_NUMBER[lookup - 1];
562
- }
563
- if (String(lookup).startsWith(`${"house" /* HOUSE */}:`)) {
564
- return parseId(lookup);
565
- }
566
- return void 0;
567
- }
568
- function buildHouseThemeProfile(houseNumber) {
569
- const houseLabel = HOUSE_LABELS_BY_NUMBER[houseNumber - 1];
570
- const houseId = id("house" /* HOUSE */, houseLabel);
571
- const seed = HOUSE_THEME_SEEDS[houseNumber];
572
- const primaryLabel = seed.primaryLabel;
573
- const axis = getHouseThemeAxis(houseNumber);
574
- const aliases = uniqueStrings(seed.aliases);
575
- const signs = getCorrespondenceRefs(houseId, "westernZodiacSign" /* WESTERN_ZODIAC_SIGN */, 1);
576
- const planets = getCorrespondenceRefs(houseId, "planet" /* PLANET */, 2);
577
- const elements = getCorrespondenceRefs(houseId, "westernElement" /* WESTERN_ELEMENT */, 2);
578
- const spheres = getCorrespondenceRefs(houseId, "sphere" /* SPHERE */, 2);
579
- const paths = getCorrespondenceRefs(houseId, "path" /* PATH */, 2);
580
- const correspondenceTexts = [
581
- ...collectCorrespondenceTexts(signs),
582
- ...collectCorrespondenceTexts(planets),
583
- ...collectCorrespondenceTexts(elements),
584
- ...collectCorrespondenceTexts(spheres),
585
- ...collectCorrespondenceTexts(paths)
586
- ];
587
- const keywords = uniqueStrings(seed.keywords);
588
- const tokens = createTokenSurface([
589
- primaryLabel,
590
- ...aliases,
591
- ...keywords,
592
- ...correspondenceTexts
593
- ]);
594
- const profile = {
595
- kind: "house",
596
- id: houseId,
597
- houseNumber,
598
- houseLabel: titleCase(houseLabel),
599
- primaryLabel,
600
- scope: seed.scope,
601
- axis: Object.freeze(axis),
602
- aliases: Object.freeze(aliases),
603
- keywords: Object.freeze(keywords),
604
- tokens: Object.freeze(tokens),
605
- correspondences: Object.freeze({
606
- planets: freezeCorrespondences(planets),
607
- signs: freezeCorrespondences(signs),
608
- elements: freezeCorrespondences(elements),
609
- spheres: freezeCorrespondences(spheres),
610
- paths: freezeCorrespondences(paths)
611
- })
612
- };
613
- return Object.freeze(profile);
614
- }
615
- function getHouseThemeProfileCache() {
616
- if (houseThemeProfilesCache) {
617
- return houseThemeProfilesCache;
618
- }
619
- houseThemeProfilesCache = Object.freeze(HOUSE_LABELS_BY_NUMBER.map(
620
- (_, index) => buildHouseThemeProfile(index + 1)
621
- ));
622
- return houseThemeProfilesCache;
623
- }
624
- function getTarotRank(card) {
625
- if (!card.tarotCard.includes(" of ")) {
626
- return void 0;
627
- }
628
- return card.tarotCard.split(" of ")[0].toLowerCase();
629
- }
630
- function buildTarotAliases(card, majorArchetype, descriptiveData) {
631
- const normalizedPrimaryLabel = normalizeThemeText(card.tarotCard);
632
- const cardNode = canonicalTree.getNode(id("tarotArkAnnu" /* TAROT_ARK_ANNU */, card.tarotCard));
633
- const aliases = [
634
- humanizeTarotFilename(card.tarotCardFilename),
635
- card.egyptianCardName,
636
- ...Object.values(descriptiveData ?? {}).map((description) => description?.name),
637
- ...cardNode?.data?.aliases ?? []
638
- ];
639
- if (majorArchetype) {
640
- aliases.push(titleCase(majorArchetype.pathSlug));
641
- }
642
- if (card.suit && card.tarotCard.includes(" of ")) {
643
- const rankLabel = card.tarotCard.split(" of ")[0];
644
- for (const suitAlias of TAROT_SUIT_ALIASES[card.suit] ?? []) {
645
- aliases.push(`${rankLabel} of ${suitAlias}`);
646
- }
647
- }
648
- return uniqueStrings(
649
- aliases.filter((alias) => Boolean(alias)).filter((alias) => normalizeThemeText(alias) !== normalizedPrimaryLabel)
650
- );
651
- }
652
- function buildTarotKeywordTexts(card, majorArchetype, descriptiveData) {
653
- const rank = getTarotRank(card);
654
- const deckKeywordTexts = Object.values(descriptiveData ?? {}).flatMap((description) => [
655
- description?.meaning,
656
- description?.reversedMeaning,
657
- ...description?.keywords ?? []
658
- ]);
659
- return uniqueStrings([
660
- card.meaning,
661
- card.papusMeaning,
662
- card.egyptianCardName,
663
- ...canonicalTree.getNode(id("tarotArkAnnu" /* TAROT_ARK_ANNU */, card.tarotCard))?.data?.keywords ?? [],
664
- ...deckKeywordTexts,
665
- ...card.suit ? TAROT_SUIT_THEME_KEYWORDS[card.suit] ?? [] : [],
666
- ...card.type === "minor" && rank ? TAROT_MINOR_PIP_STAGE_KEYWORDS[rank] ?? [] : [],
667
- ...rank ? TAROT_COURT_RANK_THEME_KEYWORDS[rank] ?? [] : [],
668
- majorArchetype?.hebrewLetter
669
- ]);
670
- }
671
- function buildTarotThemeProfile(card) {
672
- const cardId = id("tarotArkAnnu" /* TAROT_ARK_ANNU */, card.tarotCard);
673
- const cardNode = canonicalTree.getNode(cardId);
674
- if (!cardNode) {
675
- throw new Error(`Missing canonical tarot node for ${cardId}.`);
676
- }
677
- const majorArchetypeData = card.type === "major" ? getTarotArchetype({ tarotCardNumber: card.number }) : void 0;
678
- const majorArchetype = majorArchetypeData ? {
679
- pathId: majorArchetypeData.pathId,
680
- pathNumber: majorArchetypeData.pathNumber,
681
- pathSlug: majorArchetypeData.pathSlug,
682
- hebrewLetter: majorArchetypeData.hebrewLetter
683
- } : void 0;
684
- const aliases = buildTarotAliases(
685
- card,
686
- majorArchetype,
687
- cardNode.data?.descriptiveData
688
- );
689
- const suits = getCorrespondenceRefs(cardId, "tarotSuit" /* TAROT_SUIT */, 1);
690
- const planets = getCorrespondenceRefs(cardId, "planet" /* PLANET */, 3);
691
- const signs = getCorrespondenceRefs(cardId, "westernZodiacSign" /* WESTERN_ZODIAC_SIGN */, 3);
692
- const elements = getCorrespondenceRefs(cardId, "westernElement" /* WESTERN_ELEMENT */, 3);
693
- const spheres = getCorrespondenceRefs(cardId, "sphere" /* SPHERE */, 3);
694
- const paths = getCorrespondenceRefs(cardId, "path" /* PATH */, 2);
695
- const keywordTexts = buildTarotKeywordTexts(
696
- card,
697
- majorArchetype,
698
- cardNode.data?.descriptiveData
699
- );
700
- const keywords = createTokenSurface(keywordTexts);
701
- const correspondenceTexts = [
702
- ...collectCorrespondenceTexts(suits),
703
- ...collectCorrespondenceTexts(planets),
704
- ...collectCorrespondenceTexts(signs),
705
- ...collectCorrespondenceTexts(elements),
706
- ...collectCorrespondenceTexts(spheres),
707
- ...collectCorrespondenceTexts(paths)
708
- ];
709
- const tokens = uniqueStrings([
710
- ...keywords,
711
- ...createTokenSurface([
712
- card.tarotCard,
713
- ...aliases,
714
- ...correspondenceTexts,
715
- card.suit,
716
- majorArchetype?.pathSlug
717
- ])
718
- ]);
719
- const profile = {
720
- kind: "tarot",
721
- id: cardId,
722
- cardNumber: card.number,
723
- cardType: card.type,
724
- tarotCardFilename: card.tarotCardFilename,
725
- primaryLabel: card.tarotCard,
726
- aliases: Object.freeze(aliases),
727
- keywords: Object.freeze(keywords),
728
- tokens: Object.freeze(tokens),
729
- correspondences: Object.freeze({
730
- planets: freezeCorrespondences(planets),
731
- signs: freezeCorrespondences(signs),
732
- elements: freezeCorrespondences(elements),
733
- spheres: freezeCorrespondences(spheres),
734
- paths: freezeCorrespondences(paths),
735
- suits: freezeCorrespondences(suits)
736
- }),
737
- majorArchetype: majorArchetype ? Object.freeze(majorArchetype) : void 0
738
- };
739
- return Object.freeze(profile);
740
- }
741
- function getTarotThemeProfileCache() {
742
- if (tarotThemeProfilesCache) {
743
- return tarotThemeProfilesCache;
744
- }
745
- const profiles = Object.freeze(ARKANNUS.map((card) => buildTarotThemeProfile(card)));
746
- tarotThemeProfilesCache = {
747
- profiles,
748
- byId: new Map(profiles.map((profile) => [profile.id, profile])),
749
- byCardNumber: new Map(profiles.map((profile) => [profile.cardNumber, profile])),
750
- byFilename: new Map(
751
- profiles.map((profile) => [normalizeThemeText(profile.tarotCardFilename), profile])
752
- ),
753
- byName: new Map(
754
- profiles.flatMap((profile) => [
755
- [normalizeThemeText(profile.primaryLabel), profile],
756
- ...profile.aliases.map((alias) => [normalizeThemeText(alias), profile])
757
- ])
758
- ),
759
- byPathId: new Map(
760
- profiles.flatMap(
761
- (profile) => profile.majorArchetype ? [[profile.majorArchetype.pathId, profile]] : []
762
- )
763
- ),
764
- byPathSlug: new Map(
765
- profiles.flatMap(
766
- (profile) => profile.majorArchetype ? [[normalizeThemeText(profile.majorArchetype.pathSlug), profile]] : []
767
- )
768
- )
769
- };
770
- return tarotThemeProfilesCache;
771
- }
772
- function tokenizeOccultThemeText(input, options = {}) {
773
- const values = Array.isArray(input) ? input : [input];
774
- const minTokenLength = options.minTokenLength ?? 3;
775
- const stopwords = new Set((options.stopwords ?? OCCULT_THEME_STOPWORDS).map(normalizeThemeText));
776
- const seen = /* @__PURE__ */ new Set();
777
- const tokens = [];
778
- for (const value of values) {
779
- if (!value) {
780
- continue;
781
- }
782
- const normalized = normalizeThemeText(value);
783
- for (const token of normalized.split(/[^a-z0-9]+/)) {
784
- if (token.length < minTokenLength || stopwords.has(token) || seen.has(token)) {
785
- continue;
786
- }
787
- seen.add(token);
788
- tokens.push(token);
789
- }
790
- }
791
- return tokens;
792
- }
793
- function listHouseThemeProfiles() {
794
- return getHouseThemeProfileCache();
795
- }
796
- function getHouseThemeProfile(lookup) {
797
- const houseLabel = getHouseLabelFromLookup(lookup);
798
- if (!houseLabel) {
799
- return void 0;
800
- }
801
- return getHouseThemeProfileCache().find((profile) => parseId(profile.id) === houseLabel);
802
- }
803
- function listTarotThemeProfiles() {
804
- return getTarotThemeProfileCache().profiles;
805
- }
806
- function getTarotThemeProfile(lookup) {
807
- const cache = getTarotThemeProfileCache();
808
- if (typeof lookup === "number") {
809
- return cache.byCardNumber.get(lookup);
810
- }
811
- if (typeof lookup === "string") {
812
- if (lookup.startsWith(`${"tarotArkAnnu" /* TAROT_ARK_ANNU */}:`)) {
813
- return cache.byId.get(lookup);
814
- }
815
- if (lookup.startsWith(`${"path" /* PATH */}:`)) {
816
- const archetype = getTarotArchetype({
817
- pathId: lookup
818
- });
819
- return archetype ? cache.byCardNumber.get(archetype.tarotCardNumber) : void 0;
820
- }
821
- return cache.byFilename.get(normalizeThemeText(lookup)) ?? cache.byName.get(normalizeThemeText(lookup)) ?? cache.byPathSlug.get(normalizeThemeText(lookup));
822
- }
823
- if ("tarotCardNumber" in lookup) {
824
- return cache.byCardNumber.get(lookup.tarotCardNumber);
825
- }
826
- if ("tarotCardFilename" in lookup) {
827
- return cache.byFilename.get(normalizeThemeText(lookup.tarotCardFilename));
828
- }
829
- if ("tarotCardName" in lookup) {
830
- return cache.byName.get(normalizeThemeText(lookup.tarotCardName));
831
- }
832
- if ("tarotArkAnnuId" in lookup) {
833
- return cache.byId.get(lookup.tarotArkAnnuId);
834
- }
835
- if ("pathId" in lookup) {
836
- return cache.byPathId.get(lookup.pathId);
837
- }
838
- return cache.byPathSlug.get(normalizeThemeText(lookup.pathSlug));
839
- }
840
-
841
- export { OCCULT_THEME_STOPWORDS, getHouseThemeProfile, getTarotThemeProfile, listHouseThemeProfiles, listTarotThemeProfiles, tokenizeOccultThemeText };
842
- //# sourceMappingURL=chunk-RWX6HFS5.mjs.map
843
- //# sourceMappingURL=chunk-RWX6HFS5.mjs.map