import '../../../assert/js/assert.js';
import '../../../globals.js';
// Copyright 2024, University of Colorado Boulder
/**
 * A Property whose value will change with the "region and culture", and will take a value that can be used with Images.
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import { DerivedProperty1 } from '../../../axon/js/DerivedProperty.js';
import joist from '../joist.js';
import concreteRegionAndCultureProperty, { concreteRegionAndCultureValues } from './concreteRegionAndCultureProperty.js';
export default class LocalizedImageProperty extends DerivedProperty1 {
    constructor(
    // The name of the image, for debugging purposes (from the ${repo}-images.json file)
    imageName, 
    // Allow optional, so that we can support a subset of regionAndCultures.
    // BUT also require the usa regionAndCulture, so that we can always have a fallback.
    imageMap) {
        assert && Object.keys(imageMap).forEach(regionAndCulture => {
            assert && assert(concreteRegionAndCultureValues.includes(regionAndCulture), `Unsupported regionAndCulture provided to LocalizedImageProperty: ${regionAndCulture}`);
        });
        assert && concreteRegionAndCultureValues.forEach(regionAndCulture => {
            assert && assert(regionAndCulture in imageMap, `Missing image for regionAndCulture: ${regionAndCulture}`);
        });
        super([concreteRegionAndCultureProperty], (regionAndCulture) => {
            const image = imageMap[regionAndCulture];
            assert && assert(image);
            return image;
        });
        this.imageName = imageName;
        this.imageMap = imageMap;
    }
}
joist.register('LocalizedImageProperty', LocalizedImageProperty);
//# sourceMappingURL=LocalizedImageProperty.js.map