import { getCdnAssetUrl } from "../../../urls/get-cdn-asset-url";
const DEFAULT_ENTITY_THUMBNAILS = {
    discussion: "/ember-arcgis-opendata-components/assets/images/placeholders/discussion.png",
    group: "/ember-arcgis-opendata-components/assets/images/placeholders/group.png",
    event: "/ember-arcgis-opendata-components/assets/images/placeholders/event.png",
    content: "/ember-arcgis-opendata-components/assets/images/placeholders/content.png",
};
/**
 * Returns the UI schema element needed to render
 * the thumbnail editing control for an item-based entity.
 *
 * @param i18nScope i18n scope for the entity translations
 * @param entity The entity to build the UI schema for
 * @returns the UI schema element for thumbnail editing
 */
export function getThumbnailUiSchemaElement(i18nScope, thumbnail, thumbnailUrl, entityType, requestOptions) {
    var _a;
    const defaultEntityThumbnail = (_a = DEFAULT_ENTITY_THUMBNAILS[entityType]) !== null && _a !== void 0 ? _a : DEFAULT_ENTITY_THUMBNAILS.content;
    const defaultImgUrl = getCdnAssetUrl(defaultEntityThumbnail, requestOptions);
    let options;
    if (entityType === "group") {
        options = {
            aspectRatio: 1,
            sizeDescription: {
                labelKey: `${i18nScope}.fields._thumbnail.sizeDescription`,
            },
        };
    }
    else if (entityType === "event") {
        options = {
            aspectRatio: 1.5,
            sizeDescription: {
                labelKey: "shared.fields._thumbnail.sizeDescription",
            },
            sources: ["url"],
        };
    }
    else {
        options = {
            aspectRatio: 1.5,
            sizeDescription: {
                labelKey: "shared.fields._thumbnail.sizeDescription",
            },
        };
    }
    return [
        {
            labelKey: entityType === "group"
                ? `${i18nScope}.fields._thumbnail.label`
                : "shared.fields._thumbnail.label",
            scope: "/properties/_thumbnail",
            type: "Control",
            options: Object.assign({ control: "hub-field-input-image-picker", imgSrc: thumbnailUrl, defaultImgUrl, maxWidth: 727, maxHeight: 484 }, options),
        },
    ];
}
//# sourceMappingURL=getThumbnailUiSchemaElement.js.map