@almadar/core 10.86.0 → 10.87.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 (41) hide show
  1. package/dist/builders.d.ts +5 -4
  2. package/dist/builders.js +68 -29
  3. package/dist/builders.js.map +1 -1
  4. package/dist/{effect-BgDiw_bG.d.ts → effect-DMA97JxX.d.ts} +22 -6
  5. package/dist/{entityAccess-DK5S_2cT.d.ts → entityAccess-DNDEF75i.d.ts} +2 -2
  6. package/dist/{expression-Fk8bQWef.d.ts → expression-WfTp2arD.d.ts} +2 -65
  7. package/dist/factory/index.d.ts +6 -5
  8. package/dist/factory/index.js +1194 -401
  9. package/dist/factory/index.js.map +1 -1
  10. package/dist/factory-runtime/index.d.ts +35 -5
  11. package/dist/factory-runtime/index.js +127 -52
  12. package/dist/factory-runtime/index.js.map +1 -1
  13. package/dist/i18n/index.d.ts +111 -1
  14. package/dist/i18n/index.js +500 -19
  15. package/dist/i18n/index.js.map +1 -1
  16. package/dist/{index-ChYsqVJj.d.ts → index-xZP_Ajx3.d.ts} +18 -5
  17. package/dist/index.d.ts +82 -14
  18. package/dist/index.js +1876 -333
  19. package/dist/index.js.map +1 -1
  20. package/dist/json-D8gmyK3l.d.ts +65 -0
  21. package/dist/mock/index.d.ts +129 -12
  22. package/dist/mock/index.js +192 -61
  23. package/dist/mock/index.js.map +1 -1
  24. package/dist/patterns/component-mapping.json +1 -1
  25. package/dist/patterns/event-contracts.json +1 -1
  26. package/dist/patterns/index.d.ts +2525 -609
  27. package/dist/patterns/index.js +1238 -384
  28. package/dist/patterns/index.js.map +1 -1
  29. package/dist/patterns/integrators-registry.json +107 -23
  30. package/dist/patterns/patterns-registry.json +1170 -400
  31. package/dist/patterns/registry.json +1170 -400
  32. package/dist/patterns/services-registry.json +170 -35
  33. package/dist/{schema-BhfQb1oe.d.ts → schema-_SPrm5Ic.d.ts} +46381 -21335
  34. package/dist/state-machine/index.d.ts +2 -1
  35. package/dist/trait-9tfq2tQb.d.ts +10554 -0
  36. package/dist/types/index.d.ts +7 -6
  37. package/dist/types/index.js +132 -43
  38. package/dist/types/index.js.map +1 -1
  39. package/dist/{types-CCAmdxcH.d.ts → types-CjRjhiaO.d.ts} +19 -3
  40. package/package.json +2 -2
  41. package/dist/trait-pavNlGqm.d.ts +0 -5385
@@ -39,7 +39,13 @@ var en_default = {
39
39
  events: "events",
40
40
  event: "event",
41
41
  emitsScope: "emitsScope",
42
- identity: "identity"
42
+ identity: "identity",
43
+ pages: "pages",
44
+ omit: "omit",
45
+ only: "only",
46
+ roles: "roles",
47
+ entities: "entities",
48
+ extend: "extend"
43
49
  },
44
50
  shapes: {
45
51
  Entity: "Entity",
@@ -132,7 +138,6 @@ var en_default = {
132
138
  duration: "duration",
133
139
  money: "money",
134
140
  scalar: "scalar",
135
- opaque: "opaque",
136
141
  file: "file",
137
142
  email: "email",
138
143
  url: "url",
@@ -175,12 +180,12 @@ var en_default = {
175
180
  "3xl": "3xl",
176
181
  "4xl": "4xl",
177
182
  _metadata: "_metadata",
183
+ _resolved: "_resolved",
178
184
  accent: "accent",
179
185
  accentForeground: "accentForeground",
180
186
  access_waivers: "access_waivers",
181
187
  alias: "alias",
182
188
  animations: "animations",
183
- api: "api",
184
189
  appliesTo: "appliesTo",
185
190
  as: "as",
186
191
  aspect: "aspect",
@@ -267,6 +272,7 @@ var en_default = {
267
272
  emptyAsset: "emptyAsset",
268
273
  enabled: "enabled",
269
274
  enter: "enter",
275
+ entities: "entities",
270
276
  entity: "entity",
271
277
  entityBindingDescription: "entityBindingDescription",
272
278
  entityBindingSynonyms: "entityBindingSynonyms",
@@ -274,7 +280,6 @@ var en_default = {
274
280
  entityId: "entityId",
275
281
  entityRebindable: "entityRebindable",
276
282
  entityRefIds: "entityRefIds",
277
- entityType: "entityType",
278
283
  entries: "entries",
279
284
  env: "env",
280
285
  equals: "equals",
@@ -289,17 +294,18 @@ var en_default = {
289
294
  expand: "expand",
290
295
  expects: "expects",
291
296
  exposes: "exposes",
297
+ extend: "extend",
292
298
  extends: "extends",
293
299
  extendsId: "extendsId",
294
300
  family: "family",
295
301
  fast: "fast",
296
- features: "features",
297
302
  field: "field",
298
303
  fields: "fields",
299
304
  flowPattern: "flowPattern",
300
305
  foreground: "foreground",
301
306
  foreignKey: "foreignKey",
302
307
  formPattern: "formPattern",
308
+ forwardedFrom: "forwardedFrom",
303
309
  from: "from",
304
310
  geometry: "geometry",
305
311
  guard: "guard",
@@ -350,18 +356,20 @@ var en_default = {
350
356
  max: "max",
351
357
  maxAttempts: "maxAttempts",
352
358
  min: "min",
353
- mode: "mode",
354
359
  monoFamily: "monoFamily",
355
360
  motion: "motion",
361
+ mounts: "mounts",
356
362
  muted: "muted",
357
363
  mutedForeground: "mutedForeground",
358
364
  name: "name",
359
365
  normal: "normal",
360
366
  numeric: "numeric",
367
+ omit: "omit",
361
368
  onDelete: "onDelete",
362
369
  onEntry: "onEntry",
363
370
  onExit: "onExit",
364
371
  onboardingAsset: "onboardingAsset",
372
+ only: "only",
365
373
  orbital: "orbital",
366
374
  orbitalId: "orbitalId",
367
375
  orbitals: "orbitals",
@@ -404,6 +412,7 @@ var en_default = {
404
412
  reconnect: "reconnect",
405
413
  ref: "ref",
406
414
  refId: "refId",
415
+ reference: "reference",
407
416
  relatedLinks: "relatedLinks",
408
417
  relation: "relation",
409
418
  renames: "renames",
@@ -416,6 +425,7 @@ var en_default = {
416
425
  resource: "resource",
417
426
  ring: "ring",
418
427
  role: "role",
428
+ roles: "roles",
419
429
  rowHeightCompact: "rowHeightCompact",
420
430
  rowHeightNormal: "rowHeightNormal",
421
431
  rowHeightSpacious: "rowHeightSpacious",
@@ -574,7 +584,13 @@ var ar_default = {
574
584
  events: "\u0623\u062D\u062F\u0627\u062B",
575
585
  event: "\u062D\u062F\u062B",
576
586
  emitsScope: "\u0646\u0637\u0627\u0642_\u0627\u0644\u0625\u0635\u062F\u0627\u0631",
577
- identity: "\u0647\u0648\u064A\u0629"
587
+ identity: "\u0647\u0648\u064A\u0629",
588
+ pages: "\u0635\u0641\u062D\u0627\u062A",
589
+ omit: "\u0627\u0633\u062A\u0628\u0639\u0627\u062F",
590
+ only: "\u0641\u0642\u0637",
591
+ roles: "\u0623\u062F\u0648\u0627\u0631",
592
+ entities: "\u0643\u064A\u0627\u0646\u0627\u062A",
593
+ extend: "\u0627\u0645\u062A\u062F\u0627\u062F"
578
594
  },
579
595
  shapes: {
580
596
  Entity: "\u0643\u064A\u0627\u0646",
@@ -667,7 +683,6 @@ var ar_default = {
667
683
  duration: "\u0645\u062F\u0629",
668
684
  money: "\u0645\u0628\u0644\u063A_\u0645\u0627\u0644\u064A",
669
685
  scalar: "\u0639\u062F\u062F\u064A",
670
- opaque: "\u0645\u0639\u062A\u0645",
671
686
  file: "\u0645\u0644\u0641",
672
687
  email: "\u0628\u0631\u064A\u062F_\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",
673
688
  url: "\u0631\u0627\u0628\u0637",
@@ -710,12 +725,12 @@ var ar_default = {
710
725
  "3xl": "3\u0643\u0628\u064A\u0631",
711
726
  "4xl": "4\u0643\u0628\u064A\u0631",
712
727
  _metadata: "\u0628\u064A\u0627\u0646\u0627\u062A_\u0648\u0635\u0641\u064A\u0629",
728
+ _resolved: "_\u0645\u062D\u0644\u0648\u0644",
713
729
  accent: "\u062A\u0645\u064A\u064A\u0632",
714
730
  accentForeground: "\u0645\u0642\u062F\u0645\u0629_\u0627\u0644\u062A\u0645\u064A\u064A\u0632",
715
731
  access_waivers: "\u0625\u0639\u0641\u0627\u0621\u0627\u062A_\u0627\u0644\u0648\u0635\u0648\u0644",
716
732
  alias: "\u0627\u0633\u0645_\u0645\u0633\u062A\u0639\u0627\u0631",
717
733
  animations: "\u0631\u0633\u0648\u0645_\u0645\u062A\u062D\u0631\u0643\u0629",
718
- api: "\u0648\u0627\u062C\u0647\u0629_\u0628\u0631\u0645\u062C\u064A\u0629",
719
734
  appliesTo: "\u064A\u0646\u0637\u0628\u0642_\u0639\u0644\u0649",
720
735
  as: "\u0643\u0640",
721
736
  aspect: "\u0646\u0633\u0628\u0629",
@@ -802,6 +817,7 @@ var ar_default = {
802
817
  emptyAsset: "\u0623\u0635\u0644_\u0641\u0627\u0631\u063A",
803
818
  enabled: "\u0645\u064F\u0641\u0639\u0651\u0644",
804
819
  enter: "\u062F\u062E\u0648\u0644",
820
+ entities: "\u0643\u064A\u0627\u0646\u0627\u062A",
805
821
  entity: "\u0643\u064A\u0627\u0646",
806
822
  entityBindingDescription: "\u0648\u0635\u0641_\u0631\u0628\u0637_\u0627\u0644\u0643\u064A\u0627\u0646",
807
823
  entityBindingSynonyms: "\u0645\u0631\u0627\u062F\u0641\u0627\u062A_\u0631\u0628\u0637_\u0627\u0644\u0643\u064A\u0627\u0646",
@@ -809,7 +825,6 @@ var ar_default = {
809
825
  entityId: "\u0645\u0639\u0631\u0641_\u0627\u0644\u0643\u064A\u0627\u0646",
810
826
  entityRebindable: "\u0642\u0627\u0628\u0644_\u0644\u0625\u0639\u0627\u062F\u0629_\u0631\u0628\u0637_\u0627\u0644\u0643\u064A\u0627\u0646",
811
827
  entityRefIds: "\u0645\u0639\u0631\u0641\u0627\u062A_\u0645\u0631\u062C\u0639_\u0627\u0644\u0643\u064A\u0627\u0646",
812
- entityType: "\u0646\u0648\u0639_\u0627\u0644\u0643\u064A\u0627\u0646",
813
828
  entries: "\u0625\u062F\u062E\u0627\u0644\u0627\u062A",
814
829
  env: "\u0628\u064A\u0626\u0629",
815
830
  equals: "\u064A\u0633\u0627\u0648\u064A",
@@ -824,17 +839,18 @@ var ar_default = {
824
839
  expand: "\u062A\u0648\u0633\u064A\u0639",
825
840
  expects: "\u064A\u062A\u0648\u0642\u0639",
826
841
  exposes: "\u064A\u0639\u0631\u0636",
842
+ extend: "\u0627\u0645\u062A\u062F\u0627\u062F",
827
843
  extends: "\u064A\u0645\u062A\u062F",
828
844
  extendsId: "\u0645\u0639\u0631\u0641_\u0627\u0644\u0627\u0645\u062A\u062F\u0627\u062F",
829
845
  family: "\u0639\u0627\u0626\u0644\u0629",
830
846
  fast: "\u0633\u0631\u064A\u0639",
831
- features: "\u0645\u064A\u0632\u0627\u062A",
832
847
  field: "\u062D\u0642\u0644",
833
848
  fields: "\u062D\u0642\u0648\u0644",
834
849
  flowPattern: "\u0646\u0645\u0637_\u0627\u0644\u062A\u062F\u0641\u0642",
835
850
  foreground: "\u0645\u0642\u062F\u0645\u0629",
836
851
  foreignKey: "\u0645\u0641\u062A\u0627\u062D_\u0623\u062C\u0646\u0628\u064A",
837
852
  formPattern: "\u0646\u0645\u0637_\u0627\u0644\u0646\u0645\u0648\u0630\u062C",
853
+ forwardedFrom: "\u0645\u0648\u062C\u0647_\u0645\u0646",
838
854
  from: "\u0645\u0646",
839
855
  geometry: "\u0647\u0646\u062F\u0633\u0629",
840
856
  guard: "\u062D\u0627\u0631\u0633",
@@ -885,18 +901,20 @@ var ar_default = {
885
901
  max: "\u0623\u0642\u0635\u0649",
886
902
  maxAttempts: "\u0623\u0642\u0635\u0649_\u0639\u062F\u062F_\u0645\u062D\u0627\u0648\u0644\u0627\u062A",
887
903
  min: "\u0623\u062F\u0646\u0649",
888
- mode: "\u0648\u0636\u0639",
889
904
  monoFamily: "\u0639\u0627\u0626\u0644\u0629_\u0623\u062D\u0627\u062F\u064A\u0629_\u0627\u0644\u0645\u0633\u0627\u0641\u0629",
890
905
  motion: "\u062D\u0631\u0643\u0629",
906
+ mounts: "\u062A\u0631\u0643\u064A\u0628\u0627\u062A",
891
907
  muted: "\u062E\u0627\u0641\u062A",
892
908
  mutedForeground: "\u0645\u0642\u062F\u0645\u0629_\u062E\u0627\u0641\u062A\u0629",
893
909
  name: "\u0627\u0633\u0645",
894
910
  normal: "\u0639\u0627\u062F\u064A",
895
911
  numeric: "\u0631\u0642\u0645\u064A",
912
+ omit: "\u0627\u0633\u062A\u0628\u0639\u0627\u062F",
896
913
  onDelete: "\u0639\u0646\u062F_\u0627\u0644\u062D\u0630\u0641",
897
914
  onEntry: "\u0639\u0646\u062F_\u0627\u0644\u062F\u062E\u0648\u0644",
898
915
  onExit: "\u0639\u0646\u062F_\u0627\u0644\u062E\u0631\u0648\u062C",
899
916
  onboardingAsset: "\u0623\u0635\u0644_\u0627\u0644\u062A\u0623\u0647\u064A\u0644",
917
+ only: "\u0641\u0642\u0637",
900
918
  orbital: "\u0645\u062F\u0627\u0631",
901
919
  orbitalId: "\u0645\u0639\u0631\u0641_\u0627\u0644\u0645\u062F\u0627\u0631",
902
920
  orbitals: "\u0645\u062F\u0627\u0631\u0627\u062A",
@@ -939,6 +957,7 @@ var ar_default = {
939
957
  reconnect: "\u0625\u0639\u0627\u062F\u0629_\u0627\u0644\u0627\u062A\u0635\u0627\u0644",
940
958
  ref: "\u0645\u0631\u062C\u0639",
941
959
  refId: "\u0645\u0639\u0631\u0641_\u0627\u0644\u0645\u0631\u062C\u0639",
960
+ reference: "\u0645\u0631\u062C\u0639\u064A\u0629",
942
961
  relatedLinks: "\u0631\u0648\u0627\u0628\u0637_\u0630\u0627\u062A_\u0635\u0644\u0629",
943
962
  relation: "\u0639\u0644\u0627\u0642\u0629",
944
963
  renames: "\u0625\u0639\u0627\u062F\u0629_\u062A\u0633\u0645\u064A\u0629",
@@ -951,6 +970,7 @@ var ar_default = {
951
970
  resource: "\u0645\u0648\u0631\u062F",
952
971
  ring: "\u062D\u0644\u0642\u0629",
953
972
  role: "\u062F\u0648\u0631",
973
+ roles: "\u0623\u062F\u0648\u0627\u0631",
954
974
  rowHeightCompact: "\u0627\u0631\u062A\u0641\u0627\u0639_\u0627\u0644\u0635\u0641_\u0627\u0644\u0645\u0636\u063A\u0648\u0637",
955
975
  rowHeightNormal: "\u0627\u0631\u062A\u0641\u0627\u0639_\u0627\u0644\u0635\u0641_\u0627\u0644\u0639\u0627\u062F\u064A",
956
976
  rowHeightSpacious: "\u0627\u0631\u062A\u0641\u0627\u0639_\u0627\u0644\u0635\u0641_\u0627\u0644\u0648\u0627\u0633\u0639",
@@ -1109,7 +1129,13 @@ var sl_default = {
1109
1129
  events: "dogodki",
1110
1130
  event: "dogodek",
1111
1131
  emitsScope: "oddajaObseg",
1112
- identity: "identiteta"
1132
+ identity: "identiteta",
1133
+ pages: "strani",
1134
+ omit: "izloci",
1135
+ only: "samo",
1136
+ roles: "vloge",
1137
+ entities: "entitete",
1138
+ extend: "razsiritev"
1113
1139
  },
1114
1140
  shapes: {
1115
1141
  Entity: "Entiteta",
@@ -1202,7 +1228,6 @@ var sl_default = {
1202
1228
  duration: "trajanje",
1203
1229
  money: "denar",
1204
1230
  scalar: "skalar",
1205
- opaque: "nepregledno",
1206
1231
  file: "datoteka",
1207
1232
  email: "eposta",
1208
1233
  url: "url",
@@ -1245,12 +1270,12 @@ var sl_default = {
1245
1270
  "3xl": "3xv",
1246
1271
  "4xl": "4xv",
1247
1272
  _metadata: "_metapodatki",
1273
+ _resolved: "_razresen",
1248
1274
  accent: "poudarek",
1249
1275
  accentForeground: "poudarekOspredje",
1250
1276
  access_waivers: "dostop_izjeme",
1251
1277
  alias: "vzdevek",
1252
1278
  animations: "animacije",
1253
- api: "api",
1254
1279
  appliesTo: "veljaZa",
1255
1280
  as: "kot",
1256
1281
  aspect: "razmerje",
@@ -1337,6 +1362,7 @@ var sl_default = {
1337
1362
  emptyAsset: "sredstvoPrazno",
1338
1363
  enabled: "omogoceno",
1339
1364
  enter: "vstop",
1365
+ entities: "entitete",
1340
1366
  entity: "entiteta",
1341
1367
  entityBindingDescription: "entitetaVezavaOpis",
1342
1368
  entityBindingSynonyms: "entitetaVezavaSopomenke",
@@ -1344,7 +1370,6 @@ var sl_default = {
1344
1370
  entityId: "entitetaId",
1345
1371
  entityRebindable: "entitetaPrevezljivo",
1346
1372
  entityRefIds: "entitetaSklicIdji",
1347
- entityType: "entitetaTip",
1348
1373
  entries: "vnosi",
1349
1374
  env: "okolje",
1350
1375
  equals: "enako",
@@ -1359,17 +1384,18 @@ var sl_default = {
1359
1384
  expand: "razpni",
1360
1385
  expects: "pricakuje",
1361
1386
  exposes: "izpostavlja",
1387
+ extend: "razsiritev",
1362
1388
  extends: "razsiri",
1363
1389
  extendsId: "razsiriId",
1364
1390
  family: "druzina",
1365
1391
  fast: "hitro",
1366
- features: "znacilke",
1367
1392
  field: "polje",
1368
1393
  fields: "polja",
1369
1394
  flowPattern: "vzorecPoteka",
1370
1395
  foreground: "ospredje",
1371
1396
  foreignKey: "tujiKljuc",
1372
1397
  formPattern: "vzorecObrazca",
1398
+ forwardedFrom: "posredovanoOd",
1373
1399
  from: "iz",
1374
1400
  geometry: "geometrija",
1375
1401
  guard: "strazar",
@@ -1420,18 +1446,20 @@ var sl_default = {
1420
1446
  max: "najvec",
1421
1447
  maxAttempts: "najvecPoskusov",
1422
1448
  min: "najmanj",
1423
- mode: "nacin",
1424
1449
  monoFamily: "monoDruzina",
1425
1450
  motion: "gibanje",
1451
+ mounts: "priklopi",
1426
1452
  muted: "zaduseno",
1427
1453
  mutedForeground: "zadusenoOspredje",
1428
1454
  name: "ime",
1429
1455
  normal: "normalno",
1430
1456
  numeric: "stevilsko",
1457
+ omit: "izloci",
1431
1458
  onDelete: "obIzbrisi",
1432
1459
  onEntry: "obVnos",
1433
1460
  onExit: "obIzhod",
1434
1461
  onboardingAsset: "sredstvoUvod",
1462
+ only: "samo",
1435
1463
  orbital: "orbitala",
1436
1464
  orbitalId: "orbitalaId",
1437
1465
  orbitals: "orbitale",
@@ -1474,6 +1502,7 @@ var sl_default = {
1474
1502
  reconnect: "ponovnaPovezava",
1475
1503
  ref: "sklic",
1476
1504
  refId: "sklicId",
1505
+ reference: "referenca",
1477
1506
  relatedLinks: "povezanePovezave",
1478
1507
  relation: "relacija",
1479
1508
  renames: "preimenovanja",
@@ -1486,6 +1515,7 @@ var sl_default = {
1486
1515
  resource: "vir",
1487
1516
  ring: "obroc",
1488
1517
  role: "vloga",
1518
+ roles: "vloge",
1489
1519
  rowHeightCompact: "visinaVrsticeStisnjena",
1490
1520
  rowHeightNormal: "visinaVrsticeNormalna",
1491
1521
  rowHeightSpacious: "visinaVrsticeProstorna",
@@ -1603,6 +1633,457 @@ var sl_default = {
1603
1633
  }
1604
1634
  };
1605
1635
 
1636
+ // src/i18n/lolo-lexer.ts
1637
+ var IDENT_START = /[\p{L}_]/u;
1638
+ var IDENT_CONTINUE = /[\p{L}\p{N}_/-]/u;
1639
+ var SIGIL_CONTINUE = /[\p{L}\p{N}_.]/u;
1640
+ var DIGIT = /[0-9]/;
1641
+ function lexLolo(source) {
1642
+ const tokens = [];
1643
+ let i = 0;
1644
+ const n = source.length;
1645
+ const push = (kind, start, end, text, textStart) => {
1646
+ tokens.push({
1647
+ kind,
1648
+ start,
1649
+ end,
1650
+ text: text ?? source.slice(start, end),
1651
+ textStart: textStart ?? start
1652
+ });
1653
+ };
1654
+ while (i < n) {
1655
+ const c = source[i];
1656
+ if (c === " " || c === " " || c === "\r" || c === "\n") {
1657
+ i++;
1658
+ continue;
1659
+ }
1660
+ if (c === "#") {
1661
+ const start2 = i;
1662
+ if (source[i + 1] === "=") {
1663
+ const close = source.indexOf("=#", i + 2);
1664
+ i = close === -1 ? n : close + 2;
1665
+ } else {
1666
+ const nl = source.indexOf("\n", i);
1667
+ i = nl === -1 ? n : nl;
1668
+ }
1669
+ push("comment", start2, i);
1670
+ continue;
1671
+ }
1672
+ if (c === ";" && source[i + 1] === ";") {
1673
+ const start2 = i;
1674
+ const nl = source.indexOf("\n", i);
1675
+ i = nl === -1 ? n : nl;
1676
+ push("comment", start2, i);
1677
+ continue;
1678
+ }
1679
+ if (c === '"') {
1680
+ const start2 = i;
1681
+ i++;
1682
+ while (i < n) {
1683
+ if (source[i] === "\\") {
1684
+ i += 2;
1685
+ continue;
1686
+ }
1687
+ if (source[i] === '"') {
1688
+ i++;
1689
+ break;
1690
+ }
1691
+ i++;
1692
+ }
1693
+ push("string", start2, Math.min(i, n));
1694
+ continue;
1695
+ }
1696
+ if (c === "@") {
1697
+ const start2 = i;
1698
+ i++;
1699
+ if (source[i] === "(") {
1700
+ i++;
1701
+ push("punct", start2, i);
1702
+ continue;
1703
+ }
1704
+ const nameStart = i;
1705
+ while (i < n && SIGIL_CONTINUE.test(source[i])) i++;
1706
+ push("sigil", start2, i, source.slice(nameStart, i), nameStart);
1707
+ continue;
1708
+ }
1709
+ if (c === "?") {
1710
+ const start2 = i;
1711
+ i++;
1712
+ if (i < n && IDENT_START.test(source[i])) {
1713
+ const nameStart = i;
1714
+ while (i < n && SIGIL_CONTINUE.test(source[i])) i++;
1715
+ push("payload-sigil", start2, i, source.slice(nameStart, i), nameStart);
1716
+ } else {
1717
+ push("payload-sigil", start2, i, "", i);
1718
+ }
1719
+ continue;
1720
+ }
1721
+ if (c === "-") {
1722
+ const start2 = i;
1723
+ if (source[i + 1] === ">") {
1724
+ i += 2;
1725
+ push("punct", start2, i);
1726
+ } else if (source[i + 1] === "-") {
1727
+ i += 2;
1728
+ push("punct", start2, i);
1729
+ } else if (source[i + 1] !== void 0 && DIGIT.test(source[i + 1])) {
1730
+ i++;
1731
+ while (i < n && (DIGIT.test(source[i]) || source[i] === ".")) i++;
1732
+ push("number", start2, i);
1733
+ } else {
1734
+ i++;
1735
+ push("identifier", start2, i);
1736
+ }
1737
+ continue;
1738
+ }
1739
+ if (DIGIT.test(c)) {
1740
+ const start2 = i;
1741
+ while (i < n && (DIGIT.test(source[i]) || source[i] === ".")) i++;
1742
+ push("number", start2, i);
1743
+ continue;
1744
+ }
1745
+ if (c === "=" || c === "!" || c === "<" || c === ">") {
1746
+ const start2 = i;
1747
+ i++;
1748
+ if (source[i] === "=") i++;
1749
+ const two = i - start2 === 2;
1750
+ push(two ? "identifier" : "punct", start2, i);
1751
+ continue;
1752
+ }
1753
+ if (c === "+" || c === "*" || c === "/" || c === "%") {
1754
+ const start2 = i;
1755
+ i++;
1756
+ push("identifier", start2, i);
1757
+ continue;
1758
+ }
1759
+ if (IDENT_START.test(c)) {
1760
+ const start2 = i;
1761
+ while (i < n && IDENT_CONTINUE.test(source[i])) i++;
1762
+ const text = source.slice(start2, i);
1763
+ push(text === "true" || text === "false" || text === "null" ? "literal" : "identifier", start2, i, text);
1764
+ continue;
1765
+ }
1766
+ const start = i;
1767
+ i++;
1768
+ if (c === ":" && source[i] === ":") i++;
1769
+ push("punct", start, i);
1770
+ }
1771
+ return tokens;
1772
+ }
1773
+
1774
+ // src/i18n/localize.ts
1775
+ var LOLO_SECTIONS = [
1776
+ "keywords",
1777
+ "shapes",
1778
+ "tags",
1779
+ "categories",
1780
+ "capabilities",
1781
+ "annotations",
1782
+ "sigils",
1783
+ "effects",
1784
+ "types",
1785
+ "units",
1786
+ "literals",
1787
+ "reservedEvents"
1788
+ ];
1789
+ var CANON_ANY_ORDER = [
1790
+ "keywords",
1791
+ "shapes",
1792
+ "tags",
1793
+ "categories",
1794
+ "capabilities",
1795
+ "annotations",
1796
+ "sigils",
1797
+ "types",
1798
+ "units",
1799
+ "literals",
1800
+ "reservedEvents"
1801
+ ];
1802
+ function forward(lang, sections, resolutionOrder, operators) {
1803
+ const canon = (native) => {
1804
+ for (const section of resolutionOrder) {
1805
+ for (const [english, value] of Object.entries(coreTables[lang][section])) {
1806
+ if (value === native) return english;
1807
+ }
1808
+ }
1809
+ if (operators) {
1810
+ for (const [english, value] of Object.entries(operators.operators)) {
1811
+ if (value === native) return english;
1812
+ }
1813
+ }
1814
+ return void 0;
1815
+ };
1816
+ const map = /* @__PURE__ */ new Map();
1817
+ const add = (english, native) => {
1818
+ if (canon(native) !== english) return;
1819
+ map.set(english, native);
1820
+ };
1821
+ for (const section of sections) {
1822
+ for (const [english, native] of Object.entries(coreTables[lang][section])) {
1823
+ add(english, native);
1824
+ }
1825
+ }
1826
+ if (operators) {
1827
+ for (const [english, native] of Object.entries(operators.operators)) {
1828
+ add(english, native);
1829
+ }
1830
+ }
1831
+ return map;
1832
+ }
1833
+ function localizeMap(lang, operators) {
1834
+ return forward(lang, LOLO_SECTIONS, CANON_ANY_ORDER, operators);
1835
+ }
1836
+ function isWordShaped(english) {
1837
+ return /^[A-Za-z_][A-Za-z0-9_/-]*$/.test(english);
1838
+ }
1839
+ var FIELD_BLOCK_HEADS = /* @__PURE__ */ new Set(["entity", "type", "config", "params", "variants", "tokens", "event"]);
1840
+ var EVENT_BLOCK_HEADS = /* @__PURE__ */ new Set(["listens", "emits", "events"]);
1841
+ var NAME_INTRODUCING = /* @__PURE__ */ new Set([
1842
+ "app",
1843
+ "orbital",
1844
+ "entity",
1845
+ "trait",
1846
+ "state",
1847
+ "page",
1848
+ "type",
1849
+ "event",
1850
+ "uses",
1851
+ "theme",
1852
+ "as",
1853
+ "extend"
1854
+ ]);
1855
+ var NAME_PUNCT = /* @__PURE__ */ new Set(["->", "-->", "\u2192", ".", "--"]);
1856
+ function localizeLoloSource(source, lang, options = {}) {
1857
+ if (lang === "en") return source;
1858
+ const { operators } = options;
1859
+ const keywords = forward(lang, ["keywords"], CANON_ANY_ORDER);
1860
+ const shapes = forward(lang, ["shapes"], CANON_ANY_ORDER);
1861
+ const types = forward(lang, ["types"], ["types"]);
1862
+ const modifiers = forward(lang, ["tags", "categories", "capabilities", "keywords"], CANON_ANY_ORDER);
1863
+ const heads = forward(lang, ["effects"], ["effects"], operators);
1864
+ const sigils = forward(lang, ["sigils", "annotations"], ["sigils", "annotations"]);
1865
+ const bindingSigils = forward(lang, ["sigils"], ["sigils", "annotations"]);
1866
+ const literals = forward(lang, ["literals"], ["literals"]);
1867
+ const units = forward(lang, ["units"], ["units"]);
1868
+ const reservedEvents = forward(lang, ["reservedEvents"], ["reservedEvents"]);
1869
+ const tokens = lexLolo(source);
1870
+ const edits = [];
1871
+ const stack = [
1872
+ {
1873
+ kind: "root",
1874
+ stmtHead: void 0,
1875
+ blockHead: void 0,
1876
+ afterColon: false,
1877
+ sawEquals: false,
1878
+ refBody: false,
1879
+ parenHead: void 0,
1880
+ binderSeen: false
1881
+ }
1882
+ ];
1883
+ const top = () => stack[stack.length - 1];
1884
+ let prev;
1885
+ const replace = (token, map) => {
1886
+ if (!isWordShaped(token.text)) return;
1887
+ const native = map.get(token.text);
1888
+ if (native === void 0 || native === token.text) return;
1889
+ edits.push({ start: token.textStart, end: token.end, text: native });
1890
+ };
1891
+ for (let index = 0; index < tokens.length; index++) {
1892
+ const token = tokens[index];
1893
+ if (token.kind === "comment") continue;
1894
+ const frame = top();
1895
+ const startsStatement = prev === void 0 || prev.text === "{" || prev.text === "}" || source.slice(prev.end, token.start).includes("\n");
1896
+ if (startsStatement) {
1897
+ frame.stmtHead = void 0;
1898
+ frame.afterColon = false;
1899
+ frame.sawEquals = false;
1900
+ }
1901
+ if (token.kind === "punct") {
1902
+ const text = source.slice(token.start, token.end);
1903
+ const child = (kind) => ({
1904
+ kind,
1905
+ stmtHead: void 0,
1906
+ blockHead: frame.stmtHead,
1907
+ afterColon: false,
1908
+ sawEquals: false,
1909
+ refBody: frame.refBody || frame.sawEquals,
1910
+ parenHead: void 0,
1911
+ binderSeen: false
1912
+ });
1913
+ if (text === "(" || text === "@(") {
1914
+ stack.push({ ...child(parenFrame(frame, prev)), blockHead: void 0 });
1915
+ if (top().kind === "binder-list") frame.binderSeen = true;
1916
+ } else if (text === "{") {
1917
+ stack.push(child(braceFrame(frame, prev)));
1918
+ } else if (text === "[") {
1919
+ stack.push(child(bracketFrame(frame, prev)));
1920
+ } else if (text === ")" || text === "}" || text === "]") {
1921
+ if (stack.length > 1) stack.pop();
1922
+ top().afterColon = false;
1923
+ top().sawEquals = false;
1924
+ } else if (text === ":") {
1925
+ frame.afterColon = true;
1926
+ } else if (text === "=") {
1927
+ frame.afterColon = false;
1928
+ frame.sawEquals = true;
1929
+ } else if (text === ",") {
1930
+ frame.afterColon = false;
1931
+ frame.sawEquals = false;
1932
+ frame.stmtHead = void 0;
1933
+ }
1934
+ prev = token;
1935
+ continue;
1936
+ }
1937
+ const opaque = frame.kind === "object" || frame.kind === "array" || frame.kind === "binder-list" || frame.kind === "binder-pair" && prev !== void 0 && prev.text === "(";
1938
+ if (token.kind === "sigil") {
1939
+ const dot = token.text.indexOf(".");
1940
+ const root = dot === -1 ? token.text : token.text.slice(0, dot);
1941
+ const native = (opaque || frame.kind === "paren" ? bindingSigils : sigils).get(root);
1942
+ if (native !== void 0 && native !== root) {
1943
+ edits.push({ start: token.textStart, end: token.textStart + root.length, text: native });
1944
+ }
1945
+ prev = token;
1946
+ continue;
1947
+ }
1948
+ if (token.kind === "payload-sigil" || token.kind === "string" || token.kind === "number") {
1949
+ prev = token;
1950
+ continue;
1951
+ }
1952
+ if (token.kind === "literal") {
1953
+ if (!opaque) replace(token, literals);
1954
+ prev = token;
1955
+ continue;
1956
+ }
1957
+ const prevText = prev === void 0 ? void 0 : source.slice(prev.start, prev.end);
1958
+ const afterName = prevText !== void 0 && (NAME_INTRODUCING.has(prevText) || NAME_PUNCT.has(prevText));
1959
+ if (token.text === "INIT" && !opaque && !frame.sawEquals) {
1960
+ replace(token, reservedEvents);
1961
+ if (frame.stmtHead === void 0) frame.stmtHead = token.text;
1962
+ prev = token;
1963
+ continue;
1964
+ }
1965
+ if (!opaque && !startsStatement && prev !== void 0 && prev.kind === "number") {
1966
+ replace(token, units);
1967
+ prev = token;
1968
+ continue;
1969
+ }
1970
+ switch (frame.kind) {
1971
+ case "paren": {
1972
+ if (prevText === "(") {
1973
+ frame.parenHead = token.text;
1974
+ replace(token, heads);
1975
+ }
1976
+ break;
1977
+ }
1978
+ case "binder-list":
1979
+ case "binder-pair":
1980
+ break;
1981
+ case "object":
1982
+ case "array":
1983
+ break;
1984
+ case "mods":
1985
+ if (!frame.afterColon) replace(token, modifiers);
1986
+ break;
1987
+ case "type-array":
1988
+ replace(token, types);
1989
+ break;
1990
+ case "block-fields": {
1991
+ if (frame.afterColon && !afterName) replace(token, types);
1992
+ break;
1993
+ }
1994
+ case "root":
1995
+ case "block-body": {
1996
+ if (!afterName) replace(token, frame.afterColon ? types : keywords);
1997
+ break;
1998
+ }
1999
+ }
2000
+ if ((frame.kind === "root" || frame.kind === "block-body") && prevText === "=") {
2001
+ replace(token, shapes);
2002
+ }
2003
+ if (frame.stmtHead === void 0) frame.stmtHead = token.text;
2004
+ prev = token;
2005
+ }
2006
+ return applyEdits(source, edits);
2007
+ }
2008
+ function parenFrame(frame, prev) {
2009
+ if (frame.kind === "binder-list") return "binder-pair";
2010
+ if (frame.kind === "paren" && !frame.binderSeen && prev !== void 0 && prev.text === frame.parenHead && (frame.parenHead === "let" || frame.parenHead === "fn" || frame.parenHead === "lambda")) {
2011
+ return "binder-list";
2012
+ }
2013
+ return "paren";
2014
+ }
2015
+ function braceFrame(frame, prev) {
2016
+ if (isExpression(frame.kind)) return "object";
2017
+ if (frame.kind === "block-fields" && prev !== void 0 && prev.text === "=") return "object";
2018
+ if (frame.refBody && frame.stmtHead === "config") return "object";
2019
+ if (frame.blockHead !== void 0 && EVENT_BLOCK_HEADS.has(frame.blockHead)) return "block-fields";
2020
+ if (frame.kind === "type-array") return "block-fields";
2021
+ if (frame.kind === "block-fields" && frame.afterColon) return "block-fields";
2022
+ const head = frame.stmtHead;
2023
+ return head !== void 0 && FIELD_BLOCK_HEADS.has(head) ? "block-fields" : "block-body";
2024
+ }
2025
+ function bracketFrame(frame, prev) {
2026
+ if (isExpression(frame.kind)) return "array";
2027
+ if (prev !== void 0 && prev.text === "=") return "array";
2028
+ if (frame.afterColon) return frame.kind === "block-fields" ? "type-array" : "array";
2029
+ return "mods";
2030
+ }
2031
+ function isExpression(kind) {
2032
+ return kind === "paren" || kind === "object" || kind === "array" || kind === "binder-list" || kind === "binder-pair";
2033
+ }
2034
+ function applyEdits(source, edits) {
2035
+ if (edits.length === 0) return source;
2036
+ edits.sort((a, b) => a.start - b.start);
2037
+ let out = "";
2038
+ let cursor = 0;
2039
+ for (const edit of edits) {
2040
+ if (edit.start < cursor) continue;
2041
+ out += source.slice(cursor, edit.start) + edit.text;
2042
+ cursor = edit.end;
2043
+ }
2044
+ return out + source.slice(cursor);
2045
+ }
2046
+ function localizeOrbValue(value, lang, options = {}) {
2047
+ if (lang === "en") return value;
2048
+ const orbKeys = forward(lang, ["orb"], ["orb"]);
2049
+ const types = forward(lang, ["types"], ["types"]);
2050
+ const heads = forward(lang, ["effects"], ["effects"], options.operators);
2051
+ const sigils = forward(lang, ["sigils"], ["sigils", "annotations"]);
2052
+ const walk = (node) => {
2053
+ if (Array.isArray(node)) {
2054
+ const items = node.map(walk);
2055
+ const head = items[0];
2056
+ if (typeof head === "string") {
2057
+ const native = heads.get(head);
2058
+ if (native !== void 0) items[0] = native;
2059
+ }
2060
+ return items;
2061
+ }
2062
+ if (node !== null && typeof node === "object") {
2063
+ const out = {};
2064
+ for (const [key, child] of Object.entries(node)) {
2065
+ const nativeKey = orbKeys.get(key) ?? key;
2066
+ let next = walk(child);
2067
+ if (key === "type" && typeof next === "string") {
2068
+ next = types.get(next) ?? next;
2069
+ }
2070
+ out[nativeKey] = next;
2071
+ }
2072
+ return out;
2073
+ }
2074
+ if (typeof node === "string" && node.startsWith("@")) {
2075
+ const rest = node.slice(1);
2076
+ const dot = rest.indexOf(".");
2077
+ const root = dot === -1 ? rest : rest.slice(0, dot);
2078
+ const native = sigils.get(root);
2079
+ if (native === void 0) return node;
2080
+ return dot === -1 ? `@${native}` : `@${native}${rest.slice(dot)}`;
2081
+ }
2082
+ return node;
2083
+ };
2084
+ return walk(value);
2085
+ }
2086
+
1606
2087
  // src/i18n/index.ts
1607
2088
  var LANGUAGE_CODES = ["en", "ar", "sl"];
1608
2089
  var I18N_SECTIONS = [
@@ -1905,6 +2386,6 @@ function reportIdenticalToEnglish(input) {
1905
2386
  return problems;
1906
2387
  }
1907
2388
 
1908
- export { I18N_SECTIONS, LANGUAGE_CODES, LOLO_FIRST_TOKEN_KEYWORDS, aliasMap, checkI18nCoverage, coreTables, getVocabulary, languageOfLoloFirstToken, languageOfOrbTopLevelKeys, parseI18nTables, parseOperatorTables, reportIdenticalToEnglish };
2389
+ export { I18N_SECTIONS, LANGUAGE_CODES, LOLO_FIRST_TOKEN_KEYWORDS, aliasMap, checkI18nCoverage, coreTables, getVocabulary, languageOfLoloFirstToken, languageOfOrbTopLevelKeys, lexLolo, localizeLoloSource, localizeMap, localizeOrbValue, parseI18nTables, parseOperatorTables, reportIdenticalToEnglish };
1909
2390
  //# sourceMappingURL=index.js.map
1910
2391
  //# sourceMappingURL=index.js.map