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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/CHANGELOG.json +21 -0
  2. package/CHANGELOG.md +14 -1
  3. package/README.md +794 -137
  4. package/dist/ts-res.d.ts +2257 -268
  5. package/dist/tsdoc-metadata.json +1 -1
  6. package/eslint.config.js +16 -0
  7. package/lib/index.d.ts +2 -1
  8. package/lib/index.js +3 -1
  9. package/lib/packlets/bundle/bundleBuilder.js +7 -4
  10. package/lib/packlets/bundle/bundleLoader.js +1 -0
  11. package/lib/packlets/bundle/bundleUtils.js +14 -16
  12. package/lib/packlets/bundle/index.d.ts +3 -1
  13. package/lib/packlets/bundle/index.js +14 -3
  14. package/lib/packlets/common/convert.d.ts +15 -0
  15. package/lib/packlets/common/convert.js +16 -1
  16. package/lib/packlets/common/helpers/context.js +1 -0
  17. package/lib/packlets/common/helpers/resources.d.ts +7 -0
  18. package/lib/packlets/common/helpers/resources.js +13 -0
  19. package/lib/packlets/common/resources.d.ts +44 -1
  20. package/lib/packlets/common/validate/conditions.d.ts +17 -1
  21. package/lib/packlets/common/validate/conditions.js +32 -6
  22. package/lib/packlets/common/validate/regularExpressions.d.ts +4 -0
  23. package/lib/packlets/common/validate/regularExpressions.js +5 -1
  24. package/lib/packlets/common/validate/resources.d.ts +35 -1
  25. package/lib/packlets/common/validate/resources.js +55 -0
  26. package/lib/packlets/conditions/condition.js +1 -0
  27. package/lib/packlets/conditions/conditionSet.d.ts +9 -0
  28. package/lib/packlets/conditions/conditionSet.js +75 -1
  29. package/lib/packlets/config/configInitFactory.d.ts +217 -0
  30. package/lib/packlets/config/configInitFactory.js +302 -0
  31. package/lib/packlets/config/convert.d.ts +9 -0
  32. package/lib/packlets/config/convert.js +12 -1
  33. package/lib/packlets/config/index.d.ts +1 -0
  34. package/lib/packlets/config/index.js +1 -0
  35. package/lib/packlets/config/json.d.ts +1 -1
  36. package/lib/packlets/config/systemConfiguration.d.ts +16 -3
  37. package/lib/packlets/config/systemConfiguration.js +19 -40
  38. package/lib/packlets/import/fsItem.d.ts +2 -1
  39. package/lib/packlets/import/fsItem.js +9 -13
  40. package/lib/packlets/import/importManager.d.ts +2 -1
  41. package/lib/packlets/import/importers/jsonImporter.js +1 -0
  42. package/lib/packlets/import/importers/pathImporter.d.ts +2 -1
  43. package/lib/packlets/import/importers/pathImporter.js +2 -1
  44. package/lib/packlets/qualifier-types/config/convert.d.ts +22 -1
  45. package/lib/packlets/qualifier-types/config/convert.js +67 -2
  46. package/lib/packlets/qualifier-types/config/json.d.ts +24 -2
  47. package/lib/packlets/qualifier-types/config/json.js +11 -0
  48. package/lib/packlets/qualifier-types/convert.d.ts +1 -1
  49. package/lib/packlets/qualifier-types/helpers.d.ts +14 -5
  50. package/lib/packlets/qualifier-types/helpers.js +2 -2
  51. package/lib/packlets/qualifier-types/languageQualifierType.d.ts +28 -2
  52. package/lib/packlets/qualifier-types/languageQualifierType.js +73 -0
  53. package/lib/packlets/qualifier-types/literalQualifierType.d.ts +31 -5
  54. package/lib/packlets/qualifier-types/literalQualifierType.js +75 -0
  55. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts +7 -11
  56. package/lib/packlets/qualifier-types/literalValueHierarchy.js +12 -1
  57. package/lib/packlets/qualifier-types/qualifierType.d.ts +31 -2
  58. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +31 -5
  59. package/lib/packlets/qualifier-types/territoryQualifierType.js +80 -0
  60. package/lib/packlets/qualifiers/qualifierCollector.js +1 -2
  61. package/lib/packlets/resource-json/compiled/convert.js +2 -1
  62. package/lib/packlets/resource-json/compiled/json.d.ts +6 -2
  63. package/lib/packlets/resource-types/config/convert.d.ts +1 -1
  64. package/lib/packlets/resource-types/config/convert.js +3 -1
  65. package/lib/packlets/resource-types/config/json.d.ts +3 -1
  66. package/lib/packlets/resource-types/jsonResourceType.d.ts +10 -1
  67. package/lib/packlets/resource-types/jsonResourceType.js +7 -3
  68. package/lib/packlets/resource-types/resourceType.d.ts +100 -8
  69. package/lib/packlets/resource-types/resourceType.js +39 -3
  70. package/lib/packlets/resources/candidateReducer.js +3 -0
  71. package/lib/packlets/resources/candidateValue.d.ts +92 -0
  72. package/lib/packlets/resources/candidateValue.js +128 -0
  73. package/lib/packlets/resources/candidateValueCollector.d.ts +55 -0
  74. package/lib/packlets/resources/candidateValueCollector.js +96 -0
  75. package/lib/packlets/resources/common.d.ts +14 -0
  76. package/lib/packlets/resources/deltaGenerator.d.ts +189 -0
  77. package/lib/packlets/resources/deltaGenerator.js +344 -0
  78. package/lib/packlets/resources/index.d.ts +3 -0
  79. package/lib/packlets/resources/index.js +3 -0
  80. package/lib/packlets/resources/resource.d.ts +6 -6
  81. package/lib/packlets/resources/resource.js +5 -10
  82. package/lib/packlets/resources/resourceBuilder.d.ts +6 -0
  83. package/lib/packlets/resources/resourceBuilder.js +4 -1
  84. package/lib/packlets/resources/resourceCandidate.d.ts +15 -2
  85. package/lib/packlets/resources/resourceCandidate.js +17 -5
  86. package/lib/packlets/resources/resourceManagerBuilder.d.ts +131 -10
  87. package/lib/packlets/resources/resourceManagerBuilder.js +289 -45
  88. package/lib/packlets/runtime/compiledResourceCollection.d.ts +27 -11
  89. package/lib/packlets/runtime/compiledResourceCollection.js +71 -28
  90. package/lib/packlets/runtime/conditionSetResolutionResult.js +3 -0
  91. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts +53 -3
  92. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts +82 -37
  93. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js +49 -77
  94. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +23 -2
  95. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +53 -31
  96. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +4 -4
  97. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +2 -2
  98. package/lib/packlets/runtime/iResourceManager.d.ts +17 -5
  99. package/lib/packlets/runtime/index.d.ts +1 -0
  100. package/lib/packlets/runtime/index.js +1 -0
  101. package/lib/packlets/runtime/resource-tree/common.d.ts +1 -1
  102. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts +7 -7
  103. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js +5 -5
  104. package/lib/packlets/runtime/resourceResolver.d.ts +43 -1
  105. package/lib/packlets/runtime/resourceResolver.js +56 -28
  106. package/lib/packlets/runtime/resourceTreeResolver.d.ts +152 -0
  107. package/lib/packlets/runtime/resourceTreeResolver.js +222 -0
  108. package/lib/packlets/runtime/validate.js +1 -0
  109. package/lib/packlets/zip-archive/convert.d.ts +52 -0
  110. package/lib/packlets/zip-archive/convert.js +103 -0
  111. package/lib/packlets/zip-archive/index.d.ts +23 -0
  112. package/lib/packlets/zip-archive/index.js +95 -0
  113. package/lib/packlets/zip-archive/json.d.ts +64 -0
  114. package/lib/packlets/zip-archive/json.js +24 -0
  115. package/lib/packlets/zip-archive/types.d.ts +98 -0
  116. package/lib/packlets/zip-archive/types.js +39 -0
  117. package/lib/packlets/zip-archive/zipArchiveCreator.d.ts +35 -0
  118. package/lib/packlets/zip-archive/zipArchiveCreator.js +195 -0
  119. package/lib/packlets/zip-archive/zipArchiveFormat.d.ts +70 -0
  120. package/lib/packlets/zip-archive/zipArchiveFormat.js +184 -0
  121. package/lib/packlets/zip-archive/zipArchiveLoader.d.ts +70 -0
  122. package/lib/packlets/zip-archive/zipArchiveLoader.js +286 -0
  123. package/package.json +26 -32
  124. package/CLAUDE.md +0 -186
  125. package/EXAMPLE_INIT_PARAMS.md +0 -88
  126. package/PROGRESS_SUMMARY.md +0 -48
  127. package/lib/index.d.ts.map +0 -1
  128. package/lib/index.js.map +0 -1
  129. package/lib/packlets/bundle/bundleBuilder.d.ts.map +0 -1
  130. package/lib/packlets/bundle/bundleBuilder.js.map +0 -1
  131. package/lib/packlets/bundle/bundleLoader.d.ts.map +0 -1
  132. package/lib/packlets/bundle/bundleLoader.js.map +0 -1
  133. package/lib/packlets/bundle/bundleNormalizer.d.ts.map +0 -1
  134. package/lib/packlets/bundle/bundleNormalizer.js.map +0 -1
  135. package/lib/packlets/bundle/bundleUtils.d.ts.map +0 -1
  136. package/lib/packlets/bundle/bundleUtils.js.map +0 -1
  137. package/lib/packlets/bundle/convert.d.ts.map +0 -1
  138. package/lib/packlets/bundle/convert.js.map +0 -1
  139. package/lib/packlets/bundle/index.d.ts.map +0 -1
  140. package/lib/packlets/bundle/index.js.map +0 -1
  141. package/lib/packlets/bundle/model.d.ts.map +0 -1
  142. package/lib/packlets/bundle/model.js.map +0 -1
  143. package/lib/packlets/common/conditions.d.ts.map +0 -1
  144. package/lib/packlets/common/conditions.js.map +0 -1
  145. package/lib/packlets/common/convert.d.ts.map +0 -1
  146. package/lib/packlets/common/convert.js.map +0 -1
  147. package/lib/packlets/common/helpers/conditions.d.ts.map +0 -1
  148. package/lib/packlets/common/helpers/conditions.js.map +0 -1
  149. package/lib/packlets/common/helpers/context.d.ts.map +0 -1
  150. package/lib/packlets/common/helpers/context.js.map +0 -1
  151. package/lib/packlets/common/helpers/index.d.ts.map +0 -1
  152. package/lib/packlets/common/helpers/index.js.map +0 -1
  153. package/lib/packlets/common/helpers/qualifierDefaultValues.d.ts.map +0 -1
  154. package/lib/packlets/common/helpers/qualifierDefaultValues.js.map +0 -1
  155. package/lib/packlets/common/helpers/resources.d.ts.map +0 -1
  156. package/lib/packlets/common/helpers/resources.js.map +0 -1
  157. package/lib/packlets/common/index.d.ts.map +0 -1
  158. package/lib/packlets/common/index.js.map +0 -1
  159. package/lib/packlets/common/resources.d.ts.map +0 -1
  160. package/lib/packlets/common/resources.js.map +0 -1
  161. package/lib/packlets/common/validate/conditions.d.ts.map +0 -1
  162. package/lib/packlets/common/validate/conditions.js.map +0 -1
  163. package/lib/packlets/common/validate/index.d.ts.map +0 -1
  164. package/lib/packlets/common/validate/index.js.map +0 -1
  165. package/lib/packlets/common/validate/regularExpressions.d.ts.map +0 -1
  166. package/lib/packlets/common/validate/regularExpressions.js.map +0 -1
  167. package/lib/packlets/common/validate/resources.d.ts.map +0 -1
  168. package/lib/packlets/common/validate/resources.js.map +0 -1
  169. package/lib/packlets/conditions/condition.d.ts.map +0 -1
  170. package/lib/packlets/conditions/condition.js.map +0 -1
  171. package/lib/packlets/conditions/conditionCollector.d.ts.map +0 -1
  172. package/lib/packlets/conditions/conditionCollector.js.map +0 -1
  173. package/lib/packlets/conditions/conditionDecls.d.ts.map +0 -1
  174. package/lib/packlets/conditions/conditionDecls.js.map +0 -1
  175. package/lib/packlets/conditions/conditionSet.d.ts.map +0 -1
  176. package/lib/packlets/conditions/conditionSet.js.map +0 -1
  177. package/lib/packlets/conditions/conditionSetCollector.d.ts.map +0 -1
  178. package/lib/packlets/conditions/conditionSetCollector.js.map +0 -1
  179. package/lib/packlets/conditions/conditionSetDecls.d.ts.map +0 -1
  180. package/lib/packlets/conditions/conditionSetDecls.js.map +0 -1
  181. package/lib/packlets/conditions/conditionToken.d.ts.map +0 -1
  182. package/lib/packlets/conditions/conditionToken.js.map +0 -1
  183. package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +0 -1
  184. package/lib/packlets/conditions/convert/conditionSetDecls.js.map +0 -1
  185. package/lib/packlets/conditions/convert/decls.d.ts.map +0 -1
  186. package/lib/packlets/conditions/convert/decls.js.map +0 -1
  187. package/lib/packlets/conditions/convert/index.d.ts.map +0 -1
  188. package/lib/packlets/conditions/convert/index.js.map +0 -1
  189. package/lib/packlets/conditions/index.d.ts.map +0 -1
  190. package/lib/packlets/conditions/index.js.map +0 -1
  191. package/lib/packlets/config/common.d.ts.map +0 -1
  192. package/lib/packlets/config/common.js.map +0 -1
  193. package/lib/packlets/config/convert.d.ts.map +0 -1
  194. package/lib/packlets/config/convert.js.map +0 -1
  195. package/lib/packlets/config/index.d.ts.map +0 -1
  196. package/lib/packlets/config/index.js.map +0 -1
  197. package/lib/packlets/config/json.d.ts.map +0 -1
  198. package/lib/packlets/config/json.js.map +0 -1
  199. package/lib/packlets/config/predefined/default.d.ts.map +0 -1
  200. package/lib/packlets/config/predefined/default.js.map +0 -1
  201. package/lib/packlets/config/predefined/extended.d.ts.map +0 -1
  202. package/lib/packlets/config/predefined/extended.js.map +0 -1
  203. package/lib/packlets/config/predefined/index.d.ts.map +0 -1
  204. package/lib/packlets/config/predefined/index.js.map +0 -1
  205. package/lib/packlets/config/systemConfiguration.d.ts.map +0 -1
  206. package/lib/packlets/config/systemConfiguration.js.map +0 -1
  207. package/lib/packlets/context/contextDecls.d.ts.map +0 -1
  208. package/lib/packlets/context/contextDecls.js.map +0 -1
  209. package/lib/packlets/context/contextToken.d.ts.map +0 -1
  210. package/lib/packlets/context/contextToken.js.map +0 -1
  211. package/lib/packlets/context/convert/decls.d.ts.map +0 -1
  212. package/lib/packlets/context/convert/decls.js.map +0 -1
  213. package/lib/packlets/context/convert/index.d.ts.map +0 -1
  214. package/lib/packlets/context/convert/index.js.map +0 -1
  215. package/lib/packlets/context/index.d.ts.map +0 -1
  216. package/lib/packlets/context/index.js.map +0 -1
  217. package/lib/packlets/decisions/abstractDecision.d.ts.map +0 -1
  218. package/lib/packlets/decisions/abstractDecision.js.map +0 -1
  219. package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +0 -1
  220. package/lib/packlets/decisions/abstractDecisionCollector.js.map +0 -1
  221. package/lib/packlets/decisions/candidate.d.ts.map +0 -1
  222. package/lib/packlets/decisions/candidate.js.map +0 -1
  223. package/lib/packlets/decisions/common.d.ts.map +0 -1
  224. package/lib/packlets/decisions/common.js.map +0 -1
  225. package/lib/packlets/decisions/concreteDecision.d.ts.map +0 -1
  226. package/lib/packlets/decisions/concreteDecision.js.map +0 -1
  227. package/lib/packlets/decisions/decision.d.ts.map +0 -1
  228. package/lib/packlets/decisions/decision.js.map +0 -1
  229. package/lib/packlets/decisions/index.d.ts.map +0 -1
  230. package/lib/packlets/decisions/index.js.map +0 -1
  231. package/lib/packlets/import/fsItem.d.ts.map +0 -1
  232. package/lib/packlets/import/fsItem.js.map +0 -1
  233. package/lib/packlets/import/importContext.d.ts.map +0 -1
  234. package/lib/packlets/import/importContext.js.map +0 -1
  235. package/lib/packlets/import/importManager.d.ts.map +0 -1
  236. package/lib/packlets/import/importManager.js.map +0 -1
  237. package/lib/packlets/import/importable.d.ts.map +0 -1
  238. package/lib/packlets/import/importable.js.map +0 -1
  239. package/lib/packlets/import/importers/collectionImporter.d.ts.map +0 -1
  240. package/lib/packlets/import/importers/collectionImporter.js.map +0 -1
  241. package/lib/packlets/import/importers/fsItemImporter.d.ts.map +0 -1
  242. package/lib/packlets/import/importers/fsItemImporter.js.map +0 -1
  243. package/lib/packlets/import/importers/importer.d.ts.map +0 -1
  244. package/lib/packlets/import/importers/importer.js.map +0 -1
  245. package/lib/packlets/import/importers/index.d.ts.map +0 -1
  246. package/lib/packlets/import/importers/index.js.map +0 -1
  247. package/lib/packlets/import/importers/jsonImporter.d.ts.map +0 -1
  248. package/lib/packlets/import/importers/jsonImporter.js.map +0 -1
  249. package/lib/packlets/import/importers/pathImporter.d.ts.map +0 -1
  250. package/lib/packlets/import/importers/pathImporter.js.map +0 -1
  251. package/lib/packlets/import/index.d.ts.map +0 -1
  252. package/lib/packlets/import/index.js.map +0 -1
  253. package/lib/packlets/qualifier-types/config/convert.d.ts.map +0 -1
  254. package/lib/packlets/qualifier-types/config/convert.js.map +0 -1
  255. package/lib/packlets/qualifier-types/config/index.d.ts.map +0 -1
  256. package/lib/packlets/qualifier-types/config/index.js.map +0 -1
  257. package/lib/packlets/qualifier-types/config/json.d.ts.map +0 -1
  258. package/lib/packlets/qualifier-types/config/json.js.map +0 -1
  259. package/lib/packlets/qualifier-types/convert.d.ts.map +0 -1
  260. package/lib/packlets/qualifier-types/convert.js.map +0 -1
  261. package/lib/packlets/qualifier-types/helpers.d.ts.map +0 -1
  262. package/lib/packlets/qualifier-types/helpers.js.map +0 -1
  263. package/lib/packlets/qualifier-types/index.d.ts.map +0 -1
  264. package/lib/packlets/qualifier-types/index.js.map +0 -1
  265. package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +0 -1
  266. package/lib/packlets/qualifier-types/languageQualifierType.js.map +0 -1
  267. package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +0 -1
  268. package/lib/packlets/qualifier-types/literalQualifierType.js.map +0 -1
  269. package/lib/packlets/qualifier-types/literalValueHierarchy.d.ts.map +0 -1
  270. package/lib/packlets/qualifier-types/literalValueHierarchy.js.map +0 -1
  271. package/lib/packlets/qualifier-types/qualifierType.d.ts.map +0 -1
  272. package/lib/packlets/qualifier-types/qualifierType.js.map +0 -1
  273. package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +0 -1
  274. package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +0 -1
  275. package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +0 -1
  276. package/lib/packlets/qualifier-types/territoryQualifierType.js.map +0 -1
  277. package/lib/packlets/qualifiers/convert/decls.d.ts.map +0 -1
  278. package/lib/packlets/qualifiers/convert/decls.js.map +0 -1
  279. package/lib/packlets/qualifiers/convert/index.d.ts.map +0 -1
  280. package/lib/packlets/qualifiers/convert/index.js.map +0 -1
  281. package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +0 -1
  282. package/lib/packlets/qualifiers/convert/qualifier.js.map +0 -1
  283. package/lib/packlets/qualifiers/index.d.ts.map +0 -1
  284. package/lib/packlets/qualifiers/index.js.map +0 -1
  285. package/lib/packlets/qualifiers/qualifier.d.ts.map +0 -1
  286. package/lib/packlets/qualifiers/qualifier.js.map +0 -1
  287. package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +0 -1
  288. package/lib/packlets/qualifiers/qualifierCollector.js.map +0 -1
  289. package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +0 -1
  290. package/lib/packlets/qualifiers/qualifierDecl.js.map +0 -1
  291. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.d.ts.map +0 -1
  292. package/lib/packlets/qualifiers/qualifierDefaultValueDecls.js.map +0 -1
  293. package/lib/packlets/qualifiers/qualifierDefaultValueToken.d.ts.map +0 -1
  294. package/lib/packlets/qualifiers/qualifierDefaultValueToken.js.map +0 -1
  295. package/lib/packlets/resource-json/compiled/common.d.ts.map +0 -1
  296. package/lib/packlets/resource-json/compiled/common.js.map +0 -1
  297. package/lib/packlets/resource-json/compiled/convert.d.ts.map +0 -1
  298. package/lib/packlets/resource-json/compiled/convert.js.map +0 -1
  299. package/lib/packlets/resource-json/compiled/index.d.ts.map +0 -1
  300. package/lib/packlets/resource-json/compiled/index.js.map +0 -1
  301. package/lib/packlets/resource-json/compiled/json.d.ts.map +0 -1
  302. package/lib/packlets/resource-json/compiled/json.js.map +0 -1
  303. package/lib/packlets/resource-json/convert.d.ts.map +0 -1
  304. package/lib/packlets/resource-json/convert.js.map +0 -1
  305. package/lib/packlets/resource-json/helpers.d.ts.map +0 -1
  306. package/lib/packlets/resource-json/helpers.js.map +0 -1
  307. package/lib/packlets/resource-json/index.d.ts.map +0 -1
  308. package/lib/packlets/resource-json/index.js.map +0 -1
  309. package/lib/packlets/resource-json/json.d.ts.map +0 -1
  310. package/lib/packlets/resource-json/json.js.map +0 -1
  311. package/lib/packlets/resource-json/normalized.d.ts.map +0 -1
  312. package/lib/packlets/resource-json/normalized.js.map +0 -1
  313. package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +0 -1
  314. package/lib/packlets/resource-json/resourceDeclCollection.js.map +0 -1
  315. package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +0 -1
  316. package/lib/packlets/resource-json/resourceDeclContainer.js.map +0 -1
  317. package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +0 -1
  318. package/lib/packlets/resource-json/resourceDeclTree.js.map +0 -1
  319. package/lib/packlets/resource-types/config/convert.d.ts.map +0 -1
  320. package/lib/packlets/resource-types/config/convert.js.map +0 -1
  321. package/lib/packlets/resource-types/config/index.d.ts.map +0 -1
  322. package/lib/packlets/resource-types/config/index.js.map +0 -1
  323. package/lib/packlets/resource-types/config/json.d.ts.map +0 -1
  324. package/lib/packlets/resource-types/config/json.js.map +0 -1
  325. package/lib/packlets/resource-types/helpers.d.ts.map +0 -1
  326. package/lib/packlets/resource-types/helpers.js.map +0 -1
  327. package/lib/packlets/resource-types/index.d.ts.map +0 -1
  328. package/lib/packlets/resource-types/index.js.map +0 -1
  329. package/lib/packlets/resource-types/jsonResourceType.d.ts.map +0 -1
  330. package/lib/packlets/resource-types/jsonResourceType.js.map +0 -1
  331. package/lib/packlets/resource-types/resourceType.d.ts.map +0 -1
  332. package/lib/packlets/resource-types/resourceType.js.map +0 -1
  333. package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +0 -1
  334. package/lib/packlets/resource-types/resourceTypeCollector.js.map +0 -1
  335. package/lib/packlets/resources/candidateReducer.d.ts.map +0 -1
  336. package/lib/packlets/resources/candidateReducer.js.map +0 -1
  337. package/lib/packlets/resources/common.d.ts.map +0 -1
  338. package/lib/packlets/resources/common.js.map +0 -1
  339. package/lib/packlets/resources/index.d.ts.map +0 -1
  340. package/lib/packlets/resources/index.js.map +0 -1
  341. package/lib/packlets/resources/resource.d.ts.map +0 -1
  342. package/lib/packlets/resources/resource.js.map +0 -1
  343. package/lib/packlets/resources/resourceBuilder.d.ts.map +0 -1
  344. package/lib/packlets/resources/resourceBuilder.js.map +0 -1
  345. package/lib/packlets/resources/resourceCandidate.d.ts.map +0 -1
  346. package/lib/packlets/resources/resourceCandidate.js.map +0 -1
  347. package/lib/packlets/resources/resourceManagerBuilder.d.ts.map +0 -1
  348. package/lib/packlets/resources/resourceManagerBuilder.js.map +0 -1
  349. package/lib/packlets/runtime/cacheListener.d.ts.map +0 -1
  350. package/lib/packlets/runtime/cacheListener.js.map +0 -1
  351. package/lib/packlets/runtime/cacheMetrics.d.ts.map +0 -1
  352. package/lib/packlets/runtime/cacheMetrics.js.map +0 -1
  353. package/lib/packlets/runtime/compiledResourceCollection.d.ts.map +0 -1
  354. package/lib/packlets/runtime/compiledResourceCollection.js.map +0 -1
  355. package/lib/packlets/runtime/conditionSetResolutionResult.d.ts.map +0 -1
  356. package/lib/packlets/runtime/conditionSetResolutionResult.js.map +0 -1
  357. package/lib/packlets/runtime/context/contextQualifierProvider.d.ts.map +0 -1
  358. package/lib/packlets/runtime/context/contextQualifierProvider.js.map +0 -1
  359. package/lib/packlets/runtime/context/contextQualifierProviderValidator.d.ts.map +0 -1
  360. package/lib/packlets/runtime/context/contextQualifierProviderValidator.js.map +0 -1
  361. package/lib/packlets/runtime/context/index.d.ts.map +0 -1
  362. package/lib/packlets/runtime/context/index.js.map +0 -1
  363. package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +0 -1
  364. package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +0 -1
  365. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +0 -1
  366. package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +0 -1
  367. package/lib/packlets/runtime/iResourceManager.d.ts.map +0 -1
  368. package/lib/packlets/runtime/iResourceManager.js.map +0 -1
  369. package/lib/packlets/runtime/index.d.ts.map +0 -1
  370. package/lib/packlets/runtime/index.js.map +0 -1
  371. package/lib/packlets/runtime/resource-tree/common.d.ts.map +0 -1
  372. package/lib/packlets/runtime/resource-tree/common.js.map +0 -1
  373. package/lib/packlets/runtime/resource-tree/index.d.ts.map +0 -1
  374. package/lib/packlets/runtime/resource-tree/index.js.map +0 -1
  375. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.d.ts.map +0 -1
  376. package/lib/packlets/runtime/resource-tree/readOnlyResourceTree.js.map +0 -1
  377. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.d.ts.map +0 -1
  378. package/lib/packlets/runtime/resource-tree/resourceTreeChildren.js.map +0 -1
  379. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.d.ts.map +0 -1
  380. package/lib/packlets/runtime/resource-tree/resourceTreeChildrenValidator.js.map +0 -1
  381. package/lib/packlets/runtime/resourceResolver.d.ts.map +0 -1
  382. package/lib/packlets/runtime/resourceResolver.js.map +0 -1
  383. package/lib/packlets/runtime/validate.d.ts.map +0 -1
  384. package/lib/packlets/runtime/validate.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierDefaultValues.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/qualifierDefaultValues.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,MAAM,EAAW,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAExF;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,EAC9C,SAAS,EACT,KAAK,EACN,EAAE,gCAAgC,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,aAAa,CAAC,gCAAgC,CAAC,GACrD,MAAM,CAAC,2BAA2B,CAAC,CAIrC;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,MAAM,GACZ,MAAM,CAAC,gCAAgC,CAAC,CAK1C;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,MAAM,GACZ,MAAM,CAAC,gCAAgC,EAAE,CAAC,CAK5C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"qualifierDefaultValues.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/qualifierDefaultValues.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBH,0EAKC;AAQD,4EAMC;AAQD,oFAO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taining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, succeed } from '@fgv/ts-utils';\nimport * as Validate from '../validate';\nimport { QualifierDefaultValueToken, QualifierDefaultValuesToken } from '../conditions';\n\n/**\n * The values needed to create a {@link QualifierDefaultValueToken | qualifier default value token}.\n * @public\n */\nexport interface IQualifierDefaultValueTokenParts {\n qualifier: string;\n value: string;\n}\n\n/**\n * Converts a {@link Helpers.IQualifierDefaultValueTokenParts | the parts that make up a qualifier default value token} into\n * a syntactically validated {@link QualifierDefaultValueToken | qualifier default value token}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildQualifierDefaultValueToken({\n qualifier,\n value\n}: IQualifierDefaultValueTokenParts): Result<QualifierDefaultValueToken> {\n return Validate.toQualifierDefaultValueToken(`${qualifier}=${value}`);\n}\n\n/**\n * Converts an array of {@link Helpers.IQualifierDefaultValueTokenParts | qualifier default value token parts} into a\n * syntactically validated {@link QualifierDefaultValuesToken | qualifier default values token}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildQualifierDefaultValuesToken(\n parts: ReadonlyArray<IQualifierDefaultValueTokenParts>\n): Result<QualifierDefaultValuesToken> {\n return mapResults(parts.map(buildQualifierDefaultValueToken)).onSuccess((tokens) =>\n Validate.toQualifierDefaultValuesToken(tokens.join('|'))\n );\n}\n\n/**\n * Parses a qualifier default value token string into its {@link Helpers.IQualifierDefaultValueTokenParts | parts}.\n * @param token - the token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseQualifierDefaultValueTokenParts(\n token: string\n): Result<IQualifierDefaultValueTokenParts> {\n return Validate.toQualifierDefaultValueToken(token).onSuccess((t) => {\n const [qualifier, value] = t.split('=');\n return succeed({ qualifier, value });\n });\n}\n\n/**\n * Parses a qualifier default values token string into an array of {@link Helpers.IQualifierDefaultValueTokenParts | qualifier default value token parts}.\n * @param token - the qualifier default values token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseQualifierDefaultValuesTokenParts(\n token: string\n): Result<IQualifierDefaultValueTokenParts[]> {\n if (token === '') {\n return succeed([]);\n }\n return mapResults(token.split('|').map((part) => parseQualifierDefaultValueTokenParts(part.trim())));\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/resources.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAqB,MAAM,EAAuB,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGxD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC,CAK9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAG,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAUlF;AAED;;;;;;;;;GASG;AACH,wBAAgB,uB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AG,GAA2B;IACpE,MAAM,MAAM,GAAsB,IAAI,4BAAiB,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,GAAG;SACA,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;SACzB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QACd,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACL,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,IAAA,wBAAY,EAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC,CAAC;AAC3E,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 { MessageAggregator, Result, mapResults, succeed } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName } from '../resources';\nimport { toResourceId, toResourceName } from '../validate/resources';\n\n/**\n * Splits a {@link ResourceId | resource id} into its component {@link ResourceName | resource names}.\n *\n * @param id - The ID to split.\n * @returns `Success`with an array of {@link ResourceName | ResourceName} objects if the ID is valid, or\n * `Failure` with an error message if not.\n * @public\n */\nexport function splitResourceId(id: string | undefined): Result<ResourceName[]> {\n if (id === undefined) {\n return succeed([]);\n }\n return mapResults(id.split('.').map(toResourceName));\n}\n\n/**\n * Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with\n * to create a new {@link ResourceId | resource ID}. Fails if resulting ID is invalid or empty.\n *\n * @param base - The base name or ID to join.\n * @param names - Additional names to join.\n * @returns `Success` with the new ID if the base and names are valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function joinResourceIds(...ids: (string | undefined)[]): Result<ResourceId> {\n const errors: MessageAggregator = new MessageAggregator();\n const parts: ResourceName[] = [];\n ids\n .filter((id) => id !== '')\n .forEach((id) => {\n parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));\n });\n const id = parts.join('.');\n return errors.returnOrReport(toResourceId(id));\n}\n\n/**\n * Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with\n * to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.\n *\n * @param base - The base name or ID to join.\n * @param names - Additional names to join.\n * @returns `Success` with the new ID if the base and names are valid, `Success` with `undefined`\n * if names were present, or `Failure` with an error message if the resulting id is invalid.\n * @public\n */\nexport function joinOptionalResourceIds(...ids: (string | undefined)[]): Result<ResourceId | undefined> {\n const errors: MessageAggregator = new MessageAggregator();\n const parts: ResourceName[] = [];\n ids\n .filter((id) => id !== '')\n .forEach((id) => {\n parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));\n });\n const id = parts.join('.');\n return errors.returnOrReport(id ? toResourceId(id) : succeed(undefined));\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/common/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAO5B,0BAAO;AANhB,mDAAqC;AAMnB,0BAAO;AALzB,qDAAuC;AAKZ,4BAAQ;AAHnC,+CAA6B;AAC7B,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\nimport * as Convert from './convert';\nimport * as Helpers from './helpers';\nimport * as Validate from './validate';\n\nexport * from './conditions';\nexport * from './resources';\n\nexport { Convert, Helpers, Validate };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/packlets/common/resources.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,wBAAwB,EAAqC,CAAC;AAEzG;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../src/packlets/common/resources.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA4CH;;;GAGG;AACU,QAAA,4BAA4B,GAA+B,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,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 { Brand } from '@fgv/ts-utils';\n\n/**\n * Branded string representing a validated resource id. A resource ID\n * is a dot-separated sequence of resource names.\n * @public\n */\nexport type ResourceId = Brand<string, 'ResourceId'>;\n\n/**\n * Branded string representing a validated resource name.\n * @public\n */\nexport type ResourceName = Brand<string, 'ResourceName'>;\n\n/**\n * Branded number representing a validated resource index.\n * @public\n */\nexport type ResourceIndex = Brand<number, 'ResourceIndex'>;\n\n/**\n * Branded string representing a validated resource type name.\n * @public\n */\nexport type ResourceTypeName = Brand<string, 'ResourceTypeName'>;\n\n/**\n * Branded number representing a validated resource type index.\n * @public\n */\nexport type ResourceTypeIndex = Brand<number, 'ResourceTypeIndex'>;\n\n/**\n * Type representing the possible ways that a resource value can be merged into an existing resource.\n * - 'augment' means that the new value should be merged into the existing value, with new properties added and existing properties updated.\n * - 'delete' means that the existing values should be deleted.\n * - 'replace' means that the new value should replace the existing value.\n * @public\n */\nexport type ResourceValueMergeMethod = 'augment' | 'delete' | 'replace';\n\n/**\n * Array of all possible {@link ResourceValueMergeMethod | resource merge type} values.\n * @public\n */\nexport const allResourceValueMergeMethods: ResourceValueMergeMethod[] = ['augment', 'delete', 'replace'];\n\n/**\n * The completeness of a resource candidate value. A full value is one that\n * contains all of the required properties for the resource type. A partial\n * value is one that contains some of the required properties for the resource\n * type.\n * @public\n */\nexport type CandidateCompleteness = 'full' | 'partial';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/validate/conditions.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EACb,gBAAgB,EAKhB,iBAAiB,EAEjB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AAYvB;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,iBAAiB,CAEhF;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,iBAAiB,CAExF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,G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AAgB,CAAC,CAKzE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAM9D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAMpE;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,qBAAqB,CAM1F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAOxE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAMpF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAMlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,0BAA0B,CAEpG;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,2BAA2B,CAMtG;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAM9F;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAMhG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/conditions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AA+CH,oDAEC;AAQD,4DAEC;AAQD,4DAEC;AAQD,sDAEC;AAQD,8DAEC;AAQD,gEAEC;AAQD,sDA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AAC;AACxB,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 { Result, fail, succeed } from '@fgv/ts-utils';\nimport {\n ConditionPriority,\n QualifierName,\n QualifierTypeName,\n QualifierIndex,\n QualifierTypeIndex,\n ConditionIndex,\n ConditionSetIndex,\n QualifierMatchScore,\n ConditionKey,\n ConditionSetKey,\n DecisionKey,\n DecisionIndex,\n ConditionSetHash,\n NoMatch,\n PerfectMatch,\n MinConditionPriority,\n MaxConditionPriority,\n ConditionOperator,\n allConditionOperators,\n ConditionToken,\n ConditionSetToken,\n ContextQualifierToken,\n ContextToken,\n QualifierDefaultValueToken,\n QualifierDefaultValuesToken\n} from '../conditions';\nimport {\n conditionKey,\n conditionSetHash,\n conditionToken,\n contextToken,\n decisionKey,\n identifier,\n qualifierDefaultValueToken,\n qualifierDefaultValuesToken\n} from './regularExpressions';\n\n/**\n * Determines whether a string is a valid qualifier name.\n * @param name - the string to validate\n * @returns true if the string is a valid qualifier name, false otherwise.\n * @public\n */\nexport function isValidQualifierName(name: string): name is QualifierName {\n return identifier.test(name);\n}\n\n/***\n * Determines whether a string is a valid qualifier type name.\n * @param name - the string to validate\n * @returns true if the string is a valid qualifier type name, false otherwise.\n * @public\n */\nexport function isValidQualifierTypeName(name: string): name is QualifierTypeName {\n return identifier.test(name);\n}\n\n/**\n * Determines whether a number is a valid priority.\n * @param priority - the number to validate\n * @returns true if the number is a valid priority, false otherwise.\n * @public\n */\nexport function isValidConditionPriority(priority: number): priority is ConditionPriority {\n return priority >= MinConditionPriority && priority <= MaxConditionPriority;\n}\n\n/**\n * Determines whether a number is a valid qualifier index.\n * @param index - the number to validate\n * @returns true if the number is a valid qualifier index, false otherwise.\n * @public\n */\nexport function isValidQualifierIndex(index: number): index is QualifierIndex {\n return index >= 0;\n}\n\n/**\n * Determines whether a number is a valid qualifier type index.\n * @param index - the number to validate\n * @returns true if the number is a valid qualifier type index, false otherwise.\n * @public\n */\nexport function isValidQualifierTypeIndex(index: number): index is QualifierTypeIndex {\n return index >= 0;\n}\n\n/**\n * Determines whether a supplied value is a valid {@link QualifierMatchScore | match score}.\n * @param value - The value to validate.\n * @returns - `true` if the value is a valid match score, `false` otherwise.\n * @public\n */\nexport function isValidQualifierMatchScore(value: number): value is QualifierMatchScore {\n return value >= NoMatch && value <= PerfectMatch;\n}\n\n/**\n * Determines whether a number is a valid condition index.\n * @param index - the number to validate\n * @returns true if the number is a valid condition index, false otherwise.\n * @public\n */\nexport function isValidConditionIndex(index: number): index is ConditionIndex {\n return index >= 0;\n}\n\n/**\n * Determines whether a string is a valid condition operator.\n * @param operator - the string to validate\n * @returns true if the string is a valid condition operator, false otherwise.\n * @public\n */\nexport function isValidConditionOperator(operator: string): operator is ConditionOperator {\n return allConditionOperators.includes(operator as ConditionOperator);\n}\n\n/**\n * Determines whether a string is a valid condition key. A condition key has\n * the format:\n * `<qualifierName>(-<operator>)?-[<value>]@<priority>`\n * where operator is omitted for the default 'matches' operator.\n * @param key - the string to validate\n * @returns `true` if the string is a valid condition key, `false` otherwise.\n * @public\n */\nexport function isValidConditionKey(key: string): key is ConditionKey {\n return conditionKey.test(key);\n}\n\n/**\n * Determines whether a string is a valid {@link ConditionToken | condition token}.\n * A condition token has the format:\n * `<qualifierName>=<value>` or `<value>`\n * @param token -\n * @returns `true` if the string is a valid condition token, `false` otherwise.\n * @public\n */\nexport function isValidConditionToken(token: string): token is ConditionToken {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (token === '') {\n return true;\n }\n return conditionToken.test(token);\n}\n\n/**\n * Determines whether a number is a valid condition set index.\n * @param index - the number to validate\n * @returns true if the number is a valid condition set index, false otherwise.\n * @public\n */\nexport function isValidConditionSetIndex(index: number): index is ConditionSetIndex {\n return index >= 0;\n}\n\n/**\n * Determines whether a string is a valid condition set key.\n * @param key - the string to validate.\n * @returns `true` if the string is a valid condition set key, `false` otherwise.\n * @public\n */\nexport function isValidConditionSetKey(key: string): key is ConditionSetKey {\n if (key === '') {\n return true;\n }\n // a condition set key is a `+` separated list of condition keys\n return key.split('+').every(isValidConditionKey);\n}\n\n/**\n * Determines whether a string is a valid condition set token.\n * @param token - the string to validate.\n * @returns `true` if the string is a valid condition set token, `false` otherwise.\n * @public\n */\nexport function isValidConditionSetToken(token: string): token is ConditionSetToken {\n return token.split(',').every(isValidConditionToken);\n}\n\n/**\n * Determines whether a string is a valid condition set hash.\n * @param hash - the string to validate.\n * @returns `true` if the string is a valid condition set hash, `false` otherwise.\n * @public\n */\nexport function isValidConditionSetHash(hash: string): hash is ConditionSetHash {\n return conditionSetHash.test(hash);\n}\n\n/**\n * Determines whether a string is a valid decision key.\n * @param key - the string to validate\n * @returns `true` if the string is a valid decision key, `false` otherwise.\n * @public\n */\nexport function isValidDecisionKey(key: string): key is DecisionKey {\n if (key === '') {\n return true;\n }\n return decisionKey.test(key);\n}\n\n/**\n * Determines whether a number is a valid decision index.\n * @param index - the number to validate\n * @returns `true` if the number is a valid decision index, `false` otherwise.\n * @public\n */\nexport function isValidDecisionIndex(index: number): index is DecisionIndex {\n return index >= 0;\n}\n\n/**\n * Converts a string to a {@link QualifierName} if it is a valid qualifier name.\n * @param name - the string to convert\n * @returns `Success` with the converted {@link QualifierName} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierName(name: string): Result<QualifierName> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierName(name)) {\n return fail(`${name}: not a valid qualifier name`);\n }\n return succeed(name);\n}\n\n/**\n * Converts a number to a {@link QualifierIndex} if it is a valid qualifier index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link QualifierIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierIndex(index: number): Result<QualifierIndex> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidQualifierIndex(index)) {\n return fail(`${index}: not a valid qualifier index`);\n }\n return succeed(index as QualifierIndex);\n}\n\n/**\n * Converts a string to a {@link QualifierTypeName} if it is a valid qualifier type name.\n * @param name - the string to convert\n * @returns `Success` with the converted {@link QualifierTypeName} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierTypeName(name: string): Result<QualifierTypeName> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierTypeName(name)) {\n return fail(`${name}: not a valid qualifier type name`);\n }\n return succeed(name);\n}\n\n/**\n * Converts a number to a {@link QualifierTypeIndex} if it is a valid qualifier type index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link QualifierTypeIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierTypeIndex(index: number): Result<QualifierTypeIndex> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierTypeIndex(index)) {\n return fail(`${index}: not a valid qualifier type index`);\n }\n return succeed(index);\n}\n\n/**\n * Converts a number to a {@link QualifierMatchScore | match score} if it is a valid score.\n * @param value - The number to convert.\n * @returns `Success` with the converted score if successful, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toQualifierMatchScore(value: number): Result<QualifierMatchScore> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidQualifierMatchScore(value)) {\n return fail(`${value}: not a valid match score`);\n }\n return succeed(value as QualifierMatchScore);\n}\n\n/**\n * Converts a number to a {@link ConditionPriority} if it is a valid priority.\n * @param priority - the number to convert\n * @returns `Success` with the converted {@link ConditionPriority} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionPriority(priority: number): Result<ConditionPriority> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionPriority(priority)) {\n return fail(`${priority}: not a valid priority`);\n }\n return succeed(priority);\n}\n\n/**\n * Converts a number to a {@link ConditionIndex} if it is a valid condition index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link ConditionIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionIndex(index: number): Result<ConditionIndex> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionIndex(index)) {\n return fail(`${index}: not a valid condition index`);\n }\n return succeed(index);\n}\n\n/**\n * Converts a string to a {@link ConditionOperator} if it is a valid condition operator.\n * @param operator - the string to convert\n * @returns `Success` with the converted {@link ConditionOperator} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionOperator(operator: string): Result<ConditionOperator> {\n if (!isValidConditionOperator(operator)) {\n return fail(`${operator}: not a valid condition operator`);\n }\n return succeed(operator as ConditionOperator);\n}\n\n/**\n * Converts a string to a {@link ConditionKey} if it is a valid condition key.\n * @param key - the string to convert\n * @returns `Success` with the converted {@link ConditionKey} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionKey(key: string): Result<ConditionKey> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionKey(key)) {\n return fail(`${key}: not a valid condition key`);\n }\n return succeed(key);\n}\n\n/**\n * Converts a string to a {@link ConditionToken} if it is a valid condition token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link ConditionToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionToken(token: string): Result<ConditionToken> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionToken(token)) {\n return fail(`${token}: not a valid condition token`);\n }\n return succeed(token);\n}\n\n/**\n * Converts a number to a {@link ConditionSetIndex} if it is a valid condition set index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link ConditionSetIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionSetIndex(index: number): Result<ConditionSetIndex> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionSetIndex(index)) {\n return fail(`${index}: not a valid condition set index`);\n }\n return succeed(index);\n}\n\n/**\n * Converts a string to a {@link ConditionSetKey} if it is a valid condition set key.\n * @param key - the string to convert\n * @returns `Success` with the converted {@link ConditionSetKey} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionSetKey(key: string): Result<ConditionSetKey> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidConditionSetKey(key)) {\n return fail(`${key}: not a valid condition set key`);\n }\n return succeed(key);\n}\n\n/**\n * Converts a string to a {@link ConditionSetToken} if it is a valid condition set token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link ConditionSetToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionSetToken(token: string): Result<ConditionSetToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidConditionSetToken(token)) {\n return fail(`${token}: not a valid condition set token`);\n }\n return succeed(token);\n}\n\n/**\n * Converts a string to a {@link ConditionSetHash} if it is a valid condition set hash.\n * @param key - the string to convert\n * @returns `Success` with the converted {@link ConditionSetHash} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toConditionSetHash(hash: string): Result<ConditionSetHash> {\n if (!isValidConditionSetHash(hash)) {\n return fail(`${hash}: not a valid condition set hash`);\n }\n return succeed(hash);\n}\n\n/**\n * Converts a number to a {@link DecisionIndex} if it is a valid decision index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link DecisionIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toDecisionKey(key: string): Result<DecisionKey> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidDecisionKey(key)) {\n return fail(`${key}: not a valid decision key`);\n }\n return succeed(key);\n}\n\n/**\n * Converts a number to a {@link DecisionIndex} if it is a valid decision index.\n * @param index - the number to convert\n * @returns `Success` with the converted {@link DecisionIndex} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toDecisionIndex(index: number): Result<DecisionIndex> {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!isValidDecisionIndex(index)) {\n return fail(`${index}: not a valid decision index`);\n }\n return succeed(index);\n}\n\n/**\n * Determines whether a string is a valid {@link ContextQualifierToken | context qualifier token}.\n * A context qualifier token has the format:\n * `<qualifierName>=<value>` or `<value>`\n * Context qualifier tokens allow broader character set including commas for comma-separated values.\n * @param token - the string to validate\n * @returns `true` if the string is a valid context qualifier token, `false` otherwise.\n * @public\n */\nexport function isValidContextQualifierToken(token: string): token is ContextQualifierToken {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (token === '') {\n return true;\n }\n return contextToken.test(token);\n}\n\n/**\n * Determines whether a string is a valid context token.\n * Context tokens are pipe-separated lists of context qualifier tokens.\n * @param token - the string to validate.\n * @returns `true` if the string is a valid context token, `false` otherwise.\n * @public\n */\nexport function isValidContextToken(token: string): token is ContextToken {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (token === '') {\n return true;\n }\n const parts = token.split('|').map((part) => part.trim());\n return parts.every((part) => part !== '' && isValidContextQualifierToken(part));\n}\n\n/**\n * Converts a string to a {@link ContextQualifierToken} if it is a valid context qualifier token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link ContextQualifierToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toContextQualifierToken(token: string): Result<ContextQualifierToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidContextQualifierToken(token)) {\n return fail(`${token}: not a valid context qualifier token`);\n }\n return succeed(token);\n}\n\n/**\n * Converts a string to a {@link ContextToken} if it is a valid context token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link ContextToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toContextToken(token: string): Result<ContextToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidContextToken(token)) {\n return fail(`${token}: not a valid context token`);\n }\n return succeed(token);\n}\n\n/**\n * Determines whether a string is a valid {@link QualifierDefaultValueToken | qualifier default value token}.\n * A qualifier default value token has the format:\n * `<qualifierName>=<value>` or `<qualifierName>=` (to remove default)\n * Default values allow broader character set including commas for comma-separated values.\n * @param token - the string to validate\n * @returns `true` if the string is a valid qualifier default value token, `false` otherwise.\n * @public\n */\nexport function isValidQualifierDefaultValueToken(token: string): token is QualifierDefaultValueToken {\n return qualifierDefaultValueToken.test(token);\n}\n\n/**\n * Determines whether a string is a valid qualifier default values token.\n * Qualifier default values tokens are pipe-separated lists of qualifier default value tokens.\n * @param token - the string to validate.\n * @returns `true` if the string is a valid qualifier default values token, `false` otherwise.\n * @public\n */\nexport function isValidQualifierDefaultValuesToken(token: string): token is QualifierDefaultValuesToken {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (token === '') {\n return true;\n }\n return qualifierDefaultValuesToken.test(token);\n}\n\n/**\n * Converts a string to a {@link QualifierDefaultValueToken} if it is a valid qualifier default value token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link QualifierDefaultValueToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierDefaultValueToken(token: string): Result<QualifierDefaultValueToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierDefaultValueToken(token)) {\n return fail(`${token}: not a valid qualifier default value token`);\n }\n return succeed(token);\n}\n\n/**\n * Converts a string to a {@link QualifierDefaultValuesToken} if it is a valid qualifier default values token.\n * @param token - the string to convert\n * @returns `Success` with the converted {@link QualifierDefaultValuesToken} if successful, or `Failure` with an\n * error message if not.\n * @public\n */\nexport function toQualifierDefaultValuesToken(token: string): Result<QualifierDefaultValuesToken> {\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (!isValidQualifierDefaultValuesToken(token)) {\n return fail(`${token}: not a valid qualifier default values token`);\n }\n return succeed(token);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/validate/index.ts"],"names":[],"mappings":"AAsBA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,8CAA4B;AAE5B,yEAA2D;AAClD,gDAAkB","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 './conditions';\nexport * from './resources';\n\nimport * as RegularExpressions from './regularExpressions';\nexport { RegularExpressions };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"regularExpressions.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/validate/regularExpressions.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAqC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAkE,CAAC;AAErG;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAiE,CAAC;AAE/F;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,MAC+D,CAAC;AAE3F;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,MAA0D,CAAC;AAExF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,MAA6D,CAAC;AAEzF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAA2B,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAqE,CAAC;AAEhG;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAA6D,CAAC;AAEvG;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,MACmE,CAAC;AAE9G;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAwB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"regularExpressions.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/regularExpressions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH;;GAEG;AACU,QAAA,UAAU,GAAW,4BAA4B,CAAC;AAE/D;;GAEG;AACU,QAAA,mBAAmB,GAAW,yDAAyD,CAAC;AAErG;;GAEG;AACU,QAAA,cAAc,GAAW,wDAAwD,CAAC;AAE/F;;;;;GAKG;AACU,QAAA,YAAY,GACvB,wFAAwF,CAAC;AAE3F;;;;;GAKG;AACU,QAAA,cAAc,GAAW,iDAAiD,CAAC;AAExF;;;;GAIG;AACU,QAAA,YAAY,GAAW,oDAAoD,CAAC;AAEzF;;GAEG;AACU,QAAA,gBAAgB,GAAW,kBAAkB,CAAC;AAE3D;;GAEG;AACU,QAAA,WAAW,GAAW,4DAA4D,CAAC;AAEhG;;;;;GAKG;AACU,QAAA,0BAA0B,GAAW,oDAAoD,CAAC;AAEvG;;;;;GAKG;AACU,QAAA,2BAA2B,GACtC,2GAA2G,CAAC;AAE9G;;GAEG;AACU,QAAA,aAAa,GAAW,eAAe,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * @internal\n */\nexport const identifier: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*$/;\n\n/**\n * @internal\n */\nexport const segmentedIdentifier: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*(\\.[a-zA-Z_][a-zA-Z0-9_\\-]*)*$/;\n\n/**\n * @internal\n */\nexport const identifierList: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*(,[a-zA-Z_][a-zA-Z0-9_\\-]*)*$/;\n\n/**\n * The format of a {@link ConditionKey | condition key} is:\n * <qualifierName>-[<value>][\\@<priority>](<scoreAsDefault>) where operator is `matches`, or\n * <qualifierName>-<operator>-[<value>][\\@<priority>](<scoreAsDefault>)\n * @internal\n */\nexport const conditionKey: RegExp =\n /^[a-zA-Z_][a-zA-Z0-9_\\-]*(-matches)?-\\[.*\\](?:@[0-9]{1,4})?(?:\\([01](?:\\.[0-9]+)?\\))?$/;\n\n/**\n * A {@link ConditionToken | condition token} is a comma-separated list of one or more\n * condition specifiers, where a condition specifier has either the form\n * `<qualifierName>=<value>` or `<value>`.\n * @internal\n */\nexport const conditionToken: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*(?:=[a-zA-Z0-9_\\-]+)?$/;\n\n/**\n * A {@link ContextToken | context token} has the form `<qualifierName>=<value>` or `<value>`.\n * Context tokens allow broader character set including commas for comma-separated values.\n * @internal\n */\nexport const contextToken: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*(?:=[a-zA-Z0-9_\\-,\\s]+)?$/;\n\n/**\n * @internal\n */\nexport const conditionSetHash: RegExp = /^[a-zA-Z0-9]{8}$/;\n\n/**\n * @internal\n */\nexport const decisionKey: RegExp = /^[a-zA-Z0-9]{8}(?:\\+[a-zA-Z0-9]{8})*(?:\\|[a-zA-Z0-9]{8})?$/;\n\n/**\n * A {@link QualifierDefaultValueToken | qualifier default value token} has the form\n * `<qualifierName>=<value>` or `<qualifierName>=` (to remove default).\n * Default values allow broader character set including commas for comma-separated values.\n * @internal\n */\nexport const qualifierDefaultValueToken: RegExp = /^[a-zA-Z_][a-zA-Z0-9_\\-]*=(?:[a-zA-Z0-9_\\-,\\s]*)?$/;\n\n/**\n * A {@link QualifierDefaultValuesToken | qualifier default values token} is a\n * pipe-separated list of one or more qualifier default value tokens.\n * Uses \"|\" as separator to avoid conflicts with comma-separated values within defaults.\n * @internal\n */\nexport const qualifierDefaultValuesToken: RegExp =\n /^[a-zA-Z_][a-zA-Z0-9_\\-]*=(?:[a-zA-Z0-9_\\-,\\s]*)?(?:\\|[a-zA-Z_][a-zA-Z0-9_\\-]*=(?:[a-zA-Z0-9_\\-,\\s]*)?)*$/;\n\n/**\n * @internal\n */\nexport const territoryCode: RegExp = /^[a-zA-Z]{2}$/;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/validate/resources.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5G;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,YAAY,CAEtE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAE1E;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,gBAAgB,CAE9E;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAElF;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAMjE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAK3D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,CAEhF;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAKpE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAMzE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAM5E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../../src/packlets/common/validate/resources.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAaH,kDAEC;AASD,8CAEC;AASD,oDAEC;AASD,0DAEC;AASD,4DAEC;AAUD,wCAMC;AAUD,oCAKC;AAUD,oDAEC;AAUD,0CAKC;AAUD,gDAMC;AAUD,kDAMC;AAnJD,4CAAsD;AAEtD,6DAAuE;AAEvE;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,OAAO,+BAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,EAAU;IAC1C,OAAO,wCAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,KAAa;IAChD,OAAO,KAAK,IAAI,C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I,CAAC,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,OAAO,IAAA,eAAI,EAAC,GAAG,IAAI,mCAAmC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,+CAA+C;IAC/C,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,OAAO,IAAA,eAAI,EAAC,GAAG,KAAK,oCAAoC,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,CAAC;AACxB,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { fail, succeed, Result } from '@fgv/ts-utils';\nimport { ResourceId, ResourceIndex, ResourceName, ResourceTypeIndex, ResourceTypeName } from '../resources';\nimport { identifier, segmentedIdentifier } from './regularExpressions';\n\n/**\n * Checks if the given name is a valid resource name.\n *\n * @param name - The name to validate.\n * @returns `true` if the name is a valid resource name, otherwise `false`.\n * @public\n */\nexport function isValidResourceName(name: string): name is ResourceName {\n return identifier.test(name);\n}\n\n/**\n * Checks if the given ID is a valid resource ID.\n *\n * @param id - The ID to validate.\n * @returns `true` if the ID is a valid resource ID, otherwise `false`.\n * @public\n */\nexport function isValidResourceId(id: string): id is ResourceId {\n return segmentedIdentifier.test(id);\n}\n\n/**\n * Checks if the given index is a valid resource index.\n *\n * @param index - The index to validate.\n * @returns `true` if the index is a valid resource index, otherwise `false`.\n * @public\n */\nexport function isValidResourceIndex(index: number): index is ResourceIndex {\n return index >= 0;\n}\n\n/**\n * Checks if the given name is a valid resource type name.\n *\n * @param name - The name to validate.\n * @returns `true` if the name is a valid resource type name, otherwise `false`.\n * @public\n */\nexport function isValidResourceTypeName(name: string): name is ResourceTypeName {\n return identifier.test(name);\n}\n\n/**\n * Checks if the given index is a valid resource type index.\n *\n * @param index - The index to validate.\n * @returns `true` if the index is a valid resource type index, otherwise `false`.\n * @public\n */\nexport function isValidResourceTypeIndex(index: number): index is ResourceTypeIndex {\n return index >= 0;\n}\n\n/**\n * Converts a string to a {@link ResourceName | resource name}.\n *\n * @param id - The string to convert.\n * @returns `Success` with the converted name if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceName(name: string): Result<ResourceName> {\n /* c8 ignore next 3 - coverage having issues */\n if (!isValidResourceName(name)) {\n return fail(`${name}: not a valid resource name.`);\n }\n return succeed(name);\n}\n\n/**\n * Converts a string to a {@link ResourceId | resource ID}.\n *\n * @param id - The string to convert.\n * @returns `Success` with the converted ID if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceId(id: string): Result<ResourceId> {\n if (!isValidResourceId(id)) {\n return fail(`${id}: not a valid resource ID.`);\n }\n return succeed(id);\n}\n\n/**\n * Converts an optional string to an optional {@link ResourceId | resource ID}.\n *\n * @param id - The string to convert.\n * @returns `Success` with the converted ID if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toOptionalResourceId(id?: string): Result<ResourceId | undefined> {\n return id ? toResourceId(id) : succeed(undefined);\n}\n\n/**\n * Converts a number to a {@link ResourceIndex | resource index}.\n *\n * @param index - The number to convert.\n * @returns `Success` with the converted index if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceIndex(index: number): Result<ResourceIndex> {\n if (!isValidResourceIndex(index)) {\n return fail(`${index}: not a valid resource index.`);\n }\n return succeed(index);\n}\n\n/**\n * Converts a string to a {@link ResourceTypeName | resource type name}.\n *\n * @param name - The string to convert.\n * @returns `Success` with the converted name if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceTypeName(name: string): Result<ResourceTypeName> {\n /* c8 ignore next 3 - coverage having issues */\n if (!isValidResourceTypeName(name)) {\n return fail(`${name}: not a valid resource type name.`);\n }\n return succeed(name);\n}\n\n/**\n * Converts a number to a {@link ResourceTypeIndex | resource type index}.\n *\n * @param index - The number to convert.\n * @returns `Success` with the converted index if valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function toResourceTypeIndex(index: number): Result<ResourceTypeIndex> {\n /* c8 ignore next 3 - coverage having issues */\n if (!isValidResourceTypeIndex(index)) {\n return fail(`${index}: not a valid resource type index.`);\n }\n return succeed(index);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/condition.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,WAAW,EAAE,MAAM,EAAQ,MAAM,eAAe,CAAC;AACzE,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EAEd,uBAAuB,EACvB,mBAAmB,EAEpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB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GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC7E;IACJ,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,aAAa,CAAC,IAA6B;QACvD,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACpG,MAAM,GAAG,GACP,IAAI,CAAC,QAAQ,KAAK,SAAS;YACzB,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,GAAG,cAAc,EAAE;YAC5E,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,GAAG,cAAc,EAAE,CAAC;QAClG,OAAO,iBAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CACF;AA/SD,8BA+SC","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, Result, fail } from '@fgv/ts-utils';\nimport {\n Convert as CommonConvert,\n ConditionIndex,\n ConditionKey,\n ConditionOperator,\n ConditionPriority,\n ConditionToken,\n NoMatch,\n QualifierConditionValue,\n QualifierMatchScore,\n Validate\n} from '../common';\nimport { Qualifier } from '../qualifiers';\nimport { IValidatedConditionDecl } from './conditionDecls';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\n\n// eslint-disable-next-line @rushstack/typedef-var\nconst scoreFormatter = new Intl.NumberFormat('en-US', { minimumFractionDigits: 0, maximumFractionDigits: 3 });\n\n/**\n * Represents a single condition applied to some resource instance.\n * @public\n */\nexport class Condition implements IValidatedConditionDecl {\n /**\n * The {@link Qualifiers.Qualifier | qualifier} used in this condition.\n */\n public readonly qualifier: Qualifier;\n\n /**\n * The value to be matched in this condition.\n */\n public readonly value: QualifierConditionValue;\n\n /**\n * The {@link ConditionOperator | operator} used when matching context value to condition value.\n */\n public readonly operator: ConditionOperator;\n\n /**\n * The {@link ConditionPriority | relative priority} of this condition.\n */\n public readonly priority: ConditionPriority;\n\n /**\n * The {@link QualifierMatchScore | score} to be used when this condition is the default.\n */\n public readonly scoreAsDefault?: QualifierMatchScore;\n\n protected _collectible: Collections.Collectible<ConditionKey, ConditionIndex>;\n\n /**\n * Constructs a new {@link Conditions.Condition | Condition} object.\n * @param qualifier - The {@link Qualifiers.Qualifier | qualifier} used in this condition.\n * @param value - The value to be matched in this condition.\n * @param operator - The {@link ConditionOperator | operator} used when matching context value to condition value.\n * @param priority - The {@link ConditionPriority | relative priority} of this condition.\n * @param scoreAsDefault - The {@link QualifierMatchScore | score} to be used when this condition is the default.\n * @param index - The index of this condition.\n * @public\n */\n protected constructor({\n qualifier,\n value,\n operator,\n priority,\n scoreAsDefault,\n index\n }: IValidatedConditionDecl) {\n if (scoreAsDefault === undefined && qualifier.defaultValue !== undefined) {\n const defaultMatch = qualifier.type.matches(value, qualifier.defaultValue, 'matches');\n if (defaultMatch !== NoMatch) {\n scoreAsDefault = defaultMatch;\n }\n }\n this.qualifier = qualifier;\n this.operator = operator;\n this.value = qualifier.validateCondition(value, operator).orThrow();\n this.priority = priority;\n this.scoreAsDefault = scoreAsDefault;\n this._collectible = new Collections.Collectible({\n key: this.toKey(),\n index,\n indexConverter: CommonConvert.conditionIndex\n });\n }\n\n public get key(): ConditionKey {\n return this._collectible.key;\n }\n\n public get index(): ConditionIndex | undefined {\n return this._collectible.index;\n }\n\n public setIndex(index: ConditionIndex): Result<ConditionIndex> {\n return this._collectible.setIndex(index);\n }\n\n /**\n * Creates a new {@link Conditions.Condition | Condition} object from the supplied\n * {@link Conditions.IValidatedConditionDecl | validated condition declaration}.\n * @param decl - The {@link Conditions.IValidatedConditionDecl | validated condition declaration}\n * describing the condition to create.\n * @returns `Success` with the new {@link Conditions.Condition | Condition} if successful,\n * `Failure` otherwise.\n * @public\n */\n public static create(decl: IValidatedConditionDecl): Result<Condition> {\n return captureResult(() => new Condition(decl));\n }\n\n /**\n * Determines if this condition matches the supplied {@link Context.IValidatedContextDecl | validated context}.\n * @param context - The {@link Context.IValidatedContextDecl | context} to match against.\n * @param options - The {@link Context.IContextMatchOptions | options} to use when matching the context.\n * @returns A {@link QualifierMatchScore | match score} indicating match quality if the condition is present\n * in the context to be matched, `undefined` otherwise.\n * @remarks\n * If {@link Context.IContextMatchOptions.partialContextMatch | `options.partialContextMatch``} is `true`, then\n * the method will return `undefined` if the corresponding qualifier is not present in the context.\n */\n public getContextMatch(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): QualifierMatchScore | undefined {\n options = options ?? {};\n if (this.qualifier.name in context) {\n const contextValue = context[this.qualifier.name];\n const match = this.qualifier.type.matches(this.value, contextValue, this.operator);\n if (match === NoMatch && options.acceptDefaultScore === true && this.scoreAsDefault !== undefined) {\n return this.scoreAsDefault;\n }\n return match;\n }\n return options.partialContextMatch === true ? undefined : NoMatch;\n }\n\n /**\n * Determines if this condition can match the supplied context, even if the context is partial.\n *\n * Returns true if:\n * - The qualifier specified in the condition is not present in the context\n * - The qualifier is present and matches the condition\n *\n * Returns false if:\n * - The qualifier is present in the context and does not match the condition\n *\n * @param context - The context to match against.\n * @param options - Options to use when matching the context.\n * @returns `true` if the condition can match the (possibly partial) context, `false` otherwise.\n * @public\n */\n public canMatchPartialContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): boolean {\n /* c8 ignore next 1 - defense in depth */\n const scoreAsDefault = this.scoreAsDefault ?? NoMatch;\n if (!(this.qualifier.name in context) || scoreAsDefault > NoMatch) {\n return true;\n }\n return this.qualifier.type.isPotentialMatch(this.value, context[this.qualifier.name]);\n }\n\n /**\n * Compares two conditions for sorting purposes.\n * @param c1 - The first {@link Conditions.Condition | condition} to compare.\n * @param c2 - The second {@link Conditions.Condition | condition} to compare.\n * @returns A negative number if c1 should come before c2, a positive number\n * if c2 should come before c1, or zero if they are equivalent.\n * @public\n */\n public static compare(c1: Condition, c2: Condition): number {\n let diff = c1.priority - c2.priority;\n diff = diff === 0 ? (c1.scoreAsDefault ?? 0) - (c2.scoreAsDefault ?? 0) : diff;\n diff = diff === 0 ? c1.qualifier.name.localeCompare(c2.qualifier.name) : diff;\n diff = diff === 0 ? c1.value.localeCompare(c2.value) : diff;\n return diff;\n }\n\n /**\n * Gets a {@link ConditionToken | condition token} for this condition, if possible.\n * It is not possible to get a token for a condition with an operator other than `matches`,\n * with other-than-default priority, or with a name or value that contains other than alphanumeric\n * characters, underscore or non-leading hyphen.\n * @param terse - if `true` and if the qualifier token is optional, the token will be omitted\n * from the generated {@link ConditionToken | condition token}.\n * @returns\n */\n public toToken(terse?: boolean): Result<ConditionToken> {\n /* c8 ignore next 3 - defense in depth very difficult to induce */\n if (this.operator !== 'matches') {\n return fail(`${this.operator}: cannot create condition token for operator other than 'matches'`);\n }\n if (this.priority !== this.qualifier.defaultPriority) {\n return fail(`${this.priority}: cannot create condition token for non-default priority`);\n }\n if (terse && this.qualifier.tokenIsOptional) {\n return Validate.toConditionToken(this.value);\n }\n /* c8 ignore next 1 - coverage having a bad day */\n const name = this.qualifier.token ?? this.qualifier.name;\n return Validate.toConditionToken(`${name}=${this.value}`);\n }\n\n /**\n * Gets the {@link ConditionKey | key} for this condition.\n * @returns -\n */\n public toKey(): ConditionKey {\n return Condition.getKeyForDecl(this).orThrow();\n }\n\n /**\n * Get a human-readable string representation of the condition.\n * @returns A string representation of the condition.\n * @public\n */\n public toString(): string {\n return this.toKey();\n }\n\n /**\n * Gets the {@link ResourceJson.Json.IChildConditionDecl | child condition declaration} for this condition.\n * @param options - The {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the child\n * condition declaration.\n * @returns The {@link ResourceJson.Json.IChildConditionDecl | child condition declaration} for this condition.\n * @public\n */\n public toChildConditionDecl(\n options?: ResourceJson.Helpers.IDeclarationOptions\n ): ResourceJson.Json.IChildConditionDecl {\n const showDefaults = options?.showDefaults === true;\n return {\n value: this.value,\n /* c8 ignore next 1 - not really possible to reproduce right now */\n ...(showDefaults || this.operator !== 'matches' ? { operator: this.operator } : {}),\n ...(showDefaults || this.priority !== this.qualifier.defaultPriority\n ? { priority: this.priority }\n : {}),\n ...(this.scoreAsDefault ? { scoreAsDefault: this.scoreAsDefault } : {})\n };\n }\n\n /**\n * Gets the value for this condition, or the {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}\n * if the condition has non-default operator, priority or a score as default.\n * @param options - The {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the child\n * condition declaration.\n * @returns A string value for this condition, or the {@link ResourceJson.Json.IChildConditionDecl | child condition declaration}\n * if the condition has non-default operator, priority or a score as default.\n */\n public toValueOrChildConditionDecl(\n options?: ResourceJson.Helpers.IDeclarationOptions\n ): string | ResourceJson.Json.IChildConditionDecl {\n if (\n options?.showDefaults !== true &&\n this.operator === 'matches' &&\n this.priority === this.qualifier.defaultPriority &&\n this.scoreAsDefault === undefined\n ) {\n return this.value;\n }\n /* c8 ignore next 2 - unreachable: matches is the only real operator in practice */\n return this.toChildConditionDecl(options);\n }\n\n /**\n * Gets the {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration} for this condition.\n * @param options - The {@link ResourceJson.Helpers.IDeclarationOptions | options} to use when creating the loose\n * condition declaration.\n * @returns The {@link ResourceJson.Json.ILooseConditionDecl | loose condition declaration} for this condition.\n * @public\n */\n public toLooseConditionDecl(\n options?: ResourceJson.Helpers.IDeclarationOptions\n ): ResourceJson.Json.ILooseConditionDecl {\n const showDefaults = options?.showDefaults === true;\n return {\n qualifierName: this.qualifier.name,\n value: this.value,\n /* c8 ignore next 1 - not really possible to reproduce right now */\n ...(showDefaults || this.operator !== 'matches' ? { operator: this.operator } : {}),\n ...(showDefaults || this.priority !== this.qualifier.defaultPriority\n ? { priority: this.priority }\n : {}),\n ...(this.scoreAsDefault ? { scoreAsDefault: this.scoreAsDefault } : {})\n };\n }\n\n /**\n * Converts this condition to a compiled condition representation.\n * @param options - Optional compilation options controlling the output format.\n * @returns A compiled condition object that can be used for serialization or runtime processing.\n * @public\n */\n public toCompiled(\n options?: ResourceJson.Compiled.ICompiledResourceOptions\n ): ResourceJson.Compiled.ICompiledCondition {\n /* c8 ignore next 1 - defense in depth */\n const operator = this.operator === 'matches' ? undefined : this.operator;\n return {\n qualifierIndex: this.qualifier.index!,\n operator,\n value: this.value,\n priority: this.priority,\n scoreAsDefault: this.scoreAsDefault,\n ...(options?.includeMetadata === true ? { metadata: { key: this.key } } : {})\n };\n }\n\n /**\n * Gets the {@link ConditionKey | condition key} for a supplied {@link Conditions.IValidatedConditionDecl | condition declaration}.\n * @param decl - The {@link Conditions.IValidatedConditionDecl | condition declaration} for which to get the key.\n * @returns `Success` with the condition key if successful, `Failure` otherwise.\n * @public\n */\n public static getKeyForDecl(decl: IValidatedConditionDecl): Result<ConditionKey> {\n const scoreAsDefault = decl.scoreAsDefault ? `(${scoreFormatter.format(decl.scoreAsDefault)})` : '';\n const key =\n decl.operator === 'matches'\n ? `${decl.qualifier.name}-[${decl.value}]@${decl.priority}${scoreAsDefault}`\n : `${decl.qualifier.name}-${decl.operator}-[${decl.value}]@${decl.priority}${scoreAsDefault}`;\n return Validate.toConditionKey(key);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionCollector.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,WAAW,EAAE,MAAM,EAAW,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;OAGG;IACH,UAAU,EAAE,2BAA2B,CAAC;IAExC;;OAEG;IACH,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;CAC/B;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,mBAAmB,CAAC,SAAS,CAAC;IACpE;;;;OAIG;IACI,UAAU,EAAE,2BAA2B,CAAC;IAE/C;;;;OAIG;IACH,SAAS,aAAa,MAAM,EAAE,+BAA+B;IAY7D;;;;;;OAMG;WACW,MAAM,CAAC,MAAM,EAAE,+BAA+B,GAAG,MAAM,CAAC,kBAAkB,CAAC;IAIzF,OAAO,CAAC,YAAY;CAQrB;AAED;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC,4BAA4B,CAAC,SAAS,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionCollector.js","sourceRoot":"","sources":["../../../src/packlets/con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gDA4CC","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, Result, succeed, ValidatingCollector } from '@fgv/ts-utils';\nimport { IReadOnlyQualifierCollector } from '../qualifiers';\nimport { IConditionDecl } from './conditionDecls';\nimport { Condition } from './condition';\nimport { Convert as CommonConvert, ConditionKey } from '../common';\nimport { validatedConditionDecl } from './convert';\n\n/**\n * Parameters for creating a {@link Conditions.ConditionCollector | ConditionCollector}.\n * @public\n */\nexport interface IConditionCollectorCreateParams {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} used to\n * create conditions in this collector.\n */\n qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Optional array of condition declarations to add to the collector.\n */\n conditions?: IConditionDecl[];\n}\n\n/**\n * A `ValidatingCollector` for {@link Conditions.Condition | Conditions},\n * which collects conditions supplied as either {@link Conditions.Condition | Condition} or\n * {@link Conditions.IConditionDecl | IConditionDecl}.\n * @public\n */\nexport class ConditionCollector extends ValidatingCollector<Condition> {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | ReadOnlyQualifierCollector} used to create conditions\n * in this collector.\n * @public\n */\n public qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Constructor for a {@link Conditions.ConditionCollector | ConditionCollector} object.\n * @param params - Required {@link Conditions.IConditionCollectorCreateParams | parameters} for\n * creating the collector.\n */\n protected constructor(params: IConditionCollectorCreateParams) {\n super({\n converters: new Collections.KeyValueConverters<ConditionKey, Condition>({\n key: CommonConvert.conditionKey,\n value: (from: unknown) => this._toCondition(from)\n })\n });\n this.qualifiers = params.qualifiers;\n /* c8 ignore next 1 - ? is defense in depth */\n params.conditions?.forEach((c) => this.validating.add(c).orThrow());\n }\n\n /**\n * Creates a new {@link Conditions.ConditionCollector | ConditionCollector} object.\n * @param params - Required {@link Conditions.IConditionCollectorCreateParams | parameters} for\n * creating the collector.\n * @returns `Success` with the new collector if successful, or `Failure` with\n * an error message if not.\n */\n public static create(params: IConditionCollectorCreateParams): Result<ConditionCollector> {\n return captureResult(() => new ConditionCollector(params));\n }\n\n private _toCondition(from: unknown): Result<Condition> {\n if (from instanceof Condition) {\n return succeed(from);\n }\n return validatedConditionDecl\n .convert(from, { qualifiers: this.qualifiers, conditionIndex: this.size })\n .onSuccess((c) => Condition.create(c));\n }\n}\n\n/**\n * Type alias for a read-only {@link Conditions.ConditionCollector | ConditionCollector}.\n * @public\n */\nexport type ReadOnlyConditionCollector = Collections.IReadOnlyValidatingCollector<Condition>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionDecls.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionDecls.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,uBAAuB,CAAC;IAC/B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionDecls.js","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionDecls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport {\n ConditionIndex,\n ConditionOperator,\n ConditionPriority,\n QualifierConditionValue,\n QualifierMatchScore\n} from '../common';\nimport { Qualifier } from '../qualifiers';\nimport * as ResourceJson from '../resource-json';\n\n/**\n * Non-validated declaration of a {@link Conditions.Condition | condition}.\n * @public\n */\nexport type IConditionDecl = ResourceJson.Json.ILooseConditionDecl;\n\n/**\n * Validated declaration of a {@link Conditions.Condition | condition} with all defaults applied.\n * @public\n */\nexport interface IValidatedConditionDecl {\n qualifier: Qualifier;\n value: QualifierConditionValue;\n operator: ConditionOperator;\n priority: ConditionPriority;\n scoreAsDefault?: QualifierMatchScore;\n index?: ConditionIndex;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSet.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionSet.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,WAAW,EAAoB,MAAM,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAEL,iBAAiB,EACjB,eAAe,EACf,aAAa,EAEd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,YAAY,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC;;;;;;GAMG;AACH,MAAM,WAAW,wBAAyB,SAAQ,YAAY,CAAC,OAAO,CAAC,mBAAmB;IACxF;;;OAGG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACjD;AAED;;;;GAIG;AACH,qBAAa,YAAa,YAAW,0BAA0B;IAC7D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,WAAW,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;IAC7F;;;;OAIG;IACH,SAAgB,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAErD;;OAEG;IACH,IAAW,GAAG,IAAI,eAAe,CA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,CAAC,EAAE,CAAC,EAC7E;IACJ,CAAC;;AAvNH,oCAwNC;AA1LC;;GAEG;AACW,6BAAgB,GAAoB,iBAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,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 { captureResult, Collections, Hash, mapResults, Result } from '@fgv/ts-utils';\nimport { Condition } from './condition';\nimport {\n Convert as CommonConvert,\n ConditionSetIndex,\n ConditionSetKey,\n QualifierName,\n Validate\n} from '../common';\nimport { IValidatedConditionSetDecl } from './conditionSetDecls';\nimport * as ResourceJson from '../resource-json';\nimport * as Context from '../context';\n\n/**\n * Options for creating a {@link Conditions.ConditionSet | ConditionSet} declaration.\n * @remarks\n * This interface extends the {@link ResourceJson.Helpers.IDeclarationOptions | declaration options}\n * interface to include a `reduceQualifiers` option.\n * @public\n */\nexport interface IConditionSetDeclOptions extends ResourceJson.Helpers.IDeclarationOptions {\n /**\n * If provided, reduces the qualifiers of the condition set by removing qualifiers that are made\n * irrelevant by the filterForContext.\n */\n qualifiersToReduce?: ReadonlySet<QualifierName>;\n}\n\n/**\n * Represents a set of {@link Conditions.Condition | conditions} that must all be met in some runtime\n * context for a resource instance to be valid.\n * @public\n */\nexport class ConditionSet implements IValidatedConditionSetDecl {\n protected readonly _collectible: Collections.Collectible<ConditionSetKey, ConditionSetIndex>;\n /**\n * The {@link Conditions.Condition | conditions} that make up this condition\n * set.\n * @public\n */\n public readonly conditions: ReadonlyArray<Condition>;\n\n /**\n * The key for this condition set.\n */\n public get key(): ConditionSetKey {\n return this._collectible.key;\n }\n\n /**\n * The number of conditions in this condition set.\n */\n public get size(): number {\n return this.conditions.length;\n }\n\n /**\n * The index for this condition set.\n */\n public get index(): ConditionSetIndex | undefined {\n return this._collectible.index;\n }\n\n /**\n * The key for an unconditional condition set.\n */\n public static UnconditionalKey: ConditionSetKey = Validate.toConditionSetKey('').orThrow();\n\n /**\n * Constructor for a {@link Conditions.ConditionSet | ConditionSet} object.\n * @param params - {@link Conditions.IValidatedConditionSetDecl | Validated declaration}\n * used to create the condition set.\n */\n protected constructor(params: IValidatedConditionSetDecl) {\n const qualifiers = new Map<QualifierName, Condition>();\n for (const condition of params.conditions) {\n /* c8 ignore next 9 - there's a test for this but coverage is having a bad day */\n if (qualifiers.has(condition.qualifier.name)) {\n const existing = qualifiers.get(condition.qualifier.name)?.toString() ?? 'unknown';\n throw new Error(\n `${\n condition.qualifier.name\n }: Duplicate conditions ${existing} and ${condition.toString()} are not supported.`\n );\n }\n qualifiers.set(condition.qualifier.name, condition);\n }\n this.conditions = Array.from(params.conditions).sort(Condition.compare).reverse();\n this._collectible = new Collections.Collectible({\n key: this.toKey(),\n index: params.index,\n indexConverter: CommonConvert.conditionSetIndex\n });\n }\n\n /**\n * Creates a new {@link Conditions.ConditionSet | ConditionSet} object.\n * @param params - {@link Conditions.IValidatedConditionSetDecl | Validated declaration}\n * used to create the condition set.\n * @returns `Success` with the new {@link Conditions.ConditionSet | ConditionSet} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(params: IValidatedConditionSetDecl): Result<ConditionSet> {\n return captureResult(() => new ConditionSet(params));\n }\n\n /**\n * Compares two {@link Conditions.ConditionSet | ConditionSets} for sorting purposes.\n * @param cs1 - The first {@link Conditions.ConditionSet | ConditionSet} to compare.\n * @param cs2 - The second {@link Conditions.ConditionSet | ConditionSet} to compare.\n * @returns A negative number if `cs1` should come before `cs2`, a positive\n * number if `cs1` should come after `cs2`, or zero if they are equivalent.\n * @public\n */\n public static compare(cs1: ConditionSet, cs2: ConditionSet): number {\n const len = Math.min(cs1.conditions.length, cs2.conditions.length);\n for (let i = 0; i < len; i++) {\n const diff = Condition.compare(cs1.conditions[i], cs2.conditions[i]);\n if (diff !== 0) {\n return diff;\n }\n }\n return cs1.conditions.length - cs2.conditions.length;\n }\n\n /**\n * Sets the global index for this condition set. Once set, the index cannot be changed.\n * @param index - The index to set for this condition set.\n * @returns `Success` with the index if successful, `Failure` otherwise.\n */\n public setIndex(index: number): Result<ConditionSetIndex> {\n return this._collectible.setIndex(index);\n }\n\n /**\n * Determines if this condition set can match a supplied context, even if the context is partial.\n * Returns true if all conditions in the set can match the context (using canMatchPartialContext).\n * Returns false otherwise.\n * @param context - The context to match.\n * @param options - Options to use when matching.\n * @returns `true` if all conditions can match the context, `false` otherwise.\n */\n public canMatchPartialContext(\n context: Context.IValidatedContextDecl,\n options?: Context.IContextMatchOptions\n ): boolean {\n return this.conditions.every((c) => c.canMatchPartialContext(context, options));\n }\n\n /**\n * Gets the {@link ConditionSetKey | key} for a supplied {@link Conditions.IValidatedConditionSetDecl | condition set declaration}.\n * @param decl - The {@link Conditions.IValidatedConditionSetDecl | condition set declaration} for which to get the key.\n * @returns `Success` with the condition set key if successful, `Failure` otherwise.\n * @public\n */\n public static getKeyForDecl(decl: IValidatedConditionSetDecl): Result<ConditionSetKey> {\n return Validate.toConditionSetKey(decl.conditions.map((c) => c.toKey()).join('+'));\n }\n\n /**\n * Gets a {@link ConditionSetToken | condition set token} for this condition set,\n * if possible.\n * @param terse - If true, the token will be terse, omitting qualifier names where\n * possible.\n * @returns `Success` with the {@link ConditionSetToken | condition set token} if successful,\n * `Failure` with an error message otherwise.\n * @public\n */\n public toToken(terse?: boolean): Result<string> {\n return mapResults(this.conditions.map((c) => c.toToken(terse))).onSuccess((tokens) => {\n return Validate.toConditionSetToken(tokens.join(','));\n });\n }\n\n /**\n * Gets the {@link ConditionSetKey | key} for this condition set.\n * @returns The key for this condition set.\n */\n public toKey(): ConditionSetKey {\n return ConditionSet.getKeyForDecl(this).orThrow();\n }\n\n /**\n * Gets a hash of this condition set.\n * @returns A hash of this condition\n * set key.\n * @public\n */\n public toHash(): string {\n return Hash.Crc32Normalizer.crc32Hash([this.key]).padStart(8, '0');\n }\n\n /**\n * Gets a human-readable string representation of this condition set.\n * @returns A string representation of this condition set.\n */\n public toString(): string {\n return this.toKey();\n }\n\n /**\n * Gets the {@link ResourceJson.Json.ConditionSetDeclAsRecord | condition set declaration as a record} for this condition set.\n * @param options - {@link ResourceJson.Helpers.IDeclarationOptions | options} for the condition set declaration.\n * @returns The {@link ResourceJson.Json.ConditionSetDeclAsRecord | condition set declaration as a record} for this condition set.\n */\n public toConditionSetRecordDecl(\n options?: IConditionSetDeclOptions\n ): ResourceJson.Json.ConditionSetDeclAsRecord {\n const qualifiersToReduce = options?.qualifiersToReduce;\n const conditions = qualifiersToReduce\n ? this.conditions.filter((c) => !qualifiersToReduce.has(c.qualifier.name))\n : this.conditions;\n return Object.fromEntries(\n conditions.map((c): [string, ResourceJson.Json.IChildConditionDecl | string] => {\n return [c.qualifier.name, c.toValueOrChildConditionDecl(options)];\n })\n );\n }\n\n /**\n * Gets the {@link ResourceJson.Json.ConditionSetDeclAsArray | condition set declaration as an array} for this condition set.\n * @param options - {@link ResourceJson.Helpers.IDeclarationOptions | options} for the condition set declaration.\n * @returns The {@link ResourceJson.Json.ConditionSetDeclAsArray | condition set declaration as an array} for this condition set.\n */\n public toConditionSetArrayDecl(\n options?: IConditionSetDeclOptions\n ): ResourceJson.Json.ConditionSetDeclAsArray {\n const qualifiersToReduce = options?.qualifiersToReduce;\n const conditions = qualifiersToReduce\n ? this.conditions.filter((c) => !qualifiersToReduce.has(c.qualifier.name))\n : this.conditions;\n return conditions.map((c) => c.toLooseConditionDecl(options));\n }\n\n /**\n * Converts this condition set to a compiled condition set representation.\n * @param options - Optional compilation options controlling the output format.\n * @returns A compiled condition set object that can be used for serialization or runtime processing.\n * @public\n */\n public toCompiled(\n options?: ResourceJson.Compiled.ICompiledResourceOptions\n ): ResourceJson.Compiled.ICompiledConditionSet {\n return {\n conditions: this.conditions.map((c) => c.index!),\n ...(options?.includeMetadata === true ? { metadata: { key: this.key } } : {})\n };\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetCollector.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionSetCollector.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAiB,WAAW,EAAc,MAAM,EAAW,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAA6C,iBAAiB,EAAY,MAAM,WAAW,CAAC;AAEnG;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD;;;OAGG;IACH,UAAU,EAAE,kBAAkB,CAAC;IAE/B;;;OAGG;IACH,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACrC;AAED;;;;;;GAMG;AACH,qBAAa,qBAAsB,SAAQ,mBAAmB,CAAC,YAAY,CAAC;IAC1E;;;OAGG;IACI,UAAU,EAAE,kBAAkB,CAAC;IAEtC;;;OAGG;IACH,IAAW,yBAAyB,IAAI,YAAY,CAEnD;IAED;;OAEG;IACH,OAAc,kBAAkB,EAAE,iBAAiB,CAA6C;IAEhG;;;;OAIG;IACH,SAAS,aAAa,MAAM,EAAE,kCAAkC;IAgBhE;;;;;;OAMG;WACW,MAAM,CAAC,MAAM,EAAE,kCAAkC,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAI/F,OAAO,CAAC,eAAe;CAcxB;AAED;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,WAAW,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetCollector.js","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionSetCollector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAA6G;AAG7G,iDAA8C;AAC9C,uCAAsD;AACtD,sCAAmG;AAoBnG;;;;;;GAMG;AACH,MAAa,qBAAsB,SAAQ,8BAAiC;IAO1E;;;OAGG;IACH,IAAW,yBAAyB;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,CAAC;IACxE,CAAC;IAOD;;;;OAIG;IACH,YAAsB,MAA0C;;QAC9D,KAAK,CAAC;YACJ,UAAU,EAAE,IAAI,sBAAW,CAAC,kBAAkB,CAAgC;gBAC5E,GAAG,EAAE,gBAAa,CAAC,eAAe;gBAClC,wEAAwE;gBACxE,KAAK,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;aACrD,CAAC;SACH,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,+EAA+E;QAC/E,gBAAgB;QAChB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,2BAAY,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO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 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { captureResult, Collections, mapResults, Result, succeed, ValidatingCollector } from '@fgv/ts-utils';\nimport { ConditionCollector } from './conditionCollector';\nimport { IConditionSetDecl } from './conditionSetDecls';\nimport { ConditionSet } from './conditionSet';\nimport { validatedConditionSetDecl } from './convert';\nimport { ConditionSetKey, Convert as CommonConvert, ConditionSetIndex, Validate } from '../common';\n\n/**\n * Parameters for creating a {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @public\n */\nexport interface IConditionSetCollectorCreateParams {\n /**\n * The {@link Conditions.ConditionCollector | ConditionCollector} used to create conditions\n * for conditions in this collector.\n */\n conditions: ConditionCollector;\n\n /**\n * Optional array of {@link Conditions.IConditionSetDecl | condition set declarations} to add to\n * the collector.\n */\n conditionSets?: IConditionSetDecl[];\n}\n\n/**\n * A `ValidatingCollector` for {@link Conditions.ConditionSet | ConditionSets},\n * which collects condition sets supplied as {@link Conditions.ConditionSet | ConditionSet} or\n * as {@link Conditions.IConditionSetDecl | IConditionSetDecl} via the methods on the\n * `validating` property.\n * @public\n */\nexport class ConditionSetCollector extends ValidatingCollector<ConditionSet> {\n /**\n * Gets the {@link Conditions.ConditionCollector | ConditionCollector} used to create conditions\n * for conditions in this collector.\n */\n public conditions: ConditionCollector;\n\n /**\n * Gets the {@link Conditions.ConditionSet | ConditionSet} at the unconditional\n * condition set index.\n */\n public get unconditionalConditionSet(): ConditionSet {\n return this.getAt(ConditionSetCollector.UnconditionalIndex).orThrow();\n }\n\n /**\n * The index of the unconditional condition set.\n */\n public static UnconditionalIndex: ConditionSetIndex = Validate.toConditionSetIndex(0).orThrow();\n\n /**\n * Creates a new {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @param params - {@link Conditions.IConditionSetCollectorCreateParams | Parameters} used to create\n * the collector.\n */\n protected constructor(params: IConditionSetCollectorCreateParams) {\n super({\n converters: new Collections.KeyValueConverters<ConditionSetKey, ConditionSet>({\n key: CommonConvert.conditionSetKey,\n /* c8 ignore next 1 - there's a test but coverage is having a bad day */\n value: (from: unknown) => this._toConditionSet(from)\n })\n });\n this.conditions = params.conditions;\n // it's very helpful for debugging if the unconditional condition set is always\n // in position 0\n this.validating.add(ConditionSet.create({ conditions: [] }).orThrow()).orThrow();\n /* c8 ignore next 1 - ? is defense in depth */\n params.conditionSets?.forEach((item) => this.validating.add(item).orThrow());\n }\n\n /**\n * Creates a new {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @param params - {@link Conditions.IConditionSetCollectorCreateParams | Parameters} used to create\n * the collector.\n * @returns `Success` with the new collector if successful, or `Failure` with an error message\n * if not.\n */\n public static create(params: IConditionSetCollectorCreateParams): Result<ConditionSetCollector> {\n return captureResult(() => new ConditionSetCollector(params));\n }\n\n private _toConditionSet(from: unknown): Result<ConditionSet> {\n if (from instanceof ConditionSet) {\n return succeed(from);\n }\n if (Array.isArray(from)) {\n return mapResults(from.map((item) => this.conditions.validating.getOrAdd(item))).onSuccess(\n (conditions) => ConditionSet.create({ conditions })\n );\n }\n /* c8 ignore next 4 - functional code path tested but coverage intermittently missed */\n return validatedConditionSetDecl\n .convert(from, { conditions: this.conditions, conditionSetIndex: this.size })\n .onSuccess((c) => ConditionSet.create(c));\n }\n}\n\n/**\n * A read-only {@link Conditions.ConditionSetCollector | ConditionSetCollector}.\n * @public\n */\nexport type ReadOnlyConditionSetCollector = Collections.IReadOnlyValidatingCollector<ConditionSet>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetDecls.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionSetDecls.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetDecls.js","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionSetDecls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Condition } from './condition';\nimport { IConditionDecl } from './conditionDecls';\n\n/**\n * Non-validated declaration of a {@link Conditions.ConditionSet | set of conditions}.\n * @public\n */\nexport interface IConditionSetDecl {\n conditions: IConditionDecl[];\n}\n\n/**\n * Validated declaration of a {@link Conditions.ConditionSet | set of conditions}.\n * @public\n */\nexport interface IValidatedConditionSetDecl {\n conditions: ReadonlyArray<Condition>;\n index?: number;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionToken.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionToken.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,MAAM,EAAiB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAqB,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEvE;;;GAGG;AACH,qBAAa,eAAe;IAC1B;;;OAGG;IACH,SAAgB,UAAU,EAAE,2BAA2B,CAAC;IAExD;;;OAGG;gBACgB,UAAU,EAAE,2BAA2B;IAI1D;;;;;;OAMG;IACI,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,uBAAuB,CAAC;IAI1E;;;;;;OAMG;IACI,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAC;IAI/E;;;;OAIG;IACI,2BAA2B,CAChC,KAAK,EAAE,aAAa,CAAC,oBAAoB,GACxC,MAAM,CAAC,uBAAuB,CAAC;IAIlC;;;;;OAKG;IACI,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;IAI9D;;;;;;;OAOG;WACW,mBAAmB,CAC/B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,uBAAuB,CAAC;IAMlC;;;;;;;OAOG;WACW,sBAAsB,CAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,uBAAuB,EAAE,CAAC;IAMpC;;;;;;;;OAQG;WACW,2BAA2B,CACvC,KAAK,EAAE,aAAa,CAAC,oBAAoB,EACzC,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,uBAAuB,CAAC;IAkBlC;;;;;;OAMG;WACW,qBAAqB,CACjC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,2BAA2B,GACtC,MAAM,CAAC,SAAS,CAAC;CAgBrB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionToken.js","sourceRoot":"","sources":["../../../src/packlets/conditions/conditionToken.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAkE;AAClE,sCAAwE;AAIxE;;;GAGG;AACH,MAAa,eAAe;IAO1B;;;OAGG;IACH,YAAmB,UAAuC;QACxD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACI,mBAAmB,CAAC,KAAa;QACtC,OAAO,eAAe,CAAC,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;OAMG;IACI,sBAAsB,CAAC,KAAa;QACzC,OAAO,eAAe,CAAC,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACxE,CAAC;IAED;;;;OAIG;I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JC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, fail, succeed } from '@fgv/ts-utils';\nimport { Helpers as CommonHelpers, ConditionOperator } from '../common';\nimport { IValidatedConditionDecl } from './conditionDecls';\nimport { IReadOnlyQualifierCollector, Qualifier } from '../qualifiers';\n\n/**\n * Helper class to parse and validate condition tokens.\n * @public\n */\nexport class ConditionTokens {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to validate\n * qualifier names and values.\n */\n public readonly qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Constructs a new {@link Conditions.ConditionTokens | ConditionTokens } instance.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n */\n public constructor(qualifiers: IReadOnlyQualifierCollector) {\n this.qualifiers = qualifiers;\n }\n\n /**i\n * Parses a {@link ConditionToken | condition token} string and validates the parts\n * against the qualifiers present in the {@link Conditions.ConditionTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the {@link Conditions.IValidatedConditionDecl | validated condition declaration}\n * if successful, `Failure` with an error message if not.\n */\n public parseConditionToken(token: string): Result<IValidatedConditionDecl> {\n return ConditionTokens.parseConditionToken(token, this.qualifiers);\n }\n\n /**\n * Parses a {@link ConditionSetToken | condition set token} string and validates the parts\n * against the qualifiers present in the {@link Conditions.ConditionTokens.qualifiers | qualifier collector}.\n * @param token - the token string to parse.\n * @returns `Success` with the array of {@link Conditions.IValidatedConditionDecl | validated condition declarations}\n * if successful, `Failure` with an error message if not.\n */\n public parseConditionSetToken(token: string): Result<IValidatedConditionDecl[]> {\n return ConditionTokens.parseConditionSetToken(token, this.qualifiers);\n }\n\n /**\n * Validates the {@link Helpers.IConditionTokenParts | parts} of a {@link ConditionToken | condition token}.\n * @param parts - the parts to validate\n * @returns `Success` with the validated declaration if successful, `Failure` with an error message if not.\n */\n public validateConditionTokenParts(\n parts: CommonHelpers.IConditionTokenParts\n ): Result<IValidatedConditionDecl> {\n return ConditionTokens.validateConditionTokenParts(parts, this.qualifiers);\n }\n\n /**\n * Given a value, finds a single token-optional qualifier that matches the value.\n * Fails if no qualifiers match, or if more than one qualifier matches.\n * @param value - the value to match.\n * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.\n */\n public findQualifierForValue(value: string): Result<Qualifier> {\n return ConditionTokens.findQualifierForValue(value, this.qualifiers);\n }\n\n /**\n * Parses a {@link ConditionToken | condition token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with a {@link Conditions.IValidatedConditionDecl | validated condition declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static parseConditionToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedConditionDecl> {\n return CommonHelpers.parseConditionTokenParts(token).onSuccess((parts) => {\n return ConditionTokens.validateConditionTokenParts(parts, qualifiers);\n });\n }\n\n /**\n * Parses a {@link ConditionSetToken | condition set token} and validates it against the qualifiers\n * present in the supplied {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param token - the token string to parse.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} to use\n * @returns `Success` with an array of {@link Conditions.IValidatedConditionDecl | validated condition declarations}\n * if successful, `Failure` with an error message if not\n */\n public static parseConditionSetToken(\n token: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedConditionDecl[]> {\n return CommonHelpers.parseConditionSetTokenParts(token).onSuccess((parts) => {\n return mapResults(parts.map((part) => ConditionTokens.validateConditionTokenParts(part, qualifiers)));\n });\n }\n\n /**\n * Validates the parts of a condition token against the qualifiers present in the supplied\n * {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector}.\n * @param parts - the {@link Helpers.IConditionTokenParts | condition token parts} to validate.\n * @param qualifiers - the {@link Qualifiers.IReadOnlyQualifierCollector | qualifier collector} used to\n * validate qualifier names and values.\n * @returns `Success` with a {@link Conditions.IValidatedConditionDecl | validated condition declaration} if successful,\n * `Failure` with an error message if not.\n */\n public static validateConditionTokenParts(\n parts: CommonHelpers.IConditionTokenParts,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<IValidatedConditionDecl> {\n const qualifierLookup =\n parts.qualifier === undefined\n ? ConditionTokens.findQualifierForValue(parts.value, qualifiers)\n : qualifiers.getByNameOrToken(parts.qualifier);\n\n return qualifierLookup.onSuccess((qualifier) => {\n return qualifier.type\n .validateCondition(parts.value)\n .onSuccess((value) => {\n const operator: ConditionOperator = 'matches';\n const priority = qualifier.defaultPriority;\n return succeed({ qualifier, value, operator, priority });\n })\n .withDetail('failure', 'success');\n });\n }\n\n /**\n * Given a value and a set of qualifiers, finds a single token-optional qualifier that matches the value.\n * Fails if no qualifiers match, or if more than one qualifier matches.\n * @param value - the value to match.\n * @param qualifiers - the qualifiers to match against.\n * @returns `Success` with the matching qualifier if successful, `Failure` with an error message if not.\n */\n public static findQualifierForValue(\n value: string,\n qualifiers: IReadOnlyQualifierCollector\n ): Result<Qualifier> {\n const matched: Qualifier[] = [];\n for (const qualifier of qualifiers.values()) {\n if (qualifier.tokenIsOptional && qualifier.validateCondition(value).isSuccess()) {\n matched.push(qualifier);\n }\n }\n if (matched.length === 0) {\n return fail(`${value}: does not match any qualifier`);\n }\n /* c8 ignore next 3 - functional code path tested but coverage intermittently missed */\n if (matched.length > 1) {\n return fail(`${value}: matches multiple qualifiers (${matched.map((q) => q.name).join(', ')})`);\n }\n return succeed(matched[0]);\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetDecls.d.ts","sourceRoot":"","sources":["../../../../src/packlets/conditions/convert/conditionSetDecls.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAI3D;;;GAGG;AACH,eAAO,MAAM,gBAAgB,qEAE3B,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,gGAkBpC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditionSetDecls.js","sourceRoot":"","sources":["../../../../src/packlets/conditions/convert/conditionSetDecls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAA8E;AAE9E,mCAAwC;AAGxC,2CAA2C;AAE3C;;;GAGG;AACU,QAAA,gBAAgB,GAAG,qBAAU,CAAC,YAAY,CAAoB;IACzE,UAAU,EAAE,qBAAU,CAAC,OAAO,CAAC,qBAAa,CAAC;CAC9C,CAAC,CAAC;AAYH;;;;;GAKG;AACU,QAAA,yBAAyB,GAAG,qBAAU,CAAC,OAAO,CAGzD,CAAC,IAAa,EAAE,MAAM,EAAE,OAAyC,EAAsC,EAAE;IACzG,qDAAqD;IACrD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAA,eAAI,EAAC,wDAAwD,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,wBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;QACvD,OAAO,IAAA,qBAAU,EACf,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CACtF,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;YACzB,+CAA+C;YAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAClF,OAAO,IAAA,kBAAO,EAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;QACxC,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, Result, fail, mapResults, succeed } from '@fgv/ts-utils';\nimport { IConditionSetDecl, IValidatedConditionSetDecl } from '../conditionSetDecls';\nimport { conditionDecl } from './decls';\nimport { ConditionCollector } from '../conditionCollector';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter which converts to a {@link Conditions.IConditionSetDecl | condition set declaration}.\n * @public\n */\nexport const conditionSetDecl = Converters.strictObject<IConditionSetDecl>({\n conditions: Converters.arrayOf(conditionDecl)\n});\n\n/**\n * Context for converting a {@link Conditions.IConditionSetDecl | condition set declaration}\n * into an instantiated {@link Conditions.ConditionSet | condition set} object.\n * @public\n */\nexport interface IConditionSetDeclConvertContext {\n readonly conditions: ConditionCollector;\n conditionSetIndex?: number;\n}\n\n/**\n * Converter which constructs a {@link Conditions.IValidatedConditionSetDecl | validated condition set declaration}\n * from a {@link Conditions.IConditionSetDecl | condition set declaration}, instantiating qualifiers by name\n * from a supplied {@link Conditions.Convert.IConditionSetDeclConvertContext | conversion context}.\n * @public\n */\nexport const validatedConditionSetDecl = Converters.generic<\n IValidatedConditionSetDecl,\n IConditionSetDeclConvertContext\n>((from: unknown, __self, context?: IConditionSetDeclConvertContext): Result<IValidatedConditionSetDecl> => {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!context) {\n return fail('validatedConditionSetDecl converter requires a context');\n }\n\n return conditionSetDecl.convert(from).onSuccess((decl) => {\n return mapResults(\n decl.conditions.map((condition) => context.conditions.validating.getOrAdd(condition))\n ).onSuccess((conditions) => {\n /* c8 ignore next 1 - coverage having issues */\n const index = context.conditionSetIndex ? context.conditionSetIndex++ : undefined;\n return succeed({ conditions, index });\n });\n });\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"decls.d.ts","sourceRoot":"","sources":["../../../../src/packlets/conditions/convert/decls.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAkB,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAI/D;;;GAGG;AACH,eAAO,MAAM,aAAa,0GAMxB,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,0FAqCjC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"decls.js","sourceRoot":"","sources":["../../../../src/packlets/conditions/convert/decls.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qDAAuC;AACvC,4CAAkF;AAIlF,2CAA2C;AAE3C;;;GAGG;AACU,QAAA,aAAa,GAAG,qBAAU,CAAC,YAAY,CAAiB;IACnE,aAAa,EAAE,qBAAU,CAAC,MAAM;IAChC,KAAK,EAAE,qBAAU,CAAC,MAAM;IACxB,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,QAAQ,EAAE;IACrD,QAAQ,EAAE,qBAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;IACtC,cAAc,EAAE,qBAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAYH;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,qBAAU,CAAC,OAAO,CAGtD,CAAC,IAAa,EAAE,MAAM,EAAE,OAAsC,EAAmC,EAAE;IACnG,qDAAqD;I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,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC;aACzB,CAAC;iBACC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE;gBACpB,IAAI,OAAO,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;oBACzC,OAAO,CAAC,cAAc,EAAE,CAAC;gBAC3B,CAAC;gBACD,OAAO,IAAA,kBAAO,EAAC,MAAM,CAAC,CAAC;YACzB,CAAC,CAAC;iBACD,UAAU,CAAC,SAAS,CAAC,CAAC;QAC3B,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 * as Common from '../../common';\nimport { Converters, populateObject, Result, fail, succeed } from '@fgv/ts-utils';\nimport { IConditionDecl, IValidatedConditionDecl } from '../conditionDecls';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\n\n/* eslint-disable @rushstack/typedef-var */\n\n/**\n * Converter for a {@link Conditions.IConditionDecl | condition declaration}.\n * @public\n */\nexport const conditionDecl = Converters.strictObject<IConditionDecl>({\n qualifierName: Converters.string,\n value: Converters.string,\n operator: Common.Convert.conditionOperator.optional(),\n priority: Converters.number.optional(),\n scoreAsDefault: Converters.number.optional()\n});\n\n/**\n * Conversion context to uses when converting\n * a {@link Conditions.IValidatedConditionDecl | validated condition declaration}.\n * @public\n */\nexport interface IConditionDeclConvertContext {\n readonly qualifiers: IReadOnlyQualifierCollector;\n conditionIndex?: number;\n}\n\n/**\n * Converter which constructs a {@link Conditions.IValidatedConditionDecl | validated condition declaration}\n * from a {@link Conditions.IConditionDecl | condition declaration}, instantiating qualifiers by name\n * from a supplied {@link Conditions.Convert.IConditionDeclConvertContext | conversion context}.\n * @public\n */\nexport const validatedConditionDecl = Converters.generic<\n IValidatedConditionDecl,\n IConditionDeclConvertContext\n>((from: unknown, __self, context?: IConditionDeclConvertContext): Result<IValidatedConditionDecl> => {\n /* c8 ignore next 3 - coverage is having a bad day */\n if (!context) {\n return fail('validatedConditionDecl converter requires a context');\n }\n return conditionDecl.convert(from).onSuccess((decl) => {\n const operator = decl.operator ?? 'matches';\n return context.qualifiers.validating.get(decl.qualifierName).onSuccess((qualifier) => {\n return populateObject<IValidatedConditionDecl>({\n qualifier: () => succeed(qualifier),\n value: () => qualifier.validateCondition(decl.value, operator),\n operator: () => succeed(operator),\n priority: () =>\n decl.priority\n ? Common.Convert.conditionPriority.convert(decl.priority)\n : succeed(qualifier.defaultPriority),\n scoreAsDefault: () =>\n decl.scoreAsDefault\n ? Common.Convert.qualifierMatchScore.convert(decl.scoreAsDefault)\n : succeed(undefined),\n index: () =>\n context.conditionIndex\n ? Common.Convert.conditionIndex.convert(context.conditionIndex)\n : succeed(undefined)\n })\n .onSuccess((result) => {\n if (context.conditionIndex !== undefined) {\n context.conditionIndex++;\n }\n return succeed(result);\n })\n .withDetail('success');\n });\n });\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/conditions/convert/index.ts"],"names":[],"mappings":"AAsBA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/conditions/convert/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,sDAAoC","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 './conditionSetDecls';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/conditions/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/conditions/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAU5B,0BAAO;AARhB,8CAA4B;AAC5B,uDAAqC;AACrC,mDAAiC;AACjC,iDAA+B;AAC/B,0DAAwC;AACxC,sDAAoC;AACpC,mDAAiC","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 './condition';\nexport * from './conditionCollector';\nexport * from './conditionDecls';\nexport * from './conditionSet';\nexport * from './conditionSetCollector';\nexport * from './conditionSetDecls';\nexport * from './conditionToken';\n\nexport { Convert };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/packlets/config/common.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,MAAM,EAAQ,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAE/B,MAAM,uBAAuB,CAAC;AAI/B;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GACrC,SAAS,GACT,mBAAmB,GACnB,oBAAoB,GACpB,kBAAkB,CAAC;AAEvB;;;GAGG;AACH,eAAO,MAAM,iCAAiC,EAAE,aAAa,CAAC,6BAA6B,CAK1F,CAAC;AAEF,cAAc,cAAc,CAAC;AAS7B;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,6BAA6B,EACnC,UAAU,CAAC,EAAE,8BAA8B,GAC1C,MAAM,CAAC,oBAAoB,CAAC,CAY9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,6BAA6B,EACnC,UAAU,CAAC,EAAE,8BAA8B,GAC1C,MAAM,CAAC,mBAAmB,CAAC,CAM7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/packlets/config/common.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;AAmDH,4DAeC;AAWD,4EASC;AApFD,4CAA6C;AAE7C,+DAI+B;AAC/B,oDAAuD;AACvD,6CAAgD;AAYhD;;;GAGG;AACU,QAAA,iCAAiC,GAAiD;IAC7F,SAAS;IACT,mBAAmB;IACnB,oBAAoB;IACpB,kBAAkB;CACnB,CAAC;AAEF,+CAA6B;AAE7B,MAAM,eAAe,GAAgE;IACnF,OAAO,EAAE,oBAAO,CAAC,0BAA0B;IAC3C,mBAAmB,EAAE,oBAAO,CAAC,mCAAmC;IAChE,oBAAoB,EAAE,oBAAO,CAAC,oCAAoC;IAClE,kBAAkB,EAAE,oBAAO,CAAC,2BAA2B;CACxD,CAAC;AAEF;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CACtC,IAAmC,EACnC,UAA2C;IAE3C,IAAI,IAAI,IAAI,eAAe,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,IAAA,iCAAkB,EAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7D,IAAI,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,sBAAsB,EAAE,CAAC;YACvC,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CACrC,IAAA,qEAA+C,EAAC,MAAM,EAAE,UAAU,CAAC,sBAAuB,CAAC,CAC5F,CAAC;QACJ,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,IAAA,eAAI,EAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,gCAAgC,CAC9C,IAAmC,EACnC,UAA2C;IAE3C,IAAI,IAAI,IAAI,eAAe,EAAE,CAAC;QAC5B,OAAO,yCAAmB,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,IAAA,eAAI,EAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;AAClE,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 { Result, fail } from '@fgv/ts-utils';\nimport { ISystemConfiguration } from './json';\nimport {\n SystemConfiguration,\n ISystemConfigurationInitParams,\n updateSystemConfigurationQualifierDefaultValues\n} from './systemConfiguration';\nimport { sanitizeJsonObject } from '@fgv/ts-json-base';\nimport { Default, Example } from './predefined';\n\n/**\n * A `string` literal type representing a well-known predefined system configuration.\n * @public\n */\nexport type PredefinedSystemConfiguration =\n | 'default'\n | 'language-priority'\n | 'territory-priority'\n | 'extended-example';\n\n/**\n * An array of all well-known predefined system configurations.\n * @public\n */\nexport const allPredefinedSystemConfigurations: ReadonlyArray<PredefinedSystemConfiguration> = [\n 'default',\n 'language-priority',\n 'territory-priority',\n 'extended-example'\n];\n\nexport * from './predefined';\n\nconst predefinedDecls: Record<PredefinedSystemConfiguration, ISystemConfiguration> = {\n default: Default.DefaultSystemConfiguration,\n 'language-priority': Default.LanguagePrioritySystemConfiguration,\n 'territory-priority': Default.TerritoryPrioritySystemConfiguration,\n 'extended-example': Example.ExtendedSystemConfiguration\n};\n\n/**\n * Returns the {@link Config.Model.ISystemConfiguration | system configuration} declaration for the\n * specified predefined system configuration.\n * @param name - The name of the predefined system configuration.\n * @param initParams - Optional {@link Config.ISystemConfigurationInitParams | initialization parameters}.\n * @returns `Success` with the {@link Config.Model.ISystemConfiguration | system configuration}\n * declaration if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function getPredefinedDeclaration(\n name: PredefinedSystemConfiguration,\n initParams?: ISystemConfigurationInitParams\n): Result<ISystemConfiguration> {\n if (name in predefinedDecls) {\n const baseConfig = sanitizeJsonObject(predefinedDecls[name]);\n if (initParams?.qualifierDefaultValues) {\n return baseConfig.onSuccess((config) =>\n updateSystemConfigurationQualifierDefaultValues(config, initParams.qualifierDefaultValues!)\n );\n }\n return baseConfig;\n }\n\n return fail(`Unknown predefined system configuration: ${name}`);\n}\n\n/**\n * Returns the {@link Config.SystemConfiguration | SystemConfiguration} for the specified\n * predefined system configuration.\n * @param name - The name of the predefined system configuration.\n * @param initParams - Optional {@link Config.ISystemConfigurationInitParams | initialization parameters}.\n * @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}\n * if successful, `Failure` with an error message otherwise.\n * @public\n */\nexport function getPredefinedSystemConfiguration(\n name: PredefinedSystemConfiguration,\n initParams?: ISystemConfigurationInitParams\n): Result<SystemConfiguration> {\n if (name in predefinedDecls) {\n return SystemConfiguration.create(predefinedDecls[name], initParams);\n }\n\n return fail(`Unknown predefined system configuration: ${name}`);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/packlets/config/convert.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAM9C;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,wEAM9B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,kJAAgE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../src/packlets/config/convert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA2C;AAE3C,4CAA2C;AAE3C,mEAAqD;AACrD,0DAA4C;AAC5C,iEAAmD;AACnD,qCAA6D;AAE7D;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,qBAAU,CAAC,YAAY,CAAuB;IAC/E,IAAI,EAAE,qBAAU,CAAC,cAAc;IAC/B,WAAW,EAAE,qBAAU,CAAC,cAAc;IACtC,cAAc,EAAE,qBAAU,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC;IAC3F,UAAU,EAAE,qBAAU,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC;IAChE,aAAa,EAAE,qBAAU,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC;CACnF,CAAC,CAAC;AAEH;;;;GAIG;AACU,QAAA,6BAA6B,GAAG,qBAAU,CAAC,eAAe,CAAC,0CAAiC,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\n/* eslint-disable @rushstack/typedef-var */\n\nimport { Converters } from '@fgv/ts-utils';\nimport { ISystemConfiguration } from './json';\nimport * as QualifierTypes from '../qualifier-types';\nimport * as Qualifiers from '../qualifiers';\nimport * as ResourceTypes from '../resource-types';\nimport { allPredefinedSystemConfigurations } from './common';\n\n/**\n * A `Converter` for {@link Config.Model.ISystemConfiguration | ISystemConfiguration} objects.\n * @returns A `Converter` for {@link Config.Model.ISystemConfiguration | ISystemConfiguration} objects.\n * @public\n */\nexport const systemConfiguration = Converters.strictObject<ISystemConfiguration>({\n name: Converters.optionalString,\n description: Converters.optionalString,\n qualifierTypes: Converters.arrayOf(QualifierTypes.Config.Convert.systemQualifierTypeConfig),\n qualifiers: Converters.arrayOf(Qualifiers.Convert.qualifierDecl),\n resourceTypes: Converters.arrayOf(ResourceTypes.Config.Convert.resourceTypeConfig)\n});\n\n/**\n * A `Converter` for {@link Config.PredefinedSystemConfiguration | PredefinedSystemConfiguration} values.\n * @returns A `Converter` for {@link Config.PredefinedSystemConfiguration | PredefinedSystemConfiguration} values.\n * @public\n */\nexport const predefinedSystemConfiguration = Converters.enumeratedValue(allPredefinedSystemConfigurations);\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/config/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAErC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AAEzB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/config/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8CAAgC;AAMvB,sBAAK;AALd,mDAAqC;AAKrB,0BAAO;AAHvB,wDAAsC;AACtC,2CAAyB","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 Model from './json';\nimport * as Convert from './convert';\n\nexport * from './systemConfiguration';\nexport * from './common';\n\nexport { Model, Convert };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/packlets/config/json.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAE1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;IACnE,iFAAiF;IACjF,UAAU,EAAE,UAAU,CAAC,cAAc,EAAE,CAAC;IACxC,2FAA2F;IAC3F,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;CAC3D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/packlets/config/json.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as QualifierTypes from '../qualifier-types';\nimport * as Qualifiers from '../qualifiers';\nimport * as ResourceTypes from '../resource-types';\n\n/**\n * System configuration for both runtime or build.\n * @public\n */\nexport interface ISystemConfiguration {\n /** Optional human-readable name for the configuration. */\n\n name?: string;\n /** Optional description explaining the purpose and use case of the configuration. */\n description?: string;\n /** Qualifier type configurations that define the available qualifier types in the system. */\n qualifierTypes: QualifierTypes.Config.ISystemQualifierTypeConfig[];\n /** Qualifier declarations that define the available qualifiers in the system. */\n qualifiers: Qualifiers.IQualifierDecl[];\n /** Resource type configurations that define the available resource types in the system. */\n resourceTypes: ResourceTypes.Config.IResourceTypeConfig[];\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/packlets/config/predefined/default.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,cAAc,CAAC,MAAM,CAAC,0BAA0B,CAejG,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,EAAE,aAAa,CAAC,UAAU,CAAC,cAAc,CAahF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,aAAa,CAAC,UAAU,CAAC,cAAc,CAa/E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,mBAAmB,CAKxF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,EAAE,oBAMlD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,EAAE,oBAMjD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,oBAMxC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../../src/packlets/config/predefined/default.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAQH;;;;;;;GAOG;AACU,QAAA,qBAAqB,GAAoE;IACpG;QACE,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,UAAU;QACtB,aAAa,EAAE;YACb,gBAAgB,EAAE,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aAAa,EAAE,CAAC,GAAG,4BAAoB,CAAC;CACzC,CAAC;AAEF;;;;GAIG;AACU,QAAA,0BAA0B,GAAyB;IAC9D,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,8BAA8B;IAC3C,cAAc,EAAE,CAAC,GAAG,6BAAqB,CAAC;IAC1C,UAAU,EAAE,CAAC,GAAG,mCAA2B,CAAC;IAC5C,aAAa,EAAE,CAAC,GAAG,4BAAoB,CAAC;CACzC,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 { ISystemConfiguration } from '../json';\n\nimport * as QualifierTypes from '../../qualifier-types';\nimport * as Qualifiers from '../../qualifiers';\nimport * as ResourceTypes from '../../resource-types';\n\n/**\n * Default qualifier types.\n * @remarks\n * The default qualifier types are:\n * - language: recognizes BCP 47 language tags, accepts a comma-separated list of language tags in the context\n * - territory: recognizes ISO 3166-1 alpha-2 territory codes, accepts a single code in the context\n * @public\n */\nexport const DefaultQualifierTypes: ReadonlyArray<QualifierTypes.Config.ISystemQualifierTypeConfig> = [\n {\n name: 'language',\n systemType: 'language',\n configuration: {\n allowContextList: true\n }\n },\n {\n name: 'territory',\n systemType: 'territory',\n configuration: {\n allowContextList: false\n }\n }\n];\n\n/**\n * Qualifier definitions in which territory is the primary qualifier, with\n * language as a secondary qualifier.\n * @remarks\n * The default qualifiers are:\n * - currentTerritory(token: geo): territory qualifier, priority 850\n * - language(token: lang): language qualifier, priority 800\n * @public\n */\nexport const TerritoryPriorityQualifiers: ReadonlyArray<Qualifiers.IQualifierDecl> = [\n {\n name: 'currentTerritory',\n token: 'geo',\n typeName: 'territory',\n defaultPriority: 850\n },\n {\n name: 'language',\n token: 'lang',\n typeName: 'language',\n defaultPriority: 800\n }\n];\n\n/**\n * Qualifier definitions in which language is the primary qualifier, with\n * territory as a secondary qualifier.\n * @remarks\n * The default qualifiers are:\n * - language(token: lang): language qualifier, priority 850\n * - currentTerritory(token: geo): territory qualifier, priority 800\n * @public\n */\nexport const LanguagePriorityQualifiers: ReadonlyArray<Qualifiers.IQualifierDecl> = [\n {\n name: 'language',\n token: 'lang',\n typeName: 'language',\n defaultPriority: 850\n },\n {\n name: 'currentTerritory',\n token: 'geo',\n typeName: 'territory',\n defaultPriority: 800\n }\n];\n\n/**\n * Default resource types.\n * @public\n */\nexport const DefaultResourceTypes: ReadonlyArray<ResourceTypes.Config.IResourceTypeConfig> = [\n {\n name: 'json',\n typeName: 'json'\n }\n];\n\n/**\n * System configuration with territory as the primary qualifier, and\n * language as a secondary qualifier.\n * @public\n */\nexport const TerritoryPrioritySystemConfiguration: ISystemConfiguration = {\n name: 'territory-priority',\n description: 'Territory priority system configuration',\n qualifierTypes: [...DefaultQualifierTypes],\n qualifiers: [...TerritoryPriorityQualifiers],\n resourceTypes: [...DefaultResourceTypes]\n};\n\n/**\n * System configuration with language as the primary qualifier, and\n * territory as a secondary qualifier.\n * @public\n */\nexport const LanguagePrioritySystemConfiguration: ISystemConfiguration = {\n name: 'language-priority',\n description: 'Language priority system configuration',\n qualifierTypes: [...DefaultQualifierTypes],\n qualifiers: [...LanguagePriorityQualifiers],\n resourceTypes: [...DefaultResourceTypes]\n};\n\n/**\n * The default system configuration gives priority to territory as the primary qualifier,\n * with language as a secondary qualifier.\n * @public\n */\nexport const DefaultSystemConfiguration: ISystemConfiguration = {\n name: 'default',\n description: 'Default system configuration',\n qualifierTypes: [...DefaultQualifierTypes],\n qualifiers: [...TerritoryPriorityQualifiers],\n resourceTypes: [...DefaultResourceTypes]\n};\n"]}