"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ga4_properties_1 = require("../ga4-properties");
const ga4_functions_1 = require("../ga4-functions");
const action = {
    title: 'View Item List',
    description: 'Log this event when the user has been presented with a list of items of a certain category.',
    platform: 'web',
    defaultSubscription: 'type = "track" and event = "Promotion Viewed"',
    fields: {
        user_id: ga4_properties_1.user_id,
        item_list_id: ga4_properties_1.item_list_id,
        item_list_name: ga4_properties_1.item_list_name,
        items: {
            ...ga4_properties_1.items_multi_products,
            required: true
        },
        user_properties: ga4_properties_1.user_properties,
        params: ga4_properties_1.params
    },
    perform: (gtag, { payload }) => {
        ga4_functions_1.updateUser(payload.user_id, payload.user_properties, gtag);
        gtag('event', 'view_item_list', {
            item_list_id: payload.item_list_id,
            item_list_name: payload.item_list_name,
            items: payload.items,
            ...payload.params
        });
    }
};
exports.default = action;
//# sourceMappingURL=index.js.map