@fgv/ts-res 5.0.0-9 → 5.0.1-1

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 (384) hide show
  1. package/CHANGELOG.json +21 -0
  2. package/CHANGELOG.md +14 -1
  3. package/README.md +794 -137
  4. package/dist/ts-res.d.ts +2257 -268
  5. package/dist/tsdoc-metadata.json +1 -1
  6. package/eslint.config.js +16 -0
  7. package/lib/index.d.ts +2 -1
  8. package/lib/index.js +3 -1
  9. package/lib/packlets/bundle/bundleBuilder.js +7 -4
  10. package/lib/packlets/bundle/bundleLoader.js +1 -0
  11. package/lib/packlets/bundle/bundleUtils.js +14 -16
  12. package/lib/packlets/bundle/index.d.ts +3 -1
  13. package/lib/packlets/bundle/index.js +14 -3
  14. package/lib/packlets/common/convert.d.ts +15 -0
  15. package/lib/packlets/common/convert.js +16 -1
  16. package/lib/packlets/common/helpers/context.js +1 -0
  17. package/lib/packlets/common/helpers/resources.d.ts +7 -0
  18. package/lib/packlets/common/helpers/resources.js +13 -0
  19. package/lib/packlets/common/resources.d.ts +44 -1
  20. package/lib/packlets/common/validate/conditions.d.ts +17 -1
  21. package/lib/packlets/common/validate/conditions.js +32 -6
  22. package/lib/packlets/common/validate/regularExpressions.d.ts +4 -0
  23. package/lib/packlets/common/validate/regularExpressions.js +5 -1
  24. package/lib/packlets/common/validate/resources.d.ts +35 -1
  25. package/lib/packlets/common/validate/resources.js +55 -0
  26. package/lib/packlets/conditions/condition.js +1 -0
  27. package/lib/packlets/conditions/conditionSet.d.ts +9 -0
  28. package/lib/packlets/conditions/conditionSet.js +75 -1
  29. package/lib/packlets/config/configInitFactory.d.ts +217 -0
  30. package/lib/packlets/config/configInitFactory.js +302 -0
  31. package/lib/packlets/config/convert.d.ts +9 -0
  32. package/lib/packlets/config/convert.js +12 -1
  33. package/lib/packlets/config/index.d.ts +1 -0
  34. package/lib/packlets/config/index.js +1 -0
  35. package/lib/packlets/config/json.d.ts +1 -1
  36. package/lib/packlets/config/systemConfiguration.d.ts +16 -3
  37. package/lib/packlets/config/systemConfiguration.js +19 -40
  38. package/lib/packlets/import/fsItem.d.ts +2 -1
  39. package/lib/packlets/import/fsItem.js +9 -13
  40. package/lib/packlets/import/importManager.d.ts +2 -1
  41. package/lib/packlets/import/importers/jsonImporter.js +1 -0
  42. package/lib/packlets/import/importers/pathImporter.d.ts +2 -1
  43. package/lib/packlets/import/importers/pathImporter.js +2 -1
  44. package/lib/packlets/qualifier-types/config/convert.d.ts +22 -1
  45. package/lib/packlets/qualifier-types/config/convert.js +67 -2
  46. package/lib/packlets/qualifier-types/config/json.d.ts +24 -2
  47. package/lib/packlets/qualifier-types/config/json.js +11 -0
  48. package/lib/packlets/qualifier-types/convert.d.ts +1 -1
  49. package/lib/packlets/qualifier-types/helpers.d.ts +14 -5
  50. package/lib/packlets/qualifier-types/helpers.js +2 -2
  51. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +28 -2
  52. package/lib/packlets/qualifier-types/languageQualifierType.js +73 -0
  53. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +31 -5
  54. package/lib/packlets/qualifier-types/literalQualifierType.js +75 -0
  55. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +7 -11
  56. package/lib/packlets/qualifier-types/literalValueHierarchy.js +12 -1
  57. package/lib/packlets/qualifier-types/qualifierType.d.ts +31 -2
  58. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +31 -5
  59. package/lib/packlets/qualifier-types/territoryQualifierType.js +80 -0
  60. package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
  61. package/lib/packlets/resource-json/compiled/convert.js +2 -1
  62. package/lib/packlets/resource-json/compiled/json.d.ts +6 -2
  63. package/lib/packlets/resource-types/config/convert.d.ts +1 -1
  64. package/lib/packlets/resource-types/config/convert.js +3 -1
  65. package/lib/packlets/resource-types/config/json.d.ts +3 -1
  66. package/lib/packlets/resource-types/jsonResourceType.d.ts +10 -1
  67. package/lib/packlets/resource-types/jsonResourceType.js +7 -3
  68. package/lib/packlets/resource-types/resourceType.d.ts +100 -8
  69. package/lib/packlets/resource-types/resourceType.js +39 -3
  70. package/lib/packlets/resources/candidateReducer.js +3 -0
  71. package/lib/packlets/resources/candidateValue.d.ts +92 -0
  72. package/lib/packlets/resources/candidateValue.js +128 -0
  73. package/lib/packlets/resources/candidateValueCollector.d.ts +55 -0
  74. package/lib/packlets/resources/candidateValueCollector.js +96 -0
  75. package/lib/packlets/resources/common.d.ts +14 -0
  76. package/lib/packlets/resources/deltaGenerator.d.ts +189 -0
  77. package/lib/packlets/resources/deltaGenerator.js +344 -0
  78. package/lib/packlets/resources/index.d.ts +3 -0
  79. package/lib/packlets/resources/index.js +3 -0
  80. package/lib/packlets/resources/resource.d.ts +6 -6
  81. package/lib/packlets/resources/resource.js +5 -10
  82. package/lib/packlets/resources/resourceBuilder.d.ts +6 -0
  83. package/lib/packlets/resources/resourceBuilder.js +4 -1
  84. package/lib/packlets/resources/resourceCandidate.d.ts +15 -2
  85. package/lib/packlets/resources/resourceCandidate.js +17 -5
  86. package/lib/packlets/resources/resourceManagerBuilder.d.ts +131 -10
  87. package/lib/packlets/resources/resourceManagerBuilder.js +289 -45
  88. package/lib/packlets/runtime/compiledResourceCollection.d.ts +27 -11
  89. package/lib/packlets/runtime/compiledResourceCollection.js +71 -28
  90. package/lib/packlets/runtime/conditionSetResolutionResult.js +3 -0
  91. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +53 -3
  92. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +82 -37
  93. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +49 -77
  94. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +23 -2
  95. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +53 -31
  96. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +4 -4
  97. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +2 -2
  98. package/lib/packlets/runtime/iResourceManager.d.ts +17 -5
  99. package/lib/packlets/runtime/index.d.ts +1 -0
  100. package/lib/packlets/runtime/index.js +1 -0
  101. package/lib/packlets/runtime/resource-tree/common.d.ts +1 -1
  102. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
  103. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
  104. package/lib/packlets/runtime/resourceResolver.d.ts +43 -1
  105. package/lib/packlets/runtime/resourceResolver.js +56 -28
  106. package/lib/packlets/runtime/resourceTreeResolver.d.ts +152 -0
  107. package/lib/packlets/runtime/resourceTreeResolver.js +222 -0
  108. package/lib/packlets/runtime/validate.js +1 -0
  109. package/lib/packlets/zip-archive/convert.d.ts +52 -0
  110. package/lib/packlets/zip-archive/convert.js +103 -0
  111. package/lib/packlets/zip-archive/index.d.ts +23 -0
  112. package/lib/packlets/zip-archive/index.js +95 -0
  113. package/lib/packlets/zip-archive/json.d.ts +64 -0
  114. package/lib/packlets/zip-archive/json.js +24 -0
  115. package/lib/packlets/zip-archive/types.d.ts +98 -0
  116. package/lib/packlets/zip-archive/types.js +39 -0
  117. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts +35 -0
  118. package/lib/packlets/zip-archive/zipArchiveCreator.js +195 -0
  119. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts +70 -0
  120. package/lib/packlets/zip-archive/zipArchiveFormat.js +184 -0
  121. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts +70 -0
  122. package/lib/packlets/zip-archive/zipArchiveLoader.js +286 -0
  123. package/package.json +26 -32
  124. package/CLAUDE.md +0 -186
  125. package/EXAMPLE_INIT_PARAMS.md +0 -88
  126. package/PROGRESS_SUMMARY.md +0 -48
  127. package/lib/index.d.ts.map +0 -1
  128. package/lib/index.js.map +0 -1
  129. package/lib/packlets/bundle/bundleBuilder.d.ts.map +0 -1
  130. package/lib/packlets/bundle/bundleBuilder.js.map +0 -1
  131. package/lib/packlets/bundle/bundleLoader.d.ts.map +0 -1
  132. package/lib/packlets/bundle/bundleLoader.js.map +0 -1
  133. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +0 -1
  134. package/lib/packlets/bundle/bundleNormalizer.js.map +0 -1
  135. package/lib/packlets/bundle/bundleUtils.d.ts.map +0 -1
  136. package/lib/packlets/bundle/bundleUtils.js.map +0 -1
  137. package/lib/packlets/bundle/convert.d.ts.map +0 -1
  138. package/lib/packlets/bundle/convert.js.map +0 -1
  139. package/lib/packlets/bundle/index.d.ts.map +0 -1
  140. package/lib/packlets/bundle/index.js.map +0 -1
  141. package/lib/packlets/bundle/model.d.ts.map +0 -1
  142. package/lib/packlets/bundle/model.js.map +0 -1
  143. package/lib/packlets/common/conditions.d.ts.map +0 -1
  144. package/lib/packlets/common/conditions.js.map +0 -1
  145. package/lib/packlets/common/convert.d.ts.map +0 -1
  146. package/lib/packlets/common/convert.js.map +0 -1
  147. package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
  148. package/lib/packlets/common/helpers/conditions.js.map +0 -1
  149. package/lib/packlets/common/helpers/context.d.ts.map +0 -1
  150. package/lib/packlets/common/helpers/context.js.map +0 -1
  151. package/lib/packlets/common/helpers/index.d.ts.map +0 -1
  152. package/lib/packlets/common/helpers/index.js.map +0 -1
  153. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
  154. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
  155. package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
  156. package/lib/packlets/common/helpers/resources.js.map +0 -1
  157. package/lib/packlets/common/index.d.ts.map +0 -1
  158. package/lib/packlets/common/index.js.map +0 -1
  159. package/lib/packlets/common/resources.d.ts.map +0 -1
  160. package/lib/packlets/common/resources.js.map +0 -1
  161. package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
  162. package/lib/packlets/common/validate/conditions.js.map +0 -1
  163. package/lib/packlets/common/validate/index.d.ts.map +0 -1
  164. package/lib/packlets/common/validate/index.js.map +0 -1
  165. package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
  166. package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
  167. package/lib/packlets/common/validate/resources.d.ts.map +0 -1
  168. package/lib/packlets/common/validate/resources.js.map +0 -1
  169. package/lib/packlets/conditions/condition.d.ts.map +0 -1
  170. package/lib/packlets/conditions/condition.js.map +0 -1
  171. package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
  172. package/lib/packlets/conditions/conditionCollector.js.map +0 -1
  173. package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
  174. package/lib/packlets/conditions/conditionDecls.js.map +0 -1
  175. package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
  176. package/lib/packlets/conditions/conditionSet.js.map +0 -1
  177. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
  178. package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
  179. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
  180. package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
  181. package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
  182. package/lib/packlets/conditions/conditionToken.js.map +0 -1
  183. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
  184. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
  185. package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
  186. package/lib/packlets/conditions/convert/decls.js.map +0 -1
  187. package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
  188. package/lib/packlets/conditions/convert/index.js.map +0 -1
  189. package/lib/packlets/conditions/index.d.ts.map +0 -1
  190. package/lib/packlets/conditions/index.js.map +0 -1
  191. package/lib/packlets/config/common.d.ts.map +0 -1
  192. package/lib/packlets/config/common.js.map +0 -1
  193. package/lib/packlets/config/convert.d.ts.map +0 -1
  194. package/lib/packlets/config/convert.js.map +0 -1
  195. package/lib/packlets/config/index.d.ts.map +0 -1
  196. package/lib/packlets/config/index.js.map +0 -1
  197. package/lib/packlets/config/json.d.ts.map +0 -1
  198. package/lib/packlets/config/json.js.map +0 -1
  199. package/lib/packlets/config/predefined/default.d.ts.map +0 -1
  200. package/lib/packlets/config/predefined/default.js.map +0 -1
  201. package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
  202. package/lib/packlets/config/predefined/extended.js.map +0 -1
  203. package/lib/packlets/config/predefined/index.d.ts.map +0 -1
  204. package/lib/packlets/config/predefined/index.js.map +0 -1
  205. package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
  206. package/lib/packlets/config/systemConfiguration.js.map +0 -1
  207. package/lib/packlets/context/contextDecls.d.ts.map +0 -1
  208. package/lib/packlets/context/contextDecls.js.map +0 -1
  209. package/lib/packlets/context/contextToken.d.ts.map +0 -1
  210. package/lib/packlets/context/contextToken.js.map +0 -1
  211. package/lib/packlets/context/convert/decls.d.ts.map +0 -1
  212. package/lib/packlets/context/convert/decls.js.map +0 -1
  213. package/lib/packlets/context/convert/index.d.ts.map +0 -1
  214. package/lib/packlets/context/convert/index.js.map +0 -1
  215. package/lib/packlets/context/index.d.ts.map +0 -1
  216. package/lib/packlets/context/index.js.map +0 -1
  217. package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
  218. package/lib/packlets/decisions/abstractDecision.js.map +0 -1
  219. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
  220. package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
  221. package/lib/packlets/decisions/candidate.d.ts.map +0 -1
  222. package/lib/packlets/decisions/candidate.js.map +0 -1
  223. package/lib/packlets/decisions/common.d.ts.map +0 -1
  224. package/lib/packlets/decisions/common.js.map +0 -1
  225. package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
  226. package/lib/packlets/decisions/concreteDecision.js.map +0 -1
  227. package/lib/packlets/decisions/decision.d.ts.map +0 -1
  228. package/lib/packlets/decisions/decision.js.map +0 -1
  229. package/lib/packlets/decisions/index.d.ts.map +0 -1
  230. package/lib/packlets/decisions/index.js.map +0 -1
  231. package/lib/packlets/import/fsItem.d.ts.map +0 -1
  232. package/lib/packlets/import/fsItem.js.map +0 -1
  233. package/lib/packlets/import/importContext.d.ts.map +0 -1
  234. package/lib/packlets/import/importContext.js.map +0 -1
  235. package/lib/packlets/import/importManager.d.ts.map +0 -1
  236. package/lib/packlets/import/importManager.js.map +0 -1
  237. package/lib/packlets/import/importable.d.ts.map +0 -1
  238. package/lib/packlets/import/importable.js.map +0 -1
  239. package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
  240. package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
  241. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
  242. package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
  243. package/lib/packlets/import/importers/importer.d.ts.map +0 -1
  244. package/lib/packlets/import/importers/importer.js.map +0 -1
  245. package/lib/packlets/import/importers/index.d.ts.map +0 -1
  246. package/lib/packlets/import/importers/index.js.map +0 -1
  247. package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
  248. package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
  249. package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
  250. package/lib/packlets/import/importers/pathImporter.js.map +0 -1
  251. package/lib/packlets/import/index.d.ts.map +0 -1
  252. package/lib/packlets/import/index.js.map +0 -1
  253. package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
  254. package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
  255. package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
  256. package/lib/packlets/qualifier-types/config/index.js.map +0 -1
  257. package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
  258. package/lib/packlets/qualifier-types/config/json.js.map +0 -1
  259. package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
  260. package/lib/packlets/qualifier-types/convert.js.map +0 -1
  261. package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
  262. package/lib/packlets/qualifier-types/helpers.js.map +0 -1
  263. package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
  264. package/lib/packlets/qualifier-types/index.js.map +0 -1
  265. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
  266. package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
  267. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
  268. package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
  269. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
  270. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
  271. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
  272. package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
  273. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
  274. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
  275. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
  276. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
  277. package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
  278. package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
  279. package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
  280. package/lib/packlets/qualifiers/convert/index.js.map +0 -1
  281. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
  282. package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
  283. package/lib/packlets/qualifiers/index.d.ts.map +0 -1
  284. package/lib/packlets/qualifiers/index.js.map +0 -1
  285. package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
  286. package/lib/packlets/qualifiers/qualifier.js.map +0 -1
  287. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
  288. package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
  289. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
  290. package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
  291. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
  292. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
  293. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
  294. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
  295. package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
  296. package/lib/packlets/resource-json/compiled/common.js.map +0 -1
  297. package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
  298. package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
  299. package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
  300. package/lib/packlets/resource-json/compiled/index.js.map +0 -1
  301. package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
  302. package/lib/packlets/resource-json/compiled/json.js.map +0 -1
  303. package/lib/packlets/resource-json/convert.d.ts.map +0 -1
  304. package/lib/packlets/resource-json/convert.js.map +0 -1
  305. package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
  306. package/lib/packlets/resource-json/helpers.js.map +0 -1
  307. package/lib/packlets/resource-json/index.d.ts.map +0 -1
  308. package/lib/packlets/resource-json/index.js.map +0 -1
  309. package/lib/packlets/resource-json/json.d.ts.map +0 -1
  310. package/lib/packlets/resource-json/json.js.map +0 -1
  311. package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
  312. package/lib/packlets/resource-json/normalized.js.map +0 -1
  313. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
  314. package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
  315. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
  316. package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
  317. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
  318. package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
  319. package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
  320. package/lib/packlets/resource-types/config/convert.js.map +0 -1
  321. package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
  322. package/lib/packlets/resource-types/config/index.js.map +0 -1
  323. package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
  324. package/lib/packlets/resource-types/config/json.js.map +0 -1
  325. package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
  326. package/lib/packlets/resource-types/helpers.js.map +0 -1
  327. package/lib/packlets/resource-types/index.d.ts.map +0 -1
  328. package/lib/packlets/resource-types/index.js.map +0 -1
  329. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
  330. package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
  331. package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
  332. package/lib/packlets/resource-types/resourceType.js.map +0 -1
  333. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
  334. package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
  335. package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
  336. package/lib/packlets/resources/candidateReducer.js.map +0 -1
  337. package/lib/packlets/resources/common.d.ts.map +0 -1
  338. package/lib/packlets/resources/common.js.map +0 -1
  339. package/lib/packlets/resources/index.d.ts.map +0 -1
  340. package/lib/packlets/resources/index.js.map +0 -1
  341. package/lib/packlets/resources/resource.d.ts.map +0 -1
  342. package/lib/packlets/resources/resource.js.map +0 -1
  343. package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
  344. package/lib/packlets/resources/resourceBuilder.js.map +0 -1
  345. package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
  346. package/lib/packlets/resources/resourceCandidate.js.map +0 -1
  347. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
  348. package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
  349. package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
  350. package/lib/packlets/runtime/cacheListener.js.map +0 -1
  351. package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
  352. package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
  353. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
  354. package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
  355. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
  356. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
  357. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
  358. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
  359. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
  360. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
  361. package/lib/packlets/runtime/context/index.d.ts.map +0 -1
  362. package/lib/packlets/runtime/context/index.js.map +0 -1
  363. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
  364. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
  365. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
  366. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
  367. package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
  368. package/lib/packlets/runtime/iResourceManager.js.map +0 -1
  369. package/lib/packlets/runtime/index.d.ts.map +0 -1
  370. package/lib/packlets/runtime/index.js.map +0 -1
  371. package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
  372. package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
  373. package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
  374. package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
  375. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
  376. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
  377. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
  378. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
  379. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
  380. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
  381. package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
  382. package/lib/packlets/runtime/resourceResolver.js.map +0 -1
  383. package/lib/packlets/runtime/validate.d.ts.map +0 -1
  384. package/lib/packlets/runtime/validate.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"pathImporter.d.ts","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAEL,cAAc,EAEd,MAAM,EAEN,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,2BAA2B,CAAC;IACxC,IAAI,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,qBAAa,YAAa,YAAW,SAAS;IAC5C;;OAEG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;OAEG;IACH,SAAgB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAExC;;OAEG;IACH,SAAgB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAY;IAExD;;;OAGG;IACH,SAAgB,eAAe,EAAE,MAAM,EAAE,CAAC;IAE1C;;;OAGG;IACH,SAAS,aAAa,MAAM,EAAE,yBAAyB;IAMvD;;;;OAIG;WACW,MAAM,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM,CAAC,YAAY,CAAC;IAI7E;;OAEG;IACI,MAAM,CACX,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,sBAAsB,GAChC,cAAc,CAAC,WAAW,EAAE,EAAE,oBAAoB,CAAC;IAqBtD;;;;OAIG;IACH,SAAS,CAAC,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,cAAc,CAAC,MAAM,EAAE,kBAAkB,CAAC;CASxG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pathImporter.js","sourceRoot":"","sources":["../../../../src/packlets/import/importers/pathImporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAOuB;AAKvB,sCAAuD;AAYvD;;;;GAIG;AACH,MAAa,YAAY;IAsBvB;;;OAGG;IACH,YAAsB,MAAiC;;QAfvD;;WAEG;QACa,UAAK,GAA0B,CAAC,MAAM,CAAC,CAAC;QAatD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,MAAA,MAAM,CAAC,IAAI,mCAAI,mBAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,CAAC;QAC9D,IAAI,CAAC,eAAe,GAAG,MAAA,MAAM,CAAC,eAAe,mCAAI,EAAE,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,MAAiC;QACpD,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACI,MAAM,CACX,IAAiB,EACjB,SAAiC;QAEjC,MAAM,EACJ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,aAAa,EACtB,GAAG,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,IAAA,yBAAc,EAAC,cAAc,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC5F,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;YACxF,OAAO,IAAA,4BAAiB,EAAC,EAAE,EAAE,WAAW,CAAC,CAAC;QAC5C,CAAC;QAED,8EAA8E;QAC9E,mCAAmC;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,OAAO,IAAA,4BAAiB,EAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;IACrF,CAAC;IAED;;;;OAIG;IACO,8BAA8B,CAAC,IAAiB;QACxD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACzB,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACpD,OAAO,eAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,IAAA,yBAAc,EAAC,0DAA0D,EAAE,QAAQ,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,IAAA,yBAAc,EAAC,GAAG,IAAI,CAAC,IAAI,8CAA8C,EAAE,SAAS,CAAC,CAAC;IAC/F,CAAC;CACF;AAlFD,oCAkFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n captureResult,\n DetailedResult,\n failWithDetail,\n Result,\n succeedWithDetail,\n FileTree\n} from '@fgv/ts-utils';\nimport { ResourceManagerBuilder } from '../../resources';\nimport { IImportable } from '../importable';\nimport { IImporter, ImporterResultDetail } from './importer';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport { FsItem, FsItemResultDetail } from '../fsItem';\n\n/**\n * Parameters for creating a {@link Import.Importers.PathImporter | PathImporter}.\n * @public\n */\nexport interface IPathImporterCreateParams {\n qualifiers: IReadOnlyQualifierCollector;\n tree?: FileTree.FileTree;\n ignoreFileTypes?: string[];\n}\n\n/**\n * {@link Import.Importers.IImporter | Importer} implementation which imports resources from a `FileTree`\n * given a path.\n * @public\n */\nexport class PathImporter implements IImporter {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use for this importer.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * The `FileTree` from which resources will be imported.\n */\n public readonly tree: FileTree.FileTree;\n\n /**\n * The types of {@link Import.IImportable | importables} that this importer can handle.\n */\n public readonly types: ReadonlyArray<string> = ['path'];\n\n /**\n * The types of files to ignore when importing. Any file not ignored is converted\n * to an {@link Import.IImportableFsItem | IImportableFsItem}.\n */\n public readonly ignoreFileTypes: string[];\n\n /**\n * Protected constructor for the {@link Import.Importers.PathImporter | PathImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.PathImporter | PathImporter}.\n */\n protected constructor(params: IPathImporterCreateParams) {\n this.qualifiers = params.qualifiers;\n this.tree = params.tree ?? FileTree.forFilesystem().orThrow();\n this.ignoreFileTypes = params.ignoreFileTypes ?? [];\n }\n\n /**\n * Creates a new {@link Import.Importers.PathImporter | PathImporter}.\n * @param params - Parameters for creating the {@link Import.Importers.PathImporter | dirPathImporter}.\n * @returns `Success` with the new `PathImporter` if successful, `Failure` with an error message if not.\n */\n public static create(params: IPathImporterCreateParams): Result<PathImporter> {\n return captureResult(() => new PathImporter(params));\n }\n\n /**\n * {@inheritdoc Import.Importers.IImporter.import}\n */\n public import(\n item: IImportable,\n __manager: ResourceManagerBuilder\n ): DetailedResult<IImportable[], ImporterResultDetail> {\n const {\n value: fsItem,\n message: getTreeMessage,\n detail: getTreeDetail\n } = this._getFileTreeItemFromImportable(item);\n if (getTreeMessage !== undefined) {\n return failWithDetail(getTreeMessage, getTreeDetail === 'skipped' ? 'skipped' : 'failed');\n }\n\n if (fsItem.item.type === 'file' && this.ignoreFileTypes.includes(fsItem.item.extension)) {\n return succeedWithDetail([], 'processed');\n }\n\n // extracted characteristics are in the fsItem so add them to the context when\n // that is imported instead of now.\n const context = item.context;\n\n return succeedWithDetail([{ type: 'fsItem', item: fsItem, context }], 'processed');\n }\n\n /**\n * Gets an {@link Import.FsItem | FsItem} from an {@link Import.IImportable | importable}.\n * @param item - The importable to convert.\n * @returns `Success` containing the `FsItem` if successful, `Failure` with an error message if not.\n */\n protected _getFileTreeItemFromImportable(item: IImportable): DetailedResult<FsItem, FsItemResultDetail> {\n if (item.type === 'path') {\n if ('path' in item && typeof item.path === 'string') {\n return FsItem.createForPath(item.path, this.qualifiers, this.tree);\n }\n return failWithDetail(`malformed path importable does not contain a string path`, 'failed');\n }\n return failWithDetail(`${item.type}: invalid importable type for a PathImporter`, 'skipped');\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/import/index.ts"],"names":[],"mappings":"AAsBA,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAEhC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/import/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAgC;AAChC,+CAA6B;AAC7B,2CAAyB;AACzB,kDAAgC;AAEhC,uDAAyC;AAChC,8BAAS","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './importContext';\nexport * from './importable';\nexport * from './fsItem';\nexport * from './importManager';\n\nimport * as Importers from './importers';\nexport { Importers };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/convert.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,sFAEtC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,uFAIvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,qFAKrC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,4FAK1C,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,6FAK3C,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,2FAKzC,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,8EAOrC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,2CAA2C;AAE3C,4CAA2C;AAG3C;;;;GAIG;AACU,QAAA,2BAA2B,GAAG,qBAAU,CAAC,YAAY,CAAqC;IACrG,gBAAgB,EAAE,qBAAU,CAAC,OAAO,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEH;;;;GAIG;AACU,QAAA,4BAA4B,GAAG,qBAAU,CAAC,YAAY,CAAsC;IACvG,gBAAgB,EAAE,qBAAU,CAAC,OAAO;IACpC,eAAe,EAAE,qBAAU,CAAC,OAAO,CAAC,QAAQ,EAAE;IAC9C,kBAAkB,EAAE,qBAAU,CAAC,OAAO,CAAC,qBAAU,CAAC,MAAM,CAAC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kC;IAC7C,OAAO,EAAE,wCAAgC;CAC1C,CACF,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* eslint-disable @rushstack/typedef-var */\n\nimport { Converters } from '@fgv/ts-utils';\nimport * as Model from './json';\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.\n * @public\n */\nexport const languageQualifierTypeConfig = Converters.strictObject<Model.ILanguageQualifierTypeConfig>({\n allowContextList: Converters.boolean.optional()\n});\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.\n * @public\n */\nexport const territoryQualifierTypeConfig = Converters.strictObject<Model.ITerritoryQualifierTypeConfig>({\n allowContextList: Converters.boolean,\n acceptLowercase: Converters.boolean.optional(),\n allowedTerritories: Converters.arrayOf(Converters.string).optional()\n});\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.\n * @public\n */\nexport const literalQualifierTypeConfig = Converters.strictObject<Model.ILiteralQualifierTypeConfig>({\n allowContextList: Converters.boolean.optional(),\n caseSensitive: Converters.boolean.optional(),\n enumeratedValues: Converters.arrayOf(Converters.string).optional(),\n hierarchy: Converters.recordOf(Converters.string).optional()\n});\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.\n * @public\n */\nexport const systemLanguageQualifierTypeConfig =\n Converters.strictObject<Model.ISystemLanguageQualifierTypeConfig>({\n name: Converters.string,\n systemType: Converters.literal('language'),\n configuration: languageQualifierTypeConfig.optional()\n });\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.\n * @public\n */\nexport const systemTerritoryQualifierTypeConfig =\n Converters.strictObject<Model.ISystemTerritoryQualifierTypeConfig>({\n name: Converters.string,\n systemType: Converters.literal('territory'),\n configuration: territoryQualifierTypeConfig.optional()\n });\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.\n * @public\n */\nexport const systemLiteralQualifierTypeConfig =\n Converters.strictObject<Model.ISystemLiteralQualifierTypeConfig>({\n name: Converters.string,\n systemType: Converters.literal('literal'),\n configuration: literalQualifierTypeConfig.optional()\n });\n\n/**\n * A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.\n * @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.\n * @public\n */\nexport const systemQualifierTypeConfig = Converters.discriminatedObject<Model.ISystemQualifierTypeConfig>(\n 'systemType',\n {\n language: systemLanguageQualifierTypeConfig,\n territory: systemTerritoryQualifierTypeConfig,\n literal: systemLiteralQualifierTypeConfig\n }\n);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAI5B,0BAAO;AAFhB,yCAAuB","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './json';\n\nexport { Convert };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/json.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,UAAU;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE9B;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,kCACf,SAAQ,oBAAoB,CAAC,4BAA4B,CAAC;IAC1D,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,mCACf,SAAQ,oBAAoB,CAAC,6BAA6B,CAAC;IAC3D,UAAU,EAAE,WAAW,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAkC,SAAQ,oBAAoB,CAAC,2BAA2B,CAAC;IAC1G,UAAU,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAClC,kCAAkC,GAClC,mCAAmC,GACnC,iCAAiC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../../src/packlets/qualifier-types/config/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { JsonObject } from '@fgv/ts-json-base';\nimport { LiteralValueHierarchyDecl } from '../literalValueHierarchy';\n\n/**\n * Templated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.\n * @public\n */\nexport interface IQualifierTypeConfig<T = JsonObject> {\n name: string;\n systemType: string;\n configuration?: T;\n}\n\n/**\n * Configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.\n * @public\n */\nexport interface ILanguageQualifierTypeConfig {\n allowContextList?: boolean;\n}\n\n/**\n * Configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.\n * @public\n */\nexport interface ITerritoryQualifierTypeConfig {\n allowContextList?: boolean;\n\n acceptLowercase?: boolean;\n allowedTerritories?: string[];\n\n /**\n * Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}\n * of territory values to use for matching. If not provided, no hierarchy will be used.\n */\n hierarchy?: LiteralValueHierarchyDecl<string>;\n}\n\n/**\n * Configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.\n * @public\n */\nexport interface ILiteralQualifierTypeConfig {\n allowContextList?: boolean;\n caseSensitive?: boolean;\n enumeratedValues?: string[];\n hierarchy?: LiteralValueHierarchyDecl<string>;\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.LanguageQualifierType | language qualifier type} configuration.\n * @public\n */\nexport interface ISystemLanguageQualifierTypeConfig\n extends IQualifierTypeConfig<ILanguageQualifierTypeConfig> {\n systemType: 'language';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.TerritoryQualifierType | territory qualifier type} configuration.\n * @public\n */\nexport interface ISystemTerritoryQualifierTypeConfig\n extends IQualifierTypeConfig<ITerritoryQualifierTypeConfig> {\n systemType: 'territory';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.LiteralQualifierType | literal qualifier type} configuration.\n * @public\n */\nexport interface ISystemLiteralQualifierTypeConfig extends IQualifierTypeConfig<ILiteralQualifierTypeConfig> {\n systemType: 'literal';\n}\n\n/**\n * Discriminated configuration for {@link QualifierTypes.QualifierType | qualifier type} configuration.\n * @public\n */\nexport type ISystemQualifierTypeConfig =\n | ISystemLanguageQualifierTypeConfig\n | ISystemTerritoryQualifierTypeConfig\n | ISystemLiteralQualifierTypeConfig;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/convert.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAA4B,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,8BAA8B,CAAC;CAChD;AAED;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,wDAgBzB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,CAAC,SAAS,MAAM,EAChE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC,GAC3B,SAAS,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC,CAOlD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA+CH,8EASC;AAtDD,4CAAoE;AAcpE;;;;;GAKG;AACH,kDAAkD;AACrC,QAAA,aAAa,GAAG,qBAAU,CAAC,OAAO,CAC7C,CACE,IAAa,EACb,MAA8D,EAC9D,OAAsC,EACf,EAAE;IACzB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAA,eAAI,EAAC,4CAA4C,CAAC,CAAC;IAC5D,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,IAAA,eAAI,EAAC,qDAAqD,CAAC,CAAC;AACrE,CAAC,CACF,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,iCAAiC,CAC/C,cAA4B;IAE5B,OAAO,qBAAU,CAAC,MAAM,CAAwC;QAC9D,MAAM,EAAE,qBAAU,CAAC,OAAO,CAAC,cAAc,CAAC;QAC1C,SAAS,EAAE,qBAAU,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC7C,YAAY,EAAE,cAAc;SAC7B,CAAC;KACH,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converter, Converters, Result, fail } from '@fgv/ts-utils';\nimport { QualifierType } from './qualifierType';\nimport { ReadOnlyQualifierTypeCollector } from './qualifierTypeCollector';\nimport { ILiteralValueHierarchyCreateParams } from './literalValueHierarchy';\n\n/**\n * Context necessary to convert a qualifier name or number to an instantiated\n * {@link QualifierTypes.QualifierType}.\n * @public\n */\nexport interface IQualifierTypeConvertContext {\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n}\n\n/**\n * Converter for {@link QualifierTypes.QualifierType | QualifierType} objects,\n * retrieves a {@link QualifierTypes.QualifierType | QualifierType} by name or\n * index from a supplied {@link QualifierTypes.Convert.IQualifierTypeConvertContext | conversion context}.\n * @public\n */\n// eslint-disable-next-line @rushstack/typedef-var\nexport const qualifierType = Converters.generic<QualifierType, IQualifierTypeConvertContext>(\n (\n from: unknown,\n __self: Converter<QualifierType, IQualifierTypeConvertContext>,\n context?: IQualifierTypeConvertContext\n ): Result<QualifierType> => {\n if (!context) {\n return fail('qualifierType converter requires a context');\n }\n if (typeof from === 'string') {\n return context.qualifierTypes.validating.get(from);\n } else if (typeof from === 'number') {\n return context.qualifierTypes.getAt(from);\n }\n return fail('qualifierType converter requires a string or number');\n }\n);\n\n/**\n * Gets a converter for {@link QualifierTypes.ILiteralValueHierarchyCreateParams | ILiteralValueHierarchyCreateParams}\n * objects with values validated by a supplied value converter.\n * @param valueConverter - Converter for the literal value type.\n * @public\n */\nexport function literalValueHierarchyCreateParams<T extends string>(\n valueConverter: Converter<T>\n): Converter<ILiteralValueHierarchyCreateParams<T>> {\n return Converters.object<ILiteralValueHierarchyCreateParams<T>>({\n values: Converters.arrayOf(valueConverter),\n hierarchy: Converters.recordOf(valueConverter, {\n keyConverter: valueConverter\n })\n });\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/helpers.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAQ,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,CAAC,oBAAoB,CAAC,UAAU,CAAC,GAClD,MAAM,CAAC,aAAa,CAAC,CAyBvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,MAAM,CAAC,0BAA0B,GAC5C,MAAM,CAAC,aAAa,CAAC,CAYvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBH,sEA2BC;AAYD,kFAcC;AAvED,4CAA6C;AAC7C,iDAAmC;AAEnC,mEAAgE;AAChE,qEAAkE;AAClE,iEAA8D;AAG9D;;;;;;;;;GASG;AACH,SAAgB,6BAA6B,CAC3C,UAAmD;;IAEnD,yCAAyC;IACzC,MAAM,WAAW,GAAG,MAAA,UAAU,CAAC,aAAa,mCAAI,EAAE,CAAC;IACnD,QAAQ,UAAU,CAAC,UAAU,EAAE,CAAC;QAC9B,KAAK,UAAU;YACb,OAAO,MAAM,CAAC,OAAO,CAAC,2BAA2B;iBAC9C,OAAO,CAAC,WAAW,CAAC;iBACpB,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE,CAC3B,6CAAqB,CAAC,gBAAgB,iCAAM,UAAU,KAAE,aAAa,IAAG,CACzE,CAAC;QACN,KAAK,WAAW;YACd,OAAO,MAAM,CAAC,OAAO,CAAC,4BAA4B;iBAC/C,OAAO,CAAC,WAAW,CAAC;iBACpB,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE,CAC3B,+CAAsB,CAAC,gBAAgB,iCAAM,UAAU,KAAE,aAAa,IAAG,CAC1E,CAAC;QACN,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,OAAO,CAAC,0BAA0B;iBAC7C,OAAO,CAAC,WAAW,CAAC;iBACpB,SAAS,CAAC,CAAC,aAAa,EAAE,EAAE,CAC3B,2CAAoB,CAAC,gBAAgB,iCAAM,UAAU,KAAE,aAAa,IAAG,CACxE,CAAC;QACN;YACE,OAAO,IAAA,eAAI,EAAC,2BAA2B,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,mCAAmC,CACjD,UAA6C;IAE7C,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;IAClC,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,UAAU;YACb,OAAO,6CAAqB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC5D,KAAK,WAAW;YACd,OAAO,+CAAsB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC7D,KAAK,SAAS;YACZ,OAAO,2CAAoB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC3D;YACE,OAAO,IAAA,eAAI,EAAC,GAAG,UAAU,kCAAkC,CAAC,CAAC;IACjE,CAAC;AACH,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { fail, Result } from '@fgv/ts-utils';\nimport * as Config from './config';\nimport { QualifierType } from './qualifierType';\nimport { LanguageQualifierType } from './languageQualifierType';\nimport { TerritoryQualifierType } from './territoryQualifierType';\nimport { LiteralQualifierType } from './literalQualifierType';\nimport { JsonObject } from '@fgv/ts-json-base';\n\n/**\n * Creates a {@link QualifierTypes.QualifierType | QualifierType} from a configuration object.\n * This factory function determines the appropriate qualifier type based on the systemType\n * and delegates to the appropriate type-specific createFromConfig method.\n * @param typeConfig - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object}\n * containing the name, systemType, and optional type-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.QualifierType | QualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createQualifierTypeFromConfig(\n typeConfig: Config.IQualifierTypeConfig<JsonObject>\n): Result<QualifierType> {\n /* c8 ignore next 1 - defense in depth */\n const childConfig = typeConfig.configuration ?? {};\n switch (typeConfig.systemType) {\n case 'language':\n return Config.Convert.languageQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n LanguageQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n case 'territory':\n return Config.Convert.territoryQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n TerritoryQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n case 'literal':\n return Config.Convert.literalQualifierTypeConfig\n .convert(childConfig)\n .onSuccess((configuration) =>\n LiteralQualifierType.createFromConfig({ ...typeConfig, configuration })\n );\n default:\n return fail(`Unknown qualifier type: ${typeConfig.systemType}`);\n }\n}\n\n/**\n * Creates a {@link QualifierTypes.QualifierType | QualifierType} from a system configuration object.\n * This factory function determines the appropriate qualifier type based on the systemType\n * and delegates to the appropriate type-specific createFromConfig method.\n * @param typeConfig - The {@link QualifierTypes.Config.ISystemQualifierTypeConfig | configuration object}\n * containing the name, systemType, and optional type-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.QualifierType | QualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function createQualifierTypeFromSystemConfig(\n typeConfig: Config.ISystemQualifierTypeConfig\n): Result<QualifierType> {\n const { systemType } = typeConfig;\n switch (systemType) {\n case 'language':\n return LanguageQualifierType.createFromConfig(typeConfig);\n case 'territory':\n return TerritoryQualifierType.createFromConfig(typeConfig);\n case 'literal':\n return LiteralQualifierType.createFromConfig(typeConfig);\n default:\n return fail(`${systemType}: Unknown system qualifier type.`);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAmC;AAW1B,wBAAM;AAVf,mDAAqC;AAUpB,0BAAO;AARxB,kDAAgC;AAChC,0DAAwC;AACxC,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,2DAAyC;AACzC,4CAA0B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Config from './config';\nimport * as Convert from './convert';\n\nexport * from './qualifierType';\nexport * from './languageQualifierType';\nexport * from './literalQualifierType';\nexport * from './literalValueHierarchy';\nexport * from './territoryQualifierType';\nexport * from './qualifierTypeCollector';\nexport * from './helpers';\n\nexport { Config, Convert };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"languageQualifierType.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/languageQualifierType.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAA0B,MAAM,eAAe,CAAC;AAE/D,OAAO,EACL,iBAAiB,EAGjB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EAEpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAGnC;;;;GAIG;AACH,MAAM,WAAW,kCAAmC,SAAQ,OAAO,CAAC,0BAA0B,CAAC;IAC7F;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;IACtD;;;;;;OAMG;IACH,SAAS,aAAa,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,kCAAkC;IAa3F;;;;;;OAMG;WACW,MAAM,CAAC,MAAM,CAAC,EAAE,kCAAkC,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAMhG;;;;;;;OAOG;WACW,gBAAgB,CAC5B,MAAM,EAAE,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,4BAA4B,CAAC,GACvE,MAAM,CAAC,qBAAqB,CAAC;IAOhC;;OAEG;IACI,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,uBAAuB;IAM7E;;;;;;;OAOG;IACH,SAAS,CAAC,SAAS,CACjB,SAAS,EAAE,uBAAuB,EAClC,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,iBAAiB,GAC1B,mBAAmB;CASvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"languageQualifierType.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/languageQualifierType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAA+D;AAC/D,4CAAsC;AACtC,sCAQmB;AACnB,mDAA4E;AAE5E,oDAAuD;AAoBvD;;;;;GAKG;AACH,MAAa,qBAAsB,SAAQ,6BAAa;IACtD;;;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ACjB,SAAkC,EAClC,OAA8B,EAC9B,QAA2B;QAE3B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,UAAU,GAAG,gBAAK,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAC5F,IAAI,UAAU,GAAG,GAAG,IAAI,iBAAQ,CAAC,0BAA0B,CAAC,UAAU,CAAC,EAAE,CAAC;gBACxE,OAAO,UAAU,CAAC;YACpB,CAAC;QACH,CAAC;QACD,OAAO,gBAAO,CAAC;IACjB,CAAC;CACF;AAjFD,sDAiFC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Result, captureResult, succeed } from '@fgv/ts-utils';\nimport { Bcp47 } from '@fgv/ts-bcp47';\nimport {\n ConditionOperator,\n Convert,\n NoMatch,\n QualifierConditionValue,\n QualifierContextValue,\n QualifierMatchScore,\n Validate\n} from '../common';\nimport { IQualifierTypeCreateParams, QualifierType } from './qualifierType';\nimport * as Config from './config';\nimport { sanitizeJsonObject } from '@fgv/ts-json-base';\n\n/**\n * Interface defining the parameters that can be used to create a new\n * {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType}.\n * @public\n */\nexport interface ILanguageQualifierTypeCreateParams extends Partial<IQualifierTypeCreateParams> {\n /**\n * Optional name for the qualifier type. Defaults to 'language'.\n */\n name?: string;\n\n /**\n * Optional flag indicating whether the context can be a list of values.\n * Defaults to `true`.\n */\n allowContextList?: boolean;\n}\n\n/**\n * {@link QualifierTypes.QualifierType | Qualifier type} which matches BCP-47 language tags\n * applying {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.\n * Accepts a list of language tags in the context by default.\n * @public\n */\nexport class LanguageQualifierType extends QualifierType {\n /**\n * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.\n * @param name - Optional name for the qualifier type. Defaults to 'language'.\n * @param allowContextList - Optional flag indicating whether the context can be a\n * list of values. Defaults to `true`.\n * @public\n */\n protected constructor({ name, allowContextList, index }: ILanguageQualifierTypeCreateParams) {\n allowContextList = allowContextList !== false;\n /* c8 ignore next 2 - coverage intermittently drops these two lines even though they're tested */\n name = name ?? 'language';\n const validated = index ? { index: Convert.qualifierTypeIndex.convert(index).orThrow() } : {};\n\n super({\n name,\n allowContextList,\n ...validated\n });\n }\n\n /**\n * Creates a new instance of a {@link QualifierTypes.LanguageQualifierType | language qualifier type}.\n * @param params - Optional {@link QualifierTypes.ILanguageQualifierTypeCreateParams | parameters}\n * to use when creating the new instance.\n * @returns `Success` with the new {@link QualifierTypes.LanguageQualifierType | language qualifier type}\n * if successful, `Failure` otherwise.\n */\n public static create(params?: ILanguageQualifierTypeCreateParams): Result<LanguageQualifierType> {\n /* c8 ignore next 1 - coverage seems to intermittently miss the branch even though it's tested */\n params = params ?? {};\n return captureResult(() => new LanguageQualifierType(params));\n }\n\n /**\n * Creates a new {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType} from a configuration object.\n * @param config - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object} containing\n * the name, systemType, and optional language-specific configuration.\n * @returns `Success` with the new {@link QualifierTypes.LanguageQualifierType | LanguageQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\n public static createFromConfig(\n config: Config.IQualifierTypeConfig<Config.ILanguageQualifierTypeConfig>\n ): Result<LanguageQualifierType> {\n return sanitizeJsonObject<ILanguageQualifierTypeCreateParams>({\n name: config.name,\n allowContextList: config.configuration?.allowContextList === true\n }).onSuccess(LanguageQualifierType.create);\n }\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}\n */\n public isValidConditionValue(value: string): value is QualifierConditionValue {\n return Bcp47.tag(value)\n .onSuccess((tag) => succeed(tag.isValid))\n .orDefault(false);\n }\n\n /**\n * Matches a single language condition against a single language context value using\n * {@link https://github.com/ErikFortune/fgv/tree/main/libraries/ts-bcp47#tag-matching | similarity matching}.\n * @param condition - The language condition value to match.\n * @param context - The language context value to match against.\n * @param operator - The operator to use for the match. Must be 'matches'.\n * @returns The match score, or `noMatch` if the match fails.\n */\n protected _matchOne(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n operator: ConditionOperator\n ): QualifierMatchScore {\n if (operator === 'matches') {\n const similarity = Bcp47.similarity(condition, context).orDefault(Bcp47.tagSimilarity.none);\n if (similarity > 0.0 && Validate.isValidQualifierMatchScore(similarity)) {\n return similarity;\n }\n }\n return NoMatch;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"literalQualifierType.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/literalQualifierType.ts"],"names":[],"mappings":"AAsBA,OAAO,EAA6B,MAAM,EAAiB,MAAM,eAAe,CAAC;AACjF,OAAO,EACL,iBAAiB,EAIjB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EAEpB,MAAM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iBAAiB,GAC5B,mBAAmB;IAWtB;;;;;;;OAOG;WACW,MAAM,CAAC,MAAM,CAAC,EAAE,iCAAiC,GAAG,MAAM,CAAC,oBAAoB,CAAC;IAI9F;;;;;;;;OAQG;WACW,gBAAgB,CAC5B,MAAM,EAAE,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,2BAA2B,CAAC,GACtE,MAAM,CAAC,oBAAoB,CAAC;IAW/B;;;;;OAKG;WACW,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,uBAAuB;IAIzF;;;;;;OAMG;WACW,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,uBAAuB,CAAC;CAKrF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"literalQualifierType.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/literalQualifierType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAiF;AACjF,sCASmB;AACnB,mDAAgD;AAChD,mEAA2F;AAE3F,oDAAuD;AA2CvD;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,6BAAa;IAiBrD;;;;;;;;OAQG;IACH,YAAsB,EACpB,IAAI,EACJ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,KAAK,EAC6B;QAClC,gBAAgB,GAAG,gBAAgB,KAAK,KAAK,CAAC;QAC9C,KAAK,CAAC;YACJ,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,SAAS;YACvB,gBAAgB;YAChB,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;SAC7F,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,GAAG,aAAa,KAAK,IAAI,CAAC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB;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M,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY;QACrD,OAAO,iBAAQ,CAAC,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,uBAAuB,CAAC,IAAY;QAChD,OAAO,oBAAoB,CAAC,4BAA4B,CAAC,IAAI,CAAC;YAC5D,CAAC,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC;YACf,CAAC,CAAC,IAAA,eAAI,EAAC,GAAG,IAAI,wCAAwC,CAAC,CAAC;IAC5D,CAAC;CACF;AA/JD,oDA+JC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport {\n ConditionOperator,\n Convert,\n NoMatch,\n PerfectMatch,\n QualifierConditionValue,\n QualifierContextValue,\n QualifierMatchScore,\n Validate\n} from '../common';\nimport { QualifierType } from './qualifierType';\nimport { LiteralValueHierarchy, LiteralValueHierarchyDecl } from './literalValueHierarchy';\nimport * as Config from './config';\nimport { sanitizeJsonObject } from '@fgv/ts-json-base';\n\n/**\n * Interface defining the parameters that can be used to create a new\n * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}.\n * @public\n */\nexport interface ILiteralQualifierTypeCreateParams {\n /**\n * Optional name for the qualifier type. Defaults to 'literal'.\n */\n name?: string;\n\n /**\n * Optional flag indicating whether the context can be a list of values.\n * Defaults to `true`.\n */\n allowContextList?: boolean;\n\n /**\n * Optional flag indicating whether the match should be case-sensitive.\n * Defaults to `false`.\n */\n caseSensitive?: boolean;\n\n /**\n * Optional array of enumerated values to further constrain the type.\n * Defaults to no constraint.\n */\n enumeratedValues?: ReadonlyArray<string>;\n\n /**\n * Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}\n * of literal values to use for matching. If not provided, no hierarchy will be used.\n */\n hierarchy?: LiteralValueHierarchyDecl<string>;\n\n /**\n * Global index for this qualifier type.\n */\n index?: number;\n}\n\n/**\n * A {@link QualifierTypes.QualifierType | qualifier} that matches a literal value,\n * optionally case-sensitive or matching against an ordered list of values at runtime.\n * @public\n */\nexport class LiteralQualifierType extends QualifierType {\n /**\n * Indicates whether the qualifier match is case-sensitive.\n */\n public readonly caseSensitive: boolean;\n\n /**\n * Optional array of enumerated values to further constrain the type.\n */\n public readonly enumeratedValues?: ReadonlyArray<QualifierConditionValue>;\n\n /**\n * Optional {@link QualifierTypes.LiteralValueHierarchy | hierarchy} of literal\n * values to use for matching. If not provided, no hierarchy will be used.\n */\n public readonly hierarchy?: LiteralValueHierarchy<string>;\n\n /**\n * Constructs a new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}.\n * @param name - Optional name for the qualifier type. Defaults to 'literal'.\n * @param caseSensitive - Optional flag indicating whether the match should be\n * case-sensitive. Defaults to `false`.\n * @param allowContextList - Optional flag indicating whether the context can be a\n * list of values. Defaults to `false`.\n * @public\n */\n protected constructor({\n name,\n caseSensitive,\n allowContextList,\n enumeratedValues,\n hierarchy,\n index\n }: ILiteralQualifierTypeCreateParams) {\n allowContextList = allowContextList !== false;\n super({\n name: name ?? 'literal',\n allowContextList,\n index: index !== undefined ? Convert.qualifierTypeIndex.convert(index).orThrow() : undefined\n });\n this.caseSensitive = caseSensitive === true;\n this.enumeratedValues = enumeratedValues\n ? mapResults(Array.from(enumeratedValues).map(LiteralQualifierType.toLiteralConditionValue)).orThrow()\n : undefined;\n if (hierarchy) {\n /* c8 ignore next 5 - defensive coding: enumeratedValues ?? [] fallback enables open values mode */\n this.hierarchy = LiteralValueHierarchy.create({\n values: enumeratedValues ?? [],\n hierarchy: hierarchy\n }).orThrow();\n }\n }\n\n /**\n * Determines whether a value is a valid condition value for a literal qualifier.\n * The {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} accepts\n * any identifier as a valid condition value.\n * @param value - The value to validate.\n * @returns `true` if the value is a valid condition value, `false` otherwise.\n */\n public isValidConditionValue(value: string): value is QualifierConditionValue {\n if (this.enumeratedValues) {\n if (this.caseSensitive) {\n return this.enumeratedValues.includes(value as QualifierConditionValue);\n }\n return this.enumeratedValues.some((v) => v.toLowerCase() === value.toLowerCase());\n }\n return LiteralQualifierType.isValidLiteralConditionValue(value);\n }\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}\n */\n public isPotentialMatch(conditionValue: string, contextValue: string): boolean {\n if (this.isValidConditionValue(conditionValue) && this.isValidContextValue(contextValue)) {\n if (this._matchOne(conditionValue, contextValue, 'matches') !== NoMatch) {\n return true;\n }\n if (this.hierarchy) {\n return this.hierarchy.isAncestor(conditionValue, contextValue);\n }\n }\n return false;\n }\n\n /**\n * {@inheritdoc QualifierTypes.QualifierType._matchOne}\n */\n protected _matchOne(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n __operator: ConditionOperator\n ): QualifierMatchScore {\n if (this.hierarchy) {\n return this.hierarchy.match(condition, context, __operator);\n }\n if (this.caseSensitive) {\n return condition === (context as string) ? PerfectMatch : NoMatch;\n } else {\n return condition.toLowerCase() === context.toLowerCase() ? PerfectMatch : NoMatch;\n }\n }\n\n /**\n * Creates a new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}.\n * @param params - Optional {@link QualifierTypes.ILiteralQualifierTypeCreateParams | parameters}\n * to use when creating the new instance.\n * @returns `Success` with the new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\n public static create(params?: ILiteralQualifierTypeCreateParams): Result<LiteralQualifierType> {\n return captureResult(() => new LiteralQualifierType(params ?? {}));\n }\n\n /**\n * Creates a new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} from a configuration object.\n * @param config - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object} containing\n * the name, systemType, and optional literal-specific configuration including case sensitivity,\n * enumerated values, and hierarchy information.\n * @returns `Success` with the new {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\n public static createFromConfig(\n config: Config.IQualifierTypeConfig<Config.ILiteralQualifierTypeConfig>\n ): Result<LiteralQualifierType> {\n const literalConfig = config.configuration ?? {};\n return sanitizeJsonObject<ILiteralQualifierTypeCreateParams>({\n name: config.name,\n allowContextList: literalConfig.allowContextList === true,\n caseSensitive: literalConfig.caseSensitive,\n enumeratedValues: literalConfig.enumeratedValues,\n hierarchy: literalConfig.hierarchy\n }).onSuccess(LiteralQualifierType.create);\n }\n\n /**\n * Checks if the given value is a valid literal condition value.\n * @param from - The value to validate.\n * @returns `true` if the value is a valid literal condition value, otherwise `false`.\n * @public\n */\n public static isValidLiteralConditionValue(from: string): from is QualifierConditionValue {\n return Validate.RegularExpressions.identifier.test(from);\n }\n\n /**\n * Converts a string to a {@link QualifierConditionValue | literal condition value}.\n * @param from - The string to convert.\n * @returns `Success` with the converted value if valid, or `Failure` with an error\n * message if not.\n * @public\n */\n public static toLiteralConditionValue(from: string): Result<QualifierConditionValue> {\n return LiteralQualifierType.isValidLiteralConditionValue(from)\n ? succeed(from)\n : fail(`${from}: not a valid literal condition value.`);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"literalValueHierarchy.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/literalValueHierarchy.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAoC,MAAM,EAAiB,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,iBAAiB,EAGjB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EAEpB,MAAM,WAAW,CAAC;AAEnB;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEhF;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM;IAC7C,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,kCAAkC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC3E,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACzB,SAAS,CAAC,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;CAC1C;AAaD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC1D;;;OAGG;IACH,SAAgB,MAAM,EAAE,WAAW,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzD;;;OAGG;IACH,SAAgB,YAAY,EAAE,OAAO,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\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, MessageAggregator, Result, succeed, fail } from '@fgv/ts-utils';\nimport {\n ConditionOperator,\n NoMatch,\n PerfectMatch,\n QualifierConditionValue,\n QualifierContextValue,\n QualifierMatchScore,\n Convert as CommonConverters\n} from '../common';\n\n/**\n * Declares a hierarchy of literal values. The keys are the names of the values, and the\n * values are the names of their parents.\n * @remarks\n * The hierarchy is defined as a tree, where each value can have multiple children but\n * only one parent. The root of the tree has no parent. The hierarchy is used to\n * determine the relationship between values when matching conditions and contexts.\n * @public\n */\nexport type LiteralValueHierarchyDecl<T extends string> = Partial<Record<T, T>>;\n\n/**\n * Describes a single valid literal value including optional parent and child values.\n * @public\n */\nexport interface ILiteralValue<T extends string> {\n readonly name: T;\n readonly parent?: ILiteralValue<T>;\n readonly children?: ReadonlyArray<T>;\n}\n\n/**\n * Describes the parameters used to create a new\n * {@link QualifierTypes.LiteralValueHierarchy | LiteralValueHierarchy}.\n * @public\n */\nexport interface ILiteralValueHierarchyCreateParams<T extends string = string> {\n values: ReadonlyArray<T>;\n hierarchy?: LiteralValueHierarchyDecl<T>;\n}\n\n/**\n * Internal interface used during hierarchy construction to build\n * {@link QualifierTypes.ILiteralValue | ILiteralValue} objects.\n * @public\n */\ninterface ILiteralValueBuilder<T extends string> {\n readonly name: T;\n parent?: ILiteralValue<T>;\n children?: T[];\n}\n\n/**\n * A class that implements a hierarchy of literal values. The hierarchy is defined as a\n * tree, where each value can have multiple children but only one parent. The root of the\n * tree has no parent. The hierarchy is used to determine the relationship between values\n * when matching conditions and contexts.\n *\n * @remarks\n * The hierarchy can be created in two modes:\n * - **Constrained mode**: When enumerated values are provided, only those values are allowed\n * in the hierarchy and matching operations.\n * - **Open values mode**: When no enumerated values are provided, all values referenced in\n * the hierarchy are automatically collected and used. This allows for flexible hierarchies\n * where any value can be used in matching operations.\n * @public\n */\nexport class LiteralValueHierarchy<T extends string = string> {\n /**\n * A map of all allowed literal values to the corresponding\n * {@link QualifierTypes.ILiteralValue | ILiteralValue} validated definition.\n */\n public readonly values: ReadonlyMap<T, ILiteralValue<T>>;\n\n /**\n * Indicates whether this hierarchy was created with open values (no enumerated values\n * provided), allowing any value to be used in matching operations.\n */\n public readonly isOpenValues: boolean;\n\n protected constructor(params: ILiteralValueHierarchyCreateParams<T>) {\n const result = LiteralValueHierarchy._buildValuesFromHierarchy(params);\n this.values = result.orThrow();\n this.isOpenValues = !params.values || params.values.length === 0;\n }\n\n /**\n * Creates a new {@link QualifierTypes.LiteralValueHierarchy | LiteralValueHierarchy} instance.\n * @param params - The {@link QualifierTypes.ILiteralValueHierarchyCreateParams | parameters}\n * used to create the hierarchy.\n * @returns `Success` with the new hierarchy or `Failure` with an error message.\n */\n public static create<T extends string>(\n params: ILiteralValueHierarchyCreateParams<T>\n ): Result<LiteralValueHierarchy<T>> {\n return captureResult(() => new LiteralValueHierarchy(params));\n }\n\n /**\n * Checks if a value exists in the hierarchy.\n * @param value - The value to check.\n * @returns `true` if the value exists in the hierarchy, `false` otherwise.\n */\n public hasValue(value: T): boolean {\n return this.values.has(value);\n }\n\n /**\n * Gets all root values (values with no parent) in the hierarchy.\n * @returns `Success` with an array of root values.\n */\n public getRoots(): Result<T[]> {\n return succeed(\n Array.from(this.values.values())\n .filter((v) => !v.parent)\n .map((v) => v.name)\n );\n }\n\n /**\n * Gets all ancestors of a value in the hierarchy.\n * @param value - The value to get ancestors for.\n * @returns `Success` with an array of ancestor values, ordered from immediate parent\n * to root, or `Failure` if the value is not in the hierarchy.\n */\n public getAncestors(value: T): Result<T[]> {\n const current = this.values.get(value);\n /* c8 ignore next 2 - functional error case tested but coverage intermittently missed */\n if (!current) {\n return fail(`${value}: not found in hierarchy`);\n }\n\n const ancestors: T[] = [];\n let ancestor = current.parent;\n\n while (ancestor) {\n ancestors.push(ancestor.name);\n ancestor = ancestor.parent;\n }\n\n return succeed(ancestors);\n }\n\n /**\n * Determines if a value is an ancestor of a possible ancestor value.\n * @param value - The value to check.\n * @param possibleAncestor - The possible ancestor value.\n * @returns `true` if the value is an ancestor of the possible ancestor, `false` otherwise.\n */\n public isAncestor(value: T, possibleAncestor: T): boolean {\n const ancestors = this.getAncestors(value);\n if (ancestors.isSuccess()) {\n return ancestors.value.includes(possibleAncestor);\n }\n return false;\n }\n\n /**\n * Gets all descendants of a value in the hierarchy.\n * @param value - The value to get descendants for.\n * @returns `Success` with an array of descendant values, or `Failure` if the value\n * is not in the hierarchy.\n */\n public getDescendants(value: T): Result<T[]> {\n const current = this.values.get(value);\n if (!current) {\n return fail(`${value}: not found in hierarchy`);\n }\n\n const descendants: T[] = [];\n if (current.children) {\n for (const childName of current.children) {\n descendants.push(childName);\n const childDescendants = this.getDescendants(childName);\n if (childDescendants.isSuccess()) {\n descendants.push(...childDescendants.value);\n }\n }\n }\n\n return succeed(descendants);\n }\n\n public match(condition: T, context: T): QualifierMatchScore;\n /**\n * Matches a condition value against a context value, where an exact match of the\n * condition and context returns {@link PerfectMatch | PerfectMatch}, a condition\n * value that does not match the context value or any of its ancestors returns\n * {@link NoMatch | NoMatch}, and a condition value that matches the context value\n * or any of its ancestors returns a positive score that is less than\n * {@link PerfectMatch | PerfectMatch}, with the score decreasing with each ancestor\n * in the hierarchy.\n * @param condition - The condition value to match.\n * @param context - The context value to match against.\n * @param __operator - The operator used for matching (not used in this implementation).\n * @returns A {@link QualifierMatchScore | QualifierMatchScore} indicating the match score.\n */\n public match(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n __operator?: ConditionOperator\n ): QualifierMatchScore;\n public match(condition: string, context: string, __operator?: ConditionOperator): QualifierMatchScore {\n // For open hierarchies, skip validation and allow any values\n if (!this.isOpenValues) {\n // Validate that both condition and context exist in the hierarchy\n /* c8 ignore next 2 - functional error case tested but coverage intermittently missed */\n if (!this.values.has(condition as T)) {\n return NoMatch;\n }\n /* c8 ignore next 2 - functional error case tested but coverage intermittently missed */\n if (!this.values.has(context as T)) {\n return NoMatch;\n }\n }\n\n if ((condition as string) === (context as string)) {\n return PerfectMatch;\n }\n\n // For open hierarchies, if values aren't in the hierarchy, treat as no match\n // but don't fail validation\n const values: ReadonlyMap<string, ILiteralValue<string>> = this.values;\n /* c8 ignore next 1 - ? is defense in depth */\n let value = values.get(context)?.parent;\n /* c8 ignore next 2 - functional error case tested but coverage intermittently missed */\n if (!value) {\n return NoMatch;\n }\n let score = PerfectMatch as number;\n while (value) {\n score *= 0.9;\n if (value.name === condition) {\n return CommonConverters.qualifierMatchScore.convert(score).orDefault(NoMatch);\n }\n value = value.parent;\n }\n return NoMatch;\n }\n\n protected static _buildValuesFromHierarchy<T extends string>(\n params: ILiteralValueHierarchyCreateParams<T>\n ): Result<ReadonlyMap<T, ILiteralValue<T>>> {\n const errors = new MessageAggregator();\n const values = params.values;\n const hierarchy = params.hierarchy ?? {};\n\n // If no values are provided, collect all values from the hierarchy\n let allValues: T[];\n if (!values || values.length === 0) {\n const hierarchyValues = new Set<T>();\n // Add all keys and values from the hierarchy\n Object.keys(hierarchy).forEach((key) => hierarchyValues.add(key as T));\n Object.values(hierarchy).forEach((value) => hierarchyValues.add(value as T));\n allValues = Array.from(hierarchyValues);\n } else {\n allValues = [...values];\n }\n\n const valueMap = new Map<T, ILiteralValueBuilder<T>>(allValues.map((name) => [name, { name }]));\n\n if (hierarchy) {\n for (const [valueName, parentName] of Object.entries(hierarchy)) {\n const value = valueMap.get(valueName as T);\n if (!value) {\n errors.addMessage(`${valueName}: invalid literal value.`);\n continue;\n }\n\n const parent = valueMap.get(parentName as T);\n if (!parent) {\n errors.addMessage(`${valueName}: parent ${parentName} is not a valid literal value.`);\n continue;\n }\n\n let ancestor = parent.parent;\n let circular = false;\n const ancestors: T[] = [];\n\n while (ancestor) {\n /* c8 ignore next 1 - defensive coding: complex circular reference detection intermittently missed */\n ancestors.push(ancestor.name);\n /* c8 ignore next 1 - defensive coding: ancestor.parent === value is very difficult to reach */\n if (ancestor.parent === parent || ancestor.parent === value) {\n /* c8 ignore next 3 - defensive coding: circular reference error reporting intermittently missed */\n errors.addMessage(`${valueName}: Circular reference detected: ${ancestors.join('->')}`);\n circular = true;\n break;\n }\n ancestor = ancestor.parent;\n }\n\n /* c8 ignore next 2 - defensive coding: circular reference handling intermittently missed */\n if (circular) {\n continue;\n }\n\n value.parent = parent;\n if (parent.children) {\n parent.children.push(value.name);\n } else {\n parent.children = [value.name];\n }\n }\n }\n\n return errors.returnOrReport(succeed(valueMap));\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierType.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/qualifierType.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACjF,OAAO,EACL,iBAAiB,EAIjB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,WAAW,CAAC;AAEnB;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,iBAAiB,EAAE,kB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;QAEnB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACf,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAiBD;;;;;;;;OAQG;IACO,UAAU,CAClB,SAAkC,EAClC,OAAgC,EAChC,QAA2B;QAE3B,MAAM,gBAAgB,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;QAC5C,IAAI,SAAS,GAAG,qBAAY,GAAG,gBAAgB,CAAC;QAEhD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC9D,IAAI,KAAK,GAAG,gBAAO,EAAE,CAAC;gBACpB,MAAM,QAAQ,GAAG,SAAS,GAAG,gBAAgB,GAAG,KAAK,CAAC;gBACtD,IAAI,iBAAQ,CAAC,0BAA0B,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAClD,OAAO,QAAQ,CAAC;gBAClB,CAAC;YACH,CAAC;YACD,SAAS,IAAI,gBAAgB,CAAC;QAChC,CAAC;QACD,OAAO,gBAAO,CAAC;IACjB,CAAC;IAED;;;;;;OAMG;IACO,MAAM,CAAC,aAAa,CAAC,KAA4B;QACzD,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAA2B,CAAC,CAAC;IACxE,CAAC;CACF;AAhND,sCAgNC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Collections, ICollectible, Result, fail, succeed } from '@fgv/ts-utils';\nimport {\n ConditionOperator,\n Convert,\n NoMatch,\n PerfectMatch,\n QualifierConditionValue,\n QualifierContextValue,\n QualifierMatchScore,\n QualifierTypeIndex,\n QualifierTypeName,\n Validate\n} from '../common';\n\n/**\n * Interface for a qualifier type. A qualifier type implements the build and\n * runtime semantics for some class of related qualifiers (e.g. language,\n * territories, etc).\n * @public\n */\nexport interface IQualifierType extends ICollectible<QualifierTypeName, QualifierTypeIndex> {\n /**\n * The name of the qualifier type.\n */\n readonly name: QualifierTypeName;\n\n /**\n * Unique key for this qualifier.\n */\n readonly key: QualifierTypeName;\n\n /**\n * Global index for this qualifier type. Immutable once set, either at\n * construction or using {@link QualifierTypes.IQualifierType.setIndex | setIndex}.\n */\n readonly index: QualifierTypeIndex | undefined;\n\n /**\n * Validates a condition value for this qualifier type.\n * @param value - The string value to validate.\n * @returns `Success` with the {@link QualifierConditionValue | validated value}\n * if the value is valid for use in a condition, `Failure` with error details\n * otherwise.\n */\n isValidConditionValue(value: string): value is QualifierConditionValue;\n\n /**\n * Validates a context value for this qualifier type.\n * @param value - The string value to validate.\n * @returns `Success` with the {@link QualifierContextValue | validated value}\n * if the value is valid for use in a runtime context, `Failure` with error\n * details otherwise.\n */\n isValidContextValue(value: string): value is QualifierContextValue;\n\n /**\n * Determines if a supplied condition value is a potential match for a possible context value.\n * @param conditionValue - The condition value.\n * @param contextValue - The context value.\n * @returns `true` if the condition value is a potential match for the context value, `false` otherwise.\n */\n isPotentialMatch(conditionValue: string, contextValue: string): boolean;\n\n /**\n * Validates that a value and optional operator are valid for use in a condition\n * for qualifiers of this type.\n * @param value - The string value to validate.\n * @param operator - An optional operator to validate. Defaults to 'matches'.\n */\n validateCondition(value: string, operator?: ConditionOperator): Result<QualifierConditionValue>;\n\n /**\n * Validates that a value is valid for use in a runtime context for qualifiers\n * of this type.\n * @param value - The string value to validate.\n * @returns `Success` with the {@link QualifierContextValue | validated value}\n * if the value is valid for use in a runtime context, `Failure` with error\n * details otherwise.\n */\n validateContextValue(value: string): Result<QualifierContextValue>;\n\n /**\n * Determines the extent to which a condition matches a context value for this\n * qualifier type.\n * @param condition - The condition value to evaluate.\n * @param context - The context value to evaluate.\n * @param operator - The operator to use in evaluating the match.\n * @returns a {@link QualifierMatchScore | score} indicating the extent to which\n * the condition matches the context value.\n */\n matches(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n operator: ConditionOperator\n ): QualifierMatchScore;\n\n /**\n * Sets the index for this qualifier type. Once set, index is immutable.\n */\n setIndex(index: number): Result<QualifierTypeIndex>;\n}\n\n/**\n * Parameters used to create a base {@link QualifierTypes.QualifierType | qualifier type}.\n * @public\n */\nexport interface IQualifierTypeCreateParams {\n /**\n * The name of the qualifier type. No default value.\n */\n name: string;\n\n /**\n * Global index for this qualifier type.\n */\n index?: number;\n\n /**\n * Flag indicating whether this qualifier type allows a list of values in a context.\n * Defaults to `false`.\n */\n allowContextList?: boolean;\n}\n\n/**\n * Abstract base class for qualifier types. Provides default implementations for\n * the {@link QualifierTypes.IQualifierType | IQualifierType} interface.\n * @public\n */\nexport abstract class QualifierType implements IQualifierType {\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.name}\n */\n public readonly name: QualifierTypeName;\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.key}\n */\n public get key(): QualifierTypeName {\n return this._collectible.key;\n }\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.index}\n */\n public get index(): QualifierTypeIndex | undefined {\n return this._collectible.index;\n }\n\n protected readonly _collectible: Collections.Collectible<QualifierTypeName, QualifierTypeIndex>;\n\n /**\n * Flag indicating whether this qualifier type allows a list of values in a context.\n * @public\n */\n public readonly allowContextList: boolean;\n\n /**\n * Constructor for use by derived classes.\n * @param name - The name of the qualifier type.\n * @param allowContextList - Flag indicating whether this qualifier type allows a\n * comma-separated list of runtime values in the context. Defaults to `false`.\n */\n protected constructor({ name, index, allowContextList }: IQualifierTypeCreateParams) {\n this.name = Convert.qualifierTypeName.convert(name).orThrow();\n this.allowContextList = allowContextList === true;\n this._collectible = new Collections.Collectible<QualifierTypeName, QualifierTypeIndex>({\n key: this.name,\n index: index,\n indexConverter: Convert.qualifierTypeIndex\n });\n }\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.isValidConditionValue}\n */\n public abstract isValidConditionValue(value: string): value is QualifierConditionValue;\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.isValidContextValue}\n */\n public isValidContextValue(value: string): value is QualifierContextValue {\n if (this.isValidConditionValue(value)) {\n return true;\n }\n if (this.allowContextList) {\n /* c8 ignore next 1 - functional code tested but coverage intermittently missed */\n return value.split(',').every((v) => this.isValidConditionValue(v.trim()));\n }\n /* c8 ignore next 1 - functional code tested but coverage intermittently missed */\n return false;\n }\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.isPotentialMatch}\n */\n public isPotentialMatch(conditionValue: string, contextValue: string): boolean {\n if (this.isValidConditionValue(conditionValue) && this.isValidContextValue(contextValue)) {\n return this._matchOne(conditionValue, contextValue, 'matches') !== NoMatch;\n }\n return false;\n }\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.validateCondition}\n */\n public validateCondition(value: string, operator?: ConditionOperator): Result<QualifierConditionValue> {\n operator = operator ?? 'matches';\n /* c8 ignore next 2 - functional error case tested but coverage intermittently missed */\n if (operator !== 'matches') {\n return fail(`${operator}: invalid condition operator`);\n /* c8 ignore next 2 - functional error case tested but coverage intermittently missed */\n } else if (!this.isValidConditionValue(value)) {\n return fail(`${value}: invalid condition value for qualifierType ${this.name}`);\n }\n return succeed(value);\n }\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.validateContextValue}\n */\n public validateContextValue(value: string): Result<QualifierContextValue> {\n /* c8 ignore next 2 - functional error case tested but coverage intermittently missed */\n if (!this.isValidContextValue(value)) {\n return fail(`${value}: invalid context value for qualifierType ${this.name}`);\n }\n return succeed(value);\n }\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.matches}\n */\n public matches(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n operator: ConditionOperator\n ): QualifierMatchScore {\n if (this.allowContextList) {\n return this._matchList(condition, QualifierType._splitContext(context), operator);\n }\n return this._matchOne(condition, context, operator);\n }\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierType.setIndex}\n */\n public setIndex(index: number): Result<QualifierTypeIndex> {\n return this._collectible.setIndex(index);\n }\n\n /**\n * {@inheritdoc Validate.isValidQualifierTypeName}\n */\n public static isValidName(name: string): name is QualifierTypeName {\n return Validate.isValidQualifierTypeName(name);\n }\n\n /**\n * {@inheritdoc Validate.isValidQualifierTypeIndex}\n */\n public static isValidIndex(index: number): index is QualifierTypeIndex {\n return Validate.isValidQualifierTypeIndex(index);\n }\n\n /**\n * Compares two qualifier types by index.\n * @param t1 - The first qualifier type to compare.\n * @param t2 - The second qualifier type to compare.\n * @returns a number indicating the relative order of the two qualifier types.\n */\n public static compare(t1: QualifierType, t2: QualifierType): number {\n const i1 = t1._collectible.index ?? -1;\n const i2 = t2._collectible.index ?? -1;\n let diff = i1 - i2;\n\n if (diff === 0) {\n diff = t1.name.localeCompare(t2.name);\n }\n\n return diff;\n }\n\n /**\n * Matches a single condition value against a single context value.\n * @param condition - The {@link QualifierConditionValue | condition value} to match.\n * @param context - The {@link QualifierContextValue | context value} to match.\n * @param operator - The {@link ConditionOperator | operator} to use in the match.\n * @returns a {@link QualifierMatchScore | score} indicating the extent to which\n * the condition matches the context value.\n * @public\n */\n protected abstract _matchOne(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n operator: ConditionOperator\n ): QualifierMatchScore;\n\n /**\n * Matches a single condition value against a list of context values.\n * @param condition - The {@link QualifierConditionValue | condition value} to match.\n * @param context - The comma-separated list of {@link QualifierContextValue | context values} to match.\n * @param operator - The {@link ConditionOperator | operator} to use in the match.\n * @returns a {@link QualifierMatchScore | score} indicating the extent to which\n * the condition matches the context value.\n * @public\n */\n protected _matchList(\n condition: QualifierConditionValue,\n context: QualifierContextValue[],\n operator: ConditionOperator\n ): QualifierMatchScore {\n const scorePerPosition = 1 / context.length;\n let baseScore = PerfectMatch - scorePerPosition;\n\n for (let i = 0; i < context.length; i++) {\n const score = this._matchOne(condition, context[i], operator);\n if (score > NoMatch) {\n const adjusted = baseScore + scorePerPosition * score;\n if (Validate.isValidQualifierMatchScore(adjusted)) {\n return adjusted;\n }\n }\n baseScore -= scorePerPosition;\n }\n return NoMatch;\n }\n\n /**\n * Splits a comma-separated {@link QualifierContextValue | context value} into an\n * array of individual values.\n * @param value - The value to split.\n * @returns an array of individual context values.\n * @public\n */\n protected static _splitContext(value: QualifierContextValue): QualifierContextValue[] {\n return value.split(',').map((s) => s.trim() as QualifierContextValue);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierTypeCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/qualifierTypeCollector.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,WAAW,EACX,MAAM,EACN,6BAA6B,EAI9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;OAGG;IACH,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,6BAA6B,CAAC,aAAa,EAAE,aAAa,CAAC;IACrG;;;;OAIG;IACH,SAAS,aAAa,EAAE,cAAc,EAAE,EAAE,mCAAmC;IAe7E;;;;;OAKG;WACW,MAAM,CAAC,MAAM,CAAC,EAAE,mCAAmC,GAAG,MAAM,CAAC,sBAAsB,CAAC;IAMlG,SAAS,CAAC,MAAM,CAAC,qBAAqB,CACpC,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,aAAa,GACnB,MAAM,CAAC,aAAa,CAAC;IAIxB,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC;CAGxE;AAED;;;;GAIG;AACH,MAAM,MAAM,8BAA8B,GAAG,WAAW,CAAC,4BAA4B,CAAC,aAAa,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierTypeCollector.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/qualifierTypeCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAoC;AACpC,4CAOuB;AACvB,mDAAgD;AAehD;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,wCAA2D;IACrG;;;;OAIG;IACH,YAAsB,EAAE,cAAc,EAAuC;QAC3E,KAAK,CAAC;YACJ,UAAU,EAAE,IAAI,sBAAW,CAAC,kBAAkB,CAAC;gBAC7C,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB;gBACrC,KAAK,EAAE,sBAAsB,CAAC,gBAAgB;aAC/C,CAAC;YACF,OAAO,EAAE,sBAAsB,CAAC,qBAAqB;SACtD,CAAC,CAAC;QAEH,yEAAyE;QACzE,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;YAC7B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,MAA4C;QAC/D,yEAAyE;QACzE,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC;QACtB,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;IACjE,CAAC;IAES,MAAM,CAAC,qBAAqB,CACpC,GAAsB,EACtB,KAAa,EACb,KAAoB;QAEpB,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAES,MAAM,CAAC,gBAAgB,CAAC,IAAa;QAC7C,OAAO,IAAI,YAAY,6BAAa,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,eAAI,EAAC,qBAAqB,CAAC,CAAC;IACrF,CAAC;CACF;AA5CD,wDA4CC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Common from '../common';\nimport {\n Collections,\n Result,\n ValidatingConvertingCollector,\n captureResult,\n fail,\n succeed\n} from '@fgv/ts-utils';\nimport { QualifierType } from './qualifierType';\nimport { QualifierTypeName } from '../common';\n\n/**\n * Parameters for creating a new {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector}.\n * @public\n */\nexport interface IQualifierTypeCollectorCreateParams {\n /**\n * Optional list of {@link QualifierTypes.QualifierType | QualifierTypes} to add to the collector\n * on creation.\n */\n qualifierTypes?: QualifierType[];\n}\n\n/**\n * Collector for {@link QualifierTypes.QualifierType | QualifierType} objects.\n * @public\n */\nexport class QualifierTypeCollector extends ValidatingConvertingCollector<QualifierType, QualifierType> {\n /**\n * Constructor for a {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector} object.\n * @param params - Optional {@link QualifierTypes.IQualifierTypeCollectorCreateParams | parameters}\n * used to construct the collector.\n */\n protected constructor({ qualifierTypes }: IQualifierTypeCollectorCreateParams) {\n super({\n converters: new Collections.KeyValueConverters({\n key: Common.Convert.qualifierTypeName,\n value: QualifierTypeCollector._toQualifierType\n }),\n factory: QualifierTypeCollector._qualifierTypeFactory\n });\n\n /* c8 ignore next 1 - coverage seems to intermittently miss the branch */\n qualifierTypes?.forEach((qt) => {\n this.add(qt).orThrow();\n });\n }\n\n /**\n * Creates a new {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector} object.\n * @param params - Optional {@link QualifierTypes.IQualifierTypeCollectorCreateParams | parameters}\n * used to create the collector.\n * @returns `Success` with the new collector if successful, or `Failure` if not.\n */\n public static create(params?: IQualifierTypeCollectorCreateParams): Result<QualifierTypeCollector> {\n /* c8 ignore next 1 - coverage seems to miss the branch intermittently */\n params = params ?? {};\n return captureResult(() => new QualifierTypeCollector(params));\n }\n\n protected static _qualifierTypeFactory(\n key: QualifierTypeName,\n index: number,\n value: QualifierType\n ): Result<QualifierType> {\n return succeed(value);\n }\n\n protected static _toQualifierType(from: unknown): Result<QualifierType> {\n return from instanceof QualifierType ? succeed(from) : fail('not a QualifierType');\n }\n}\n\n/**\n * Interface exposing non-mutating members of a\n * {@link QualifierTypes.QualifierTypeCollector | QualifierTypeCollector}.\n * @public\n */\nexport type ReadOnlyQualifierTypeCollector = Collections.IReadOnlyValidatingCollector<QualifierType>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"territoryQualifierType.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/territoryQualifierType.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,MAAM,EAA6B,MAAM,eAAe,CAAC;AACjF,OAAO,EAIL,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EAEnB,iBAAiB,EAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAGnC;;;GAGG;AACH,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE9B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;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2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Result, fail, succeed, mapResults } from '@fgv/ts-utils';\nimport {\n Convert,\n NoMatch,\n PerfectMatch,\n QualifierConditionValue,\n QualifierContextValue,\n QualifierMatchScore,\n Validate,\n ConditionOperator\n} from '../common';\nimport { QualifierType } from './qualifierType';\nimport { LiteralValueHierarchy, LiteralValueHierarchyDecl } from './literalValueHierarchy';\nimport * as Config from './config';\nimport { sanitizeJsonObject } from '@fgv/ts-json-base';\n\n/**\n * Parameters used to create a new {@link QualifierTypes.TerritoryQualifierType | TerritoryQualifierType} instance.\n * @public\n */\nexport interface ITerritoryQualifierTypeCreateParams {\n /**\n * {@inheritdoc QualifierTypes.IQualifierTypeCreateParams.name}\n */\n name?: string;\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierTypeCreateParams.allowContextList}\n */\n allowContextList?: boolean;\n\n /**\n * {@inheritdoc QualifierTypes.IQualifierTypeCreateParams.index}\n */\n index?: number;\n\n /**\n * Optional array enumerating allowed territories to further constrain the type.\n */\n allowedTerritories?: string[];\n\n /**\n * Flag indicating whether the qualifier type should accept lowercase territory codes.\n * Defaults to `false`.\n */\n acceptLowercase?: boolean;\n\n /**\n * Optional {@link QualifierTypes.LiteralValueHierarchyDecl | hierarchy declaration}\n * of territory values to use for matching. If not provided, no hierarchy will be used.\n */\n hierarchy?: LiteralValueHierarchyDecl<string>;\n}\n\n/**\n * Qualifier type for territory values. Territories are two-letter ISO-3166-2\n * Alpha-2 country codes. Canonical territory codes are uppercase, but this\n * implementation handles incorrect casing.\n * @public\n */\nexport class TerritoryQualifierType extends QualifierType {\n /**\n * Optional array enumerating allowed territories to further constrain the type.\n */\n public readonly allowedTerritories?: ReadonlyArray<QualifierConditionValue>;\n\n /**\n * Flag indicating whether the qualifier type should accept lowercase territory codes.\n * Defaults to `false`.\n */\n public readonly acceptLowercase: boolean;\n\n /**\n * Optional {@link QualifierTypes.LiteralValueHierarchy | hierarchy} of territory\n * values to use for matching. If not provided, no hierarchy will be used.\n */\n public readonly hierarchy?: LiteralValueHierarchy<string>;\n\n /**\n * Creates a new {@link QualifierTypes.TerritoryQualifierType | TerritoryQualifierType} instance.\n * @public\n */\n protected constructor({\n acceptLowercase,\n allowedTerritories,\n allowContextList,\n name,\n index,\n hierarchy\n }: ITerritoryQualifierTypeCreateParams) {\n /* c8 ignore next 7 - coverage seems to be missing coalescing branches */\n name = name ?? 'territory';\n const validIndex = index !== undefined ? Convert.qualifierTypeIndex.convert(index).orThrow() : undefined;\n const validTerritories =\n allowedTerritories !== undefined\n ? mapResults(\n allowedTerritories.map((t) => TerritoryQualifierType.toTerritoryConditionValue(t.toUpperCase()))\n ).orThrow()\n : undefined;\n\n allowContextList = allowContextList === true;\n super({\n name: name,\n allowContextList,\n index: validIndex\n });\n this.allowedTerritories = validTerritories;\n this.acceptLowercase = acceptLowercase === true;\n\n if (hierarchy) {\n /* c8 ignore next 5 - defensive coding: allowedTerritories ?? [] fallback enables open values mode */\n this.hierarchy = LiteralValueHierarchy.create({\n values: allowedTerritories ?? [],\n hierarchy: hierarchy\n }).orThrow();\n }\n }\n\n /**\n * {@inheritdoc QualifierTypes.QualifierType.isValidConditionValue}\n */\n public isValidConditionValue(value: string): value is QualifierConditionValue {\n const normalized = this.acceptLowercase ? value.toUpperCase() : value;\n\n if (!TerritoryQualifierType.isValidTerritoryConditionValue(normalized)) {\n return false;\n }\n if (this.allowedTerritories !== undefined) {\n return this.allowedTerritories.includes(normalized);\n }\n return true;\n }\n\n /**\n * Creates a new {@link QualifierTypes.TerritoryQualifierType | TerritoryQualifierType} instance.\n * @param params - Optional {@link QualifierTypes.ITerritoryQualifierTypeCreateParams | parameters}\n * to use when creating the instance.\n * @returns `Success` with the new {@link QualifierTypes.TerritoryQualifierType | TerritoryQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\n public static create(params?: ITerritoryQualifierTypeCreateParams): Result<TerritoryQualifierType> {\n /* c8 ignore next 1 - coverage having problems with conditional branches */\n params = params ?? {};\n return captureResult(() => new TerritoryQualifierType(params));\n }\n\n /**\n * Creates a new {@link QualifierTypes.TerritoryQualifierType | TerritoryQualifierType} from a configuration object.\n * @param config - The {@link QualifierTypes.Config.IQualifierTypeConfig | configuration object} containing\n * the name, systemType, and optional territory-specific configuration including allowed territories and hierarchy.\n * @returns `Success` with the new {@link QualifierTypes.TerritoryQualifierType | TerritoryQualifierType}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\n public static createFromConfig(\n config: Config.IQualifierTypeConfig<Config.ITerritoryQualifierTypeConfig>\n ): Result<TerritoryQualifierType> {\n const territoryConfig = config.configuration ?? {};\n return sanitizeJsonObject<ITerritoryQualifierTypeCreateParams>({\n name: config.name,\n allowContextList: territoryConfig.allowContextList === true,\n allowedTerritories: territoryConfig.allowedTerritories,\n acceptLowercase: territoryConfig.acceptLowercase === true,\n hierarchy: territoryConfig.hierarchy\n }).onSuccess(TerritoryQualifierType.create);\n }\n\n /**\n * {@inheritdoc QualifierTypes.QualifierType._matchOne}\n */\n protected _matchOne(\n condition: QualifierConditionValue,\n context: QualifierContextValue,\n __operator?: ConditionOperator\n ): QualifierMatchScore {\n if (this.isValidConditionValue(condition) && this.isValidContextValue(context)) {\n // Normalize to uppercase for territory codes\n const normalizedCondition = condition.toUpperCase();\n const normalizedContext = context.toUpperCase() as QualifierContextValue;\n\n if (normalizedCondition === normalizedContext) {\n return PerfectMatch;\n }\n\n if (this.hierarchy) {\n return this.hierarchy.match(\n normalizedCondition as QualifierConditionValue,\n normalizedContext as QualifierContextValue,\n __operator\n );\n }\n }\n return NoMatch;\n }\n\n /**\n * Determines whether a value is a valid condition value for a territory qualifier.\n * @param value - The value to validate.\n * @param acceptLowercase - Flag indicating whether the qualifier type should accept lowercase territory codes.\n * Defaults to `false`.\n * @returns `true` if the value is a valid condition value, `false` otherwise.\n * @public\n */\n public static isValidTerritoryConditionValue(\n value: string,\n acceptLowercase?: boolean\n ): value is QualifierConditionValue {\n if (acceptLowercase !== true && value !== value.toUpperCase()) {\n return false;\n }\n return Validate.RegularExpressions.territoryCode.test(value.toUpperCase());\n }\n\n /**\n * Converts a string value to a territory condition value.\n * @param value - The value to convert.\n * @param acceptLowercase - Flag indicating whether the qualifier type should accept lowercase territory codes.\n * Defaults to `false`.\n * @returns `Success` with the converted value if successful, `Failure` with an error\n * message otherwise.\n * @public\n */\n public static toTerritoryConditionValue(\n value: string,\n acceptLowercase?: boolean\n ): Result<QualifierConditionValue> {\n const normalized = value.toUpperCase();\n return TerritoryQualifierType.isValidTerritoryConditionValue(normalized, acceptLowercase)\n ? succeed(normalized)\n : fail(`${value}: not a valid territory code`);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"decls.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifiers/convert/decls.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,8BAA8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AC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converters, populateObject, Result, fail, succeed } from '@fgv/ts-utils';\nimport { IQualifierDecl, IValidatedQualifierDecl } from '../qualifierDecl';\nimport { Validate } from '../../common';\nimport { ReadOnlyQualifierTypeCollector } from '../../qualifier-types';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter for a {@link Qualifiers.IQualifierDecl | qualifier declaration}.\n * @public\n */\nexport const qualifierDecl = Converters.strictObject<IQualifierDecl>({\n name: Converters.string,\n typeName: Converters.string,\n defaultPriority: Converters.number,\n token: Converters.string.optional(),\n tokenIsOptional: Converters.boolean.optional(),\n defaultValue: Converters.string.optional()\n});\n\n/**\n * Context necessary to convert a {@link Qualifiers.IValidatedQualifierDecl | validated qualifier declaration}.\n * @public\n */\nexport interface IQualifierDeclConvertContext {\n readonly qualifierTypes: ReadOnlyQualifierTypeCollector;\n qualifierIndex?: number;\n}\n\n/**\n * Converter which constructs a {@link Qualifiers.IValidatedQualifierDecl | validated qualifier declaration}\n * from a {@link Qualifiers.IQualifierDecl | qualifier declaration}, instantiating qualifier types by name\n * from a supplied {@link Qualifiers.Convert.IQualifierDeclConvertContext | conversion context}.\n * @public\n */\nexport const validatedQualifierDecl = Converters.generic<\n IValidatedQualifierDecl,\n IQualifierDeclConvertContext\n>((from: unknown, __self, context?: IQualifierDeclConvertContext): Result<IValidatedQualifierDecl> => {\n /* c8 ignore next 7 - this is tested but code coverage is losing its mind */\n if (context === undefined) {\n return fail('validatedQualifierDecl converter requires a context');\n }\n const validatedIndexResult =\n context.qualifierIndex !== undefined\n ? Validate.toQualifierIndex(context.qualifierIndex)\n : succeed(undefined);\n\n return qualifierDecl.convert(from).onSuccess((decl) => {\n return context.qualifierTypes.validating.get(decl.typeName).asResult.onSuccess((type) => {\n return populateObject<IValidatedQualifierDecl>({\n name: () => Validate.toQualifierName(decl.name),\n token: () => Validate.toQualifierName(decl.token ?? decl.name),\n tokenIsOptional: () => succeed(decl.tokenIsOptional === true),\n type: () => succeed(type),\n defaultPriority: () => Validate.toConditionPriority(decl.defaultPriority),\n defaultValue: () =>\n decl.defaultValue ? type.validateContextValue(decl.defaultValue) : succeed(undefined),\n index: () => validatedIndexResult\n }).onSuccess((validated) => {\n if (context.qualifierIndex !== undefined) {\n context.qualifierIndex++;\n }\n return succeed(validated);\n });\n });\n });\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifiers/convert/index.ts"],"names":[],"mappings":"AAsBA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/qualifiers/convert/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,8CAA4B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './decls';\nexport * from './qualifier';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifier.d.ts","sourceRoot":"","sources":["../../../../src/packlets/qualifiers/convert/qualifier.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,2BAA2B,CAAC;CACzC;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,wEAYrB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifier.js","sourceRoot":"","sources":["../../../../src/packlets/qualifiers/convert/qualifier.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAyD;AAezD;;;;GAIG;AACU,QAAA,SAAS,GAAG,qBAAU,CAAC,OAAO,CACzC,CAAC,IAAa,EAAE,MAAM,EAAE,OAAkC,EAAqB,EAAE;IAC/E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,IAAA,eAAI,EAAC,wCAAwC,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,IAAA,eAAI,EAAC,iDAAiD,CAAC,CAAC;AACjE,CAAC,CACF,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Converters, Result, fail } from '@fgv/ts-utils';\nimport { IReadOnlyQualifierCollector } from '../qualifierCollector';\nimport { Qualifier } from '../qualifier';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Context necessary to convert a string or number to a\n * {@link Qualifiers.Qualifier | Qualifier} object.\n * @public\n */\nexport interface IQualifierConvertContext {\n qualifiers: IReadOnlyQualifierCollector;\n}\n\n/**\n * Converter which choose a qualifier by name or number from a\n * supplied {@link Qualifiers.Convert.IQualifierConvertContext | conversion context}.\n * @public\n */\nexport const qualifier = Converters.generic<Qualifier, IQualifierConvertContext>(\n (from: unknown, __self, context?: IQualifierConvertContext): Result<Qualifier> => {\n if (context === undefined) {\n return fail('qualifier converter requires a context');\n }\n if (typeof from === 'string') {\n return context.qualifiers.validating.get(from);\n } else if (typeof from === 'number') {\n return context.qualifiers.getAt(from);\n }\n return fail('qualifier converter requires a string or number');\n }\n);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAQ5B,0BAAO;AANhB,8CAA4B;AAC5B,kDAAgC;AAChC,uDAAqC;AACrC,+DAA6C;AAC7C,+DAA6C","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\n\nexport * from './qualifier';\nexport * from './qualifierDecl';\nexport * from './qualifierCollector';\nexport * from './qualifierDefaultValueDecls';\nexport * from './qualifierDefaultValueToken';\n\nexport { Convert };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifier.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifier.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,aAAa,EAEb,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,SAAU,YAAW,uBAAuB,EAAE,YAAY,CAAC,aAAa,EAAE,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AI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,qBAAqB,CAAC,KAAa;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,KAAa,EAAE,QAA4B;QAClE,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,KAAa;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;CACF;AAhID,8BAgIC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Collections, ICollectible, Result } from '@fgv/ts-utils';\nimport {\n ConditionPriority,\n QualifierIndex,\n QualifierName,\n Convert as CommonConvert,\n QualifierContextValue,\n QualifierConditionValue,\n ConditionOperator\n} from '../common';\nimport { QualifierType } from '../qualifier-types';\nimport { IValidatedQualifierDecl } from './qualifierDecl';\n\n/**\n * Represents a qualifier that can be used to identify the context in\n * which a resource is used.\n * @public\n */\nexport class Qualifier implements IValidatedQualifierDecl, ICollectible<QualifierName, QualifierIndex> {\n /**\n * The name of the qualifier.\n */\n public readonly name: QualifierName;\n\n /**\n * The token used to identify the qualifier in the name or\n * path of a resource being imported.\n */\n public readonly token: QualifierName;\n\n /**\n * The {@link QualifierTypes.QualifierType | type} of the qualifier.\n */\n public readonly type: QualifierType;\n\n /**\n * Indicates whether the token is optional in the name or path of a resource being imported.\n */\n public readonly tokenIsOptional: boolean;\n\n /**\n * Optional default value for the qualifier.\n */\n public readonly defaultValue?: QualifierContextValue;\n\n /**\n * The index of the qualifier.\n */\n public get index(): QualifierIndex | undefined {\n return this._collectible.index;\n }\n\n /**\n * The collector key for this qualifier.\n */\n public get key(): QualifierName {\n return this._collectible.key;\n }\n\n /**\n * The default {@link ConditionPriority | priority} of conditions\n * that depend on this qualifier.\n */\n public readonly defaultPriority: ConditionPriority;\n\n protected readonly _collectible: Collections.Collectible<QualifierName, QualifierIndex>;\n\n /**\n * Constructs a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the\n * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.\n * @param name - The name of the qualifier.\n * @param type - The {@link QualifierTypes.QualifierType | type} of the qualifier.\n * @param defaultPriority - The default {@link ConditionPriority | priority} of conditions\n * @public\n */\n protected constructor({\n name,\n token,\n type,\n defaultPriority,\n tokenIsOptional,\n defaultValue,\n index\n }: IValidatedQualifierDecl) {\n this.name = name;\n this.token = token;\n this.type = type;\n this.defaultPriority = defaultPriority;\n this.tokenIsOptional = tokenIsOptional;\n this.defaultValue = defaultValue;\n this._collectible = new Collections.Collectible<QualifierName, QualifierIndex>({\n key: name,\n index,\n indexConverter: CommonConvert.qualifierIndex\n });\n }\n\n /**\n * Creates a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the\n * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.\n * @param decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}\n * for the new instance.\n * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful,\n * `Failure` with an error message otherwise.\n * @public\n */\n public static create(decl: IValidatedQualifierDecl): Result<Qualifier> {\n return captureResult(() => new Qualifier(decl));\n }\n\n /**\n * Sets the index of this qualifier. Once set, the index cannot be changed.\n * @param index - The index to set.\n * @returns `Success` with the index if successful, `Failure` with an error message otherwise.\n */\n public setIndex(index: QualifierIndex): Result<QualifierIndex> {\n return this._collectible.setIndex(index);\n }\n\n /**\n * {@inheritdoc QualifierTypes.QualifierType.isValidContextValue}\n */\n public isValidContextValue(value: string): value is QualifierContextValue {\n return this.type.isValidContextValue(value);\n }\n\n /**\n * {@inheritdoc QualifierTypes.QualifierType.isValidConditionValue}\n */\n public isValidConditionValue(value: string): value is QualifierConditionValue {\n return this.type.isValidConditionValue(value);\n }\n\n /**\n * {@inheritdoc QualifierTypes.QualifierType.validateCondition}\n */\n public validateCondition(value: string, operator?: ConditionOperator): Result<QualifierConditionValue> {\n return this.type.validateCondition(value, operator);\n }\n\n /**\n * {@inheritdoc QualifierTypes.QualifierType.validateContextValue}\n */\n public validateContextValue(value: string): Result<QualifierContextValue> {\n return this.type.validateContextValue(value);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierCollector.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEL,WAAW,EAEX,MAAM,EAIN,6BAA6B,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAA2B,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA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AwC,CAC1E,CAAC;YACJ,CAAC;YACD,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC;aACD,SAAS,CAAC,qBAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACF;AA1GD,gDA0GC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Common from '../common';\nimport {\n captureResult,\n Collections,\n failWithDetail,\n Result,\n fail,\n succeed,\n succeedWithDetail,\n ValidatingConvertingCollector\n} from '@fgv/ts-utils';\nimport { IQualifierDecl, IValidatedQualifierDecl } from './qualifierDecl';\nimport { QualifierName } from '../common';\nimport { Qualifier } from './qualifier';\nimport { IQualifierDeclConvertContext, qualifierDecl, validatedQualifierDecl } from './convert';\nimport { ReadOnlyQualifierTypeCollector } from '../qualifier-types';\n\n/**\n * Readonly version of {@link Qualifiers.QualifierCollector | QualifierCollector}.\n * @public\n */\nexport interface IReadOnlyQualifierCollector extends Collections.IReadOnlyValidatingCollector<Qualifier> {\n /**\n * {@inheritdoc Qualifiers.QualifierCollector.qualifierTypes}\n */\n readonly qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Gets a {@link Qualifiers.Qualifier | qualifier} by name or token.\n * @param nameOrToken - The name or token of the qualifier to retrieve.\n * @returns `Success` with the qualifier if found, or `Failure` if not.\n */\n getByNameOrToken(nameOrToken: string): Result<Qualifier>;\n\n /**\n * Checks if a qualifier with a given name or token is in the collection.\n * @param nameOrToken - The name or token of the qualifier to check.\n * @returns `true` if the qualifier is in the collection, `false` if not.\n */\n hasNameOrToken(nameOrToken: string): boolean;\n}\n\n/**\n * Parameters for creating a new {@link Qualifiers.QualifierCollector}.\n * @public\n */\nexport interface IQualifierCollectorCreateParams {\n /**\n * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} used to\n * create {@link Qualifiers.Qualifier | qualifiers} from {@link Qualifiers.IQualifierDecl | declarations}.\n */\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Optional list of {@link Qualifiers.IQualifierDecl | declarations} for the qualifiers to add to the collection\n * upon creation.\n */\n qualifiers?: IQualifierDecl[];\n}\n\n/**\n * Collects {@link Qualifiers.Qualifier | Qualifiers} from {@link Qualifiers.IQualifierDecl | declarations},\n * with strongly-typed ({@link QualifierName | QualifierName} and {@link QualifierIndex | QualifierIndex}) key\n * and index.\n * @public\n */\nexport class QualifierCollector\n extends ValidatingConvertingCollector<Qualifier, IQualifierDecl>\n implements IReadOnlyQualifierCollector\n{\n /**\n * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} that this collector uses.\n */\n public qualifierTypes: ReadOnlyQualifierTypeCollector;\n\n /**\n * Constructor for a {@link Qualifiers.QualifierCollector | QualifierCollector} object.\n * @param params - Parameters for creating the collector.\n * @public\n */\n protected constructor(params: IQualifierCollectorCreateParams) {\n super({\n factory: (k, i, v) => this._qualifierFactory(k, i, v),\n converters: new Collections.KeyValueConverters({\n key: Common.Convert.qualifierName,\n value: qualifierDecl\n })\n });\n this.qualifierTypes = params.qualifierTypes;\n /* c8 ignore next 1 - coverage misses the branch intermittently */\n params.qualifiers?.forEach((q) => this.validating.add(q.name, q).orThrow());\n }\n\n /**\n * Creates a new {@link Qualifiers.QualifierCollector | QualifierCollector} object.\n * @param params - {@link Qualifiers.IQualifierCollectorCreateParams | Parameters} for creating a new {@link Qualifiers.QualifierCollector | QualifierCollector}.\n * @returns `Success` with the new collector if successful, or `Failure` if not.\n */\n public static create(params: IQualifierCollectorCreateParams): Result<QualifierCollector> {\n return captureResult(() => new QualifierCollector(params));\n }\n\n /**\n * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}\n */\n public getByNameOrToken(nameOrToken: string): Result<Qualifier> {\n return this.validating.get(nameOrToken).onFailure((message) => {\n for (const q of this.values()) {\n if (q.token === nameOrToken) {\n return succeedWithDetail(q, 'success');\n }\n }\n return failWithDetail(`Qualifier token '${nameOrToken}' not found`, 'not-found');\n });\n }\n\n /**\n * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}\n */\n public hasNameOrToken(nameOrToken: string): boolean {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (this.validating.has(nameOrToken)) {\n return true;\n }\n for (const q of this.values()) {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (q.token === nameOrToken) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets a read-only view of this collector.\n * @returns A read-only view of this collector.\n */\n public toReadOnly(): IReadOnlyQualifierCollector {\n return this;\n }\n\n /**\n * Factory method for creating a {@link Qualifiers.Qualifier | Qualifier} from a {@link Qualifiers.IQualifierDecl | declaration}.\n * @param __key - The key for the qualifier.\n * @param index - The index of the qualifier.\n * @param decl - The {@link Qualifiers.IQualifierDecl | declaration} for the qualifier.\n * @returns `Success` with the new {@link Qualifiers.Qualifier | Qualifier} if successful, or `Failure` if not.\n * @public\n */\n protected _qualifierFactory(__key: QualifierName, index: number, decl: IQualifierDecl): Result<Qualifier> {\n const convertContext: IQualifierDeclConvertContext = {\n qualifierTypes: this.qualifierTypes,\n qualifierIndex: index\n };\n return validatedQualifierDecl\n .convert(decl, convertContext)\n .onSuccess((validated) => {\n if (this.hasNameOrToken(validated.token)) {\n /* c8 ignore next 3 - functional error case tested but coverage intermittently missed */\n return fail<IValidatedQualifierDecl>(\n `Qualifier token '${validated.token}' is not unique or collides with name`\n );\n } else if (this.hasNameOrToken(validated.name)) {\n /* c8 ignore next 4 - functional error case tested but coverage intermittently missed */\n return fail<IValidatedQualifierDecl>(\n `Qualifier name '${validated.name}' is not unique or collides with token`\n );\n }\n return succeed(validated);\n })\n .onSuccess(Qualifier.create);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierDecl.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDecl.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,eAAe,EAAE,iBAAiB,CAAC;IAEnC;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;OAEG;IACH,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC;CACnC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierDecl.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDecl.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { ConditionPriority, QualifierContextValue, QualifierIndex, QualifierName } from '../common';\nimport { QualifierType } from '../qualifier-types';\n\n/**\n * Simple declaration for a {@link Qualifiers.Qualifier | Qualifier}.\n * @public\n */\nexport interface IQualifierDecl {\n name: string;\n typeName: string;\n defaultPriority: number;\n token?: string;\n tokenIsOptional?: boolean;\n defaultValue?: string;\n}\n\n/**\n * Validated declaration for a {@link Qualifiers.Qualifier | Qualifier}.\n * @public\n */\nexport interface IValidatedQualifierDecl {\n /**\n * The name of the qualifier.\n */\n name: QualifierName;\n\n /**\n * The token used to identify the qualifier in the name or\n * path of a resource being imported.\n */\n token: QualifierName;\n\n /**\n * The {@link QualifierTypes.QualifierType | type} of the qualifier.\n */\n type: QualifierType;\n\n /**\n * The default {@link ConditionPriority | priority} of conditions\n * that depend on this qualifier.\n */\n defaultPriority: ConditionPriority;\n\n /**\n * Indicates whether the token is optional when parsing a resource token.\n */\n tokenIsOptional: boolean;\n\n /**\n * Optional default value for the qualifier.\n */\n defaultValue?: QualifierContextValue;\n\n /**\n * Index of the qualifier.\n */\n index: QualifierIndex | undefined;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierDefaultValueDecls.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueDecls.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,mCAAmC;IAClD,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,qBAAqB,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG,MAAM,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierDefaultValueDecls.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueDecls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { QualifierContextValue, QualifierName } from '../common';\nimport { Qualifier } from './qualifier';\n\n/**\n * Non-validated declaration of a single qualifier default value.\n * @public\n */\nexport interface IQualifierDefaultValueDecl {\n qualifier: string;\n value: string;\n}\n\n/**\n * Non-validated declaration of qualifier default values, consisting of named\n * default values.\n * @public\n */\nexport type IQualifierDefaultValuesDecl = Record<string, string>;\n\n/**\n * Validated declaration of a single qualifier default value.\n * @public\n */\nexport interface IValidatedQualifierDefaultValueDecl {\n qualifier: Qualifier;\n value: QualifierContextValue;\n}\n\n/**\n * Validated declaration of qualifier default values, a record with strongly-typed\n * {@link QualifierName | qualifier names} as keys and\n * {@link QualifierContextValue | qualifier context values} as values.\n * @public\n */\nexport type IValidatedQualifierDefaultValuesDecl = Record<QualifierName, QualifierContextValue>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierDefaultValueToken.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueToken.ts"],"names":[],"mappings":"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C,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,oCAAoC,CAAC;IAyB/C;;;;OAIG;WACW,iCAAiC,CAC7C,IAAI,EAAE,oCAAoC,GACzC,MAAM,CAAC,MAAM,CAAC;CAsBlB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierDefaultValueToken.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierDefaultValueToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkE;AAClE,sCAA2F;AAO3F;;;GAGG;AACH,MAAa,2BAA2B;IAOtC;;;OAGG;IACH,YAAmB,UAAuC;QACxD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACI,+BAA+B,CAAC,KAAa;QAClD,OAAO,2BAA2B,CAAC,+BAA+B,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;OAMG;IACI,gCAAgC,CAAC,KAAa;QACnD,OAAO,2BAA2B,CAAC,gCAAgC,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9F,CAAC;IAED;;;;OAIG;IACI,uCAAuC,CAC5C,KAAqD;QAErD,OAAO,2BAA2B,CAAC,uCAAuC,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACrG,CAAC;IAED;;;;OAIG;IACI,iCAAiC,CAAC,KAAa;QACpD,OAAO,2BAA2B,CAAC,iCAAiC,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/F,CAAC;IAED;;;;OAIG;IACI,iCAAiC,CAAC,IAA0C;QACjF,OAAO,2BAA2B,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,+BAA+B,CAC3C,KAAa,EACb,UAAuC;QAEvC,OAAO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AAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACnB,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC9B,CAAC,CAAC,CACH,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAA,kBAAO,EAAC,WAAW,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF;AAnMD,kEAmMC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport { Helpers as CommonHelpers, QualifierName, QualifierContextValue } from '../common';\nimport {\n IValidatedQualifierDefaultValueDecl,\n IValidatedQualifierDefaultValuesDecl\n} from './qualifierDefaultValueDecls';\nimport { IReadOnlyQualifierCollector } from './qualifierCollector';\n\n/**\n * Helper class to parse and validate qualifier default value tokens.\n * @public\n */\nexport class QualifierDefaultValueTokens {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to validate\n * qualifier names and values.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Constructs a new {@link Qualifiers.QualifierDefaultValueTokens | QualifierDefaultValueTokens } instance.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n */\n public constructor(qualifiers: IReadOnlyQualifierCollector) {\n this.qualifiers = qualifiers;\n }\n\n /**\n * Parses a {@link QualifierDefaultValueToken | qualifier default value token} string and validates the parts\n * against the qualifiers present in the {@link Qualifiers.QualifierDefaultValueTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declaration}\n * if successful, `Failure` with an error message if not.\n */\n public parseQualifierDefaultValueToken(token: string): Result<IValidatedQualifierDefaultValueDecl> {\n return QualifierDefaultValueTokens.parseQualifierDefaultValueToken(token, this.qualifiers);\n }\n\n /**\n * Parses a {@link QualifierDefaultValuesToken | qualifier default values token} string and validates the parts\n * against the qualifiers present in the {@link Qualifiers.QualifierDefaultValueTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the array of {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declarations}\n * if successful, `Failure` with an error message if not.\n */\n public parseQualifierDefaultValuesToken(token: string): Result<IValidatedQualifierDefaultValueDecl[]> {\n return QualifierDefaultValueTokens.parseQualifierDefaultValuesToken(token, this.qualifiers);\n }\n\n /**\n * Validates the {@link Helpers.IQualifierDefaultValueTokenParts | parts} of a {@link QualifierDefaultValueToken | qualifier default value token}.\n * @param parts - the parts to validate\n * @returns `Success` with the validated declaration if successful, `Failure` with an error message if not.\n */\n public validateQualifierDefaultValueTokenParts(\n parts: CommonHelpers.IQualifierDefaultValueTokenParts\n ): Result<IValidatedQualifierDefaultValueDecl> {\n return QualifierDefaultValueTokens.validateQualifierDefaultValueTokenParts(parts, this.qualifiers);\n }\n\n /**\n * Converts a {@link QualifierDefaultValuesToken | qualifier default values token} to a validated qualifier default values declaration.\n * @param token - the qualifier default values token to convert\n * @returns `Success` with the validated qualifier default values declaration if successful, `Failure` with an error message if not.\n */\n public qualifierDefaultValuesTokenToDecl(token: string): Result<IValidatedQualifierDefaultValuesDecl> {\n return QualifierDefaultValueTokens.qualifierDefaultValuesTokenToDecl(token, this.qualifiers);\n }\n\n /**\n * Converts a validated qualifier default values declaration to a {@link QualifierDefaultValuesToken | qualifier default values token}.\n * @param decl - the validated qualifier default values declaration to convert\n * @returns `Success` with the qualifier default values token if successful, `Failure` with an error message if not.\n */\n public declToQualifierDefaultValuesToken(decl: IValidatedQualifierDefaultValuesDecl): Result<string> {\n return QualifierDefaultValueTokens.declToQualifierDefaultValuesToken(decl);\n }\n\n /**\n * Parses a {@link QualifierDefaultValueToken | qualifier default value token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with a {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static parseQualifierDefaultValueToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValueDecl> {\n return CommonHelpers.parseQualifierDefaultValueTokenParts(token).onSuccess((parts) => {\n return QualifierDefaultValueTokens.validateQualifierDefaultValueTokenParts(parts, qualifiers);\n });\n }\n\n /**\n * Parses a {@link QualifierDefaultValuesToken | qualifier default values token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with an array of {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declarations}\n * if successful, `Failure` with an error message if not\n */\n public static parseQualifierDefaultValuesToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValueDecl[]> {\n return CommonHelpers.parseQualifierDefaultValuesTokenParts(token).onSuccess((parts) => {\n return mapResults(\n parts.map((part) =>\n QualifierDefaultValueTokens.validateQualifierDefaultValueTokenParts(part, qualifiers)\n )\n );\n });\n }\n\n /**\n * Validates the parts of a qualifier default value token against the qualifiers present in the supplied\n * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param parts - the {@link Helpers.IQualifierDefaultValueTokenParts | qualifier default value token parts} to validate.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to\n * validate qualifier names and values.\n * @returns `Success` with a {@link Qualifiers.IValidatedQualifierDefaultValueDecl | validated qualifier default value declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static validateQualifierDefaultValueTokenParts(\n parts: CommonHelpers.IQualifierDefaultValueTokenParts,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValueDecl> {\n return qualifiers.getByNameOrToken(parts.qualifier).onSuccess((qualifier) => {\n // Allow empty values to remove defaults\n if (parts.value === '') {\n return succeed({ qualifier, value: '' as QualifierContextValue });\n }\n\n return qualifier.type\n .validateContextValue(parts.value)\n .onSuccess((value) => {\n return succeed({ qualifier, value });\n })\n .withDetail('failure', 'success');\n });\n }\n\n /**\n * Converts a {@link QualifierDefaultValuesToken | qualifier default values token} to a validated qualifier default values declaration.\n * @param token - the qualifier default values token to convert\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with the validated qualifier default values declaration if successful, `Failure` with an error message if not.\n */\n public static qualifierDefaultValuesTokenToDecl(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedQualifierDefaultValuesDecl> {\n return QualifierDefaultValueTokens.parseQualifierDefaultValuesToken(token, qualifiers).onSuccess(\n (qualifierDefaultValues) => {\n const defaultValues: IValidatedQualifierDefaultValuesDecl = {};\n\n for (const { qualifier, value } of qualifierDefaultValues) {\n const qualifierName = qualifier.name as QualifierName;\n const contextValue = value as QualifierContextValue;\n\n // Check for duplicate qualifiers\n if (qualifierName in defaultValues) {\n return fail(`${qualifier.name}: duplicate qualifier in default values token`);\n }\n\n // Only add non-empty values (empty values remove defaults)\n if (contextValue !== '') {\n defaultValues[qualifierName] = contextValue;\n }\n }\n\n return succeed(defaultValues);\n }\n );\n }\n\n /**\n * Converts a validated qualifier default values declaration to a {@link QualifierDefaultValuesToken | qualifier default values token}.\n * @param decl - the validated qualifier default values declaration to convert\n * @returns `Success` with the qualifier default values token if successful, `Failure` with an error message if not.\n */\n public static declToQualifierDefaultValuesToken(\n decl: IValidatedQualifierDefaultValuesDecl\n ): Result<string> {\n const tokens: string[] = [];\n\n for (const [qualifierName, contextValue] of Object.entries(decl)) {\n // Build token as \"qualifier=value\"\n tokens.push(`${qualifierName}=${contextValue}`);\n }\n\n if (tokens.length === 0) {\n return succeed('');\n }\n\n const tokenString = tokens.join('|');\n\n // Validate the generated token\n return CommonHelpers.buildQualifierDefaultValuesToken(\n tokens.map((token) => {\n const [qualifier, value] = token.split('=');\n return { qualifier, value };\n })\n ).onSuccess(() => succeed(tokenString));\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/packlets/resource-json/compiled/common.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}