@fgv/ts-res 5.1.0-3 → 5.1.0-31

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 (545) hide show
  1. package/dist/index.browser.js.map +1 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/packlets/bundle/bundleBuilder.js.map +1 -0
  4. package/dist/packlets/bundle/bundleLoader.js.map +1 -0
  5. package/dist/packlets/bundle/bundleNormalizer.js.map +1 -0
  6. package/dist/packlets/bundle/bundleUtils.js.map +1 -0
  7. package/dist/packlets/bundle/convert.js.map +1 -0
  8. package/dist/packlets/bundle/index.js.map +1 -0
  9. package/dist/packlets/bundle/model.js.map +1 -0
  10. package/dist/packlets/common/conditions.js.map +1 -0
  11. package/dist/packlets/common/convert.js.map +1 -0
  12. package/dist/packlets/common/helpers/conditions.js.map +1 -0
  13. package/dist/packlets/common/helpers/context.js.map +1 -0
  14. package/dist/packlets/common/helpers/index.js.map +1 -0
  15. package/dist/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  16. package/dist/packlets/common/helpers/resources.js +2 -4
  17. package/dist/packlets/common/helpers/resources.js.map +1 -0
  18. package/dist/packlets/common/index.js.map +1 -0
  19. package/dist/packlets/common/resources.js.map +1 -0
  20. package/dist/packlets/common/validate/conditions.js +4 -4
  21. package/dist/packlets/common/validate/conditions.js.map +1 -0
  22. package/dist/packlets/common/validate/index.js.map +1 -0
  23. package/dist/packlets/common/validate/regularExpressions.js +2 -2
  24. package/dist/packlets/common/validate/regularExpressions.js.map +1 -0
  25. package/dist/packlets/common/validate/resources.js +1 -1
  26. package/dist/packlets/common/validate/resources.js.map +1 -0
  27. package/dist/packlets/conditions/condition.js +3 -7
  28. package/dist/packlets/conditions/condition.js.map +1 -0
  29. package/dist/packlets/conditions/conditionCollector.js.map +1 -0
  30. package/dist/packlets/conditions/conditionDecls.js.map +1 -0
  31. package/dist/packlets/conditions/conditionSet.js +14 -5
  32. package/dist/packlets/conditions/conditionSet.js.map +1 -0
  33. package/dist/packlets/conditions/conditionSetCollector.js.map +1 -0
  34. package/dist/packlets/conditions/conditionSetDecls.js.map +1 -0
  35. package/dist/packlets/conditions/conditionToken.js.map +1 -0
  36. package/dist/packlets/conditions/convert/conditionSetDecls.js +50 -6
  37. package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  38. package/dist/packlets/conditions/convert/decls.js +61 -5
  39. package/dist/packlets/conditions/convert/decls.js.map +1 -0
  40. package/dist/packlets/conditions/convert/index.js.map +1 -0
  41. package/dist/packlets/conditions/index.js.map +1 -0
  42. package/dist/packlets/config/common.js.map +1 -0
  43. package/dist/packlets/config/configInitFactory.js.map +1 -0
  44. package/dist/packlets/config/convert.js.map +1 -0
  45. package/dist/packlets/config/index.browser.js.map +1 -0
  46. package/dist/packlets/config/index.js.map +1 -0
  47. package/dist/packlets/config/json.js.map +1 -0
  48. package/dist/packlets/config/predefined/default.js.map +1 -0
  49. package/dist/packlets/config/predefined/extended.js.map +1 -0
  50. package/dist/packlets/config/predefined/index.js.map +1 -0
  51. package/dist/packlets/config/systemConfiguration.js.map +1 -0
  52. package/dist/packlets/context/contextDecls.js.map +1 -0
  53. package/dist/packlets/context/contextToken.js.map +1 -0
  54. package/dist/packlets/context/convert/decls.js.map +1 -0
  55. package/dist/packlets/context/convert/index.js.map +1 -0
  56. package/dist/packlets/context/index.js.map +1 -0
  57. package/dist/packlets/decisions/abstractDecision.js.map +1 -0
  58. package/dist/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  59. package/dist/packlets/decisions/candidate.js.map +1 -0
  60. package/dist/packlets/decisions/common.js.map +1 -0
  61. package/dist/packlets/decisions/concreteDecision.js.map +1 -0
  62. package/dist/packlets/decisions/decision.js +1 -1
  63. package/dist/packlets/decisions/decision.js.map +1 -0
  64. package/dist/packlets/decisions/index.js.map +1 -0
  65. package/dist/packlets/import/fsItem.js +1 -4
  66. package/dist/packlets/import/fsItem.js.map +1 -0
  67. package/dist/packlets/import/importContext.js +3 -3
  68. package/dist/packlets/import/importContext.js.map +1 -0
  69. package/dist/packlets/import/importManager.js +7 -3
  70. package/dist/packlets/import/importManager.js.map +1 -0
  71. package/dist/packlets/import/importable.js.map +1 -0
  72. package/dist/packlets/import/importers/collectionImporter.js +2 -2
  73. package/dist/packlets/import/importers/collectionImporter.js.map +1 -0
  74. package/dist/packlets/import/importers/fsItemImporter.js +30 -14
  75. package/dist/packlets/import/importers/fsItemImporter.js.map +1 -0
  76. package/dist/packlets/import/importers/importer.js.map +1 -0
  77. package/dist/packlets/import/importers/index.browser.js.map +1 -0
  78. package/dist/packlets/import/importers/index.js.map +1 -0
  79. package/dist/packlets/import/importers/jsonImporter.js +2 -2
  80. package/dist/packlets/import/importers/jsonImporter.js.map +1 -0
  81. package/dist/packlets/import/importers/pathImporter.js +1 -1
  82. package/dist/packlets/import/importers/pathImporter.js.map +1 -0
  83. package/dist/packlets/import/index.browser.js.map +1 -0
  84. package/dist/packlets/import/index.js.map +1 -0
  85. package/dist/packlets/qualifier-types/config/convert.js.map +1 -0
  86. package/dist/packlets/qualifier-types/config/index.js.map +1 -0
  87. package/dist/packlets/qualifier-types/config/json.js.map +1 -0
  88. package/dist/packlets/qualifier-types/convert.js.map +1 -0
  89. package/dist/packlets/qualifier-types/helpers.js.map +1 -0
  90. package/dist/packlets/qualifier-types/index.js.map +1 -0
  91. package/dist/packlets/qualifier-types/languageQualifierType.js +6 -7
  92. package/dist/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  93. package/dist/packlets/qualifier-types/literalQualifierType.js +7 -10
  94. package/dist/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  95. package/dist/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  96. package/dist/packlets/qualifier-types/qualifierType.js +12 -13
  97. package/dist/packlets/qualifier-types/qualifierType.js.map +1 -0
  98. package/dist/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  99. package/dist/packlets/qualifier-types/territoryQualifierType.js +5 -5
  100. package/dist/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  101. package/dist/packlets/qualifiers/convert/decls.js.map +1 -0
  102. package/dist/packlets/qualifiers/convert/index.js.map +1 -0
  103. package/dist/packlets/qualifiers/convert/qualifier.js.map +1 -0
  104. package/dist/packlets/qualifiers/index.js.map +1 -0
  105. package/dist/packlets/qualifiers/qualifier.js +6 -7
  106. package/dist/packlets/qualifiers/qualifier.js.map +1 -0
  107. package/dist/packlets/qualifiers/qualifierCollector.js +153 -9
  108. package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -0
  109. package/dist/packlets/qualifiers/qualifierDecl.js.map +1 -0
  110. package/dist/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  111. package/dist/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  112. package/dist/packlets/resource-json/compiled/common.js.map +1 -0
  113. package/dist/packlets/resource-json/compiled/convert.js.map +1 -0
  114. package/dist/packlets/resource-json/compiled/index.js.map +1 -0
  115. package/dist/packlets/resource-json/compiled/json.js.map +1 -0
  116. package/dist/packlets/resource-json/convert.js +225 -0
  117. package/dist/packlets/resource-json/convert.js.map +1 -0
  118. package/dist/packlets/resource-json/helpers.js.map +1 -0
  119. package/dist/packlets/resource-json/index.js.map +1 -0
  120. package/dist/packlets/resource-json/json.js +2 -2
  121. package/dist/packlets/resource-json/json.js.map +1 -0
  122. package/dist/packlets/resource-json/normalized.js.map +1 -0
  123. package/dist/packlets/resource-json/resourceDeclCollection.js +1 -1
  124. package/dist/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  125. package/dist/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  126. package/dist/packlets/resource-json/resourceDeclTree.js +1 -1
  127. package/dist/packlets/resource-json/resourceDeclTree.js.map +1 -0
  128. package/dist/packlets/resource-types/config/convert.js.map +1 -0
  129. package/dist/packlets/resource-types/config/index.js.map +1 -0
  130. package/dist/packlets/resource-types/config/json.js.map +1 -0
  131. package/dist/packlets/resource-types/helpers.js.map +1 -0
  132. package/dist/packlets/resource-types/index.js.map +1 -0
  133. package/dist/packlets/resource-types/jsonResourceType.js +2 -2
  134. package/dist/packlets/resource-types/jsonResourceType.js.map +1 -0
  135. package/dist/packlets/resource-types/resourceType.js +2 -2
  136. package/dist/packlets/resource-types/resourceType.js.map +1 -0
  137. package/dist/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  138. package/dist/packlets/resources/candidateReducer.js.map +1 -0
  139. package/dist/packlets/resources/candidateValue.js.map +1 -0
  140. package/dist/packlets/resources/candidateValueCollector.js.map +1 -0
  141. package/dist/packlets/resources/common.js.map +1 -0
  142. package/dist/packlets/resources/deltaGenerator.js.map +1 -0
  143. package/dist/packlets/resources/index.js.map +1 -0
  144. package/dist/packlets/resources/resource.js.map +1 -0
  145. package/dist/packlets/resources/resourceBuilder.js +2 -2
  146. package/dist/packlets/resources/resourceBuilder.js.map +1 -0
  147. package/dist/packlets/resources/resourceCandidate.js.map +1 -0
  148. package/dist/packlets/resources/resourceManagerBuilder.js +5 -5
  149. package/dist/packlets/resources/resourceManagerBuilder.js.map +1 -0
  150. package/dist/packlets/runtime/cacheListener.js.map +1 -0
  151. package/dist/packlets/runtime/cacheMetrics.js.map +1 -0
  152. package/dist/packlets/runtime/compiledResourceCollection.js +5 -5
  153. package/dist/packlets/runtime/compiledResourceCollection.js.map +1 -0
  154. package/dist/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  155. package/dist/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  156. package/dist/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  157. package/dist/packlets/runtime/context/index.js.map +1 -0
  158. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  159. package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  160. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  161. package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  162. package/dist/packlets/runtime/iResourceManager.js.map +1 -0
  163. package/dist/packlets/runtime/index.js.map +1 -0
  164. package/dist/packlets/runtime/resource-tree/common.js.map +1 -0
  165. package/dist/packlets/runtime/resource-tree/index.js.map +1 -0
  166. package/dist/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  167. package/dist/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  168. package/dist/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  169. package/dist/packlets/runtime/resourceResolver.js.map +1 -0
  170. package/dist/packlets/runtime/resourceTreeResolver.js.map +1 -0
  171. package/dist/packlets/runtime/validate.js.map +1 -0
  172. package/dist/packlets/zip-archive/convert.js.map +1 -0
  173. package/dist/packlets/zip-archive/index.browser.js.map +1 -0
  174. package/dist/packlets/zip-archive/index.js.map +1 -0
  175. package/dist/packlets/zip-archive/json.js.map +1 -0
  176. package/dist/packlets/zip-archive/types.js.map +1 -0
  177. package/dist/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  178. package/dist/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  179. package/dist/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  180. package/dist/ts-res.d.ts +576 -164
  181. package/dist/tsdoc-metadata.json +1 -1
  182. package/lib/index.browser.d.ts.map +1 -0
  183. package/lib/index.browser.js.map +1 -0
  184. package/lib/index.d.ts.map +1 -0
  185. package/lib/index.js.map +1 -0
  186. package/lib/packlets/bundle/bundleBuilder.d.ts.map +1 -0
  187. package/lib/packlets/bundle/bundleBuilder.js.map +1 -0
  188. package/lib/packlets/bundle/bundleLoader.d.ts.map +1 -0
  189. package/lib/packlets/bundle/bundleLoader.js.map +1 -0
  190. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +1 -0
  191. package/lib/packlets/bundle/bundleNormalizer.js.map +1 -0
  192. package/lib/packlets/bundle/bundleUtils.d.ts.map +1 -0
  193. package/lib/packlets/bundle/bundleUtils.js.map +1 -0
  194. package/lib/packlets/bundle/convert.d.ts.map +1 -0
  195. package/lib/packlets/bundle/convert.js.map +1 -0
  196. package/lib/packlets/bundle/index.d.ts.map +1 -0
  197. package/lib/packlets/bundle/index.js.map +1 -0
  198. package/lib/packlets/bundle/model.d.ts.map +1 -0
  199. package/lib/packlets/bundle/model.js.map +1 -0
  200. package/lib/packlets/common/conditions.d.ts.map +1 -0
  201. package/lib/packlets/common/conditions.js.map +1 -0
  202. package/lib/packlets/common/convert.d.ts.map +1 -0
  203. package/lib/packlets/common/convert.js.map +1 -0
  204. package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
  205. package/lib/packlets/common/helpers/conditions.js.map +1 -0
  206. package/lib/packlets/common/helpers/context.d.ts.map +1 -0
  207. package/lib/packlets/common/helpers/context.js.map +1 -0
  208. package/lib/packlets/common/helpers/index.d.ts.map +1 -0
  209. package/lib/packlets/common/helpers/index.js.map +1 -0
  210. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +1 -0
  211. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +1 -0
  212. package/lib/packlets/common/helpers/resources.d.ts +2 -4
  213. package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
  214. package/lib/packlets/common/helpers/resources.js +2 -4
  215. package/lib/packlets/common/helpers/resources.js.map +1 -0
  216. package/lib/packlets/common/index.d.ts.map +1 -0
  217. package/lib/packlets/common/index.js.map +1 -0
  218. package/lib/packlets/common/resources.d.ts.map +1 -0
  219. package/lib/packlets/common/resources.js.map +1 -0
  220. package/lib/packlets/common/validate/conditions.d.ts +4 -4
  221. package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
  222. package/lib/packlets/common/validate/conditions.js +4 -4
  223. package/lib/packlets/common/validate/conditions.js.map +1 -0
  224. package/lib/packlets/common/validate/index.d.ts.map +1 -0
  225. package/lib/packlets/common/validate/index.js.map +1 -0
  226. package/lib/packlets/common/validate/regularExpressions.d.ts +2 -2
  227. package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
  228. package/lib/packlets/common/validate/regularExpressions.js +2 -2
  229. package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
  230. package/lib/packlets/common/validate/resources.d.ts +1 -1
  231. package/lib/packlets/common/validate/resources.d.ts.map +1 -0
  232. package/lib/packlets/common/validate/resources.js +1 -1
  233. package/lib/packlets/common/validate/resources.js.map +1 -0
  234. package/lib/packlets/conditions/condition.d.ts +3 -7
  235. package/lib/packlets/conditions/condition.d.ts.map +1 -0
  236. package/lib/packlets/conditions/condition.js +3 -7
  237. package/lib/packlets/conditions/condition.js.map +1 -0
  238. package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
  239. package/lib/packlets/conditions/conditionCollector.js.map +1 -0
  240. package/lib/packlets/conditions/conditionDecls.d.ts +6 -1
  241. package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
  242. package/lib/packlets/conditions/conditionDecls.js.map +1 -0
  243. package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
  244. package/lib/packlets/conditions/conditionSet.js +14 -5
  245. package/lib/packlets/conditions/conditionSet.js.map +1 -0
  246. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
  247. package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
  248. package/lib/packlets/conditions/conditionSetDecls.d.ts +7 -2
  249. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
  250. package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
  251. package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
  252. package/lib/packlets/conditions/conditionToken.js.map +1 -0
  253. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +30 -2
  254. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
  255. package/lib/packlets/conditions/convert/conditionSetDecls.js +51 -5
  256. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
  257. package/lib/packlets/conditions/convert/decls.d.ts +39 -3
  258. package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
  259. package/lib/packlets/conditions/convert/decls.js +63 -5
  260. package/lib/packlets/conditions/convert/decls.js.map +1 -0
  261. package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
  262. package/lib/packlets/conditions/convert/index.js.map +1 -0
  263. package/lib/packlets/conditions/index.d.ts.map +1 -0
  264. package/lib/packlets/conditions/index.js.map +1 -0
  265. package/lib/packlets/config/common.d.ts.map +1 -0
  266. package/lib/packlets/config/common.js.map +1 -0
  267. package/lib/packlets/config/configInitFactory.d.ts.map +1 -0
  268. package/lib/packlets/config/configInitFactory.js.map +1 -0
  269. package/lib/packlets/config/convert.d.ts.map +1 -0
  270. package/lib/packlets/config/convert.js.map +1 -0
  271. package/lib/packlets/config/index.browser.d.ts.map +1 -0
  272. package/lib/packlets/config/index.browser.js.map +1 -0
  273. package/lib/packlets/config/index.d.ts.map +1 -0
  274. package/lib/packlets/config/index.js.map +1 -0
  275. package/lib/packlets/config/json.d.ts.map +1 -0
  276. package/lib/packlets/config/json.js.map +1 -0
  277. package/lib/packlets/config/predefined/default.d.ts.map +1 -0
  278. package/lib/packlets/config/predefined/default.js.map +1 -0
  279. package/lib/packlets/config/predefined/extended.d.ts.map +1 -0
  280. package/lib/packlets/config/predefined/extended.js.map +1 -0
  281. package/lib/packlets/config/predefined/index.d.ts.map +1 -0
  282. package/lib/packlets/config/predefined/index.js.map +1 -0
  283. package/lib/packlets/config/systemConfiguration.d.ts.map +1 -0
  284. package/lib/packlets/config/systemConfiguration.js.map +1 -0
  285. package/lib/packlets/context/contextDecls.d.ts.map +1 -0
  286. package/lib/packlets/context/contextDecls.js.map +1 -0
  287. package/lib/packlets/context/contextToken.d.ts.map +1 -0
  288. package/lib/packlets/context/contextToken.js.map +1 -0
  289. package/lib/packlets/context/convert/decls.d.ts.map +1 -0
  290. package/lib/packlets/context/convert/decls.js.map +1 -0
  291. package/lib/packlets/context/convert/index.d.ts.map +1 -0
  292. package/lib/packlets/context/convert/index.js.map +1 -0
  293. package/lib/packlets/context/index.d.ts.map +1 -0
  294. package/lib/packlets/context/index.js.map +1 -0
  295. package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
  296. package/lib/packlets/decisions/abstractDecision.js.map +1 -0
  297. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
  298. package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
  299. package/lib/packlets/decisions/candidate.d.ts.map +1 -0
  300. package/lib/packlets/decisions/candidate.js.map +1 -0
  301. package/lib/packlets/decisions/common.d.ts.map +1 -0
  302. package/lib/packlets/decisions/common.js.map +1 -0
  303. package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
  304. package/lib/packlets/decisions/concreteDecision.js.map +1 -0
  305. package/lib/packlets/decisions/decision.d.ts +1 -1
  306. package/lib/packlets/decisions/decision.d.ts.map +1 -0
  307. package/lib/packlets/decisions/decision.js +1 -1
  308. package/lib/packlets/decisions/decision.js.map +1 -0
  309. package/lib/packlets/decisions/index.d.ts.map +1 -0
  310. package/lib/packlets/decisions/index.js.map +1 -0
  311. package/lib/packlets/import/fsItem.d.ts +1 -4
  312. package/lib/packlets/import/fsItem.d.ts.map +1 -0
  313. package/lib/packlets/import/fsItem.js +1 -4
  314. package/lib/packlets/import/fsItem.js.map +1 -0
  315. package/lib/packlets/import/importContext.d.ts +5 -5
  316. package/lib/packlets/import/importContext.d.ts.map +1 -0
  317. package/lib/packlets/import/importContext.js +3 -3
  318. package/lib/packlets/import/importContext.js.map +1 -0
  319. package/lib/packlets/import/importManager.d.ts +15 -1
  320. package/lib/packlets/import/importManager.d.ts.map +1 -0
  321. package/lib/packlets/import/importManager.js +7 -3
  322. package/lib/packlets/import/importManager.js.map +1 -0
  323. package/lib/packlets/import/importable.d.ts.map +1 -0
  324. package/lib/packlets/import/importable.js.map +1 -0
  325. package/lib/packlets/import/importers/collectionImporter.d.ts +2 -2
  326. package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
  327. package/lib/packlets/import/importers/collectionImporter.js +2 -2
  328. package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
  329. package/lib/packlets/import/importers/fsItemImporter.d.ts +16 -2
  330. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
  331. package/lib/packlets/import/importers/fsItemImporter.js +29 -13
  332. package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
  333. package/lib/packlets/import/importers/importer.d.ts.map +1 -0
  334. package/lib/packlets/import/importers/importer.js.map +1 -0
  335. package/lib/packlets/import/importers/index.browser.d.ts.map +1 -0
  336. package/lib/packlets/import/importers/index.browser.js.map +1 -0
  337. package/lib/packlets/import/importers/index.d.ts.map +1 -0
  338. package/lib/packlets/import/importers/index.js.map +1 -0
  339. package/lib/packlets/import/importers/jsonImporter.d.ts +2 -2
  340. package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
  341. package/lib/packlets/import/importers/jsonImporter.js +2 -2
  342. package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
  343. package/lib/packlets/import/importers/pathImporter.d.ts +1 -1
  344. package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
  345. package/lib/packlets/import/importers/pathImporter.js +1 -1
  346. package/lib/packlets/import/importers/pathImporter.js.map +1 -0
  347. package/lib/packlets/import/index.browser.d.ts.map +1 -0
  348. package/lib/packlets/import/index.browser.js.map +1 -0
  349. package/lib/packlets/import/index.d.ts.map +1 -0
  350. package/lib/packlets/import/index.js.map +1 -0
  351. package/lib/packlets/qualifier-types/config/convert.d.ts.map +1 -0
  352. package/lib/packlets/qualifier-types/config/convert.js.map +1 -0
  353. package/lib/packlets/qualifier-types/config/index.d.ts.map +1 -0
  354. package/lib/packlets/qualifier-types/config/index.js.map +1 -0
  355. package/lib/packlets/qualifier-types/config/json.d.ts.map +1 -0
  356. package/lib/packlets/qualifier-types/config/json.js.map +1 -0
  357. package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
  358. package/lib/packlets/qualifier-types/convert.js.map +1 -0
  359. package/lib/packlets/qualifier-types/helpers.d.ts.map +1 -0
  360. package/lib/packlets/qualifier-types/helpers.js.map +1 -0
  361. package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
  362. package/lib/packlets/qualifier-types/index.js.map +1 -0
  363. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +6 -7
  364. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
  365. package/lib/packlets/qualifier-types/languageQualifierType.js +6 -7
  366. package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
  367. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +7 -10
  368. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
  369. package/lib/packlets/qualifier-types/literalQualifierType.js +7 -10
  370. package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
  371. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +1 -0
  372. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +1 -0
  373. package/lib/packlets/qualifier-types/qualifierType.d.ts +17 -18
  374. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
  375. package/lib/packlets/qualifier-types/qualifierType.js +12 -13
  376. package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
  377. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
  378. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
  379. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +8 -8
  380. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
  381. package/lib/packlets/qualifier-types/territoryQualifierType.js +5 -5
  382. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
  383. package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
  384. package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
  385. package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
  386. package/lib/packlets/qualifiers/convert/index.js.map +1 -0
  387. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
  388. package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
  389. package/lib/packlets/qualifiers/index.d.ts.map +1 -0
  390. package/lib/packlets/qualifiers/index.js.map +1 -0
  391. package/lib/packlets/qualifiers/qualifier.d.ts +6 -7
  392. package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
  393. package/lib/packlets/qualifiers/qualifier.js +6 -7
  394. package/lib/packlets/qualifiers/qualifier.js.map +1 -0
  395. package/lib/packlets/qualifiers/qualifierCollector.d.ts +107 -9
  396. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
  397. package/lib/packlets/qualifiers/qualifierCollector.js +152 -8
  398. package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
  399. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
  400. package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
  401. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +1 -0
  402. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +1 -0
  403. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +1 -0
  404. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +1 -0
  405. package/lib/packlets/resource-json/compiled/common.d.ts.map +1 -0
  406. package/lib/packlets/resource-json/compiled/common.js.map +1 -0
  407. package/lib/packlets/resource-json/compiled/convert.d.ts.map +1 -0
  408. package/lib/packlets/resource-json/compiled/convert.js.map +1 -0
  409. package/lib/packlets/resource-json/compiled/index.d.ts.map +1 -0
  410. package/lib/packlets/resource-json/compiled/index.js.map +1 -0
  411. package/lib/packlets/resource-json/compiled/json.d.ts.map +1 -0
  412. package/lib/packlets/resource-json/compiled/json.js.map +1 -0
  413. package/lib/packlets/resource-json/convert.d.ts +85 -0
  414. package/lib/packlets/resource-json/convert.d.ts.map +1 -0
  415. package/lib/packlets/resource-json/convert.js +237 -0
  416. package/lib/packlets/resource-json/convert.js.map +1 -0
  417. package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
  418. package/lib/packlets/resource-json/helpers.js.map +1 -0
  419. package/lib/packlets/resource-json/index.d.ts.map +1 -0
  420. package/lib/packlets/resource-json/index.js.map +1 -0
  421. package/lib/packlets/resource-json/json.d.ts +128 -39
  422. package/lib/packlets/resource-json/json.d.ts.map +1 -0
  423. package/lib/packlets/resource-json/json.js +2 -2
  424. package/lib/packlets/resource-json/json.js.map +1 -0
  425. package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
  426. package/lib/packlets/resource-json/normalized.js.map +1 -0
  427. package/lib/packlets/resource-json/resourceDeclCollection.d.ts +1 -1
  428. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
  429. package/lib/packlets/resource-json/resourceDeclCollection.js +1 -1
  430. package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
  431. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
  432. package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
  433. package/lib/packlets/resource-json/resourceDeclTree.d.ts +1 -1
  434. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
  435. package/lib/packlets/resource-json/resourceDeclTree.js +1 -1
  436. package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
  437. package/lib/packlets/resource-types/config/convert.d.ts.map +1 -0
  438. package/lib/packlets/resource-types/config/convert.js.map +1 -0
  439. package/lib/packlets/resource-types/config/index.d.ts.map +1 -0
  440. package/lib/packlets/resource-types/config/index.js.map +1 -0
  441. package/lib/packlets/resource-types/config/json.d.ts.map +1 -0
  442. package/lib/packlets/resource-types/config/json.js.map +1 -0
  443. package/lib/packlets/resource-types/helpers.d.ts.map +1 -0
  444. package/lib/packlets/resource-types/helpers.js.map +1 -0
  445. package/lib/packlets/resource-types/index.d.ts.map +1 -0
  446. package/lib/packlets/resource-types/index.js.map +1 -0
  447. package/lib/packlets/resource-types/jsonResourceType.d.ts +17 -5
  448. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
  449. package/lib/packlets/resource-types/jsonResourceType.js +2 -2
  450. package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
  451. package/lib/packlets/resource-types/resourceType.d.ts +5 -5
  452. package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
  453. package/lib/packlets/resource-types/resourceType.js +2 -2
  454. package/lib/packlets/resource-types/resourceType.js.map +1 -0
  455. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
  456. package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
  457. package/lib/packlets/resources/candidateReducer.d.ts.map +1 -0
  458. package/lib/packlets/resources/candidateReducer.js.map +1 -0
  459. package/lib/packlets/resources/candidateValue.d.ts.map +1 -0
  460. package/lib/packlets/resources/candidateValue.js.map +1 -0
  461. package/lib/packlets/resources/candidateValueCollector.d.ts.map +1 -0
  462. package/lib/packlets/resources/candidateValueCollector.js.map +1 -0
  463. package/lib/packlets/resources/common.d.ts.map +1 -0
  464. package/lib/packlets/resources/common.js.map +1 -0
  465. package/lib/packlets/resources/deltaGenerator.d.ts.map +1 -0
  466. package/lib/packlets/resources/deltaGenerator.js.map +1 -0
  467. package/lib/packlets/resources/index.d.ts.map +1 -0
  468. package/lib/packlets/resources/index.js.map +1 -0
  469. package/lib/packlets/resources/resource.d.ts.map +1 -0
  470. package/lib/packlets/resources/resource.js.map +1 -0
  471. package/lib/packlets/resources/resourceBuilder.d.ts +2 -2
  472. package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
  473. package/lib/packlets/resources/resourceBuilder.js +2 -2
  474. package/lib/packlets/resources/resourceBuilder.js.map +1 -0
  475. package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
  476. package/lib/packlets/resources/resourceCandidate.js.map +1 -0
  477. package/lib/packlets/resources/resourceManagerBuilder.d.ts +5 -5
  478. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +1 -0
  479. package/lib/packlets/resources/resourceManagerBuilder.js +5 -5
  480. package/lib/packlets/resources/resourceManagerBuilder.js.map +1 -0
  481. package/lib/packlets/runtime/cacheListener.d.ts.map +1 -0
  482. package/lib/packlets/runtime/cacheListener.js.map +1 -0
  483. package/lib/packlets/runtime/cacheMetrics.d.ts.map +1 -0
  484. package/lib/packlets/runtime/cacheMetrics.js.map +1 -0
  485. package/lib/packlets/runtime/compiledResourceCollection.d.ts +5 -5
  486. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +1 -0
  487. package/lib/packlets/runtime/compiledResourceCollection.js +5 -5
  488. package/lib/packlets/runtime/compiledResourceCollection.js.map +1 -0
  489. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +1 -0
  490. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +1 -0
  491. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +1 -0
  492. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +1 -0
  493. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +1 -0
  494. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +1 -0
  495. package/lib/packlets/runtime/context/index.d.ts.map +1 -0
  496. package/lib/packlets/runtime/context/index.js.map +1 -0
  497. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +9 -2
  498. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -0
  499. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
  500. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -0
  501. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +8 -1
  502. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -0
  503. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
  504. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -0
  505. package/lib/packlets/runtime/iResourceManager.d.ts.map +1 -0
  506. package/lib/packlets/runtime/iResourceManager.js.map +1 -0
  507. package/lib/packlets/runtime/index.d.ts.map +1 -0
  508. package/lib/packlets/runtime/index.js.map +1 -0
  509. package/lib/packlets/runtime/resource-tree/common.d.ts.map +1 -0
  510. package/lib/packlets/runtime/resource-tree/common.js.map +1 -0
  511. package/lib/packlets/runtime/resource-tree/index.d.ts.map +1 -0
  512. package/lib/packlets/runtime/resource-tree/index.js.map +1 -0
  513. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +1 -0
  514. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +1 -0
  515. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +1 -0
  516. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +1 -0
  517. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +1 -0
  518. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +1 -0
  519. package/lib/packlets/runtime/resourceResolver.d.ts.map +1 -0
  520. package/lib/packlets/runtime/resourceResolver.js.map +1 -0
  521. package/lib/packlets/runtime/resourceTreeResolver.d.ts.map +1 -0
  522. package/lib/packlets/runtime/resourceTreeResolver.js.map +1 -0
  523. package/lib/packlets/runtime/validate.d.ts.map +1 -0
  524. package/lib/packlets/runtime/validate.js.map +1 -0
  525. package/lib/packlets/zip-archive/convert.d.ts.map +1 -0
  526. package/lib/packlets/zip-archive/convert.js.map +1 -0
  527. package/lib/packlets/zip-archive/index.browser.d.ts.map +1 -0
  528. package/lib/packlets/zip-archive/index.browser.js.map +1 -0
  529. package/lib/packlets/zip-archive/index.d.ts.map +1 -0
  530. package/lib/packlets/zip-archive/index.js.map +1 -0
  531. package/lib/packlets/zip-archive/json.d.ts.map +1 -0
  532. package/lib/packlets/zip-archive/json.js.map +1 -0
  533. package/lib/packlets/zip-archive/types.d.ts.map +1 -0
  534. package/lib/packlets/zip-archive/types.js.map +1 -0
  535. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts.map +1 -0
  536. package/lib/packlets/zip-archive/zipArchiveCreator.js.map +1 -0
  537. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts.map +1 -0
  538. package/lib/packlets/zip-archive/zipArchiveFormat.js.map +1 -0
  539. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts.map +1 -0
  540. package/lib/packlets/zip-archive/zipArchiveLoader.js.map +1 -0
  541. package/package.json +12 -10
  542. package/dist/test/data/sample.json +0 -32
  543. package/dist/test/unit/qualifier-types/testQualifierType.js +0 -76
  544. package/dist/test/unit/resource-types/testDerivedResourceType.js +0 -109
  545. package/dist/test/unit/resources/deltaGenerator.helpers.js +0 -282
@@ -0,0 +1 @@
1
+ {"version":3,"file":"territoryQualifierType.js","sourceRoot":"","sources":["../../../src/packlets/qualifier-types/territoryQualifierType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4CAAiF;AACjF,sCAUmB;AACnB,mDAAgD;AAChD,mEAAgE;AAChE,iDAAmC;AACnC,oDAAuF;AAwCvF;;;;;GAKG;AACH,MAAa,sBAAuB,SAAQ,6BAE3C;IAyBC;;;OAGG;IACH,YAAsB,EACpB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,IAAI,EACJ,KAAK,EACL,SAAS,EAC2B;QACpC,yEAAyE;QACzE,IAAI,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,WAAW,CAAC;QAC3B,MAAM,UAAU,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACzG,MAAM,gBAAgB,GACpB,kBAAkB,KAAK,SAAS;YAC9B,CAAC,CAAC,IAAA,qBAAU,EACR,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,yBAAyB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CACjG,CAAC,OAAO,EAAE;YACb,CAAC,CAAC,SA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AAC;QACf,CAAC;QACD,OAAO,iBAAQ,CAAC,kBAAkB,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,yBAAyB,CACrC,KAAa,EACb,eAAyB;QAEzB,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QACvC,OAAO,sBAAsB,CAAC,8BAA8B,CAAC,UAAU,EAAE,eAAe,CAAC;YACvF,CAAC,CAAC,IAAA,kBAAO,EAAC,UAAU,CAAC;YACrB,CAAC,CAAC,IAAA,eAAI,EAAC,GAAG,KAAK,0BAA0B,CAAC,CAAC;IAC/C,CAAC;CACF;AA5OD,wDA4OC","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, 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 QualifierTypeName\n} from '../common';\nimport { QualifierType } from './qualifierType';\nimport { LiteralValueHierarchy } from './literalValueHierarchy';\nimport * as Config from './config';\nimport { JsonCompatibleType, JsonObject, 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.Config.LiteralValueHierarchyDecl | hierarchy declaration}\n * of territory values to use for matching. If not provided, no hierarchy will be used.\n */\n hierarchy?: Config.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 JsonCompatibleType<Config.ITerritoryQualifierTypeConfig>\n> {\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.systemTypeName}\n */\n public readonly systemTypeName: QualifierTypeName = Convert.qualifierTypeName\n .convert('territory')\n .orThrow();\n\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 /* c8 ignore next 6 - edge case: invalid territory values and allowed territory filtering rarely hit */\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 * Gets the {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration}\n * for this qualifier type.\n * @returns `Success` with the configuration if successful, `Failure` with an error message otherwise.\n */\n public getConfiguration(): Result<Config.ISystemTerritoryQualifierTypeConfig> {\n return this.getConfigurationJson().onSuccess((json) =>\n Config.Convert.systemTerritoryQualifierTypeConfig.convert(json)\n );\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.getConfigurationJson}\n */\n public getConfigurationJson(): Result<JsonCompatibleType<Config.ISystemTerritoryQualifierTypeConfig>> {\n const hierarchy: JsonObject = this.hierarchy ? { hierarchy: this.hierarchy.asRecord() } : {};\n const allowedTerritories: JsonObject = this.allowedTerritories\n ? { allowedTerritories: [...this.allowedTerritories] }\n : {};\n return succeed({\n name: this.name,\n systemType: 'territory' as const,\n configuration: {\n allowContextList: this.allowContextList,\n acceptLowercase: this.acceptLowercase,\n ...allowedTerritories,\n ...hierarchy\n }\n });\n }\n\n /**\n * {@inheritDoc QualifierTypes.IQualifierType.validateConfigurationJson}\n */\n public validateConfigurationJson(\n from: unknown\n ): Result<JsonCompatibleType<Config.ISystemTerritoryQualifierTypeConfig>> {\n return Config.Convert.systemTerritoryQualifierTypeConfig.convert(from);\n }\n\n /**\n * Validates a {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | strongly typed configuration object}\n * for this qualifier type.\n * @param from - The unknown data to validate as a configuration object.\n * @returns `Success` with the validated configuration if successful, `Failure` with an error message otherwise.\n */\n public validateConfiguration(from: unknown): Result<Config.ISystemTerritoryQualifierTypeConfig> {\n return this.validateConfigurationJson(from).onSuccess((json) =>\n Config.Convert.systemTerritoryQualifierTypeConfig.convert(json)\n );\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 /* c8 ignore next 8 - edge case: hierarchy matching and fallback logic rarely used */\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 /* c8 ignore next 3 - edge case: lowercase validation rarely fails */\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}: invalid territory code`);\n }\n}\n"]}
@@ -0,0 +1 @@
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,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAIvE;;;GAGG;AACH,eAAO,MAAM,aAAa,kEAOxB,CAAC;AAEH;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,cAAc,EAAE,8BAA8B,CAAC;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,0FAgCjC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decls.js","sourceRoot":"","sources":["../../../../src/packlets/qualifiers/convert/decls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkF;AAElF,yCAAwC;AAGxC,2CAA2C;AAE3C;;;GAGG;AACU,QAAA,aAAa,GAAG,qBAAU,CAAC,YAAY,CAAiB;IACnE,IAAI,EAAE,qBAAU,CAAC,MAAM;IACvB,QAAQ,EAAE,qBAAU,CAAC,MAAM;IAC3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;gBAC7D,IAAI,EAAE,GAAG,EAAE,CAAC,IAAA,kBAAO,EAAC,IAAI,CAAC;gBACzB,eAAe,EAAE,GAAG,EAAE,CAAC,iBAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,eAAe,CAAC;gBACzE,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC;gBACvF,KAAK,EAAE,GAAG,EAAE,CAAC,oBAAoB;aAClC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE;gBACzB,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;oBACzC,OAAO,CAAC,cAAc,EAAE,CAAC;gBAC3B,CAAC;gBACD,OAAO,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;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"]}
@@ -0,0 +1 @@
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"}
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1 @@
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"}
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1 @@
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"}
@@ -0,0 +1 @@
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"]}
@@ -46,9 +46,8 @@ export declare class Qualifier implements IValidatedQualifierDecl, ICollectible<
46
46
  /**
47
47
  * Constructs a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the
48
48
  * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.
49
- * @param name - The name of the qualifier.
50
- * @param type - The {@link QualifierTypes.QualifierType | type} of the qualifier.
51
- * @param defaultPriority - The default {@link ConditionPriority | priority} of conditions
49
+ * @param decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}
50
+ * describing the qualifier to construct.
52
51
  * @public
53
52
  */
54
53
  protected constructor({ name, token, type, defaultPriority, tokenIsOptional, defaultValue, index }: IValidatedQualifierDecl);
@@ -69,19 +68,19 @@ export declare class Qualifier implements IValidatedQualifierDecl, ICollectible<
69
68
  */
70
69
  setIndex(index: QualifierIndex): Result<QualifierIndex>;
71
70
  /**
72
- * {@inheritdoc QualifierTypes.QualifierType.isValidContextValue}
71
+ * {@inheritDoc QualifierTypes.QualifierType.isValidContextValue}
73
72
  */
74
73
  isValidContextValue(value: string): value is QualifierContextValue;
75
74
  /**
76
- * {@inheritdoc QualifierTypes.QualifierType.isValidConditionValue}
75
+ * {@inheritDoc QualifierTypes.QualifierType.isValidConditionValue}
77
76
  */
78
77
  isValidConditionValue(value: string): value is QualifierConditionValue;
79
78
  /**
80
- * {@inheritdoc QualifierTypes.QualifierType.validateCondition}
79
+ * {@inheritDoc QualifierTypes.QualifierType.validateCondition}
81
80
  */
82
81
  validateCondition(value: string, operator?: ConditionOperator): Result<QualifierConditionValue>;
83
82
  /**
84
- * {@inheritdoc QualifierTypes.QualifierType.validateContextValue}
83
+ * {@inheritDoc QualifierTypes.QualifierType.validateContextValue}
85
84
  */
86
85
  validateContextValue(value: string): Result<QualifierContextValue>;
87
86
  }
@@ -0,0 +1 @@
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,cAAc,CAAC;IACpG;;OAEG;IACH,SAAgB,IAAI,EAAE,aAAa,CAAC;IAEpC;;;OAGG;IACH,SAAgB,KAAK,EAAE,aAAa,CAAC;IAErC;;OAEG;IACH,SAAgB,IAAI,EAAE,aAAa,CAAC;IAEpC;;OAEG;IACH,SAAgB,eAAe,EAAE,OAAO,CAAC;IAEzC;;OAEG;IACH,SAAgB,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErD;;OAEG;IACH,IAAW,KAAK,IAAI,cAAc,GAAG,SAAS,CAE7C;IAED;;OAEG;IACH,IAAW,GAAG,IAAI,aAAa,CAE9B;IAED;;;OAGG;IACH,SAAgB,eAAe,EAAE,iBAAiB,CAAC;IAEnD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAExF;;;;;;OAMG;IACH,SAAS,aAAa,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,KAAK,EACN,EAAE,uBAAuB;IAc1B;;;;;;;;OAQG;WACW,MAAM,CAAC,IAAI,EAAE,uBAAuB,GAAG,MAAM,CAAC,SAAS,CAAC;IAItE;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IAI9D;;OAEG;IACI,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,qBAAqB;IAIzE;;OAEG;IACI,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,uBAAuB;IAI7E;;OAEG;IACI,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC,uBAAuB,CAAC;IAItG;;OAEG;IACI,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;CAG1E"}
@@ -45,9 +45,8 @@ class Qualifier {
45
45
  /**
46
46
  * Constructs a new instance of a {@link Qualifiers.Qualifier | Qualifier} from the
47
47
  * supplied {@link Qualifiers.IValidatedQualifierDecl | validated declaration}.
48
- * @param name - The name of the qualifier.
49
- * @param type - The {@link QualifierTypes.QualifierType | type} of the qualifier.
50
- * @param defaultPriority - The default {@link ConditionPriority | priority} of conditions
48
+ * @param decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}
49
+ * describing the qualifier to construct.
51
50
  * @public
52
51
  */
53
52
  constructor({ name, token, type, defaultPriority, tokenIsOptional, defaultValue, index }) {
@@ -84,25 +83,25 @@ class Qualifier {
84
83
  return this._collectible.setIndex(index);
85
84
  }
86
85
  /**
87
- * {@inheritdoc QualifierTypes.QualifierType.isValidContextValue}
86
+ * {@inheritDoc QualifierTypes.QualifierType.isValidContextValue}
88
87
  */
89
88
  isValidContextValue(value) {
90
89
  return this.type.isValidContextValue(value);
91
90
  }
92
91
  /**
93
- * {@inheritdoc QualifierTypes.QualifierType.isValidConditionValue}
92
+ * {@inheritDoc QualifierTypes.QualifierType.isValidConditionValue}
94
93
  */
95
94
  isValidConditionValue(value) {
96
95
  return this.type.isValidConditionValue(value);
97
96
  }
98
97
  /**
99
- * {@inheritdoc QualifierTypes.QualifierType.validateCondition}
98
+ * {@inheritDoc QualifierTypes.QualifierType.validateCondition}
100
99
  */
101
100
  validateCondition(value, operator) {
102
101
  return this.type.validateCondition(value, operator);
103
102
  }
104
103
  /**
105
- * {@inheritdoc QualifierTypes.QualifierType.validateContextValue}
104
+ * {@inheritDoc QualifierTypes.QualifierType.validateContextValue}
106
105
  */
107
106
  validateContextValue(value) {
108
107
  return this.type.validateContextValue(value);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifier.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifier.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAiF;AACjF,sCAQmB;AAInB;;;;GAIG;AACH,MAAa,SAAS;IA2BpB;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;IAC/B,CAAC;IAUD;;;;;;OAMG;IACH,YAAsB,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,KAAK,EACmB;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,IAAI,sBAAW,CAAC,WAAW,CAAgC;YAC7E,GAAG,EAAE,IAAI;YACT,KAAK;YACL,cAAc,EAAE,gBAAa,CAAC,cAAc;SAC7C,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,MAAM,CAAC,IAA6B;QAChD,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAC,KAAqB;QACnC,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,KAAa;QACtC,OAAO,IAAI,CAAC,IAAI,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;AA/HD,8BA+HC","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 decl - The {@link Qualifiers.IValidatedQualifierDecl | validated declaration}\n * describing the qualifier to construct.\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"]}
@@ -9,7 +9,7 @@ import { ReadOnlyQualifierTypeCollector } from '../qualifier-types';
9
9
  */
10
10
  export interface IReadOnlyQualifierCollector extends Collections.IReadOnlyValidatingCollector<Qualifier> {
11
11
  /**
12
- * {@inheritdoc Qualifiers.QualifierCollector.qualifierTypes}
12
+ * {@inheritDoc Qualifiers.QualifierCollector.qualifierTypes}
13
13
  */
14
14
  readonly qualifierTypes: ReadOnlyQualifierTypeCollector;
15
15
  /**
@@ -28,18 +28,49 @@ export interface IReadOnlyQualifierCollector extends Collections.IReadOnlyValida
28
28
  /**
29
29
  * Parameters for creating a new {@link Qualifiers.QualifierCollector}.
30
30
  * @public
31
+ *
32
+ * @remarks
33
+ * `qualifiers` accepts a mixed array of bare axis-name strings and full
34
+ * {@link Qualifiers.IQualifierDecl | declarations}. A string element is
35
+ * sugar for "literal qualifier with this name"; the library synthesizes a
36
+ * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} and a
37
+ * declaration `{ name, typeName: name, defaultPriority: <descending> }`.
38
+ *
39
+ * Synthesized priorities are distributed across the
40
+ * `[MinConditionPriority..MaxConditionPriority]` range adaptively to the
41
+ * array length: `step = max(1, floor((Max - Min) / length))`,
42
+ * `priority = max(Min, Max - index * step)`. Earlier elements get higher
43
+ * priority. The formula never overflows the `ConditionPriority` range
44
+ * regardless of input length; for inputs whose length exceeds the range
45
+ * cardinality (\>1000 axes), trailing priorities collapse at
46
+ * `MinConditionPriority` — supply explicit priorities in that regime
47
+ * if uniqueness matters.
48
+ *
49
+ * `qualifierTypes` may be omitted only when every element of `qualifiers`
50
+ * is a string. If any element is an {@link Qualifiers.IQualifierDecl},
51
+ * `qualifierTypes` must be supplied and must contain the referenced
52
+ * {@link Qualifiers.IQualifierDecl.typeName | typeNames}.
31
53
  */
32
54
  export interface IQualifierCollectorCreateParams {
33
55
  /**
34
56
  * The {@link QualifierTypes.QualifierTypeCollector | qualifier types} used to
35
57
  * create {@link Qualifiers.Qualifier | qualifiers} from {@link Qualifiers.IQualifierDecl | declarations}.
58
+ *
59
+ * Optional only when every entry in `qualifiers` is a bare axis-name string
60
+ * (in which case the library synthesizes a literal qualifier type per name).
36
61
  */
37
- qualifierTypes: ReadOnlyQualifierTypeCollector;
62
+ qualifierTypes?: ReadOnlyQualifierTypeCollector;
38
63
  /**
39
- * Optional list of {@link Qualifiers.IQualifierDecl | declarations} for the qualifiers to add to the collection
40
- * upon creation.
64
+ * Optional list of {@link Qualifiers.IQualifierDecl | declarations} or bare
65
+ * axis-name strings for the qualifiers to add to the collection on creation.
66
+ *
67
+ * @remarks
68
+ * A string element `'foo'` is sugar for a literal qualifier:
69
+ * `{ name: 'foo', typeName: 'foo', defaultPriority: <descending> }` backed by
70
+ * a synthesized {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}
71
+ * named `'foo'`.
41
72
  */
42
- qualifiers?: IQualifierDecl[];
73
+ qualifiers?: ReadonlyArray<string | IQualifierDecl>;
43
74
  }
44
75
  /**
45
76
  * Collects {@link Qualifiers.Qualifier | Qualifiers} from {@link Qualifiers.IQualifierDecl | declarations},
@@ -54,22 +85,89 @@ export declare class QualifierCollector extends ValidatingConvertingCollector<Qu
54
85
  qualifierTypes: ReadOnlyQualifierTypeCollector;
55
86
  /**
56
87
  * Constructor for a {@link Qualifiers.QualifierCollector | QualifierCollector} object.
57
- * @param params - Parameters for creating the collector.
88
+ * @param qualifierTypes - The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types}
89
+ * used to validate declarations.
90
+ * @param qualifiers - Optional list of fully-resolved {@link Qualifiers.IQualifierDecl | declarations}.
58
91
  * @public
59
92
  */
60
- protected constructor(params: IQualifierCollectorCreateParams);
93
+ protected constructor(qualifierTypes: ReadOnlyQualifierTypeCollector, qualifiers?: ReadonlyArray<IQualifierDecl>);
61
94
  /**
62
95
  * Creates a new {@link Qualifiers.QualifierCollector | QualifierCollector} object.
63
96
  * @param params - {@link Qualifiers.IQualifierCollectorCreateParams | Parameters} for creating a new {@link Qualifiers.QualifierCollector | QualifierCollector}.
64
97
  * @returns `Success` with the new collector if successful, or `Failure` if not.
98
+ *
99
+ * @remarks
100
+ * Accepts a mixed array of bare axis-name strings and full
101
+ * {@link Qualifiers.IQualifierDecl | declarations}. String elements are sugar
102
+ * for a literal qualifier: the library synthesizes a
103
+ * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} named
104
+ * after the string and a declaration `{ name, typeName: name, defaultPriority }`.
105
+ * Synthesized priorities are distributed across the
106
+ * `[MinConditionPriority..MaxConditionPriority]` range adaptively to the
107
+ * input length (`step = max(1, floor((Max - Min) / length))`,
108
+ * `priority = max(Min, Max - index * step)`). Earlier elements get higher
109
+ * priority — matching the "earlier qualifier wins when multiple match"
110
+ * mental model — and the formula never overflows the `ConditionPriority`
111
+ * range regardless of input length.
112
+ *
113
+ * `qualifierTypes` may be omitted only when every element of `qualifiers`
114
+ * is a string. If any element is a declaration, `qualifierTypes` is
115
+ * required (and must include the referenced typeNames); the error message
116
+ * names the offending typeName when it is missing.
65
117
  */
66
118
  static create(params: IQualifierCollectorCreateParams): Result<QualifierCollector>;
67
119
  /**
68
- * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}
120
+ * Resolves the public {@link Qualifiers.IQualifierCollectorCreateParams | create params}
121
+ * into the concrete `(qualifierTypes, qualifiers)` pair the constructor expects.
122
+ *
123
+ * @remarks
124
+ * Validates the mixed-shape `qualifiers` input through
125
+ * {@link Converters.oneOf} (string vs {@link Qualifiers.IQualifierDecl})
126
+ * at the public-API boundary, then partitions into bare-string and decl
127
+ * buckets to drive type synthesis. If any decl is present and
128
+ * `qualifierTypes` is omitted, fails with an error that names the
129
+ * offending typeNames.
130
+ *
131
+ * @internal
132
+ */
133
+ private static _resolveCreateParams;
134
+ /**
135
+ * Returns the provided {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}
136
+ * (or synthesizes a new one) augmented with synthesized literal qualifier types for the supplied
137
+ * string names that are not already present.
138
+ *
139
+ * @internal
140
+ */
141
+ private static _resolveQualifierTypes;
142
+ /**
143
+ * Normalizes a mixed `(string | IQualifierDecl)[]` into a fully-resolved
144
+ * `IQualifierDecl[]`, assigning descending default priorities to synthesized
145
+ * decls within the `[MinConditionPriority..MaxConditionPriority]` range.
146
+ *
147
+ * @remarks
148
+ * Step size is adaptive to input length:
149
+ * `step = max(1, floor((Max - Min) / length))`. Each synthesized priority
150
+ * is `max(Min, Max - index * step)` — clamped at the bottom so length
151
+ * extremes (\>1000 axes) degrade gracefully into a tail of equal-`Min`
152
+ * priorities rather than overflowing the `ConditionPriority` range.
153
+ *
154
+ * @internal
155
+ */
156
+ private static _normalizeQualifierDecls;
157
+ /**
158
+ * Returns an empty {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}
159
+ * used as a placeholder when no qualifiers are supplied and the caller omits
160
+ * `qualifierTypes`.
161
+ *
162
+ * @internal
163
+ */
164
+ private static _emptyQualifierTypes;
165
+ /**
166
+ * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}
69
167
  */
70
168
  getByNameOrToken(nameOrToken: string): Result<Qualifier>;
71
169
  /**
72
- * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}
170
+ * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}
73
171
  */
74
172
  hasNameOrToken(nameOrToken: string): boolean;
75
173
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierCollector.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEL,WAAW,EAKX,MAAM,EAIN,6BAA6B,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAA2B,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAA8C,aAAa,EAAE,MAAM,WAAW,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAGL,8BAA8B,EAC/B,MAAM,oB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AEG;IACI,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAcnD;;;OAGG;IACI,UAAU,IAAI,2BAA2B;IAIhD;;;;;;;OAOG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC;CAsB1G"}
@@ -57,8 +57,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
57
57
  exports.QualifierCollector = void 0;
58
58
  const Common = __importStar(require("../common"));
59
59
  const ts_utils_1 = require("@fgv/ts-utils");
60
+ const common_1 = require("../common");
60
61
  const qualifier_1 = require("./qualifier");
61
62
  const convert_1 = require("./convert");
63
+ const qualifier_types_1 = require("../qualifier-types");
64
+ /**
65
+ * Converter for a single entry in the mixed-shape
66
+ * {@link Qualifiers.IQualifierCollectorCreateParams.qualifiers | qualifiers}
67
+ * input — either a bare axis-name string or a full
68
+ * {@link Qualifiers.IQualifierDecl | declaration}. Validates the entry
69
+ * shape at the public-API boundary rather than deferring to the
70
+ * internal qualifier factory.
71
+ */
72
+ const _qualifierEntriesConverter = ts_utils_1.Converters.arrayOf(ts_utils_1.Converters.oneOf([ts_utils_1.Converters.string, convert_1.qualifierDecl]));
62
73
  /**
63
74
  * Collects {@link Qualifiers.Qualifier | Qualifiers} from {@link Qualifiers.IQualifierDecl | declarations},
64
75
  * with strongly-typed ({@link QualifierName | QualifierName} and {@link QualifierIndex | QualifierIndex}) key
@@ -68,11 +79,12 @@ const convert_1 = require("./convert");
68
79
  class QualifierCollector extends ts_utils_1.ValidatingConvertingCollector {
69
80
  /**
70
81
  * Constructor for a {@link Qualifiers.QualifierCollector | QualifierCollector} object.
71
- * @param params - Parameters for creating the collector.
82
+ * @param qualifierTypes - The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types}
83
+ * used to validate declarations.
84
+ * @param qualifiers - Optional list of fully-resolved {@link Qualifiers.IQualifierDecl | declarations}.
72
85
  * @public
73
86
  */
74
- constructor(params) {
75
- var _a;
87
+ constructor(qualifierTypes, qualifiers) {
76
88
  super({
77
89
  factory: (k, i, v) => this._qualifierFactory(k, i, v),
78
90
  converters: new ts_utils_1.Collections.KeyValueConverters({
@@ -80,20 +92,152 @@ class QualifierCollector extends ts_utils_1.ValidatingConvertingCollector {
80
92
  value: convert_1.qualifierDecl
81
93
  })
82
94
  });
83
- this.qualifierTypes = params.qualifierTypes;
95
+ this.qualifierTypes = qualifierTypes;
84
96
  /* c8 ignore next 1 - coverage misses the branch intermittently */
85
- (_a = params.qualifiers) === null || _a === void 0 ? void 0 : _a.forEach((q) => this.validating.add(q.name, q).orThrow());
97
+ qualifiers === null || qualifiers === void 0 ? void 0 : qualifiers.forEach((q) => this.validating.add(q.name, q).orThrow());
86
98
  }
87
99
  /**
88
100
  * Creates a new {@link Qualifiers.QualifierCollector | QualifierCollector} object.
89
101
  * @param params - {@link Qualifiers.IQualifierCollectorCreateParams | Parameters} for creating a new {@link Qualifiers.QualifierCollector | QualifierCollector}.
90
102
  * @returns `Success` with the new collector if successful, or `Failure` if not.
103
+ *
104
+ * @remarks
105
+ * Accepts a mixed array of bare axis-name strings and full
106
+ * {@link Qualifiers.IQualifierDecl | declarations}. String elements are sugar
107
+ * for a literal qualifier: the library synthesizes a
108
+ * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} named
109
+ * after the string and a declaration `{ name, typeName: name, defaultPriority }`.
110
+ * Synthesized priorities are distributed across the
111
+ * `[MinConditionPriority..MaxConditionPriority]` range adaptively to the
112
+ * input length (`step = max(1, floor((Max - Min) / length))`,
113
+ * `priority = max(Min, Max - index * step)`). Earlier elements get higher
114
+ * priority — matching the "earlier qualifier wins when multiple match"
115
+ * mental model — and the formula never overflows the `ConditionPriority`
116
+ * range regardless of input length.
117
+ *
118
+ * `qualifierTypes` may be omitted only when every element of `qualifiers`
119
+ * is a string. If any element is a declaration, `qualifierTypes` is
120
+ * required (and must include the referenced typeNames); the error message
121
+ * names the offending typeName when it is missing.
91
122
  */
92
123
  static create(params) {
93
- return (0, ts_utils_1.captureResult)(() => new QualifierCollector(params));
124
+ return QualifierCollector._resolveCreateParams(params).onSuccess(({ qualifierTypes, qualifiers }) => {
125
+ return (0, ts_utils_1.captureResult)(() => new QualifierCollector(qualifierTypes, qualifiers));
126
+ });
127
+ }
128
+ /**
129
+ * Resolves the public {@link Qualifiers.IQualifierCollectorCreateParams | create params}
130
+ * into the concrete `(qualifierTypes, qualifiers)` pair the constructor expects.
131
+ *
132
+ * @remarks
133
+ * Validates the mixed-shape `qualifiers` input through
134
+ * {@link Converters.oneOf} (string vs {@link Qualifiers.IQualifierDecl})
135
+ * at the public-API boundary, then partitions into bare-string and decl
136
+ * buckets to drive type synthesis. If any decl is present and
137
+ * `qualifierTypes` is omitted, fails with an error that names the
138
+ * offending typeNames.
139
+ *
140
+ * @internal
141
+ */
142
+ static _resolveCreateParams(params) {
143
+ const raw = params.qualifiers;
144
+ if (raw === undefined || raw.length === 0) {
145
+ if (params.qualifierTypes === undefined) {
146
+ return (0, ts_utils_1.succeed)({ qualifierTypes: QualifierCollector._emptyQualifierTypes(), qualifiers: undefined });
147
+ }
148
+ return (0, ts_utils_1.succeed)({ qualifierTypes: params.qualifierTypes, qualifiers: undefined });
149
+ }
150
+ return _qualifierEntriesConverter.convert(raw).onSuccess((entries) => {
151
+ const stringNames = [];
152
+ const declTypeNames = [];
153
+ for (const entry of entries) {
154
+ if (typeof entry === 'string') {
155
+ stringNames.push(entry);
156
+ }
157
+ else {
158
+ declTypeNames.push(entry.typeName);
159
+ }
160
+ }
161
+ if (declTypeNames.length > 0 && params.qualifierTypes === undefined) {
162
+ const unique = Array.from(new Set(declTypeNames));
163
+ return (0, ts_utils_1.fail)(`qualifierTypes must be supplied when qualifiers include declarations; ` +
164
+ `missing types for: ${unique.map((n) => `'${n}'`).join(', ')}`);
165
+ }
166
+ return QualifierCollector._resolveQualifierTypes(params.qualifierTypes, stringNames).onSuccess((qualifierTypes) => {
167
+ const decls = QualifierCollector._normalizeQualifierDecls(entries);
168
+ return (0, ts_utils_1.succeed)({ qualifierTypes, qualifiers: decls });
169
+ });
170
+ });
171
+ }
172
+ /**
173
+ * Returns the provided {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}
174
+ * (or synthesizes a new one) augmented with synthesized literal qualifier types for the supplied
175
+ * string names that are not already present.
176
+ *
177
+ * @internal
178
+ */
179
+ static _resolveQualifierTypes(provided, stringNames) {
180
+ if (stringNames.length === 0) {
181
+ // No bare names to synthesize. The all-decls case requires `provided` to be defined
182
+ // (else _resolveCreateParams would have failed before calling us); fall back to an
183
+ // empty type collector only as a defensive measure.
184
+ /* c8 ignore next 1 - defensive: unreachable when called from _resolveCreateParams */
185
+ return (0, ts_utils_1.succeed)(provided !== null && provided !== void 0 ? provided : QualifierCollector._emptyQualifierTypes());
186
+ }
187
+ return (0, ts_utils_1.mapResults)(stringNames.map((name) => qualifier_types_1.LiteralQualifierType.create({ name }))).onSuccess((literalTypes) => {
188
+ return qualifier_types_1.QualifierTypeCollector.create().onSuccess((collector) => {
189
+ const existingAdds = provided !== undefined
190
+ ? Array.from(provided.values()).map((existing) => collector.add(existing))
191
+ : [];
192
+ const literalAdds = literalTypes
193
+ .filter((lit) => !collector.has(lit.name))
194
+ .map((lit) => collector.add(lit));
195
+ return (0, ts_utils_1.mapResults)([...existingAdds, ...literalAdds]).onSuccess(() => (0, ts_utils_1.succeed)(collector));
196
+ });
197
+ });
198
+ }
199
+ /**
200
+ * Normalizes a mixed `(string | IQualifierDecl)[]` into a fully-resolved
201
+ * `IQualifierDecl[]`, assigning descending default priorities to synthesized
202
+ * decls within the `[MinConditionPriority..MaxConditionPriority]` range.
203
+ *
204
+ * @remarks
205
+ * Step size is adaptive to input length:
206
+ * `step = max(1, floor((Max - Min) / length))`. Each synthesized priority
207
+ * is `max(Min, Max - index * step)` — clamped at the bottom so length
208
+ * extremes (\>1000 axes) degrade gracefully into a tail of equal-`Min`
209
+ * priorities rather than overflowing the `ConditionPriority` range.
210
+ *
211
+ * @internal
212
+ */
213
+ static _normalizeQualifierDecls(qualifiers) {
214
+ const range = common_1.MaxConditionPriority - common_1.MinConditionPriority;
215
+ const step = Math.max(1, Math.floor(range / qualifiers.length));
216
+ return qualifiers.map((q, index) => {
217
+ if (typeof q === 'string') {
218
+ const raw = common_1.MaxConditionPriority - index * step;
219
+ return {
220
+ name: q,
221
+ typeName: q,
222
+ defaultPriority: Math.max(common_1.MinConditionPriority, raw)
223
+ };
224
+ }
225
+ return q;
226
+ });
227
+ }
228
+ /**
229
+ * Returns an empty {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}
230
+ * used as a placeholder when no qualifiers are supplied and the caller omits
231
+ * `qualifierTypes`.
232
+ *
233
+ * @internal
234
+ */
235
+ static _emptyQualifierTypes() {
236
+ /* c8 ignore next 1 - QualifierTypeCollector.create() is total for the empty case */
237
+ return qualifier_types_1.QualifierTypeCollector.create().orThrow();
94
238
  }
95
239
  /**
96
- * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}
240
+ * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.getByNameOrToken}
97
241
  */
98
242
  getByNameOrToken(nameOrToken) {
99
243
  return this.validating.get(nameOrToken).onFailure((message) => {
@@ -106,7 +250,7 @@ class QualifierCollector extends ts_utils_1.ValidatingConvertingCollector {
106
250
  });
107
251
  }
108
252
  /**
109
- * {@inheritdoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}
253
+ * {@inheritDoc Qualifiers.IReadOnlyQualifierCollector.hasNameOrToken}
110
254
  */
111
255
  hasNameOrToken(nameOrToken) {
112
256
  /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualifierCollector.js","sourceRoot":"","sources":["../../../src/packlets/qualifiers/qualifierCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;G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E,EAAE;YACvB,kEAAkE;YAClE,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzC,OAAO,IAAA,eAAI,EACT,oBAAoB,SAAS,CAAC,KAAK,uCAAuC,CAC3E,CAAC;YACJ,CAAC;iBAAM,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/C,OAAO,IAAA,eAAI,EACT,mBAAmB,SAAS,CAAC,IAAI,wCAAwC,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;AA5QD,gDA4QC","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 Converter,\n Converters,\n failWithDetail,\n mapResults,\n Result,\n fail,\n succeed,\n succeedWithDetail,\n ValidatingConvertingCollector\n} from '@fgv/ts-utils';\nimport { IQualifierDecl, IValidatedQualifierDecl } from './qualifierDecl';\nimport { MaxConditionPriority, MinConditionPriority, QualifierName } from '../common';\nimport { Qualifier } from './qualifier';\nimport { IQualifierDeclConvertContext, qualifierDecl, validatedQualifierDecl } from './convert';\nimport {\n LiteralQualifierType,\n QualifierTypeCollector,\n ReadOnlyQualifierTypeCollector\n} from '../qualifier-types';\n\n/**\n * Converter for a single entry in the mixed-shape\n * {@link Qualifiers.IQualifierCollectorCreateParams.qualifiers | qualifiers}\n * input — either a bare axis-name string or a full\n * {@link Qualifiers.IQualifierDecl | declaration}. Validates the entry\n * shape at the public-API boundary rather than deferring to the\n * internal qualifier factory.\n */\nconst _qualifierEntriesConverter: Converter<ReadonlyArray<string | IQualifierDecl>> = Converters.arrayOf(\n Converters.oneOf<string | IQualifierDecl>([Converters.string, qualifierDecl])\n);\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 *\n * @remarks\n * `qualifiers` accepts a mixed array of bare axis-name strings and full\n * {@link Qualifiers.IQualifierDecl | declarations}. A string element is\n * sugar for \"literal qualifier with this name\"; the library synthesizes a\n * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} and a\n * declaration `{ name, typeName: name, defaultPriority: <descending> }`.\n *\n * Synthesized priorities are distributed across the\n * `[MinConditionPriority..MaxConditionPriority]` range adaptively to the\n * array length: `step = max(1, floor((Max - Min) / length))`,\n * `priority = max(Min, Max - index * step)`. Earlier elements get higher\n * priority. The formula never overflows the `ConditionPriority` range\n * regardless of input length; for inputs whose length exceeds the range\n * cardinality (\\>1000 axes), trailing priorities collapse at\n * `MinConditionPriority` — supply explicit priorities in that regime\n * if uniqueness matters.\n *\n * `qualifierTypes` may be omitted only when every element of `qualifiers`\n * is a string. If any element is an {@link Qualifiers.IQualifierDecl},\n * `qualifierTypes` must be supplied and must contain the referenced\n * {@link Qualifiers.IQualifierDecl.typeName | typeNames}.\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 * Optional only when every entry in `qualifiers` is a bare axis-name string\n * (in which case the library synthesizes a literal qualifier type per name).\n */\n qualifierTypes?: ReadOnlyQualifierTypeCollector;\n\n /**\n * Optional list of {@link Qualifiers.IQualifierDecl | declarations} or bare\n * axis-name strings for the qualifiers to add to the collection on creation.\n *\n * @remarks\n * A string element `'foo'` is sugar for a literal qualifier:\n * `{ name: 'foo', typeName: 'foo', defaultPriority: <descending> }` backed by\n * a synthesized {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType}\n * named `'foo'`.\n */\n qualifiers?: ReadonlyArray<string | 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 qualifierTypes - The {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier types}\n * used to validate declarations.\n * @param qualifiers - Optional list of fully-resolved {@link Qualifiers.IQualifierDecl | declarations}.\n * @public\n */\n protected constructor(\n qualifierTypes: ReadOnlyQualifierTypeCollector,\n qualifiers?: ReadonlyArray<IQualifierDecl>\n ) {\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 = qualifierTypes;\n /* c8 ignore next 1 - coverage misses the branch intermittently */\n 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 * @remarks\n * Accepts a mixed array of bare axis-name strings and full\n * {@link Qualifiers.IQualifierDecl | declarations}. String elements are sugar\n * for a literal qualifier: the library synthesizes a\n * {@link QualifierTypes.LiteralQualifierType | LiteralQualifierType} named\n * after the string and a declaration `{ name, typeName: name, defaultPriority }`.\n * Synthesized priorities are distributed across the\n * `[MinConditionPriority..MaxConditionPriority]` range adaptively to the\n * input length (`step = max(1, floor((Max - Min) / length))`,\n * `priority = max(Min, Max - index * step)`). Earlier elements get higher\n * priority — matching the \"earlier qualifier wins when multiple match\"\n * mental model — and the formula never overflows the `ConditionPriority`\n * range regardless of input length.\n *\n * `qualifierTypes` may be omitted only when every element of `qualifiers`\n * is a string. If any element is a declaration, `qualifierTypes` is\n * required (and must include the referenced typeNames); the error message\n * names the offending typeName when it is missing.\n */\n public static create(params: IQualifierCollectorCreateParams): Result<QualifierCollector> {\n return QualifierCollector._resolveCreateParams(params).onSuccess(({ qualifierTypes, qualifiers }) => {\n return captureResult(() => new QualifierCollector(qualifierTypes, qualifiers));\n });\n }\n\n /**\n * Resolves the public {@link Qualifiers.IQualifierCollectorCreateParams | create params}\n * into the concrete `(qualifierTypes, qualifiers)` pair the constructor expects.\n *\n * @remarks\n * Validates the mixed-shape `qualifiers` input through\n * {@link Converters.oneOf} (string vs {@link Qualifiers.IQualifierDecl})\n * at the public-API boundary, then partitions into bare-string and decl\n * buckets to drive type synthesis. If any decl is present and\n * `qualifierTypes` is omitted, fails with an error that names the\n * offending typeNames.\n *\n * @internal\n */\n private static _resolveCreateParams(params: IQualifierCollectorCreateParams): Result<{\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n qualifiers?: ReadonlyArray<IQualifierDecl>;\n }> {\n const raw = params.qualifiers;\n if (raw === undefined || raw.length === 0) {\n if (params.qualifierTypes === undefined) {\n return succeed({ qualifierTypes: QualifierCollector._emptyQualifierTypes(), qualifiers: undefined });\n }\n return succeed({ qualifierTypes: params.qualifierTypes, qualifiers: undefined });\n }\n\n return _qualifierEntriesConverter.convert(raw).onSuccess((entries) => {\n const stringNames: string[] = [];\n const declTypeNames: string[] = [];\n for (const entry of entries) {\n if (typeof entry === 'string') {\n stringNames.push(entry);\n } else {\n declTypeNames.push(entry.typeName);\n }\n }\n\n if (declTypeNames.length > 0 && params.qualifierTypes === undefined) {\n const unique = Array.from(new Set(declTypeNames));\n return fail<{\n qualifierTypes: ReadOnlyQualifierTypeCollector;\n qualifiers?: ReadonlyArray<IQualifierDecl>;\n }>(\n `qualifierTypes must be supplied when qualifiers include declarations; ` +\n `missing types for: ${unique.map((n) => `'${n}'`).join(', ')}`\n );\n }\n\n return QualifierCollector._resolveQualifierTypes(params.qualifierTypes, stringNames).onSuccess(\n (qualifierTypes) => {\n const decls = QualifierCollector._normalizeQualifierDecls(entries);\n return succeed({ qualifierTypes, qualifiers: decls });\n }\n );\n });\n }\n\n /**\n * Returns the provided {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}\n * (or synthesizes a new one) augmented with synthesized literal qualifier types for the supplied\n * string names that are not already present.\n *\n * @internal\n */\n private static _resolveQualifierTypes(\n provided: ReadOnlyQualifierTypeCollector | undefined,\n stringNames: ReadonlyArray<string>\n ): Result<ReadOnlyQualifierTypeCollector> {\n if (stringNames.length === 0) {\n // No bare names to synthesize. The all-decls case requires `provided` to be defined\n // (else _resolveCreateParams would have failed before calling us); fall back to an\n // empty type collector only as a defensive measure.\n /* c8 ignore next 1 - defensive: unreachable when called from _resolveCreateParams */\n return succeed(provided ?? QualifierCollector._emptyQualifierTypes());\n }\n return mapResults(stringNames.map((name) => LiteralQualifierType.create({ name }))).onSuccess(\n (literalTypes) => {\n return QualifierTypeCollector.create().onSuccess((collector) => {\n const existingAdds: ReadonlyArray<Result<unknown>> =\n provided !== undefined\n ? Array.from(provided.values()).map((existing) => collector.add(existing))\n : [];\n const literalAdds: ReadonlyArray<Result<unknown>> = literalTypes\n .filter((lit) => !collector.has(lit.name))\n .map((lit) => collector.add(lit));\n return mapResults([...existingAdds, ...literalAdds]).onSuccess(() =>\n succeed(collector as ReadOnlyQualifierTypeCollector)\n );\n });\n }\n );\n }\n\n /**\n * Normalizes a mixed `(string | IQualifierDecl)[]` into a fully-resolved\n * `IQualifierDecl[]`, assigning descending default priorities to synthesized\n * decls within the `[MinConditionPriority..MaxConditionPriority]` range.\n *\n * @remarks\n * Step size is adaptive to input length:\n * `step = max(1, floor((Max - Min) / length))`. Each synthesized priority\n * is `max(Min, Max - index * step)` — clamped at the bottom so length\n * extremes (\\>1000 axes) degrade gracefully into a tail of equal-`Min`\n * priorities rather than overflowing the `ConditionPriority` range.\n *\n * @internal\n */\n private static _normalizeQualifierDecls(\n qualifiers: ReadonlyArray<string | IQualifierDecl>\n ): ReadonlyArray<IQualifierDecl> {\n const range = MaxConditionPriority - MinConditionPriority;\n const step = Math.max(1, Math.floor(range / qualifiers.length));\n return qualifiers.map((q, index) => {\n if (typeof q === 'string') {\n const raw = MaxConditionPriority - index * step;\n return {\n name: q,\n typeName: q,\n defaultPriority: Math.max(MinConditionPriority, raw)\n };\n }\n return q;\n });\n }\n\n /**\n * Returns an empty {@link QualifierTypes.ReadOnlyQualifierTypeCollector | qualifier-type collector}\n * used as a placeholder when no qualifiers are supplied and the caller omits\n * `qualifierTypes`.\n *\n * @internal\n */\n private static _emptyQualifierTypes(): ReadOnlyQualifierTypeCollector {\n /* c8 ignore next 1 - QualifierTypeCollector.create() is total for the empty case */\n return QualifierTypeCollector.create().orThrow();\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 /* c8 ignore next 9 - coverage intermittently misses this block */\n if (this.hasNameOrToken(validated.token)) {\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 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"]}
@@ -0,0 +1 @@
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"}