class MediaTool {
    ////////////////////////////////////////////////////////////////
    // Static Methods
    ////////////////////////////////////////////////////////////////
    /**
     * Get the first MediaElement found
     * @param input MediaElement or MediaElement[]
     */
    static element(input) {
        if (Array.isArray(input) && input.length > 0)
            return input[0];
        return input;
    }
    /**
     * Get the first MediaElement found in the given size
     * @param input MediaElement or MediaElement[]
     * @param size xs, s, m, l , xl, xxl
     * @param defaultImage url
     */
    static size(input, size, defaultImage) {
        const element = this.element(input);
        return typeof element !== 'undefined' && size in element ? element[size] : defaultImage;
    }
    /**
     * Get the audio of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    static audio(input) {
        return this.size(input, 'media', 'http://www.mp3classicalmusic.net/48Music/Vivaldi48/Stagioni4-3.mp3');
    }
    /**
     * Get the media of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    static media(input) {
        return this.size(input, 'media', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    }
    /**
     * Get the xs size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    static imageXS(input) {
        return this.size(input, 'xs', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    }
    /**
     * Get the s size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    static imageS(input) {
        return this.size(input, 's', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    }
    /**
     * Get the m size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    static imageM(input) {
        return this.size(input, 'm', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    }
    /**
     * Get the l size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    static imageL(input) {
        return this.size(input, 'l', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    }
    /**
     * Get the xl size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    static imageXL(input) {
        return this.size(input, 'xl', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    }
    /**
     * Get the xxl size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    static imageXXL(input) {
        return this.size(input, 'xxl', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    }
    /**
     * Get the size of a MediaElement depending on web or phone mode
     * @param isWeb
     * @param webSize
     * @param phoneSize
     * @param input
     */
    static image(isWeb, webSize, phoneSize, input) {
        return this.size(input, isWeb ? webSize : phoneSize, 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    }
    /**
     * Get a fullscreen (XXL on web and XL on phone)
     * @param isWeb
     * @param input
     */
    static fullScreen(isWeb, input) {
        return this.image(isWeb, 'xxl', 'xl', input);
    }
}

export { MediaTool as M };
