import '../../../globals.js';
import optionize from '../../../phet-core/js/optionize.js';
import tambo from '../tambo.js';
import MultiClip from './MultiClip.js';
class PropertyMultiClip extends MultiClip {
    /**
     * @param property - the property for which sounds are played on value changes
     * @param valueToSoundMap - a map of values to WrappedAudioBuffer objects that is used to define the association
     *                          between values and sounds.
     * @param [providedOptions]
     */
    constructor(property, valueToSoundMap, providedOptions) {
        const options = optionize()({
            linkLazily: true
        }, providedOptions);
        super(valueToSoundMap, options);
        const playSoundForValue = (value) => { this.playAssociatedSound(value); };
        if (options.linkLazily) {
            property.lazyLink(playSoundForValue);
        }
        else {
            property.link(playSoundForValue);
        }
        // dispose function
        this.disposePropertyMultiClip = () => { property.unlink(playSoundForValue); };
    }
    /**
     * dispose function
     */
    dispose() {
        this.disposePropertyMultiClip();
    }
}
tambo.register('PropertyMultiClip', PropertyMultiClip);
export default PropertyMultiClip;
//# sourceMappingURL=PropertyMultiClip.js.map