@elite-dangerous-almanac/core 0.2.11 → 0.2.13

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 (116) hide show
  1. package/PROVENANCE/astro/SOURCES.md +18 -0
  2. package/PROVENANCE/commodities/SOURCES.md +2 -1
  3. package/PROVENANCE/i18n/SOURCES.md +66 -2
  4. package/PROVENANCE/ships/SOURCES.md +119 -67
  5. package/README.md +2 -2
  6. package/THIRD_PARTY_NOTICES.md +2 -1
  7. package/dist/astro/codex-region-lookup.js +1 -1
  8. package/dist/astro/codex-region.d.ts +5 -1
  9. package/dist/astro/codex-region.js +1 -1
  10. package/dist/astro/index.js +1 -1
  11. package/dist/{chunk-OSMBAFRW.js → chunk-2GVJNKFW.js} +1 -1
  12. package/dist/{chunk-OSMBAFRW.js.map → chunk-2GVJNKFW.js.map} +1 -1
  13. package/dist/{chunk-Q5ALV3DI.js → chunk-3I2I5KG4.js} +1 -1
  14. package/dist/chunk-55R4MYWV.js +1 -0
  15. package/dist/chunk-55R4MYWV.js.map +1 -0
  16. package/dist/{chunk-2TY42PTF.js → chunk-6MQOPQAA.js} +1 -1
  17. package/dist/{chunk-RA6SY445.js → chunk-7UF4XRIR.js} +1 -1
  18. package/dist/{chunk-K5JK3XQB.js → chunk-ARG6ESYB.js} +1 -1
  19. package/dist/{chunk-K5JK3XQB.js.map → chunk-ARG6ESYB.js.map} +1 -1
  20. package/dist/{chunk-ADLVPKUV.js → chunk-ATD32GCX.js} +1 -1
  21. package/dist/{chunk-ADLVPKUV.js.map → chunk-ATD32GCX.js.map} +1 -1
  22. package/dist/{chunk-UVX7RCMP.js → chunk-BI3EFLQ7.js} +1 -1
  23. package/dist/{chunk-SFEQXUIA.js → chunk-CCJPWDMA.js} +1 -1
  24. package/dist/chunk-EXHZ4CFB.js +1 -0
  25. package/dist/{chunk-AUBV6S7V.js.map → chunk-EXHZ4CFB.js.map} +1 -1
  26. package/dist/chunk-FRG7MKSJ.js +1 -0
  27. package/dist/{chunk-T7IQHFQ2.js.map → chunk-FRG7MKSJ.js.map} +1 -1
  28. package/dist/chunk-HE4XE3WR.js +1 -0
  29. package/dist/chunk-HE4XE3WR.js.map +1 -0
  30. package/dist/{chunk-XQJERZUS.js → chunk-HWOP7QWK.js} +1 -1
  31. package/dist/{chunk-ZWT5Y3JR.js → chunk-JEHKGTP2.js} +1 -1
  32. package/dist/chunk-JEHKGTP2.js.map +1 -0
  33. package/dist/chunk-KLC5XT6F.js +1 -0
  34. package/dist/chunk-KLC5XT6F.js.map +1 -0
  35. package/dist/chunk-KR664YI3.js +1 -0
  36. package/dist/{chunk-UI5RROGI.js.map → chunk-KR664YI3.js.map} +1 -1
  37. package/dist/{chunk-Q647OXON.js → chunk-LOWKWUNS.js} +1 -1
  38. package/dist/{chunk-Q647OXON.js.map → chunk-LOWKWUNS.js.map} +1 -1
  39. package/dist/chunk-O4NIJDL4.js +1 -0
  40. package/dist/chunk-O4NIJDL4.js.map +1 -0
  41. package/dist/{chunk-4T3TTYUT.js → chunk-P3DGQUID.js} +1 -1
  42. package/dist/{chunk-4T3TTYUT.js.map → chunk-P3DGQUID.js.map} +1 -1
  43. package/dist/{chunk-F44QX47A.js → chunk-Q75JSMU6.js} +1 -1
  44. package/dist/{chunk-F44QX47A.js.map → chunk-Q75JSMU6.js.map} +1 -1
  45. package/dist/chunk-QQFZEOPB.js +1 -0
  46. package/dist/chunk-QQFZEOPB.js.map +1 -0
  47. package/dist/{chunk-DBJKLXLS.js → chunk-SRPCHXW2.js} +1 -1
  48. package/dist/{chunk-3GNYPM6J.js → chunk-T6BIFKPU.js} +1 -1
  49. package/dist/{chunk-3GNYPM6J.js.map → chunk-T6BIFKPU.js.map} +1 -1
  50. package/dist/chunk-WDAYRHXR.js +1 -0
  51. package/dist/{chunk-AYAKU4YA.js.map → chunk-WDAYRHXR.js.map} +1 -1
  52. package/dist/chunk-ZBB7Q3OZ.js +1 -0
  53. package/dist/chunk-ZBB7Q3OZ.js.map +1 -0
  54. package/dist/commodities/commodities-all.js +1 -1
  55. package/dist/commodities/commodities-standard.d.ts +1 -1
  56. package/dist/commodities/commodities-standard.js +1 -1
  57. package/dist/commodities/commodities.js +1 -1
  58. package/dist/commodities/index.js +1 -1
  59. package/dist/i18n/blueprints.js +1 -1
  60. package/dist/i18n/codex-regions.d.ts +33 -0
  61. package/dist/i18n/codex-regions.js +1 -0
  62. package/dist/i18n/codex-regions.js.map +1 -0
  63. package/dist/i18n/index.d.ts +10 -8
  64. package/dist/i18n/index.js +1 -1
  65. package/dist/i18n/pre-engineered.d.ts +4 -0
  66. package/dist/i18n/pre-engineered.js +1 -1
  67. package/dist/materials/index.js +1 -1
  68. package/dist/materials/micro-resources-all.js +1 -1
  69. package/dist/materials/micro-resources.js +1 -1
  70. package/dist/ships/armour.js +1 -1
  71. package/dist/ships/blueprint-costs.js +1 -1
  72. package/dist/ships/blueprints.d.ts +1 -2
  73. package/dist/ships/blueprints.js +1 -1
  74. package/dist/ships/build-metrics.js +1 -1
  75. package/dist/ships/index.js +1 -1
  76. package/dist/ships/loadout-validation.d.ts +1 -1
  77. package/dist/ships/loadout-validation.js +1 -1
  78. package/dist/ships/modules-all.js +1 -1
  79. package/dist/ships/modules-hardpoint.js +1 -1
  80. package/dist/ships/modules.d.ts +26 -13
  81. package/dist/ships/modules.js +1 -1
  82. package/dist/ships/pre-engineered-stats.d.ts +5 -9
  83. package/dist/ships/pre-engineered-stats.js +1 -1
  84. package/dist/ships/pre-engineered.d.ts +12 -6
  85. package/dist/ships/pre-engineered.js +1 -1
  86. package/dist/ships/resistances.d.ts +3 -2
  87. package/dist/ships/resistances.js +1 -1
  88. package/dist/ships/shield-capacitor.js +1 -1
  89. package/dist/ships/shields.js +1 -1
  90. package/dist/ships/ship-loadout.d.ts +16 -18
  91. package/dist/ships/ship-loadout.js +1 -1
  92. package/dist/ships/weapons.d.ts +2 -0
  93. package/dist/ships/weapons.js +1 -1
  94. package/package.json +10 -5
  95. package/dist/chunk-4WC5NHBJ.js +0 -1
  96. package/dist/chunk-4WC5NHBJ.js.map +0 -1
  97. package/dist/chunk-53EBUFVU.js +0 -1
  98. package/dist/chunk-53EBUFVU.js.map +0 -1
  99. package/dist/chunk-A6QTYK2D.js +0 -1
  100. package/dist/chunk-A6QTYK2D.js.map +0 -1
  101. package/dist/chunk-AAU7OM47.js +0 -1
  102. package/dist/chunk-AAU7OM47.js.map +0 -1
  103. package/dist/chunk-AUBV6S7V.js +0 -1
  104. package/dist/chunk-AYAKU4YA.js +0 -1
  105. package/dist/chunk-C3YZ5KTA.js +0 -1
  106. package/dist/chunk-C3YZ5KTA.js.map +0 -1
  107. package/dist/chunk-T7IQHFQ2.js +0 -1
  108. package/dist/chunk-UI5RROGI.js +0 -1
  109. package/dist/chunk-ZWT5Y3JR.js.map +0 -1
  110. /package/dist/{chunk-Q5ALV3DI.js.map → chunk-3I2I5KG4.js.map} +0 -0
  111. /package/dist/{chunk-2TY42PTF.js.map → chunk-6MQOPQAA.js.map} +0 -0
  112. /package/dist/{chunk-RA6SY445.js.map → chunk-7UF4XRIR.js.map} +0 -0
  113. /package/dist/{chunk-UVX7RCMP.js.map → chunk-BI3EFLQ7.js.map} +0 -0
  114. /package/dist/{chunk-SFEQXUIA.js.map → chunk-CCJPWDMA.js.map} +0 -0
  115. /package/dist/{chunk-XQJERZUS.js.map → chunk-HWOP7QWK.js.map} +0 -0
  116. /package/dist/{chunk-DBJKLXLS.js.map → chunk-SRPCHXW2.js.map} +0 -0
@@ -0,0 +1 @@
1
+ import{getShipBySymbol,getShipByName,getShipSlots}from"./chunk-C4FUV6GF.js";import{getLoadoutModifier}from"./chunk-T4MKUKYS.js";import{sourcePurchaseFromLoadout}from"./chunk-NIURLW2F.js";import{weaponMetrics}from"./chunk-QQFZEOPB.js";import{isBuiltInHullSymbol,identifyPreEngineeredVariant,unrollableFixedArticle,cloneLoadoutModule,isNonOutfittingSlot,isBuiltInHullModule,matchingKeyIn,ownKeyIn,getPreEngineeredStats,getPreEngineeredModifiers,cloneModuleStats,isFinalGuardianWeaponEngineering,scaleDamageComponents}from"./chunk-HE4XE3WR.js";import{builtInModuleBySymbol,getBulkheadsForShip}from"./chunk-2GVJNKFW.js";import{getPreEngineeredVariants}from"./chunk-EXHZ4CFB.js";import{shieldMetrics}from"./chunk-SRPCHXW2.js";import{CORE_MODULES}from"./chunk-ZZTDEDXJ.js";import{stockedMountKind}from"./chunk-M6J7KP7G.js";import{getDefaultLoadout}from"./chunk-KY7KSPU6.js";import{getExperimentalEffect}from"./chunk-77I24V6B.js";import{ammunitionCapacity}from"./chunk-AA3K5XUE.js";import{fieldForLabel,scaleForLabel,labelsForField,capabilityValueForLabel,damageTypeForLabel}from"./chunk-U73MBQ45.js";import{BURST_PATTERN_LABELS,journalRateOfFire,preciseValueFor}from"./chunk-EFQOUATZ.js";import{parseSlotName,SLOT_RESTRICTION_LABELS,enumerateSlots}from"./chunk-RAO35XDF.js";import{normalizeKey}from"./chunk-BKWLI44T.js";import{truncate,requireString,describeValue,requireStringIfPresent}from"./chunk-PKWVG2JY.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var MILITARY_PREFIXES=["int_hullreinforcement","int_metaalloyhullreinforcement","int_modulereinforcement","int_shieldcellbank","int_guardianhullreinforcement","int_guardianmodulereinforcement","int_guardianshieldreinforcement"];var MINING_PREFIXES=["hpt_mininglaser","hpt_mining_abrblstr","hpt_mining_seismchrgwarhd","hpt_mining_subsurfdispmisle","hpt_human_extraction","hpt_miningtoolv2"];var CARGO_PREFIXES=["int_cargorack","int_largecargorack","int_corrosionproofcargorack","int_fueltank"];var RESTRICTED_SLOT_PREFIXES={mining:MINING_PREFIXES,military:MILITARY_PREFIXES,cargo:CARGO_PREFIXES,limpetController:["int_dronecontrol","int_multidronecontrol"],vesselHangar:["int_fighterbay","int_largebuggybay","int_mkiilargebuggybay"],passenger:["int_passengercabin","int_mkii_passengercabin"],planetaryApproachSuite:["int_planetapproachsuite"]};var problem=(constraint,message,params)=>({constraint:constraint,message:message,...params===void 0?{}:{params:params}});function restrictionProblem(slot,symbol){const restriction=slot.restriction;if(!restriction)return null;if(RESTRICTED_SLOT_PREFIXES[restriction].some(prefix=>symbol.startsWith(prefix))){return null}return problem("restrictedMount",`slot only takes ${SLOT_RESTRICTION_LABELS[restriction]}`,{restriction:restriction})}function moduleSlotProblem(slot,module){const required=module.restrictedToSlot;if(!required||slot.restriction===required)return null;return problem("restrictedMount",`module only fits a mount that takes ${SLOT_RESTRICTION_LABELS[required]}`,{restriction:required})}function moduleFitProblem(shipSymbol,slot,module){if(slot.kind==="cargoHatch"){return problem("immutableSlot","the cargoHatch slot cannot be changed")}if(isBuiltInHullSymbol(module.symbol)){return problem("builtInHullModule","the cargo hatch is part of the hull, not an outfitting module")}if(slot.kind==="armour"){const hull=getShipBySymbol(shipSymbol);if(module.slot!=="armour"||module.ship===void 0){return problem("armourRequired","not a ship armour module")}if(!hull||module.ship.toLowerCase()!==hull.name.toLowerCase()){const armourHull=getShipByName(module.ship);return problem("wrongHullArmour",`armour belongs to ${truncate(module.ship)}, not ${truncate(hull?.name??shipSymbol)}`,{armourShipName:module.ship,...armourHull===null?{}:{armourShipSymbol:armourHull.symbol},shipSymbol:shipSymbol,...hull===null?{}:{shipName:hull.name}})}return null}const restricted=module.restrictedToShips;if(restricted&&!restricted.some(symbol2=>symbol2.toLowerCase()===shipSymbol.toLowerCase())){const allowedShipNames=restricted.map(symbol2=>{const hull=getShipBySymbol(symbol2);return hull?.name??symbol2});const labels=restricted.map((symbol2,index)=>{const name=allowedShipNames[index];return name===symbol2?symbol2:`${name} (${symbol2})`});return problem("restrictedHull",`module is restricted to ${truncate(labels.join(", "))}`,{allowedShipNames:allowedShipNames,allowedShipSymbols:[...restricted],shipSymbol:shipSymbol})}const wrongMount=moduleSlotProblem(slot,module);if(wrongMount)return wrongMount;const symbol=module.symbol.toLowerCase();const moduleSlot=module.slot;switch(slot.kind){case"core":if(moduleSlot!==slot.core){return problem("wrongCoreType",`not a ${slot.core} module`,{requiredCore:slot.core,moduleSlot:moduleSlot??"none"})}break;case"hardpoint":{if(module.category!=="hardpoint"){return problem("hardpointRequired","not a hardpoint weapon")}const restricted2=restrictionProblem(slot,symbol);if(restricted2)return restricted2;break}case"utility":if(module.category!=="utility"){return problem("utilityRequired","not a utility module")}return null;case"optional":{const isFuelTank=moduleSlot==="fuelTank";if(module.category!=="internal"&&!isFuelTank){return problem("optionalInternalRequired","not an optional-internal module")}if(moduleSlot&&!isFuelTank){return problem("coreModuleInOptionalSlot","a core module only fits its core slot")}const restricted2=restrictionProblem(slot,symbol);if(restricted2)return restricted2;break}}if(module.class>slot.size){return problem("oversized",`module size ${truncate(module.class)} exceeds slot size ${slot.size}`,{moduleClass:module.class,slotSize:slot.size})}if(module.supercruiseOvercharge===true&&module.class<slot.size){return problem("exactSizeRequired",`an SCO drive fits a size ${truncate(module.class)} mount only, not size ${slot.size}`,{moduleClass:module.class,slotSize:slot.size})}return null}function moduleFitError(shipSymbol,slot,module){return moduleFitProblem(shipSymbol,slot,module)?.message??null}function preEngineeredVariantFor(module){return identifyPreEngineeredVariant(module)??(module.Engineering?unrollableFixedArticle(module.Item,module.Engineering):null)}function captureLoadoutEvent(event){const modules=event.Modules;const shipName=event.ShipName;const shipIdent=event.ShipIdent;const hullValue=event.HullValue;const modulesValue=event.ModulesValue;const rebuy=event.Rebuy;const unladenMass=event.UnladenMass;const cargoCapacity=event.CargoCapacity;const fuelCapacity=event.FuelCapacity;return{Ship:event.Ship,Modules:Array.isArray(modules)?captureEach(modules,captureModule):modules,...shipName===void 0?{}:{ShipName:shipName},...shipIdent===void 0?{}:{ShipIdent:shipIdent},...hullValue===void 0?{}:{HullValue:hullValue},...modulesValue===void 0?{}:{ModulesValue:modulesValue},...rebuy===void 0?{}:{Rebuy:rebuy},...unladenMass===void 0?{}:{UnladenMass:unladenMass},...cargoCapacity===void 0?{}:{CargoCapacity:cargoCapacity},...fuelCapacity===void 0?{}:{FuelCapacity:{...fuelCapacity}}}}function captureEach(values,capture){const captured=[];const{length:length}=values;for(let index=0;index<length;index++)captured.push(capture(values[index]));return captured}function captureModule(module){if(module===null||typeof module!=="object")return module;const on=module.On;const priority=module.Priority;const health=module.Health;const value=module.Value;const engineering=module.Engineering;return{Slot:module.Slot,Item:module.Item,...on===void 0?{}:{On:on},...priority===void 0?{}:{Priority:priority},...health===void 0?{}:{Health:health},...value===void 0?{}:{Value:value},...engineering===void 0?{}:{Engineering:captureEngineering(engineering)}}}function captureEngineering(engineering){if(engineering===null||typeof engineering!=="object")return engineering;const experimental=engineering.ExperimentalEffect;const experimentalLocalised=engineering.ExperimentalEffect_Localised;const modifiers=engineering.Modifiers;return{BlueprintName:engineering.BlueprintName,Level:engineering.Level,Quality:engineering.Quality,...experimental===void 0?{}:{ExperimentalEffect:experimental},...experimentalLocalised===void 0?{}:{ExperimentalEffect_Localised:experimentalLocalised},...modifiers===void 0?{}:{Modifiers:Array.isArray(modifiers)?captureEach(modifiers,modifier=>modifier!==null&&typeof modifier==="object"?{...modifier}:modifier):modifiers}}}function hullLayout(shipSymbol){const slots=getShipSlots(shipSymbol);return slots?enumerateSlots(slots):[]}function stockedMountRejects(shipSymbol,layout,slot,stats){const mount=layout.find(candidate=>candidate.key.toLowerCase()===slot.toLowerCase());return mount!==void 0&&moduleFitProblem(shipSymbol,mount,stats)!==null}function normalizeLoadoutEvent(rawEvent){const event=captureLoadoutEvent(rawEvent);requireString(event.Ship,"ShipLoadout.fromLoadout: event.Ship");if(!Array.isArray(event.Modules)){throw new TypeError(`ShipLoadout.fromLoadout: event.Modules must be an array, received ${describeValue(event.Modules)}`)}const modules=/* @__PURE__ */new Map;const slots=/* @__PURE__ */new Set;for(const module of event.Modules){if(module===null||typeof module!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: event.Modules[] must hold module objects, received ${describeValue(module)}`)}requireString(module.Slot,"ShipLoadout.fromLoadout: module.Slot");requireString(module.Item,"ShipLoadout.fromLoadout: module.Item");if(module.Engineering!==void 0){if(module.Engineering===null||typeof module.Engineering!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: module.Engineering must be an object, received ${describeValue(module.Engineering)}`)}requireStringIfPresent(module.Engineering.BlueprintName,"ShipLoadout.fromLoadout: module.Engineering.BlueprintName");requireStringIfPresent(module.Engineering.ExperimentalEffect,"ShipLoadout.fromLoadout: module.Engineering.ExperimentalEffect");if(module.Engineering.Modifiers!==void 0&&!Array.isArray(module.Engineering.Modifiers)){throw new TypeError(`ShipLoadout.fromLoadout: module.Engineering.Modifiers must be an array, received ${describeValue(module.Engineering.Modifiers)}`)}for(const[index,modifier]of(module.Engineering.Modifiers??[]).entries()){if(modifier===null||typeof modifier!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: module.Engineering.Modifiers[${index}] must be an object, received ${describeValue(modifier)}`)}requireString(modifier.Label,`ShipLoadout.fromLoadout: module.Engineering.Modifiers[${index}].Label`)}}const normalizedSlot=module.Slot.toLowerCase();if(slots.has(normalizedSlot)){throw new TypeError(`ShipLoadout.fromLoadout: duplicate slot "${truncate(module.Slot)}"`)}slots.add(normalizedSlot);modules.set(module.Slot,cloneLoadoutModule(module))}const top={};if(event.ShipName!==void 0)top.ShipName=event.ShipName;if(event.ShipIdent!==void 0)top.ShipIdent=event.ShipIdent;if(event.HullValue!==void 0)top.HullValue=event.HullValue;if(event.ModulesValue!==void 0)top.ModulesValue=event.ModulesValue;if(event.Rebuy!==void 0)top.Rebuy=event.Rebuy;if(event.UnladenMass!==void 0)top.UnladenMass=event.UnladenMass;if(event.CargoCapacity!==void 0)top.CargoCapacity=event.CargoCapacity;if(event.FuelCapacity!==void 0)top.FuelCapacity={...event.FuelCapacity};let invalidatesAggregates=false;const outcomes=[];const defaults=getDefaultLoadout(event.Ship)?.modules??[];let layout;for(const[slot,module]of modules){if(isNonOutfittingSlot(slot)||isBuiltInHullModule(module))continue;const stats=builtInModuleBySymbol(module.Item,"ShipLoadout.fromLoadout: module.Item");const parsed=parseSlotName(slot);const stocked=parsed===null?null:stockedMountKind(parsed);const fallback=stocked===null?void 0:defaults.find(candidate=>candidate.slot.toLowerCase()===slot.toLowerCase());const rejected=fallback!==void 0&&(stats===null||stocked==="cargoHatch"||stockedMountRejects(event.Ship,layout??=hullLayout(event.Ship),slot,stats));if(stats!==null&&!rejected)continue;if(fallback){modules.set(slot,{Slot:slot,Item:fallback.symbol,...module.On===void 0?{}:{On:module.On},...module.Priority===void 0?{}:{Priority:module.Priority},...module.Health===void 0?{}:{Health:module.Health}});outcomes.push({action:"defaulted",slot:slot,sourceSymbol:module.Item,replacementSymbol:fallback.symbol})}else{modules.delete(slot);outcomes.push({action:"emptied",slot:slot,sourceSymbol:module.Item})}invalidatesAggregates=true}for(const fallback of defaults){const parsed=parseSlotName(fallback.slot);const stocked=parsed===null?null:stockedMountKind(parsed);if(stocked===null||matchingKeyIn(modules,fallback.slot)!==null)continue;const slot=ownKeyIn(modules,fallback.slot);modules.set(slot,{Slot:slot,Item:fallback.symbol});outcomes.push({action:"defaulted",slot:slot,sourceSymbol:null,replacementSymbol:fallback.symbol});if(stocked==="core")invalidatesAggregates=true}if(invalidatesAggregates){delete top.ModulesValue;delete top.Rebuy;delete top.UnladenMass;delete top.CargoCapacity;delete top.FuelCapacity}const moduleStats=/* @__PURE__ */new Map;const primitiveModifiers=/* @__PURE__ */new Map;for(const module of modules.values()){const engineering=module.Engineering;const variant=preEngineeredVariantFor(module);const catalogueVariantStats=variant?getPreEngineeredStats(variant):null;let variantStats=catalogueVariantStats;const retainsBakedExperimental=variant?.experimentalEffectSymbol!==void 0&&typeof engineering?.ExperimentalEffect==="string"&&variant.experimentalEffectSymbol.trim().toLowerCase()===engineering.ExperimentalEffect.trim().toLowerCase();if(variant&&catalogueVariantStats&&!catalogueVariantStats.engineeringLocked&&!retainsBakedExperimental){const{experimentalEffectSymbol:originalExperimental,...withoutExperimental}=variant;const currentExperimental=engineering?.ExperimentalEffect;const currentVariant=typeof currentExperimental==="string"?{...withoutExperimental,experimentalEffectSymbol:currentExperimental}:withoutExperimental;variantStats=getPreEngineeredStats(withoutExperimental);primitiveModifiers.set(module.Slot,[...engineering?.Modifiers??[],...getPreEngineeredModifiers(currentVariant)])}if(variantStats)moduleStats.set(module.Slot,cloneModuleStats(variantStats));const guardianFinal=typeof engineering?.BlueprintName==="string"&&isFinalGuardianWeaponEngineering(module.Item,engineering.BlueprintName);if(variantStats?.engineeringLocked||typeof engineering?.BlueprintName!=="string"||!guardianFinal){continue}const normalizedBlueprint=normalizeKey(engineering.BlueprintName,"ShipLoadout.fromLoadout: module.Engineering.BlueprintName");const normalizedExperimental=normalizeKey(engineering.ExperimentalEffect,"ShipLoadout.fromLoadout: module.Engineering.ExperimentalEffect");const variants=getPreEngineeredVariants(module.Item);const exact=variants.find(candidate=>candidate.engineeringLocked===true&&candidate.blueprintSymbol.toLowerCase()===normalizedBlueprint&&candidate.grade===engineering.Level&&candidate.experimentalEffectSymbol?.toLowerCase()===normalizedExperimental);const guardianBase=variants.find(candidate=>candidate.engineeringLocked===true&&candidate.blueprintSymbol.toLowerCase()===normalizedBlueprint&&candidate.grade===engineering.Level&&candidate.experimentalEffectSymbol===void 0);const stats=exact?getPreEngineeredStats(exact):guardianBase&&engineering.ExperimentalEffect!==void 0?getPreEngineeredStats({...guardianBase,experimentalEffectSymbol:engineering.ExperimentalEffect}):builtInModuleBySymbol(module.Item,"ShipLoadout.fromLoadout: module.Item");if(stats){moduleStats.set(module.Slot,cloneModuleStats({...stats,engineeringLocked:true}))}}return{shipSymbol:event.Ship,modules:modules,moduleStats:moduleStats,primitiveModifiers:primitiveModifiers,top:top,sourcePurchase:sourcePurchaseFromLoadout(event),outcomes:deepFreeze(outcomes)}}var NO_ISSUES=Object.freeze([]);function completeResult(value){return Object.freeze({value:value,complete:true,issues:NO_ISSUES})}function incompleteResult(issues){return Object.freeze({value:null,complete:false,issues:Object.freeze(issues.map(issue=>Object.freeze({...issue,...issue.params?{params:Object.freeze({...issue.params})}:{}})))})}var PREFIX={powerPlant:["int_powerplant","int_guardianpowerplant"],thrusters:["int_engine","int_mkiiagileboost_engine"],frameShiftDrive:["int_hyperdrive"],powerDistributor:["int_powerdistributor","int_guardianpowerdistributor"],shieldGenerator:["int_shieldgenerator"],shieldCellBank:["int_shieldcellbank"],shieldBooster:["hpt_shieldbooster"],shieldReinforcement:["int_guardianshieldreinforcement"],hullReinforcement:["int_hullreinforcement","int_guardianhullreinforcement","int_metaalloyhullreinforcement"],moduleReinforcement:["int_modulereinforcement","int_guardianmodulereinforcement"]};var startsWithAny=(symbol,prefixes)=>prefixes.some(prefix=>symbol.toLowerCase().startsWith(prefix));function isPowerDistributor(module,stats){return stats?.slot?stats.slot==="powerDistributor":startsWithAny(module.Item,PREFIX.powerDistributor)}function isPowerPlant(module,stats){const parsed=parseSlotName(module.Slot);if(parsed?.kind==="core"&&parsed.core==="powerPlant")return true;return stats?.slot?stats.slot==="powerPlant":startsWithAny(module.Item,PREFIX.powerPlant)}function isThruster(module,stats){const parsed=parseSlotName(module.Slot);if(parsed?.kind==="core"&&parsed.core==="thrusters")return true;return stats?.slot?stats.slot==="thrusters":startsWithAny(module.Item,PREFIX.thrusters)}function isFrameShiftDrive(module,stats){const parsed=parseSlotName(module.Slot);if(parsed?.kind==="core"&&parsed.core==="frameShiftDrive")return true;return stats?.slot?stats.slot==="frameShiftDrive":startsWithAny(module.Item,PREFIX.frameShiftDrive)}function isEnabled(module){return module.On!==false}function priorityOf(module){return(module.Priority??0)+1}function effectiveStat(module,field,stats){const stated=statedModifier(module,field);if(stated!==void 0)return stated;const base=stats?.[field];return typeof base==="number"?base:void 0}function statedModifier(module,field){for(const label of labelsForField(field)){if(capabilityValueForLabel(label)!==null)continue;const modified=getLoadoutModifier(module,label);if(modified!==null)return modified/scaleForLabel(label)}return void 0}function effectiveCapability(module,field,stats){for(const label of labelsForField(field)){if(capabilityValueForLabel(label)===null)continue;if(module.Engineering?.Modifiers?.some(modifier=>modifier.Label.toLowerCase()===label.toLowerCase())){return true}}const base=stats[field];return typeof base==="boolean"?base:void 0}function effectiveDamageDistribution(module,stats){const fromEffect=module.Engineering?.ExperimentalEffect?getExperimentalEffect(module.Engineering.ExperimentalEffect)?.damageDistribution:void 0;const distribution={...fromEffect??stats.damageDistribution};let resolved=fromEffect!==void 0||stats.damageDistribution!==void 0;const seen=/* @__PURE__ */new Set;for(const modifier of module.Engineering?.Modifiers??[]){const type=damageTypeForLabel(modifier.Label);if(type===null||seen.has(type))continue;seen.add(type);if(modifier.Value===void 0)continue;distribution[type]=modifier.Value/scaleForLabel(modifier.Label);resolved=true}return resolved?distribution:void 0}function convertsDamage(module){if(module.Engineering?.ExperimentalEffect&&getExperimentalEffect(module.Engineering.ExperimentalEffect)?.damageDistribution){return true}return(module.Engineering?.Modifiers??[]).some(modifier=>damageTypeForLabel(modifier.Label)!==null)}function modifierRatio(module,stats,field){const base=stats?.[field];if(typeof base!=="number"||base===0)return 1;const effective=effectiveStat(module,field,stats);return effective===void 0?1:effective/base}function relatedStat(module,stats,field,ratio){const stated=statedModifier(module,field);if(stated!==void 0)return stated;const base=stats?.[field];return typeof base==="number"?base*ratio:void 0}function carriesMassCurve(stats){return(stats.minMass??stats.maxMass??stats.minMultiplier??stats.maxMultiplier)!==void 0}function maxMassRatio(thrusters,ratio){return thrusters?ratio:Math.max(1,ratio)}function effectiveModule(module,stats){if(!stats||!module.Engineering)return stats;const merged={...stats};const fields=new Set(Object.keys(stats));for(const modifier of module.Engineering.Modifiers??[]){const field=fieldForLabel(modifier.Label,stats);if(field)fields.add(field)}for(const key of fields){const capability=effectiveCapability(module,key,stats);if(capability!==void 0){merged[key]=capability;continue}const value=effectiveStat(module,key,stats);if(value!==void 0)merged[key]=value}if(carriesMassCurve(stats)){const thrusters=stats.slot==="thrusters";const massRatio=modifierRatio(module,stats,"optMass");const minMass=relatedStat(module,stats,"minMass",massRatio);const maxMass=relatedStat(module,stats,"maxMass",maxMassRatio(thrusters,massRatio));if(minMass!==void 0)merged.minMass=minMass;if(maxMass!==void 0)merged.maxMass=maxMass;const performanceRatio=modifierRatio(module,stats,"optMultiplier");const minMultiplier=relatedStat(module,stats,"minMultiplier",performanceRatio);const maxMultiplier=relatedStat(module,stats,"maxMultiplier",performanceRatio);if(minMultiplier!==void 0)merged.minMultiplier=minMultiplier;if(maxMultiplier!==void 0)merged.maxMultiplier=maxMultiplier;if(thrusters){for(const field of["minSpeedMultiplier","optSpeedMultiplier","maxSpeedMultiplier","minRotationMultiplier","optRotationMultiplier","maxRotationMultiplier"]){const value=stats[field];if(value!==void 0)merged[field]=value*performanceRatio}}}const damageDistribution=effectiveDamageDistribution(module,stats);if(damageDistribution)merged.damageDistribution=damageDistribution;if(stats.category==="hardpoint")normalizeEffectiveWeapon(module,merged);if(convertsDamage(module)){delete merged.damageComponents}else if(stats.damageComponents){merged.damageComponents=scaleDamageComponents(stats.damageComponents,stats.damage,typeof merged.damage==="number"?merged.damage:void 0)}return merged}function powerConsumerFor(module,stats){const draw=effectiveStat(module,"powerDraw",stats);if(draw===void 0||draw===0)return null;const mounted=stats?.category==="hardpoint"||stats?.category==="utility";return{draw:draw,priority:priorityOf(module),enabled:isEnabled(module),deployedOnly:mounted&&stats?.alwaysPowered!==true,label:module.Slot,symbol:module.Item}}function powerAvailable(modules,statsFor){for(const module of modules){const stats=statsFor(module);if(!isPowerPlant(module,stats))continue;if(!isEnabled(module))return 0;return effectiveStat(module,"powerCapacity",stats)??0}return 0}var DEFAULT_SLOT={powerCapacity:"PowerPlant",heatEfficiency:"PowerPlant",thrusters:"MainEngines",powerDistributor:"PowerDistributor"};var UNRESOLVED_FACT={thrusters:"thruster stats",shieldGenerator:"shield-generator stats",powerCapacity:"power capacity",heatEfficiency:"heat efficiency",powerDistributor:"power-distributor stats"};var NOTHING_FITTED={powerCapacity:"PowerPlant: no power plant is fitted",heatEfficiency:"PowerPlant: no power plant is fitted",thrusters:"MainEngines: no thrusters are fitted",powerDistributor:"PowerDistributor: no power distributor is fitted"};function metricIssue(field,reason,module){const defaultSlot=DEFAULT_SLOT[field];const slot=module?.Slot??defaultSlot;const symbol=module?.Item;const params={field:field,reason:reason,...slot===void 0?{}:{slot:slot},...symbol===void 0?{}:{symbol:symbol}};let message;if(reason==="missing"){message=NOTHING_FITTED[field]??"no shield generator is fitted"}else if(reason==="unresolved"){const unavailable=UNRESOLVED_FACT[field]??field;message=`${truncate(slot??field)}: ${unavailable} unavailable for ${truncate(symbol??field)}`}else if(reason==="disabled"){message=`${truncate(slot??field)}: ${truncate(symbol??field)} is switched off`}else if(reason==="invalid"){message=`${truncate(slot??field)}: ${truncate(symbol??field)} has invalid ${field}`}else{message=`${truncate(slot??field)}: ${truncate(symbol??field)} is not powered with hardpoints retracted`}return{field:field,reason:reason,...slot===void 0?{}:{slot:slot},...symbol===void 0?{}:{symbol:symbol},message:message,params:params}}function powerPlantIssueFor(modules,statsFor){for(const module of modules){const stats=statsFor(module);if(!isPowerPlant(module,stats))continue;if(!isEnabled(module))return metricIssue("powerCapacity","disabled",module);const capacity=effectiveStat(module,"powerCapacity",stats);if(capacity===void 0)return metricIssue("powerCapacity","unresolved",module);return!Number.isFinite(capacity)||capacity<=0?metricIssue("powerCapacity","invalid",module):null}return metricIssue("powerCapacity","missing")}function powerDrawIssueFor(modules,statsFor){for(const module of modules){const consumer=powerConsumerFor(module,statsFor(module));if(consumer&&(!Number.isFinite(consumer.draw)||consumer.draw<0)){return metricIssue("powerDraw","invalid",module)}}return null}function poweredMetricBudgetFor(field,module,stats,modules,getBudget,statsFor){if(!isEnabled(module))return incompleteResult([metricIssue(field,"disabled",module)]);const plantIssue=powerPlantIssueFor(modules,statsFor);if(plantIssue)return incompleteResult([plantIssue]);const drawIssue=powerDrawIssueFor(modules,statsFor);if(drawIssue)return incompleteResult([drawIssue]);const budget=getBudget();return budget.available>0&&poweredStates(module,stats,budget).retracted?completeResult(budget):incompleteResult([metricIssue(field,"shed",module)])}function poweredShieldGeneratorResultFor(modules,getBudget,statsFor){for(const module of modules){if(!startsWithAny(module.Item,PREFIX.shieldGenerator))continue;const stats=statsFor(module);const powered=poweredMetricBudgetFor("shieldGenerator",module,stats,modules,getBudget,statsFor);if(!powered.complete)return powered;return stats===null?incompleteResult([metricIssue("shieldGenerator","unresolved",module)]):completeResult({module:module,budget:powered.value})}return incompleteResult([metricIssue("shieldGenerator","missing")])}function mapResistanceFields(read){return{kineticResistance:read("kineticResistance")??0,thermalResistance:read("thermalResistance")??0,explosiveResistance:read("explosiveResistance")??0,causticResistance:read("causticResistance")??0}}function resistancesOf(module,stats){return mapResistanceFields(field=>effectiveStat(module,field,stats))}function shieldInputFor(ship,modules,budget,statsFor){let generator=null;const boosters=[];let reinforcement=0;for(const module of modules){if(!isEnabled(module))continue;const stats=statsFor(module);if(!(budget.available>0&&poweredStates(module,stats,budget).retracted))continue;if(!generator&&startsWithAny(module.Item,PREFIX.shieldGenerator)){const effective=effectiveModule(module,stats);const{optMass:optMass,minMass:minMass,maxMass:maxMass,optMultiplier:optMultiplier,minMultiplier:minMultiplier,maxMultiplier:maxMultiplier}=effective??{};generator={...optMass===void 0?{}:{optMass:optMass},...minMass===void 0?{}:{minMass:minMass},...maxMass===void 0?{}:{maxMass:maxMass},...optMultiplier===void 0?{}:{optMultiplier:optMultiplier},...minMultiplier===void 0?{}:{minMultiplier:minMultiplier},...maxMultiplier===void 0?{}:{maxMultiplier:maxMultiplier},...resistancesOf(module,stats)}}else if(startsWithAny(module.Item,PREFIX.shieldBooster)){boosters.push({shieldBoost:effectiveStat(module,"shieldBoost",stats)??0,...resistancesOf(module,stats)})}else if(startsWithAny(module.Item,PREFIX.shieldReinforcement)){reinforcement+=effectiveStat(module,"shieldAddition",stats)??0}}return{hullMass:ship.hullMass,baseShieldStrength:ship.baseShieldStrength,generator:generator,boosters:boosters,reinforcement:reinforcement}}function shieldInputResultFor(ship,modules,getBudget,statsFor){const fitted=poweredShieldGeneratorResultFor(modules,getBudget,statsFor);if(!fitted.complete)return fitted;return completeResult(shieldInputFor(ship,modules,fitted.value.budget,statsFor))}function shieldCapacitorInputResultFor(ship,modules,getBudget,systemsPips,statsFor){const fitted=poweredShieldGeneratorResultFor(modules,getBudget,statsFor);if(!fitted.complete)return fitted;const budget=fitted.value.budget;const capacitor=systemsCapacitorResultFor(modules,budget,statsFor);if(!capacitor.complete)return capacitor;const shields=shieldMetrics(shieldInputFor(ship,modules,budget,statsFor));return completeResult({strength:shields.strength,resistances:shields.resistances,systemsCapacity:capacitor.value.systemsCapacity,systemsRecharge:capacitor.value.systemsRecharge,systemsPips:systemsPips})}function systemsCapacitorResultFor(modules,budget,statsFor){let distributor=null;for(const module of modules){const stats2=statsFor(module);if(isPowerDistributor(module,stats2)&&isEnabled(module)&&budget.available>0&&poweredStates(module,stats2,budget).retracted)distributor=module}if(!distributor)return completeResult({systemsCapacity:0,systemsRecharge:0});const stats=statsFor(distributor);const systemsCapacity=effectiveStat(distributor,"systemsCapacity",stats);const systemsRecharge=effectiveStat(distributor,"systemsRecharge",stats);return systemsCapacity===void 0||systemsRecharge===void 0?incompleteResult([metricIssue("powerDistributor","unresolved",distributor)]):completeResult({systemsCapacity:systemsCapacity,systemsRecharge:systemsRecharge})}function thrusterCurveFor(module,stats){const effective=effectiveModule(module,stats);const minMass=effective?.minMass;const optMass=effective?.optMass;const maxMass=effective?.maxMass;const minMultiplier=effective?.minMultiplier;const optMultiplier=effective?.optMultiplier;const maxMultiplier=effective?.maxMultiplier;if(minMass===void 0||optMass===void 0||maxMass===void 0||minMultiplier===void 0||optMultiplier===void 0||maxMultiplier===void 0){return null}return{minMass:minMass,optMass:optMass,maxMass:maxMass,minMultiplier:minMultiplier,optMultiplier:optMultiplier,maxMultiplier:maxMultiplier,...effective?.optSpeedMultiplier===void 0?{}:{speedCurve:{minMass:minMass,optMass:optMass,maxMass:maxMass,minMultiplier:effective.minSpeedMultiplier??minMultiplier,optMultiplier:effective.optSpeedMultiplier,maxMultiplier:effective.maxSpeedMultiplier??maxMultiplier}},...effective?.optRotationMultiplier===void 0?{}:{rotationCurve:{minMass:minMass,optMass:optMass,maxMass:maxMass,minMultiplier:effective.minRotationMultiplier??minMultiplier,optMultiplier:effective.optRotationMultiplier,maxMultiplier:effective.maxRotationMultiplier??maxMultiplier}}}}function fittedThrusterParamsFor(modules,statsFor){for(const module of modules){const stats=statsFor(module);if(isThruster(module,stats))return thrusterCurveFor(module,stats)}return null}function mobilityInputResultFor(ship,modules,getBudget,mass,statsFor){let thrusters=null;for(const module of modules){const stats=statsFor(module);if(!isThruster(module,stats))continue;const powered=poweredMetricBudgetFor("thrusters",module,stats,modules,getBudget,statsFor);if(!powered.complete)return powered;thrusters=thrusterCurveFor(module,stats);if(!thrusters)return incompleteResult([metricIssue("thrusters","unresolved",module)]);break}if(!thrusters)return incompleteResult([metricIssue("thrusters","missing")]);return completeResult({minimumSpeed:ship.minimumSpeed,maximumSpeed:ship.maximumSpeed,boost:ship.boost,minPitch:ship.minPitch,pitch:ship.pitch,minRoll:ship.minRoll,roll:ship.roll,minYaw:ship.minYaw,yaw:ship.yaw,mass:typeof mass==="function"?mass():mass,thrusters:thrusters})}function shieldRecoveryInputResultFor(ship,modules,getBudget,systemsPips,statsFor){const generator=poweredShieldGeneratorResultFor(modules,getBudget,statsFor);if(!generator.complete)return generator;const{module:generatorModule,budget:budget}=generator.value;const generatorStats=statsFor(generatorModule);const distributorDraw=effectiveStat(generatorModule,"distributorDraw",generatorStats);const regenRate=effectiveStat(generatorModule,"shieldRegenRate",generatorStats);const brokenRegenRate=effectiveStat(generatorModule,"shieldBrokenRegenRate",generatorStats);if(distributorDraw===void 0||regenRate===void 0||brokenRegenRate===void 0){return incompleteResult([metricIssue("shieldGenerator","unresolved",generatorModule)])}const capacitor=systemsCapacitorResultFor(modules,budget,statsFor);if(!capacitor.complete)return capacitor;const strength=shieldMetrics(shieldInputFor(ship,modules,budget,statsFor)).strength;return completeResult({strength:strength,regenRate:regenRate,brokenRegenRate:brokenRegenRate,distributorDraw:distributorDraw,systemsCapacity:capacitor.value.systemsCapacity,systemsRecharge:capacitor.value.systemsRecharge,systemsPips:systemsPips})}function weaponsCapacitorInputFor(modules,weaponsPips,budget,statsFor){let weaponsCapacity=0;let weaponsRecharge=0;let sustainedEnergyPerSecond=0;for(const module of modules){if(!isEnabled(module))continue;const stats=statsFor(module);if(!poweredStates(module,stats,budget).deployed)continue;if(isPowerDistributor(module,stats)){weaponsCapacity=effectiveStat(module,"weaponsCapacity",stats)??0;weaponsRecharge=effectiveStat(module,"weaponsRecharge",stats)??0}const weapon=weaponStatsFor(module,stats);if(weapon){sustainedEnergyPerSecond+=weaponMetrics(weapon).sustainedEnergyPerSecond}}return{weaponsCapacity:weaponsCapacity,weaponsRecharge:weaponsRecharge,sustainedEnergyPerSecond:sustainedEnergyPerSecond,weaponsPips:weaponsPips}}function distributorInputResultFor(modules,pips,budget,statsFor){let disabled=null;for(const module of modules){const stats=statsFor(module);if(!isPowerDistributor(module,stats))continue;if(!isEnabled(module)){disabled??=module;continue}if(!poweredStates(module,stats,budget).retracted){return incompleteResult([metricIssue("powerDistributor","shed",module)])}const systemsCapacity=effectiveStat(module,"systemsCapacity",stats);const systemsRecharge=effectiveStat(module,"systemsRecharge",stats);const enginesCapacity=effectiveStat(module,"enginesCapacity",stats);const enginesRecharge=effectiveStat(module,"enginesRecharge",stats);const weaponsCapacity=effectiveStat(module,"weaponsCapacity",stats);const weaponsRecharge=effectiveStat(module,"weaponsRecharge",stats);if(systemsCapacity===void 0||systemsRecharge===void 0||enginesCapacity===void 0||enginesRecharge===void 0||weaponsCapacity===void 0||weaponsRecharge===void 0){return incompleteResult([metricIssue("powerDistributor","unresolved",module)])}return completeResult({systemsCapacity:systemsCapacity,systemsRecharge:systemsRecharge,enginesCapacity:enginesCapacity,enginesRecharge:enginesRecharge,weaponsCapacity:weaponsCapacity,weaponsRecharge:weaponsRecharge,...pips})}return incompleteResult([disabled===null?metricIssue("powerDistributor","missing"):metricIssue("powerDistributor","disabled",disabled)])}function heatInputResultFor(ship,modules,budget,statsFor){let plant=null;let heatEfficiency;let thrusterHeatRate=0;let deployedThrusterHeatRate=0;let fsdHeatRate=0;let weaponsCapacity=0;const weapons=[];for(const module of modules){const stats=statsFor(module);if(isPowerPlant(module,stats)){if(!isEnabled(module)){return incompleteResult([metricIssue("powerCapacity","disabled",module)])}plant=module;heatEfficiency=effectiveStat(module,"heatEfficiency",stats);continue}if(!isEnabled(module))continue;const running=poweredStates(module,stats,budget);if(isThruster(module,stats)){const heat=effectiveStat(module,"engineHeatRate",stats)??0;if(running.retracted)thrusterHeatRate+=heat;if(running.deployed)deployedThrusterHeatRate+=heat}else if(isFrameShiftDrive(module,stats)){if(running.retracted)fsdHeatRate+=effectiveStat(module,"fsdHeatRate",stats)??0}else if(isPowerDistributor(module,stats)){if(running.deployed){weaponsCapacity=effectiveStat(module,"weaponsCapacity",stats)??0}}const weapon=weaponStatsFor(module,stats);if(!running.deployed)continue;if(!weapon)continue;weapons.push({heatPerSecond:weaponMetrics(weapon).sustainedHeatPerSecond,distributorDraw:weapon.distributorDraw??0})}if(heatEfficiency===void 0){return incompleteResult([plant===null?metricIssue("powerCapacity","missing"):metricIssue("heatEfficiency","unresolved",plant)])}return completeResult({heatCapacity:ship.heatCapacity,heatDissipation:ship.heatDissipation,heatEfficiency:heatEfficiency,retractedPowerDraw:poweredDraw(budget,"retracted"),deployedPowerDraw:poweredDraw(budget,"deployed"),thrusterHeatRate:thrusterHeatRate,deployedThrusterHeatRate:deployedThrusterHeatRate,fsdHeatRate:fsdHeatRate,weaponsCapacity:weaponsCapacity,weapons:weapons})}function poweredDraw(budget,state){const powered=state==="retracted"?"poweredRetracted":"poweredDeployed";return budget.bands.reduce((total,band)=>band[powered]?total+band[state]:total,0)}function poweredStates(module,stats,budget){const draw=effectiveStat(module,"powerDraw",stats);if(draw===void 0||draw===0)return{retracted:true,deployed:true};const band=budget.bands[Math.min(budget.bands.length,Math.max(1,priorityOf(module)))-1];if(!band)return{retracted:true,deployed:true};return{retracted:band.poweredRetracted,deployed:band.poweredDeployed}}function cellBankInputsFor(modules,budget,statsFor){const banks=[];for(const module of modules){if(!startsWithAny(module.Item,PREFIX.shieldCellBank))continue;const stats=statsFor(module);const effective=effectiveModule(module,stats);const ammunition=effective?ammunitionCapacity(effective):null;banks.push({slot:module.Slot,symbol:module.Item,reinforcementRate:effective?.shieldBankReinforcement??0,cells:ammunition?.total??0,spinUp:effective?.shieldBankSpinUp??0,duration:effective?.shieldBankDuration??0,heat:effective?.shieldBankHeat??0,powered:budget.available>0&&isEnabled(module)&&poweredStates(module,stats,budget).deployed})}return banks}function stockBulkhead(ship){const variants=getBulkheadsForShip(ship.name,CORE_MODULES);return variants.find(v=>v.symbol.toLowerCase().endsWith("_default"))??variants.find(v=>v.mass===0)??variants[0]??null}function armourInputFor(ship,modules,statsFor){const reinforcements=[];const moduleReinforcements=[];let bulkhead=null;for(const module of modules){if(!isEnabled(module))continue;const stats=statsFor(module);if(module.Slot.toLowerCase()==="armour"){bulkhead={hullBoost:effectiveStat(module,"hullBoost",stats)??0,...resistancesOf(module,stats)}}else if(startsWithAny(module.Item,PREFIX.hullReinforcement)){const boost=getLoadoutModifier(module,"DefenceModifierHealthMultiplier");reinforcements.push({hullReinforcement:effectiveStat(module,"hullReinforcement",stats)??0,hullBoost:boost===null?0:boost/scaleForLabel("DefenceModifierHealthMultiplier"),...resistancesOf(module,stats)})}else if(startsWithAny(module.Item,PREFIX.moduleReinforcement)){moduleReinforcements.push({moduleProtection:effectiveStat(module,"moduleProtection",stats)??0,integrity:effectiveStat(module,"integrity",stats)??0})}}if(!bulkhead){const stock=stockBulkhead(ship);bulkhead=stock?{hullBoost:stock.hullBoost??0,...mapResistanceFields(field=>stock[field])}:null}return{baseArmour:ship.baseArmour,bulkhead:bulkhead,reinforcements:reinforcements,moduleReinforcements:moduleReinforcements}}var WEAPON_FIELDS=["damage","roundsPerShot","rateOfFire","burstInterval","burstRounds","burstRateOfFire","chargeTime","clipSize","ammoMaximum","reloadTime","distributorDraw","thermalLoad","powerDraw","maximumRange","falloffRange","armourPiercing"];function weaponStatsFor(module,stats){if(!stats||stats.category!=="hardpoint")return null;const weapon={};for(const field of WEAPON_FIELDS){const value=effectiveStat(module,field,stats);if(value!==void 0)weapon[field]=value}normalizeEffectiveWeapon(module,weapon);const damageDistribution=effectiveDamageDistribution(module,stats);if(damageDistribution)weapon.damageDistribution=damageDistribution;if(stats.damageComponents&&!convertsDamage(module)){weapon.damageComponents=scaleDamageComponents(stats.damageComponents,stats.damage,typeof weapon.damage==="number"?weapon.damage:void 0)}if(stats.projectileRange)weapon.projectileRange={...stats.projectileRange};return weapon}function burstAdjustedRateOfFire(module,weapon){if(getLoadoutModifier(module,"RateOfFire")!==null)return void 0;const modifiers=module.Engineering?.Modifiers;const touched=BURST_PATTERN_LABELS.some(label=>getLoadoutModifier(module,label)!==null);if(!touched)return void 0;const stated=(label,field)=>preciseValueFor(modifiers,label)??weapon[field];return journalRateOfFire(stated("BurstInterval","burstInterval"),stated("BurstSize","burstRounds"),stated("BurstRateOfFire","burstRateOfFire"))}var FIRING_RATE_LABELS=["RateOfFire","BurstRateOfFire","BurstSize","BurstInterval","RoundsPerShot","Rounds"];function readsDamageFromPerSecond(module){return getLoadoutModifier(module,"Damage")===null&&FIRING_RATE_LABELS.every(label=>getLoadoutModifier(module,label)===null)}function normalizeEffectiveWeapon(module,weapon){const rate=burstAdjustedRateOfFire(module,weapon);if(rate!==void 0)weapon.rateOfFire=rate;if(readsDamageFromPerSecond(module)){const statedDamagePerSecond=getLoadoutModifier(module,"DamagePerSecond");const firingFactor=Number(weapon.roundsPerShot??1)*Number(weapon.rateOfFire??1);if(statedDamagePerSecond!==null&&firingFactor>0){weapon.damage=statedDamagePerSecond/firingFactor}}const{maximumRange:maximumRange,falloffRange:falloffRange}=weapon;if(maximumRange!==void 0&&falloffRange!==void 0&&falloffRange>maximumRange){weapon.falloffRange=maximumRange}}var INTERNALS=/* @__PURE__ */new WeakMap;function publishLoadoutInternals(build,internals){INTERNALS.set(build,internals)}function loadoutInternals(build,label){const internals=typeof build==="object"&&build!==null?INTERNALS.get(build):void 0;if(internals===void 0){throw new TypeError(`${label} must be a ShipLoadout, received ${describeValue(build)}`)}return internals}export{armourInputFor,cellBankInputsFor,completeResult,distributorInputResultFor,effectiveModule,fittedThrusterParamsFor,heatInputResultFor,incompleteResult,loadoutInternals,mobilityInputResultFor,moduleFitError,moduleFitProblem,normalizeLoadoutEvent,powerAvailable,powerConsumerFor,preEngineeredVariantFor,publishLoadoutInternals,shieldCapacitorInputResultFor,shieldInputResultFor,shieldRecoveryInputResultFor,weaponStatsFor,weaponsCapacitorInputFor};//# sourceMappingURL=chunk-ZBB7Q3OZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ships/internal/loadout-fitting.ts","../src/ships/internal/loadout-import.ts","../src/ships/internal/calculation-result.ts","../src/ships/internal/loadout-metrics.ts","../src/ships/internal/loadout-internals.ts"],"names":["getShipBySymbol","getShipByName","getShipSlots","getLoadoutModifier","sourcePurchaseFromLoadout","weaponMetrics","isBuiltInHullSymbol","identifyPreEngineeredVariant","unrollableFixedArticle","cloneLoadoutModule","isNonOutfittingSlot","isBuiltInHullModule","matchingKeyIn","ownKeyIn","getPreEngineeredStats","getPreEngineeredModifiers","cloneModuleStats","isFinalGuardianWeaponEngineering","scaleDamageComponents","builtInModuleBySymbol","getBulkheadsForShip","getPreEngineeredVariants","shieldMetrics","CORE_MODULES","stockedMountKind","getDefaultLoadout","getExperimentalEffect","ammunitionCapacity","fieldForLabel","scaleForLabel","labelsForField","capabilityValueForLabel","damageTypeForLabel","BURST_PATTERN_LABELS","journalRateOfFire","preciseValueFor","parseSlotName","SLOT_RESTRICTION_LABELS","enumerateSlots","normalizeKey","truncate","requireString","describeValue","requireStringIfPresent","deepFreeze","MILITARY_PREFIXES","MINING_PREFIXES","CARGO_PREFIXES","RESTRICTED_SLOT_PREFIXES","mining","military","cargo","limpetController","vesselHangar","passenger","planetaryApproachSuite","problem","constraint","message","params","restrictionProblem","slot","symbol","restriction","some","prefix","startsWith","moduleSlotProblem","module","required","restrictedToSlot","moduleFitProblem","shipSymbol","kind","hull","ship","toLowerCase","name","armourHull","armourShipName","armourShipSymbol","shipName","restricted","restrictedToShips","allowedShipNames","map","labels","index","join","allowedShipSymbols","wrongMount","moduleSlot","core","requiredCore","category","isFuelTank","class","size","moduleClass","slotSize","supercruiseOvercharge","moduleFitError","preEngineeredVariantFor","Engineering","Item","captureLoadoutEvent","event","modules","Modules","ShipName","shipIdent","ShipIdent","hullValue","HullValue","modulesValue","ModulesValue","rebuy","Rebuy","unladenMass","UnladenMass","cargoCapacity","CargoCapacity","fuelCapacity","FuelCapacity","Ship","Array","isArray","captureEach","captureModule","values","capture","captured","length","push","on","On","priority","Priority","health","Health","value","Value","engineering","Slot","captureEngineering","experimental","ExperimentalEffect","experimentalLocalised","ExperimentalEffect_Localised","modifiers","Modifiers","BlueprintName","Level","Quality","modifier","hullLayout","slots","stockedMountRejects","layout","stats","mount","find","candidate","key","normalizeLoadoutEvent","rawEvent","TypeError","Map","Set","entries","Label","normalizedSlot","has","add","set","top","invalidatesAggregates","outcomes","defaults","parsed","stocked","fallback","rejected","action","sourceSymbol","replacementSymbol","delete","moduleStats","primitiveModifiers","variant","catalogueVariantStats","variantStats","retainsBakedExperimental","experimentalEffectSymbol","trim","engineeringLocked","originalExperimental","withoutExperimental","currentExperimental","currentVariant","guardianFinal","normalizedBlueprint","normalizedExperimental","variants","exact","blueprintSymbol","grade","guardianBase","sourcePurchase","NO_ISSUES","Object","freeze","completeResult","complete","issues","incompleteResult","issue","PREFIX","powerPlant","thrusters","frameShiftDrive","powerDistributor","shieldGenerator","shieldCellBank","shieldBooster","shieldReinforcement","hullReinforcement","moduleReinforcement","startsWithAny","prefixes","isPowerDistributor","isPowerPlant","isThruster","isFrameShiftDrive","isEnabled","priorityOf","effectiveStat","field","stated","statedModifier","base","label","modified","effectiveCapability","effectiveDamageDistribution","fromEffect","damageDistribution","distribution","resolved","seen","type","convertsDamage","modifierRatio","effective","relatedStat","ratio","carriesMassCurve","minMass","maxMass","minMultiplier","maxMultiplier","maxMassRatio","Math","max","effectiveModule","merged","fields","keys","capability","massRatio","performanceRatio","normalizeEffectiveWeapon","damageComponents","damage","powerConsumerFor","draw","mounted","enabled","deployedOnly","alwaysPowered","powerAvailable","statsFor","DEFAULT_SLOT","powerCapacity","heatEfficiency","UNRESOLVED_FACT","NOTHING_FITTED","metricIssue","reason","defaultSlot","unavailable","powerPlantIssueFor","capacity","Number","isFinite","powerDrawIssueFor","consumer","poweredMetricBudgetFor","getBudget","plantIssue","drawIssue","budget","available","poweredStates","retracted","poweredShieldGeneratorResultFor","powered","mapResistanceFields","read","kineticResistance","thermalResistance","explosiveResistance","causticResistance","resistancesOf","shieldInputFor","generator","boosters","reinforcement","optMass","optMultiplier","shieldBoost","hullMass","baseShieldStrength","shieldInputResultFor","fitted","shieldCapacitorInputResultFor","systemsPips","capacitor","systemsCapacitorResultFor","shields","strength","resistances","systemsCapacity","systemsRecharge","distributor","thrusterCurveFor","optSpeedMultiplier","speedCurve","minSpeedMultiplier","maxSpeedMultiplier","optRotationMultiplier","rotationCurve","minRotationMultiplier","maxRotationMultiplier","fittedThrusterParamsFor","mobilityInputResultFor","mass","minimumSpeed","maximumSpeed","boost","minPitch","pitch","minRoll","roll","minYaw","yaw","shieldRecoveryInputResultFor","generatorModule","generatorStats","distributorDraw","regenRate","brokenRegenRate","weaponsCapacitorInputFor","weaponsPips","weaponsCapacity","weaponsRecharge","sustainedEnergyPerSecond","deployed","weapon","weaponStatsFor","distributorInputResultFor","pips","disabled","enginesCapacity","enginesRecharge","heatInputResultFor","plant","thrusterHeatRate","deployedThrusterHeatRate","fsdHeatRate","weapons","running","heat","heatPerSecond","sustainedHeatPerSecond","heatCapacity","heatDissipation","retractedPowerDraw","poweredDraw","deployedPowerDraw","state","bands","reduce","total","band","min","poweredRetracted","poweredDeployed","cellBankInputsFor","banks","ammunition","reinforcementRate","shieldBankReinforcement","cells","spinUp","shieldBankSpinUp","duration","shieldBankDuration","shieldBankHeat","stockBulkhead","v","endsWith","armourInputFor","reinforcements","moduleReinforcements","bulkhead","hullBoost","moduleProtection","integrity","stock","baseArmour","WEAPON_FIELDS","projectileRange","burstAdjustedRateOfFire","touched","FIRING_RATE_LABELS","readsDamageFromPerSecond","every","rate","rateOfFire","statedDamagePerSecond","firingFactor","roundsPerShot","maximumRange","falloffRange","INTERNALS","WeakMap","publishLoadoutInternals","build","internals","loadoutInternals","get"],"mappings":"O,o6CAUA,IAAM6C,kBAAuC,CACzC,wBACA,iCACA,0BACA,qBACA,gCACA,kCACA,mCAUJ,IAAMC,gBAAqC,CACvC,kBACA,sBACA,4BACA,8BACA,uBACA,oBAOJ,IAAMC,eAAoC,CACtC,gBACA,qBACA,8BACA,gBAUJ,IAAMC,yBAAuE,CACzEC,OAAQH,gBACRI,SAAUL,kBACVM,MAAOJ,eAEPK,iBAAkB,CAAC,mBAAoB,yBAOvCC,aAAc,CAAC,iBAAkB,oBAAqB,yBAEtDC,UAAW,CAAC,qBAAsB,2BAElCC,uBAAwB,CAAC,4BAU7B,IAAMC,QAAU,CACZC,WACAC,QACAC,UAAA,CACsBF,sBAAYC,mBAAaC,cAAW,EAAY,CAAA,EAAK,CAAEA,iBAEjF,SAASC,mBAAmBC,KAAiBC,QACzC,MAAMC,YAAcF,KAAKE,YACzB,IAAKA,YAAa,OAAO,KACzB,GAAIf,yBAAyBe,aAAaC,KAAMC,QAAWH,OAAOI,WAAWD,SAAU,CACnF,OAAO,IACX,CACA,OAAOT,QAAQ,kBAAmB,mBAAmBnB,wBAAwB0B,eAAgB,CACzFA,yBAER,CAEA,SAASI,kBAAkBN,KAAiBO,QACxC,MAAMC,SAAWD,OAAOE,iBACxB,IAAKD,UAAYR,KAAKE,cAAgBM,SAAU,OAAO,KACvD,OAAOb,QACH,kBACA,uCAAuCnB,wBAAwBgC,YAC/D,CAAEN,YAAaM,UAEvB,CASO,SAASE,iBACZC,WACAX,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WAAaD,KAE5C,GAAIF,yBAAyBtW,QAAS,CAClC,MAAM0W,sBAAwB3a,mBAAmBiE,OAAQ,mBACzD,MAAM2W,aAAe1I,OAAO2E,OAAOgE,eAAiB,GAAK3I,OAAO2E,OAAO6D,YAAc,GACrF,GAAIC,wBAA0B,MAAQC,aAAe,EAAG,CACpD/D,OAAO/F,OAAS6J,sBAAwBC,YAC5C,CACJ,CAEA,MAAME,aAAEA,aAAAC,aAAcA,cAAiBlE,OACvC,GAAIiE,oBAAiB,GAAaC,oBAAiB,GAAaA,aAAeD,aAAc,CACzFjE,OAAOkE,aAAeD,YAC1B,CACJ,CClwCA,IAAME,yBAAA,IAAgBC,QAGf,SAASC,wBAAwBC,MAAeC,WACnDJ,UAAUrQ,IAAIwQ,MAAOC,UACzB,CAeO,SAASC,iBAAiBF,MAAgBrM,OAC7C,MAAMsM,iBACKD,QAAU,UAAYA,QAAU,KAAOH,UAAUM,IAAIH,YAAS,EACzE,GAAIC,iBAAc,EAAW,CACzB,MAAM,IAAIjR,UAAU,GAAG2E,yCAAyCvM,cAAc4Y,SAClF,CACA,OAAOC,SACX,QAAA3B,eAAAd,kBAAA1L,eAAA8J,0BAAA1G,gBAAAgF,wBAAA+B,mBAAAhK,iBAAAiO,iBAAA/F,uBAAApP,eAAA9B,iBAAA6F,sBAAAoH,eAAAN,iBAAA5K,wBAAA+U,wBAAAhH,8BAAAF,qBAAAiC,6BAAAa,eAAAP"}
@@ -1 +1 @@
1
- export{ALL_COMMODITIES}from"../chunk-SFEQXUIA.js"; //# sourceMappingURL=commodities-all.js.map
1
+ export{ALL_COMMODITIES}from"../chunk-CCJPWDMA.js"; //# sourceMappingURL=commodities-all.js.map
@@ -9,7 +9,7 @@ import { Commodity } from './commodities.js';
9
9
  *
10
10
  * Data from EDCD FDevIDs (`commodity.csv`), from a player-journal observation with an
11
11
  * in-game category check, and from two readings of the running game's own commodity
12
- * registry, whose difference is a batch of mineral and chemical goods the FDevIDs
12
+ * registry, whose difference is a batch of mineral, metal and chemical goods the FDevIDs
13
13
  * snapshot does not carry; see
14
14
  * [`data/commodities/SOURCES.md`](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/data/commodities/SOURCES.md).
15
15
  *
@@ -1 +1 @@
1
- export{COMMODITIES}from"../chunk-Q647OXON.js"; //# sourceMappingURL=commodities-standard.js.map
1
+ export{COMMODITIES}from"../chunk-LOWKWUNS.js"; //# sourceMappingURL=commodities-standard.js.map
@@ -1 +1 @@
1
- export{commoditiesInCategory,getCommodityByName,getCommodityBySymbol}from"../chunk-2TY42PTF.js"; //# sourceMappingURL=commodities.js.map
1
+ export{commoditiesInCategory,getCommodityByName,getCommodityBySymbol}from"../chunk-6MQOPQAA.js"; //# sourceMappingURL=commodities.js.map
@@ -1 +1 @@
1
- export{commoditiesInCategory,getCommodityByName,getCommodityBySymbol}from"../chunk-2TY42PTF.js";export{ALL_COMMODITIES}from"../chunk-SFEQXUIA.js";export{RARE_COMMODITIES}from"../chunk-TYRH73MO.js";export{COMMODITIES}from"../chunk-Q647OXON.js"; //# sourceMappingURL=index.js.map
1
+ export{commoditiesInCategory,getCommodityByName,getCommodityBySymbol}from"../chunk-6MQOPQAA.js";export{ALL_COMMODITIES}from"../chunk-CCJPWDMA.js";export{RARE_COMMODITIES}from"../chunk-TYRH73MO.js";export{COMMODITIES}from"../chunk-LOWKWUNS.js"; //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export{getBlueprintName}from"../chunk-UI5RROGI.js"; //# sourceMappingURL=blueprints.js.map
1
+ export{getBlueprintName}from"../chunk-KR664YI3.js"; //# sourceMappingURL=blueprints.js.map
@@ -0,0 +1,33 @@
1
+ /** Localized galactic codex region names, isolated from the region footprints. */
2
+ /**
3
+ * Look up a galactic codex region's source-backed display name for a locale.
4
+ *
5
+ * @param id - Region id, 1–42, as `CodexRegion.id` carries it. Id `0` means
6
+ * "outside the mapped region grid" and has no name.
7
+ * @param locale - A BCP 47 language or regional tag, such as `"de"` or `"de-DE"`; see
8
+ * {@link GameLocale} for how a tag is matched.
9
+ * @returns The localized region name; the canonical `CodexRegion.name` for any English
10
+ * tag; or `null` when the id is not 1–42 or the locale is not one of the six this
11
+ * catalogue stores.
12
+ * @remarks
13
+ * The catalogue is keyed by region id rather than by English name, because the id is
14
+ * the region's stable identity while the name is the value being translated.
15
+ *
16
+ * All six stored locales are complete, so a supported locale always answers. The game
17
+ * leaves many regions untranslated in some languages, and spells Izanami, Temple, Mare
18
+ * Somnia, Xibalba and Tenebrae alike in all six. The catalogue stores those source values
19
+ * verbatim rather than treating them as a missing translation.
20
+ * @throws {TypeError} If `locale` is not a string. A nullish or out-of-range `id` is a
21
+ * lookup miss and returns `null`.
22
+ * @example
23
+ * ```ts
24
+ * import { getCodexRegionName } from '@elite-dangerous-almanac/core/i18n/codex-regions';
25
+ *
26
+ * getCodexRegionName(1, 'de-DE'); // -> 'Galaktisches Zentrum'
27
+ * getCodexRegionName(5, 'fr'); // -> 'Bras de la Règle'
28
+ * getCodexRegionName(5, 'it'); // -> null
29
+ * ```
30
+ */
31
+ declare function getCodexRegionName(id: number, locale: string): string | null;
32
+
33
+ export { getCodexRegionName };
@@ -0,0 +1 @@
1
+ export{getCodexRegionName}from"../chunk-O4NIJDL4.js"; //# sourceMappingURL=codex-regions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"O"}
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Sparse, source-backed localized display names and descriptions for Elite Dangerous
3
- * outfitting, personal-equipment, engineering, material and market-commodity
4
- * catalogues.
3
+ * outfitting, personal-equipment, engineering, material, market-commodity and galactic
4
+ * codex-region catalogues.
5
5
  *
6
6
  * Each lookup takes the identifier its owning catalogue is keyed by — a Frontier symbol,
7
- * or the library id where the game publishes none, as for a suit tool and a BCP 47
8
- * locale. English is complete: for a name catalogue it is exactly the owning record's
9
- * `name`, and for a description catalogue it is the game's own display prose, which no
10
- * catalogue otherwise publishes.
7
+ * the library id where the game publishes none, as for a suit tool, or the region id for
8
+ * a galactic codex region — and a BCP 47 locale. English is complete: for a name
9
+ * catalogue it is exactly the owning record's `name`, and for a description catalogue it
10
+ * is the game's own display prose, which no catalogue otherwise publishes.
11
11
  * Other locales are intentionally sparse: the function returns `null` when its pinned
12
12
  * sources carry no translation, leaving the application in control of fallback policy.
13
13
  * A source-backed localized spelling can be identical to English; the lookup returns
@@ -28,7 +28,8 @@
28
28
  * <!-- generated by scripts/i18n-coverage.mjs -->
29
29
  * | Lookup | Keys | en | de | es | fr | pt | ru |
30
30
  * | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
31
- * | `getBlueprintName` | 107 | 100 | 100 | 100 | 100 | 100 | 100 |
31
+ * | `getBlueprintName` | 111 | 100 | 100 | 100 | 100 | 100 | 100 |
32
+ * | `getCodexRegionName` | 42 | 100 | 100 | 100 | 100 | 100 | 100 |
32
33
  * | `getCommodityName` | 412 | 100 | 100 | 100 | 100 | 100 | 100 |
33
34
  * | `getExperimentalEffectDescription` | 86 | 100 | 100 | 100 | 100 | 100 | 100 |
34
35
  * | `getExperimentalEffectName` | 86 | 100 | 100 | 100 | 100 | 100 | 100 |
@@ -41,7 +42,7 @@
41
42
  * | `getPersonalWeaponDescription` | 11 | 100 | 100 | 100 | 100 | 100 | 100 |
42
43
  * | `getSuitDescription` | 19 | 100 | 100 | 100 | 100 | 100 | 100 |
43
44
  * | `getSuitName` | 19 | 100 | 100 | 100 | 100 | 100 | 100 |
44
- * | `getPreEngineeredVariantName` | 76 | 100 | 92 | 89 | 89 | 100 | 100 |
45
+ * | `getPreEngineeredVariantName` | 79 | 100 | 92 | 89 | 89 | 100 | 100 |
45
46
  * | `getOutfittingFamilyName` | 77 | 100 | 75 | 75 | 75 | 75 | 75 |
46
47
  * <!-- end generated -->
47
48
  *
@@ -81,6 +82,7 @@ export { getBlueprintName } from './blueprints.js';
81
82
  export { getExperimentalEffectName } from './experimental-effects.js';
82
83
  export { getExperimentalEffectDescription } from './experimental-effect-descriptions.js';
83
84
  export { getCommodityName } from './commodities.js';
85
+ export { getCodexRegionName } from './codex-regions.js';
84
86
  export { getMaterialName } from './materials.js';
85
87
  export { getMicroResourceName } from './micro-resources.js';
86
88
  export { getPersonalMountName, getSuitDescription, getSuitName } from './suits.js';
@@ -1 +1 @@
1
- export{getModuleName}from"../chunk-URRPEUIK.js";export{getPersonalModificationDescription,getPersonalModificationName}from"../chunk-SS7HVNP5.js";export{getPersonalToolName}from"../chunk-E2HDF6PJ.js";export{getPersonalWeaponDescription}from"../chunk-7C7NJWCF.js";export{getPreEngineeredVariantName}from"../chunk-T7IQHFQ2.js";export{getLoadoutSlotName,getSlotRestrictionLabel}from"../chunk-ZRG35JSH.js"; export{getPersonalMountName,getSuitDescription,getSuitName}from"../chunk-RA4YJBU5.js";export{getCommodityName}from"../chunk-TRGHPX2O.js";export{getCalculationIssueMessage,getLoadoutEditErrorMessage,getLoadoutIssueMessage,getSlefDiagnosticMessage}from"../chunk-6G6TYW2D.js";export{getExperimentalEffectDescription}from"../chunk-RJ3ZLQRB.js";export{getExperimentalEffectName}from"../chunk-QPT2WJYN.js";export{getMaterialName}from"../chunk-UE22QU7A.js";export{getMicroResourceName}from"../chunk-WZIBBJHA.js";export{getOutfittingFamilyName}from"../chunk-YBE5M27G.js";export{getBlueprintName}from"../chunk-UI5RROGI.js"; //# sourceMappingURL=index.js.map
1
+ export{getOutfittingFamilyName}from"../chunk-YBE5M27G.js";export{getModuleName}from"../chunk-URRPEUIK.js";export{getPersonalModificationDescription,getPersonalModificationName}from"../chunk-SS7HVNP5.js";export{getPersonalToolName}from"../chunk-E2HDF6PJ.js";export{getPersonalWeaponDescription}from"../chunk-7C7NJWCF.js";export{getPreEngineeredVariantName}from"../chunk-FRG7MKSJ.js";export{getLoadoutSlotName,getSlotRestrictionLabel}from"../chunk-ZRG35JSH.js"; export{getPersonalMountName,getSuitDescription,getSuitName}from"../chunk-RA4YJBU5.js";export{getCodexRegionName}from"../chunk-O4NIJDL4.js";export{getCommodityName}from"../chunk-TRGHPX2O.js";export{getCalculationIssueMessage,getLoadoutEditErrorMessage,getLoadoutIssueMessage,getSlefDiagnosticMessage}from"../chunk-6G6TYW2D.js";export{getExperimentalEffectDescription}from"../chunk-RJ3ZLQRB.js";export{getExperimentalEffectName}from"../chunk-QPT2WJYN.js";export{getMaterialName}from"../chunk-UE22QU7A.js";export{getMicroResourceName}from"../chunk-WZIBBJHA.js";export{getBlueprintName}from"../chunk-KR664YI3.js"; //# sourceMappingURL=index.js.map
@@ -1,4 +1,8 @@
1
1
  import { PreEngineeredAcquisition } from '../ships/pre-engineered.js';
2
+ import '../ships/modules.js';
3
+ import '../ships/engineering-options.js';
4
+ import '../ships/module-families.js';
5
+ import '../ships/slots.js';
2
6
 
3
7
  /** Localized pre-engineered variant names, isolated from module and modifier statistics. */
4
8
 
@@ -1 +1 @@
1
- export{getPreEngineeredVariantName}from"../chunk-T7IQHFQ2.js"; //# sourceMappingURL=pre-engineered.js.map
1
+ export{getPreEngineeredVariantName}from"../chunk-FRG7MKSJ.js"; //# sourceMappingURL=pre-engineered.js.map
@@ -1 +1 @@
1
- export{getMicroResourceByName,getMicroResourceBySymbol,microResourcesInCategory}from"../chunk-RA6SY445.js";export{MaterialGrade,MaterialLine,getMaterialByElementSymbol,getMaterialByName,getMaterialBySymbol,materialsByGrade,materialsInCategory,materialsInLine}from"../chunk-ETREYN5U.js";export{ALL_MATERIALS}from"../chunk-FP2TQJZP.js";export{ENCODED_MATERIALS}from"../chunk-A5TCT2AJ.js";export{MANUFACTURED_MATERIALS}from"../chunk-PF3HZ73R.js";export{RAW_MATERIALS}from"../chunk-GZLD7RTK.js"; export{ALL_MICRO_RESOURCES}from"../chunk-4WC5NHBJ.js";export{DATA_MICRO_RESOURCES}from"../chunk-GVLDFJEY.js";export{ITEM_MICRO_RESOURCES}from"../chunk-WHWFKHV3.js";export{COMPONENT_MICRO_RESOURCES}from"../chunk-HTB52N6S.js";export{CONSUMABLE_MICRO_RESOURCES}from"../chunk-K7L7SMIR.js"; //# sourceMappingURL=index.js.map
1
+ export{getMicroResourceByName,getMicroResourceBySymbol,microResourcesInCategory}from"../chunk-7UF4XRIR.js";export{MaterialGrade,MaterialLine,getMaterialByElementSymbol,getMaterialByName,getMaterialBySymbol,materialsByGrade,materialsInCategory,materialsInLine}from"../chunk-ETREYN5U.js";export{ALL_MATERIALS}from"../chunk-FP2TQJZP.js";export{ENCODED_MATERIALS}from"../chunk-A5TCT2AJ.js";export{MANUFACTURED_MATERIALS}from"../chunk-PF3HZ73R.js";export{RAW_MATERIALS}from"../chunk-GZLD7RTK.js"; export{ALL_MICRO_RESOURCES}from"../chunk-KLC5XT6F.js";export{CONSUMABLE_MICRO_RESOURCES}from"../chunk-K7L7SMIR.js";export{DATA_MICRO_RESOURCES}from"../chunk-GVLDFJEY.js";export{ITEM_MICRO_RESOURCES}from"../chunk-WHWFKHV3.js";export{COMPONENT_MICRO_RESOURCES}from"../chunk-HTB52N6S.js"; //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export{ALL_MICRO_RESOURCES}from"../chunk-4WC5NHBJ.js"; //# sourceMappingURL=micro-resources-all.js.map
1
+ export{ALL_MICRO_RESOURCES}from"../chunk-KLC5XT6F.js"; //# sourceMappingURL=micro-resources-all.js.map
@@ -1 +1 @@
1
- export{getMicroResourceByName,getMicroResourceBySymbol,microResourcesInCategory}from"../chunk-RA6SY445.js"; //# sourceMappingURL=micro-resources.js.map
1
+ export{getMicroResourceByName,getMicroResourceBySymbol,microResourcesInCategory}from"../chunk-7UF4XRIR.js"; //# sourceMappingURL=micro-resources.js.map
@@ -1 +1 @@
1
- export{armourMetrics}from"../chunk-Q5ALV3DI.js"; //# sourceMappingURL=armour.js.map
1
+ export{armourMetrics}from"../chunk-3I2I5KG4.js"; //# sourceMappingURL=armour.js.map
@@ -1 +1 @@
1
- export{BLUEPRINT_COSTS,BLUEPRINT_MERC_COIN_COSTS,getBlueprintCost,getBlueprintCosts,getBlueprintGradeCost}from"../chunk-K5JK3XQB.js"; //# sourceMappingURL=blueprint-costs.js.map
1
+ export{BLUEPRINT_COSTS,BLUEPRINT_MERC_COIN_COSTS,getBlueprintCost,getBlueprintCosts,getBlueprintGradeCost}from"../chunk-ARG6ESYB.js"; //# sourceMappingURL=blueprint-costs.js.map
@@ -30,10 +30,9 @@ import './slots.js';
30
30
  * full mechanics catalogue and resolves one against a module.
31
31
  *
32
32
  * Further keys are the **Operations** ids: recipes a module is *sold*
33
- * carrying (`ships/pre-engineered`) and the four Operations recipes a player rolls at an
33
+ * carrying (`ships/pre-engineered`) and the Operations recipes a player rolls at an
34
34
  * engineer (`ships/engineering-options`). No journal spelling has been observed for those
35
35
  * Operations ids — a gap in the evidence, not a claim that the game writes none.
36
- *
37
36
  * **Every recipe is keyed once.** Anti-Guardian Zone Resistance is
38
37
  * `GuardianModule_Sturdy`, the id the game writes on Guardian weapons as well as on
39
38
  * Guardian modules; the Inara registry's `recipe_guardianmodule_sturdy` and
@@ -1 +1 @@
1
- export{BLUEPRINTS,getBlueprint,getBlueprintGrade}from"../chunk-AYAKU4YA.js"; //# sourceMappingURL=blueprints.js.map
1
+ export{BLUEPRINTS,getBlueprint,getBlueprintGrade}from"../chunk-WDAYRHXR.js"; //# sourceMappingURL=blueprints.js.map
@@ -1 +1 @@
1
- export{BuildMetrics}from"../chunk-ZWT5Y3JR.js"; //# sourceMappingURL=build-metrics.js.map
1
+ export{BuildMetrics}from"../chunk-JEHKGTP2.js"; //# sourceMappingURL=build-metrics.js.map
@@ -1 +1 @@
1
- export{LoadoutEditError,ShipLoadout}from"../chunk-53EBUFVU.js";export{OUTFITTING_FAMILIES}from"../chunk-M6G3UDTX.js";export{validateLoadout}from"../chunk-3GNYPM6J.js";export{SHIP_MODULE_LIMITS,calculateModuleLimits}from"../chunk-KPETDYQX.js";export{hasFrameShiftDriveJumpStats,hasMassCurveStats,hasPowerDistributorStats,hasPowerGenerationStats,hasShieldRegenerationStats,hasWeaponDamageStats}from"../chunk-JTQVWIGL.js";export{BuildMetrics}from"../chunk-ZWT5Y3JR.js";export{weaponsCapacitorMetrics}from"../chunk-M4FZRDAH.js";export{powerBudget}from"../chunk-GGQMIQPC.js";export{shieldCapacitorMetrics}from"../chunk-XQJERZUS.js";export{cellBankSummary,shieldRecovery}from"../chunk-JMAXSXXQ.js"; export{SHIPS,getShipByName,getShipBySymbol,getShipSlots}from"../chunk-C4FUV6GF.js";export{getLoadoutModifier,inspectSlef,parseSlef,stringifySlef,toSlef}from"../chunk-T4MKUKYS.js";export{getSourceModuleValue,sourcePurchaseFromLoadout,sumSourceModuleValues}from"../chunk-NIURLW2F.js";export{armourPiercingFactor,combinedRateOfFire,damageFalloff,damagePerSecond,energyPerSecond,heatPerSecond,splitDamage,sumWeaponMetrics,sustainedDamagePerSecond,sustainedFireFactor,weaponMetrics}from"../chunk-AAU7OM47.js";export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-C3YZ5KTA.js";export{PRE_ENGINEERED_MODULES,getPreEngineeredVariants,isPreEngineered}from"../chunk-AUBV6S7V.js";export{shieldMassCurveMultiplier,shieldMetrics,shieldStrength}from"../chunk-DBJKLXLS.js";export{getBulkheadsForShip,getModuleBySymbol,getModulesByName}from"../chunk-OSMBAFRW.js"; export{OVERHEAT_HEAT_LEVEL,effectiveWeaponThermalLoad,equilibriumHeatLevel,heatLevelAtTime,heatMetrics,secondsToHeatLevel}from"../chunk-6HA2YIKW.js";export{frameShiftDriveMassFactor,fuelPerJump,singleJumpRange,totalRange}from"../chunk-VTMCSCXV.js";export{calculateCargoCapacity,calculateFuelCapacity,calculatePassengerCapacity,calculateUnladenMass}from"../chunk-C3LLPLLD.js"; export{mobilityCapacitorMetrics}from"../chunk-VEEBJFJ7.js";export{mobilityMetrics,thrusterMassCurveMultiplier}from"../chunk-A4QKXXZD.js"; export{distributorMetrics}from"../chunk-M2TCZKRT.js"; export{EXPERIMENTAL_EFFECTS,getExperimentalEffect}from"../chunk-77I24V6B.js";export{SHIP_GUNSIGHTS,getShipGunsight,projectGunsight}from"../chunk-XSN53F7W.js";export{ammunitionCapacity}from"../chunk-AA3K5XUE.js";export{armourMetrics}from"../chunk-Q5ALV3DI.js";export{effectiveHitPoints,mapDamageTypes,stackArmourResistance,stackShieldResistance,systemsResistance}from"../chunk-F44QX47A.js"; export{computeModifiers,sumMaterials}from"../chunk-U73MBQ45.js"; export{resolveBlueprintForModule}from"../chunk-2J6NNI3Y.js";export{ENGINEERING_OPTION_GROUPS,getBlueprintsForModule,getEngineeringGroup,getExperimentalsForBlueprint,getExperimentalsForModule}from"../chunk-M4STXLXO.js";export{BLUEPRINTS,getBlueprint,getBlueprintGrade}from"../chunk-AYAKU4YA.js"; export{SLOT_RESTRICTION_LABELS,enumerateSlots,parseSlotName}from"../chunk-RAO35XDF.js"; //# sourceMappingURL=index.js.map
1
+ export{LoadoutEditError,ShipLoadout}from"../chunk-55R4MYWV.js";export{hasFrameShiftDriveJumpStats,hasMassCurveStats,hasPowerDistributorStats,hasPowerGenerationStats,hasShieldRegenerationStats,hasWeaponDamageStats}from"../chunk-JTQVWIGL.js";export{OUTFITTING_FAMILIES}from"../chunk-M6G3UDTX.js";export{SHIP_GUNSIGHTS,getShipGunsight,projectGunsight}from"../chunk-XSN53F7W.js";export{validateLoadout}from"../chunk-T6BIFKPU.js";export{SHIP_MODULE_LIMITS,calculateModuleLimits}from"../chunk-KPETDYQX.js";export{BuildMetrics}from"../chunk-JEHKGTP2.js"; export{SHIPS,getShipByName,getShipBySymbol,getShipSlots}from"../chunk-C4FUV6GF.js";export{getLoadoutModifier,inspectSlef,parseSlef,stringifySlef,toSlef}from"../chunk-T4MKUKYS.js";export{getSourceModuleValue,sourcePurchaseFromLoadout,sumSourceModuleValues}from"../chunk-NIURLW2F.js";export{weaponsCapacitorMetrics}from"../chunk-M4FZRDAH.js";export{armourPiercingFactor,combinedRateOfFire,damageFalloff,damagePerSecond,energyPerSecond,heatPerSecond,splitDamage,sumWeaponMetrics,sustainedDamagePerSecond,sustainedFireFactor,weaponMetrics}from"../chunk-QQFZEOPB.js";export{powerBudget}from"../chunk-GGQMIQPC.js";export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-HE4XE3WR.js";export{getBulkheadsForShip,getModuleBySymbol,getModulesByName}from"../chunk-2GVJNKFW.js";export{PRE_ENGINEERED_MODULES,getPreEngineeredVariants,isPreEngineered}from"../chunk-EXHZ4CFB.js";export{shieldCapacitorMetrics}from"../chunk-HWOP7QWK.js";export{cellBankSummary,shieldRecovery}from"../chunk-JMAXSXXQ.js";export{shieldMassCurveMultiplier,shieldMetrics,shieldStrength}from"../chunk-SRPCHXW2.js"; export{OVERHEAT_HEAT_LEVEL,effectiveWeaponThermalLoad,equilibriumHeatLevel,heatLevelAtTime,heatMetrics,secondsToHeatLevel}from"../chunk-6HA2YIKW.js";export{frameShiftDriveMassFactor,fuelPerJump,singleJumpRange,totalRange}from"../chunk-VTMCSCXV.js";export{calculateCargoCapacity,calculateFuelCapacity,calculatePassengerCapacity,calculateUnladenMass}from"../chunk-C3LLPLLD.js"; export{mobilityCapacitorMetrics}from"../chunk-VEEBJFJ7.js";export{mobilityMetrics,thrusterMassCurveMultiplier}from"../chunk-A4QKXXZD.js"; export{BLUEPRINTS,getBlueprint,getBlueprintGrade}from"../chunk-WDAYRHXR.js"; export{distributorMetrics}from"../chunk-M2TCZKRT.js"; export{EXPERIMENTAL_EFFECTS,getExperimentalEffect}from"../chunk-77I24V6B.js";export{ammunitionCapacity}from"../chunk-AA3K5XUE.js";export{armourMetrics}from"../chunk-3I2I5KG4.js";export{effectiveHitPoints,mapDamageTypes,stackArmourResistance,stackShieldResistance,systemsResistance}from"../chunk-Q75JSMU6.js"; export{computeModifiers,sumMaterials}from"../chunk-U73MBQ45.js"; export{resolveBlueprintForModule}from"../chunk-2J6NNI3Y.js";export{ENGINEERING_OPTION_GROUPS,getBlueprintsForModule,getEngineeringGroup,getExperimentalsForBlueprint,getExperimentalsForModule}from"../chunk-M4STXLXO.js"; export{SLOT_RESTRICTION_LABELS,enumerateSlots,parseSlotName}from"../chunk-RAO35XDF.js"; //# sourceMappingURL=index.js.map
@@ -45,7 +45,7 @@ type ThrusterLoad = 'dry' | 'unladen' | 'laden';
45
45
  * `builtInHullModule` is the only one that does not depend on the mount: the cargo hatch
46
46
  * comes with the hull and goes in no mount an editor can set.
47
47
  */
48
- type ModuleFitConstraint = 'immutableSlot' | 'builtInHullModule' | 'armourRequired' | 'wrongHullArmour' | 'restrictedHull' | 'restrictedMount' | 'wrongCoreType' | 'hardpointRequired' | 'utilityRequired' | 'optionalInternalRequired' | 'coreModuleInOptionalSlot' | 'oversized' | 'unknownConstraint';
48
+ type ModuleFitConstraint = 'immutableSlot' | 'builtInHullModule' | 'armourRequired' | 'wrongHullArmour' | 'restrictedHull' | 'restrictedMount' | 'wrongCoreType' | 'hardpointRequired' | 'utilityRequired' | 'optionalInternalRequired' | 'coreModuleInOptionalSlot' | 'oversized' | 'exactSizeRequired' | 'unknownConstraint';
49
49
  /**
50
50
  * One language-neutral value carried by a structured loadout diagnostic: a scalar
51
51
  * string/number, or a string list the consumer can format for its locale. Paired name
@@ -1 +1 @@
1
- export{validateLoadout}from"../chunk-3GNYPM6J.js"; //# sourceMappingURL=loadout-validation.js.map
1
+ export{validateLoadout}from"../chunk-T6BIFKPU.js"; //# sourceMappingURL=loadout-validation.js.map
@@ -1 +1 @@
1
- export{ALL_MODULES}from"../chunk-UVX7RCMP.js"; //# sourceMappingURL=modules-all.js.map
1
+ export{ALL_MODULES}from"../chunk-BI3EFLQ7.js"; //# sourceMappingURL=modules-all.js.map
@@ -1 +1 @@
1
- export{HARDPOINT_MODULES}from"../chunk-4T3TTYUT.js"; //# sourceMappingURL=modules-hardpoint.js.map
1
+ export{HARDPOINT_MODULES}from"../chunk-P3DGQUID.js"; //# sourceMappingURL=modules-hardpoint.js.map
@@ -120,12 +120,19 @@ interface ModuleLimitIncrease {
120
120
  * The conventional shares — {@link DamageDistribution.kinetic | kinetic},
121
121
  * {@link DamageDistribution.thermal | thermal},
122
122
  * {@link DamageDistribution.explosive | explosive},
123
+ * {@link DamageDistribution.caustic | caustic},
123
124
  * {@link DamageDistribution.absolute | absolute}, and any
124
125
  * {@link DamageDistribution.unclassified | unclassified} share — partition the damage and sum to
125
- * `1`; a type a weapon does not deal is absent rather than `0`. Kinetic, thermal and
126
- * explosive damage meet the defender's resistance of the same name. No shield or hull
127
- * resistance reduces absolute damage; the type and mitigation of unclassified damage
128
- * are not established by in-game verification.
126
+ * `1`; a type a weapon does not deal is absent rather than `0`. Kinetic, thermal,
127
+ * explosive and caustic damage meet the defender's resistance of the same name. No
128
+ * shield or hull resistance reduces absolute damage; the type and mitigation of
129
+ * unclassified damage are not established by in-game verification.
130
+ *
131
+ * A weapon the game gives the **Plasma** damage type carries its share under
132
+ * {@link DamageDistribution.absolute | absolute}, as the Mk II Plasma Shock Accelerator
133
+ * does. Plasma is a type of its own and not a second name for absolute damage, but no
134
+ * defensive module resists either one, so the two are indistinguishable to a damage
135
+ * calculation and one share states the weapon's effect exactly.
129
136
  *
130
137
  * {@link DamageDistribution.antiXeno | antiXeno} is different: it **overlays** the
131
138
  * conventional split instead of partitioning it, flagging the portion that is effective
@@ -139,6 +146,8 @@ interface DamageDistribution {
139
146
  readonly thermal?: number;
140
147
  /** Explosive share of one shot's damage, `0`–`1`. */
141
148
  readonly explosive?: number;
149
+ /** Caustic share of one shot's damage, `0`–`1`. */
150
+ readonly caustic?: number;
142
151
  /** Absolute share — damage no resistance reduces — of one shot's damage, `0`–`1`. */
143
152
  readonly absolute?: number;
144
153
  /** Share unclassified by in-game verification, `0`–`1`. */
@@ -153,7 +162,7 @@ interface DamageDistribution {
153
162
  * Exact damage amounts carried by one round, or one second of continuous fire.
154
163
  *
155
164
  * @remarks
156
- * Every amount is non-negative. Kinetic, thermal, explosive, absolute and all
165
+ * Every amount is non-negative. Kinetic, thermal, explosive, caustic, absolute and all
157
166
  * `unclassified` entries sum to the module's conventional {@link OutfittingModule.damage}.
158
167
  * `antiXeno` overlays that conventional amount and is not added to it. The exact amounts
159
168
  * are authoritative when present; {@link DamageDistribution} remains the compatible
@@ -173,6 +182,8 @@ interface DamageComponents {
173
182
  readonly thermal?: number;
174
183
  /** Non-negative explosive damage. */
175
184
  readonly explosive?: number;
185
+ /** Non-negative caustic damage. */
186
+ readonly caustic?: number;
176
187
  /** Non-negative absolute damage, which no resistance reduces. */
177
188
  readonly absolute?: number;
178
189
  /** Non-negative damage effective against Thargoid targets, overlaid on conventional damage. */
@@ -522,8 +533,8 @@ interface OutfittingModuleStats {
522
533
  * {@link OutfittingModule.engineHeatRate}. It is what Faster Boot Sequence trades
523
534
  * away, what Shielded improves, and the whole of the Deep Charge / Thermal Spread
524
535
  * (`special_fsd_cooled`) experimental effect. A drive's size sets it — every rating
525
- * of a size shares one value, and a supercruise-assist (SCO) drive matches the plain
526
- * drive of the same size.
536
+ * of a size shares one value, and a Supercruise Overcharge (SCO) drive matches the
537
+ * plain drive of the same size.
527
538
  */
528
539
  readonly fsdHeatRate?: number;
529
540
  /**
@@ -534,14 +545,16 @@ interface OutfittingModuleStats {
534
545
  * A sparse capability flag on the Overcharge drives and absent everywhere else,
535
546
  * including on the ordinary drives of the same sizes and ratings. Read it rather
536
547
  * than matching `Int_Hyperdrive_Overcharge` on the symbol: the capability is the
537
- * record's to state, and a pre-engineered or fitted article carries the flag
538
- * through while its symbol is not always the one you looked up.
548
+ * record's to state, so a consumer that reads the flag stays correct for any
549
+ * article the catalogue flags, whatever Frontier names it.
539
550
  *
540
551
  * The two lines share every jump constant this library models, so the flag changes
541
- * no calculation here; it is what an outfitting list filters and labels on. The
542
- * overcharged supercruise behaviour itselfthe boosted acceleration and the extra
543
- * fuel it burns is in-flight behaviour the game publishes no figures for, and the
544
- * library models none of it.
552
+ * no jump calculation; it is what an outfitting list filters and labels on, and it
553
+ * is what makes a drive unfittable below its own size an SCO drive takes the mount
554
+ * of its own class and no larger one, where an ordinary drive may be underfitted.
555
+ * The overcharged supercruise behaviour itself — the boosted acceleration and the
556
+ * extra fuel it burns — is in-flight behaviour the game publishes no figures for,
557
+ * and the library models none of it.
545
558
  *
546
559
  * @example
547
560
  * ```ts
@@ -1 +1 @@
1
- export{getBulkheadsForShip,getModuleBySymbol,getModulesByName}from"../chunk-OSMBAFRW.js"; //# sourceMappingURL=modules.js.map
1
+ export{getBulkheadsForShip,getModuleBySymbol,getModulesByName}from"../chunk-2GVJNKFW.js"; //# sourceMappingURL=modules.js.map
@@ -44,8 +44,7 @@ import './slots.js';
44
44
  *
45
45
  * @param variant - A pre-engineered variant.
46
46
  * @returns One modifier per computable label, or an empty array when the variant carries
47
- * neither a stat block nor a baked effect that moves a stat (a `mercenary` row carries no
48
- * stat block, so only its baked effect contributes) or its symbol is unknown.
47
+ * neither a stat block nor a baked effect that moves a stat, or its symbol is unknown.
49
48
  *
50
49
  * @example
51
50
  * ```ts
@@ -69,9 +68,8 @@ declare function getPreEngineeredModifiers(variant: PreEngineeredVariant): Engin
69
68
  *
70
69
  * @param variant - A pre-engineered variant.
71
70
  * @returns Its computable fixed modifiers in journal representation, or an empty array
72
- * when its symbol is unknown or it moves no stat the catalogue carries. A `mercenary` row
73
- * publishes no stat block, so what its baked experimental effect moves is the whole of
74
- * what it reports — the same block `ShipLoadout.setPreEngineeredVariant` fits.
71
+ * when its symbol is unknown or it moves no stat the catalogue carries. A measured
72
+ * Mercenary row combines its fixed block with its baked experimental effect.
75
73
  *
76
74
  * @example
77
75
  * ```ts
@@ -178,10 +176,8 @@ declare function unresolvedModifiers(variant: PreEngineeredVariant): string[];
178
176
  * Exact damage components scale with an engineered `damage` value so their proportions
179
177
  * and the anti-xeno overlay remain coherent with the resolved scalar.
180
178
  *
181
- * A variant with no stat block (every `mercenary` row) resolves to a copy of the base
182
- * record with only its baked experimental effect applied, which is the honest answer —
183
- * the effect is published, the grade-1 pre-engineering those arrive with is not, so the
184
- * catalogue does not guess at it.
179
+ * A caller-supplied variant with no stat block resolves to a copy of the base record with only
180
+ * its baked experimental effect applied.
185
181
  *
186
182
  * `rateOfFire` follows a moved firing cycle even though no recipe names it: an article
187
183
  * whose burst interval, burst size or within-burst rate moves — by its own stat block or
@@ -1 +1 @@
1
- export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-C3YZ5KTA.js"; //# sourceMappingURL=pre-engineered-stats.js.map
1
+ export{getPreEngineeredJournalModifiers,getPreEngineeredModifiers,getPreEngineeredStats,identifyPreEngineeredVariant,unresolvedModifiers}from"../chunk-HE4XE3WR.js"; //# sourceMappingURL=pre-engineered-stats.js.map