import { createRef } from 'react';
import { MenuButton, Modal } from '@pega/cosmos-react-core';
import { EmailComposer } from '@pega/cosmos-react-social';
export const emailBodyContent = '<div>Hi, <br /> <br /><div>Can you please change my address in the SSN.</div> <br /> <br />Regards, <br />Sara Davis </div>';
export const emailAttachments = [
    {
        id: 'item-1',
        name: 'Policy.doc',
        progress: 100
    },
    {
        id: 'item-2',
        name: 'E-Ticket',
        thumbnail: 'https://pbs.twimg.com/media/ENNN5PAXkAE-hag.jpg'
    }
];
export const participants = [
    { emailAddress: 'Vernon.Lee@example.com', fullName: 'Vernon Lee', shortName: 'Vernon' },
    { emailAddress: 'Eula.Morales@example.com', fullName: 'Eula Morales', shortName: 'Eula' },
    { emailAddress: 'Paul.Smith@example.com', fullName: 'Paul Smith', shortName: 'Paul' },
    { emailAddress: 'Frank.Walker@example.com', fullName: 'Frank Walker', shortName: 'Frank' },
    { emailAddress: 'Edward.Green@example.com', fullName: 'Edward Green', shortName: 'Edward' },
    { emailAddress: 'John.Smith@example.com', fullName: 'John Smith', shortName: 'John' },
    { emailAddress: 'Olivia.Cockburn@example.com', fullName: 'Olivia Cockburn', shortName: 'Olivia' },
    { emailAddress: 'Peter.Hernandez@example.com', fullName: 'Peter Hernandez', shortName: 'Peter' },
    { emailAddress: 'Helena.Johnson@example.com', fullName: 'Helena Johnson', shortName: 'Helena' },
    {
        emailAddress: 'Katheryn.Hudson@example.com',
        fullName: 'Katheryn Hudson',
        shortName: 'Katheryn'
    },
    { emailAddress: 'Mia.Hershel@example.com', fullName: 'Mia Hershel', shortName: 'Mia' },
    { emailAddress: 'Ann.Mitchell@example.com', fullName: 'Ann Mitchell', shortName: 'Ann' },
    { emailAddress: 'Rafael.Bottom@example.com', fullName: 'Rafael Bottom', shortName: 'Rafael' },
    {
        emailAddress: 'Christopher.Gatsby@example.com',
        fullName: 'Christopher Gatsby',
        shortName: 'Christopher'
    },
    { emailAddress: 'Julianne.Moore@example.com', fullName: 'Julianne Moore', shortName: 'Julianne' },
    { emailAddress: 'Emily.Stone@example.com', fullName: 'Emily Stone', shortName: 'Emily' },
    { emailAddress: 'Richard.Wiles@example.com', fullName: 'Richard Wiles', shortName: 'Richard' },
    { emailAddress: 'Ella.Connor@example.com', fullName: 'Ella Connor', shortName: 'Ella' },
    { emailAddress: 'Robyn.Fenton@example.com', fullName: 'Robyn Fenton', shortName: 'Robyn' },
    { emailAddress: 'Lucille.Hale@example.com', fullName: 'Lucille Hale', shortName: 'Lucille' },
    { emailAddress: 'Angelina.Pitt@example.com', fullName: 'Angelina Pitt', shortName: 'Angelina' },
    { emailAddress: 'Tanya.Robinson@example.com', fullName: 'Tanya Robinson', shortName: 'Tanya' },
    { emailAddress: 'Laura.Horowitz@example.com', fullName: 'Laura Horowitz', shortName: 'Laura' }
];
export const emailAccounts = [
    { emailAddress: 'Vernon.Lee@example.com', fullName: 'Vernon Lee', shortName: 'Vernon' },
    { emailAddress: 'Eula.Morales@example.com', fullName: 'Eula Morales', shortName: 'Eula' },
    { emailAddress: 'Paul.Smith@example.com', fullName: 'Paul Smith', shortName: 'Paul' },
    { emailAddress: 'Frank.Walker@example.com', fullName: 'Frank Walker', shortName: 'Frank' },
    { emailAddress: 'Edward.Green@example.com', fullName: 'Edward Green', shortName: 'Edward' },
    { emailAddress: 'John.Smith@example.com', fullName: 'John Smith', shortName: 'John' },
    { emailAddress: 'Olivia.Cockburn@example.com', fullName: 'Olivia Cockburn', shortName: 'Olivia' },
    { emailAddress: 'Peter.Hernandez@example.com', fullName: 'Peter Hernandez', shortName: 'Peter' },
    { emailAddress: 'Helena.Johnson@example.com', fullName: 'Helena Johnson', shortName: 'Helena' },
    {
        emailAddress: 'Katheryn.Hudson@example.com',
        fullName: 'Katheryn Hudson',
        shortName: 'Katheryn'
    },
    { emailAddress: 'Mia.Hershel@example.com', fullName: 'Mia Hershel', shortName: 'Mia' },
    { emailAddress: 'Ann.Mitchell@example.com', fullName: 'Ann Mitchell', shortName: 'Ann' },
    { emailAddress: 'Rafael.Bottom@example.com', fullName: 'Rafael Bottom', shortName: 'Rafael' },
    {
        emailAddress: 'Christopher.Gatsby@example.com',
        fullName: 'Christopher Gatsby',
        shortName: 'Christopher'
    },
    { emailAddress: 'Julianne.Moore@example.com', fullName: 'Julianne Moore', shortName: 'Julianne' },
    { emailAddress: 'Emily.Stone@example.com', fullName: 'Emily Stone', shortName: 'Emily' },
    { emailAddress: 'Richard.Wiles@example.com', fullName: 'Richard Wiles', shortName: 'Richard' },
    { emailAddress: 'Ella.Connor@example.com', fullName: 'Ella Connor', shortName: 'Ella' },
    { emailAddress: 'Robyn.Fenton@example.com', fullName: 'Robyn Fenton', shortName: 'Robyn' },
    { emailAddress: 'Lucille.Hale@example.com', fullName: 'Lucille Hale', shortName: 'Lucille' },
    { emailAddress: 'Angelina.Pitt@example.com', fullName: 'Angelina Pitt', shortName: 'Angelina' },
    { emailAddress: 'Tanya.Robinson@example.com', fullName: 'Tanya Robinson', shortName: 'Tanya' },
    { emailAddress: 'Laura.Horowitz@example.com', fullName: 'Laura Horowitz', shortName: 'Laura' }
];
export const mailDeliverySystemEmail = {
    emailAddress: 'mail.delivery@example.com',
    fullName: 'Mail Delivery System',
    shortName: 'MDS'
};
export const supportTeamEmail = {
    emailAddress: 'support.team@example.com',
    fullName: 'Suport team',
    shortName: 'Support'
};
export const toParticipants = participants
    .slice(1, 3)
    .map((participant) => participant.emailAddress);
export const ccParticipants = participants
    .slice(9, 11)
    .map((participant) => participant.emailAddress);
export const bccParticipants = participants
    .slice(4, 9)
    .map((participant) => participant.emailAddress);
export const EntityListMockData = [
    {
        name: 'Ticket number',
        value: [
            {
                id: '1',
                entity: {
                    value: '7546383',
                    type: 'system',
                    variant: 3
                }
            },
            {
                id: '2',
                entity: {
                    value: '7546383',
                    type: 'system',
                    variant: 3,
                    icon: 'paper-clip'
                }
            }
        ]
    },
    {
        name: 'Name',
        value: [
            {
                id: '1',
                entity: {
                    value: 'Robert stanton',
                    type: 'system',
                    variant: 1
                }
            },
            {
                id: '2',
                entity: {
                    value: 'Sara Davis',
                    type: 'system',
                    variant: 1
                }
            },
            {
                id: '3',
                entity: {
                    value: 'Cindy',
                    type: 'system',
                    variant: 1
                }
            },
            {
                id: '4',
                entity: {
                    value: 'Dean',
                    type: 'system',
                    variant: 1
                }
            },
            {
                id: '5',
                entity: {
                    value: 'Joe Stevens',
                    type: 'system',
                    variant: 1
                }
            }
        ]
    },
    {
        name: 'Email',
        value: [
            {
                id: '1',
                entity: {
                    value: 'robert.stanton@example.com',
                    type: 'system',
                    variant: 2
                }
            },
            {
                id: '2',
                entity: {
                    value: 'robert.stanton@example.com',
                    type: 'system',
                    variant: 2,
                    icon: 'paper-clip'
                }
            },
            {
                id: '3',
                entity: {
                    value: 'cindy.turner@example.com',
                    type: 'system',
                    variant: 2
                }
            },
            {
                id: '4',
                entity: {
                    value: 'dean.thomas@example.com',
                    type: 'system',
                    variant: 2
                }
            },
            {
                id: '5',
                entity: {
                    value: 'joe.stevens@example.com',
                    type: 'system',
                    variant: 2
                }
            }
        ]
    },
    {
        name: 'Date',
        value: [
            {
                id: '1',
                entity: {
                    value: 'Dec 5,2021 9.05 AM',
                    type: 'system',
                    variant: 4
                }
            }
        ]
    },
    {
        name: 'Flight Number',
        value: [
            {
                id: '1',
                entity: {
                    value: 'FL-JK-403',
                    type: 'system',
                    variant: 5
                }
            }
        ]
    },
    {
        name: 'Address',
        value: [
            {
                id: '1',
                entity: {
                    value: 'Nagercoil,Hyderabad',
                    type: 'system',
                    variant: 15
                }
            }
        ]
    },
    {
        name: 'Location',
        value: [
            {
                id: '1',
                entity: {
                    value: 'Hyderabad',
                    type: 'system',
                    variant: 8
                }
            }
        ]
    }
];
export const EmailMockData = {
    emails: {
        'Sara Davis': {
            fullName: 'Sara Davis',
            shortName: 'Sara',
            emailAddress: 'saraConnor@example.com'
        },
        'John Brown': {
            fullName: 'John Brown',
            shortName: 'John',
            emailAddress: 'john@example.com'
        },
        'Hugh Phillips': {
            fullName: 'Hugh Phillips',
            shortName: 'Hugh',
            emailAddress: 'Hugh@example.com'
        },
        'Laura Stevens': {
            fullName: 'Laura Stevens',
            shortName: 'Laura',
            emailAddress: 'laurastevens@example.com',
            avatarProps: {
                icon: 'headset'
            }
        },
        'Joe Stevens': {
            fullName: 'Joe Stevens',
            shortName: 'Joe',
            emailAddress: 'Joe@example.com'
        },
        'Adam Gillchrist': {
            fullName: 'Adam Gillchrist',
            shortName: 'Adam',
            emailAddress: 'adam@example.com'
        },
        'John Paul': {
            fullName: 'John, Paul',
            shortName: 'Paul',
            emailAddress: 'John.Paul@example.com'
        },
        'Oran Jacob': {
            fullName: 'Oran, Jacob',
            shortName: 'Jacob',
            emailAddress: 'jacob@example.com'
        },
        'Tyson Mike': {
            fullName: 'Tyson, Mike',
            shortName: 'Mike',
            emailAddress: 'mike@example.com'
        },
        'John Cent': {
            fullName: 'John, Cent',
            shortName: 'John',
            emailAddress: 'John.cena@example.com'
        },
        'Mystery Rey': {
            fullName: 'Mystery, Rey',
            shortName: 'Rey',
            emailAddress: 'rey619@example.com'
        },
        'Anton, Randy': {
            fullName: 'Anton, Randy',
            shortName: 'Randy',
            emailAddress: 'Randy.ortan@example.com'
        }
    },
    suggestedReplies: [
        {
            id: 'thank-you',
            title: 'Thank you',
            content: 'Thank you'
        },
        {
            id: 'clarification',
            title: 'Clarification',
            content: 'Can you please provide more clarification'
        },
        {
            id: 'apologies',
            title: 'Apologies',
            content: 'Apologies for the inconvenience'
        },
        {
            id: 'we_will_help',
            title: 'We will help',
            content: 'We will help'
        }
    ],
    emailBodyTemplates: [
        {
            id: '1',
            title: 'Thank you',
            templates: [
                {
                    id: 'thank-you-request',
                    title: 'Accepting Request',
                    content: 'Thank you for accepting our request'
                },
                {
                    id: 'thank-you-time',
                    title: 'Time',
                    content: 'Thank you for your time'
                },
                {
                    id: 'thank-you-assistance',
                    title: 'Assistance',
                    content: 'Thank you for your assistance'
                },
                {
                    id: 'thank-you-clarification',
                    title: 'Clarification',
                    content: 'Thank you for taking to the time so to provide answers to my questions. Your clarification email includes everything I need to progress.'
                },
                {
                    id: 'thank-you',
                    title: 'Thank you',
                    content: 'Thank You'
                }
            ]
        },
        {
            id: '2',
            title: 'Clarification',
            templates: [
                {
                    id: 'clarification-asking',
                    title: 'Asking for clarification',
                    content: 'Im contacting you as I need some additional details'
                },
                {
                    id: 'clarification',
                    title: 'Clarification',
                    content: 'Can you please provide more clarification'
                }
            ]
        },
        {
            id: '3',
            title: 'Apologies',
            templates: [
                {
                    id: 'apologies-delayed',
                    title: 'Delayed',
                    content: 'Apologies for the delay'
                },
                {
                    id: 'apologies-app-downtime',
                    title: 'App Downtime',
                    content: 'Apologies for the inconvenience caused, currently our app server is down, we are working on it'
                },
                {
                    id: 'apologies',
                    title: 'Apologies',
                    content: 'Apologies for the inconvenience'
                }
            ]
        },
        {
            id: '4',
            title: 'We will help',
            templates: [
                {
                    id: 'we_will_help_setup',
                    title: 'Setup',
                    content: 'We will help you setup the application as per our requirement'
                },
                {
                    id: 'we_will_help_asking',
                    title: 'Need Help',
                    content: 'Please, let us know if you need any help'
                },
                {
                    id: 'we_will_help',
                    title: 'We will help',
                    content: 'We will help'
                }
            ]
        },
        {
            id: 'information',
            title: 'Information',
            content: 'Please provide us more information'
        }
    ]
};
export const viewAnalysisEmailHeaderMock = [
    {
        name: 'Sender email',
        value: 'robert.stanton@hotmail.com'
    },
    {
        name: 'Sender name',
        value: 'Robert stanton'
    },
    {
        name: 'Subject',
        value: 'I have a quick question on travel'
    }
];
export const topicListMock = [
    {
        id: '1',
        primary: 'Missing ticket',
        secondary: {
            indicator: 'Confidence',
            value: '50%'
        }
    },
    {
        id: '2',
        primary: 'Missing baggage',
        secondary: {
            indicator: 'Confidence',
            value: '80%'
        }
    },
    {
        id: '3',
        primary: 'Ticket booking',
        secondary: {
            indicator: 'Confidence',
            value: '30%'
        }
    },
    {
        id: '4',
        primary: 'Language',
        secondary: {
            indicator: 'Confidence'
        }
    }
];
export const emptyFieldErrorMessage = 'Field cannot be blank';
export const invalidEmailErrorMessage = 'Invalid Email Address';
export const emailValidation = (validationData) => {
    const emailAddress = participants.map(a => a.emailAddress);
    return validationData.every(val => emailAddress.includes(val));
};
export const fieldValidation = (validationData) => {
    if (!!validationData && emailValidation(validationData))
        return undefined;
    return invalidEmailErrorMessage;
};
export const handleExternalEntry = (filterValue) => {
    const pattern = /^[\w.\-_]+@[a-zA-Z]+(\.[a-zA-Z]{2,3}){1,2}$/;
    const matched = filterValue.match(pattern);
    return !!matched?.input;
};
export const templates = EmailMockData.emailBodyTemplates;
export const baseComposerProps = {
    progress: false,
    participants,
    externalValidator: handleExternalEntry,
    data: {
        to: { value: toParticipants, error: '' },
        cc: { value: ccParticipants, error: '' },
        subject: { value: '' },
        bodyContent: { defaultValue: '' }
    },
    onSend: () => { },
    onCancel: () => { },
    onFilterChange: () => { },
    templates,
    onChange: () => { },
    onSave: () => { }
};
export var LaunchAction;
(function (LaunchAction) {
    LaunchAction[LaunchAction["REPLY"] = 0] = "REPLY";
    LaunchAction[LaunchAction["REPLYALL"] = 1] = "REPLYALL";
    LaunchAction[LaunchAction["SUGGESTION"] = 2] = "SUGGESTION";
    LaunchAction[LaunchAction["FORWARD"] = 3] = "FORWARD";
})(LaunchAction || (LaunchAction = {}));
export const composerModals = {};
export const getCompositeId = (id, launchAction) => {
    return `${id}-${launchAction}`;
};
export const handleComposerCancel = (compositeID) => {
    composerModals[compositeID]?.dismissModal();
    composerModals[compositeID]?.unMountModal();
    delete composerModals[compositeID];
};
export const ComposerModalComponent = ({ compositeId, composerProps, composerHandle, progress }) => {
    return (<Modal heading={composerProps.data.subject.value} options={{ id: { compositeId } }}>
      <EmailComposer {...composerProps} handle={composerHandle} onCancel={() => handleComposerCancel(compositeId)} progress={progress}/>
    </Modal>);
};
export const mockEmails = EmailMockData.emails;
export const mockSuggestedReplies = EmailMockData.suggestedReplies;
export const mockEmailBodyTemplates = EmailMockData.emailBodyTemplates;
const flattendMockEmailBodyTemplates = [];
mockEmailBodyTemplates.forEach(template => {
    if (template.templates)
        flattendMockEmailBodyTemplates.push(...template.templates);
    else
        flattendMockEmailBodyTemplates.push(template);
});
export const getTemplate = (id) => {
    return flattendMockEmailBodyTemplates.find(template => template.id === id);
};
const handleTemplateChange = (templateId, compositeId) => {
    const selectedTemplate = getTemplate(templateId);
    composerModals[compositeId]?.updateModal({ progress: { message: 'Loading template...' } });
    return new Promise(resolve => {
        setTimeout(() => {
            composerModals[compositeId]?.updateModal({ progress: false });
            resolve(selectedTemplate?.content);
        }, 1000);
    });
};
export const launchEmailComposer = (id, launchAction, composerProps, create) => {
    const compositeId = getCompositeId(id, launchAction);
    const composerHandle = createRef();
    const composerPropsWithOnSend = {
        ...composerProps,
        onSend: () => {
            composerModals[compositeId]?.updateModal({
                progress: {
                    message: 'Sending..'
                }
            });
            setTimeout(() => {
                composerModals[compositeId]?.dismissModal();
                composerModals[compositeId]?.unMountModal();
            }, 3000);
        },
        onTemplateChange: (templateId) => {
            return handleTemplateChange(templateId, compositeId);
        }
    };
    const modalControls = create(ComposerModalComponent, {
        compositeId,
        composerProps: composerPropsWithOnSend,
        composerHandle,
        progress: composerProps.progress
    }, { minimizable: true, maximizable: true, dockable: true });
    composerModals[compositeId] = {
        dismissModal: modalControls.dismiss,
        unMountModal: modalControls.unmount,
        updateModal: modalControls.update,
        composerHandle
    };
};
export const emailDemoActions = (id, subject, createOrActivateComposer, draft, body, deleteEmail) => {
    const menuItems = draft
        ? [
            {
                primary: 'Edit draft',
                onClick: () => createOrActivateComposer(id, LaunchAction.REPLY, {
                    ...baseComposerProps,
                    data: {
                        ...baseComposerProps.data,
                        responseType: 'reply',
                        subject: { value: `Re-${subject}` || '' },
                        bodyContent: { defaultValue: body || '' }
                    }
                })
            },
            {
                primary: 'Delete draft',
                onClick: () => {
                    deleteEmail(id);
                }
            }
        ].map((item, i) => ({ ...item, id: `item_${i}` }))
        : [
            {
                primary: 'Reply',
                onClick: () => createOrActivateComposer(id, LaunchAction.REPLY, {
                    ...baseComposerProps,
                    data: {
                        ...baseComposerProps.data,
                        responseType: 'reply',
                        subject: { value: `Re-${subject}` || '' },
                        bodyContent: { defaultValue: body || '' }
                    }
                })
            },
            {
                primary: 'Reply all',
                onClick: () => createOrActivateComposer(id, LaunchAction.REPLYALL, {
                    ...baseComposerProps,
                    data: {
                        ...baseComposerProps.data,
                        responseType: 'replyAll',
                        cc: { value: [] },
                        subject: { value: `Re-${subject}` || '' },
                        bodyContent: { defaultValue: body || '' }
                    }
                })
            },
            {
                primary: 'Forward',
                onClick: () => createOrActivateComposer(id, LaunchAction.FORWARD, {
                    ...baseComposerProps,
                    data: {
                        ...baseComposerProps.data,
                        responseType: 'forward',
                        subject: { value: `Fw-${subject}` || '' },
                        bodyContent: { defaultValue: body || '' }
                    }
                })
            }
        ].map((item, i) => ({ ...item, id: `item_${i}` }));
    return (<MenuButton text='Email actions' variant='simple' icon='more' iconOnly menu={{
            items: menuItems
        }}/>);
};
export const generateEmailConversationParticipants = (emails, fields) => {
    let l;
    if (fields) {
        l = [...fields];
    }
    else {
        l = ['from', 'to', 'cc', 'bcc'];
    }
    const emailUsers = emails.map(emailItem => {
        return l.map(n => {
            if (emailItem[n]) {
                return emailItem[n];
            }
            return [];
        });
    });
    return [...new Set(emailUsers.flat(2))];
};
export const sentiment = {
    variant: 'negative',
    labelHidden: true
};
export const emailSummaryItems = [
    {
        activeParticipants: [
            { shortName: 'Robert', fullName: 'Robert Downer', emailAddress: 'robert.downey@example.com' },
            { shortName: 'Support', fullName: 'Support', emailAddress: 'support@example.com' }
        ],
        message: 'I have a quick question on travel',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 85,
        unreadEmailCount: 0,
        drafts: true,
        undelivered: true
    },
    {
        activeParticipants: [
            {
                shortName: 'Nathan',
                fullName: 'Nathan Swanson',
                emailAddress: 'nathan.swanson@example.com'
            }
        ],
        undelivered: true,
        message: 'My luggage did not drive!',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Missing Luggage',
        sentiment: { ...sentiment, variant: 'positive' },
        urgency: 10,
        unreadEmailCount: 2
    },
    {
        activeParticipants: [
            { shortName: 'Simpson', fullName: 'Glenn Simpson', emailAddress: 'glenn.simpson@example.com' }
        ],
        message: 'Re: How much is a flight to Florida. Is there a discount going on?',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 65,
        unreadEmailCount: 1
    },
    {
        activeParticipants: [
            { shortName: 'Green', fullName: 'Ralph Green', emailAddress: 'ralph.green@example.com' }
        ],
        message: 'Re: Should I purchase travel insurance? How often do we need it?',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment: { ...sentiment, variant: 'neutral' },
        urgency: 85,
        unreadEmailCount: 6
    },
    {
        activeParticipants: [
            { shortName: 'Greene', fullName: 'Fred Greene', emailAddress: 'Fred.greene@example.com' }
        ],
        message: 'My next vacation',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 45
    },
    {
        activeParticipants: [
            { shortName: 'Smith', fullName: 'Aya Smith', emailAddress: 'aya.smith@example.com' },
            { shortName: 'Support', fullName: 'Support', emailAddress: 'support@example.com' },
            { shortName: 'Downer', fullName: 'Robert Downer', emailAddress: 'robert.downer@example.com' }
        ],
        message: 'Airport questions',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment: { ...sentiment, variant: 'positive' },
        urgency: 35
    },
    {
        activeParticipants: [
            { shortName: 'Robert', fullName: 'Robert Downer', emailAddress: 'robert.downey@example.com' },
            { shortName: 'Robert', fullName: 'Robert ', emailAddress: 'robert.downey@example.com' }
        ],
        message: 'I have a quick question on travel',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment: { ...sentiment, variant: 'positive' },
        urgency: 85
    },
    {
        activeParticipants: [
            {
                shortName: 'Nathan',
                fullName: 'Nathan Swanson',
                emailAddress: 'nathan.swanson@example.com'
            }
        ],
        message: 'My luggage did not drive!',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Missing Luggage',
        sentiment,
        urgency: 10
    },
    {
        activeParticipants: [
            { shortName: 'Simpson', fullName: 'Glenn Simpson', emailAddress: 'glenn.simpson@example.com' }
        ],
        message: 'Re: How much is a flight to Florida',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 65
    },
    {
        activeParticipants: [
            { shortName: 'Green', fullName: 'Ralph Green', emailAddress: 'ralph.green@example.com' }
        ],
        message: 'Re: Should I purchase travel insurance',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 85
    },
    {
        activeParticipants: [
            { shortName: 'Greene', fullName: 'Fred Greene', emailAddress: 'Fred.greene@example.com' }
        ],
        message: 'My next vacation',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 45
    },
    {
        activeParticipants: [
            { shortName: 'Smith', fullName: 'Aya Smith', emailAddress: 'aya.smith@example.com' },
            { shortName: 'Support', fullName: 'Support', emailAddress: 'support@example.com' },
            { shortName: 'Downer', fullName: 'Robert Downer', emailAddress: 'robert.downer@example.com' }
        ],
        message: 'Airport questions',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 35
    },
    {
        activeParticipants: [
            { shortName: 'Robert', fullName: 'Robert Downer', emailAddress: 'robert.downey@example.com' },
            { shortName: 'Robert', fullName: 'Robert ', emailAddress: 'robert.downey@example.com' }
        ],
        message: 'I have a quick question on travel',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 85
    },
    {
        activeParticipants: [
            {
                shortName: 'Nathan',
                fullName: 'Nathan Swanson',
                emailAddress: 'nathan.swanson@example.com'
            }
        ],
        message: 'My luggage did not drive!',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Missing Luggage',
        sentiment,
        urgency: 10
    },
    {
        activeParticipants: [
            { shortName: 'Simpson', fullName: 'Glenn Simpson', emailAddress: 'glenn.simpson@example.com' }
        ],
        message: 'Re: How much is a flight to Florida',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 65
    },
    {
        activeParticipants: [
            { shortName: 'Green', fullName: 'Ralph Green', emailAddress: 'ralph.green@example.com' }
        ],
        message: 'Re: Should I purchase travel insurance',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 85
    },
    {
        activeParticipants: [
            { shortName: 'Greene', fullName: 'Fred Greene', emailAddress: 'Fred.greene@example.com' }
        ],
        message: 'My next vacation',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 45
    },
    {
        activeParticipants: [
            { shortName: 'Smith', fullName: 'Aya Smith', emailAddress: 'aya.smith@example.com' },
            { shortName: 'Support', fullName: 'Support', emailAddress: 'support@example.com' },
            { shortName: 'Downer', fullName: 'Robert Downer', emailAddress: 'robert.downer@example.com' }
        ],
        message: 'Airport questions',
        timeStamp: new Date(Date.UTC(new Date().getUTCFullYear(), new Date().getUTCMonth(), 24)),
        topic: 'Travel request',
        sentiment,
        urgency: 35
    }
].map((item, i) => ({ ...item, id: `item_${i}` }));
export const forwardedContent = `
  <div id="pega-email-message-forward" style="font-family:OpenSans,sans-serif; border-left: 1px solid #c4c4c4; padding-left: 8px;">
     <div>
        <p class="pega-email-forward-header" style="font-size:smaller;color:#90909D;">--------------------Forwarded message--------------------<br />From: Person, Example &lt;example.person@pega.com&gt; &nbsp;<br />Date: Feb 23, 2022 9:29:59 PM&nbsp;<br />Subject: Regarding flight booking &nbsp;<br />To: Laura, Stevens &lt;laurastevens@example.com&gt;<br />&nbsp;</p>
     </div>
     <div class="pega-email-forward-content">
        <div class="WordSection1">
           <p class="MsoNormal" style="margin:0cm;font-size:11pt;font-family:'calibri' , sans-serif"><span style="color:black">Hi,&nbsp; </span></p>
           <p class="MsoNormal" style="margin:0cm;font-size:11pt;font-family:'calibri' , sans-serif"><span style="color:black">&nbsp;&nbsp; </span></p>
           <p class="MsoNormal" style="margin:0cm;font-size:11pt;font-family:'calibri' , sans-serif"><span style="color:black">I need to book a flight from Hyderabad to Chennai.&nbsp; </span></p>
           <p class="MsoNormal" style="margin:0cm;font-size:11pt;font-family:'calibri' , sans-serif"><span style="color:black">Please let me know the fare including taxes per each person. </span></p>
           <p class="MsoNormal" style="margin:0cm;font-size:11pt;font-family:'calibri' , sans-serif"><span style="color:black">&nbsp;&nbsp; </span></p>
           <p class="MsoNormal" style="margin:0cm;font-size:11pt;font-family:'calibri' , sans-serif"><span style="color:black">Thanks,&nbsp; </span></p>
           <p class="MsoNormal" style="margin:0cm;font-size:11pt;font-family:'calibri' , sans-serif"><span style="color:black">Goutham </span></p>
        </div>
     </div>
  </div>
`;
export const emailWorklistItemsMock = [
    {
        id: 'item_0',
        primary: 'Default worklist',
        selected: false
    },
    {
        id: 'item_1',
        primary: 'Authors',
        selected: false
    },
    {
        id: 'item_2',
        primary: 'Administrators',
        selected: false
    },
    {
        id: 'item_3',
        primary: 'Managers',
        selected: false
    },
    {
        id: 'item_4',
        primary: 'Users',
        selected: false
    }
];
export const contextMenuItemsMock = [
    {
        id: 'item_0',
        primary: 'Field 1',
        selected: false
    },
    {
        id: 'item_1',
        primary: 'Field 2',
        selected: false
    },
    {
        id: 'item_2',
        primary: 'Field 3',
        selected: true
    },
    {
        id: 'item_3',
        primary: 'Field 4',
        selected: true
    }
];
export const highlightedEntitiesMock = [
    {
        value: '3967',
        type: 'system',
        variant: 0,
        names: ['Branch Code']
    },
    {
        value: 'Laura Stevens',
        type: 'system',
        variant: 1,
        names: ['Name']
    },
    {
        value: 'Nagercoil',
        type: 'system',
        variant: 2,
        names: ['Place', 'Location']
    },
    {
        value: 'indian',
        type: 'system',
        variant: 4,
        names: ['Nationality']
    },
    {
        value: 'Indian overseas bank',
        type: 'system',
        variant: 2,
        names: ['Bank']
    },
    {
        value: 'Trichy',
        type: 'system',
        variant: 2,
        names: ['Location']
    },
    {
        value: '6785420965476',
        type: 'system',
        variant: 3,
        names: ['Account Number']
    },
    {
        value: '+918989812345',
        type: 'system',
        variant: 4,
        names: ['Mobile Number']
    },
    {
        value: '1920 6746 8653 1256',
        type: 'system',
        variant: 4,
        names: ['Card Number']
    },
    {
        value: 'Debit Card',
        type: 'system',
        variant: 5,
        names: ['Card Type']
    },
    {
        value: 'Jan 04, 2021',
        type: 'system',
        variant: 6,
        names: ['Date']
    },
    {
        value: '97,398.57.',
        type: 'system',
        variant: 3,
        names: ['Account balance']
    },
    {
        value: '22-6-14/A(99M5+RR), Gandhi Road, Hyderabad',
        type: 'system',
        variant: 17,
        names: ['Address']
    },
    {
        value: '.5',
        type: 'system',
        variant: 17,
        names: ['Decimal']
    }
];
export const mockUploadImage = (image) => {
    return new Promise(res => {
        setTimeout(() => {
            res({
                src: 'https://www.pega.com/themes/custom/pegawww_theme/images/pega-logo.svg',
                alt: image.name
            });
        }, 3000);
    });
};
export const bodyData = `<div id="pega-email-message-forward" style="font-family: OpenSans, sans-serif">
      <div>
        <p
          class="pega-email-forward-header"
          style="font-size: smaller; color: #90909d"
        >
          --------------------Forwarded message--------------------<br />
          From: Support2 &lt;testinpega2022@gmail.com&gt; &nbsp;<br />
          Date: May 30, 2022 11:40:51 AM&nbsp;<br />
          Subject: Re:Address Change &nbsp;<br />
          To: Bandi, Likitha &lt;Likitha.Bandi@in.pega.com&gt; <br />
          &nbsp;
        </p>
      </div>
      <div class="pega-email-forward-content"><p>hi</p></div>
      <p
        class="pega-email-forward-separator"
        style="margin-left: 7px; font-size: smaller; color: #90909d"
      >
        On May 26, 2022 1:11:55 PM Support2 &lt;testinpega2022@gmail.com&gt; wrote :
      </p>
      <blockquote
        style="
          border-left: 1px solid #d7d7d7;
          margin-left: 10px;
          padding-left: 5px;
          font-style: normal;
          font-family: inherit;
          padding-bottom: 0px;
        "
      >
        <div class="pega-email-forward-content">
          Dear&nbsp;Bandi, Likitha &nbsp; <br />&nbsp; <br />Thank you for reaching
          out! <br />Could you tell me a little more about the issue? Where exactly
          you are facing the issue? <br />Having a little more information about the
          situation will help me to evaluate and get the issue sorted faster.
          <br />&nbsp; <br />Thank you <br />Goutham &nbsp;
        </div>
        <p
          class="pega-email-forward-separator"
          style="margin-left: 7px; font-size: smaller; color: #90909d"
        >
          On May 12, 2022 6:14:52 PM Bandi, Likitha
          &lt;Likitha.Bandi@in.pega.com&gt; wrote :
        </p>
        <blockquote
          style="
            border-left: 1px solid #d7d7d7;
            margin-left: 10px;
            padding-left: 5px;
            font-style: normal;
            font-family: inherit;
            padding-bottom: 0px;
          "
        >
          <div class="pega-email-forward-content">
            <div class="WordSection1">
              <p
                class="MsoNormal"
                style="
                  margin: 0in;
                  font-size: 11pt;
                  font-family: 'calibri', sans-serif;
                "
              >
                <span
                  style="
                    font-size: 10.5pt;
                    font-family: 'segoe ui', sans-serif;
                    color: black;
                    background: white;
                  "
                  >Hello,</span
                ><span
                  style="
                    font-size: 10.5pt;
                    font-family: 'segoe ui', sans-serif;
                    color: black;
                  "
                  ><br />
                  <br />
                  <span style="background: white"
                    >I want to update my address details into my profile. Here is my
                    latest email as follows:</span
                  ><br />
                  <br />
                  <span style="background: white">102, 2nd Floor,</span><br />
                  <span style="background: white">Mumbai</span><br />
                  <span style="background: white">500011</span><br />
                  <span style="background: white">Mobile: 9012390123 </span></span
                >
              </p>
              <p
                class="MsoNormal"
                style="
                  margin: 0in;
                  font-size: 11pt;
                  font-family: 'calibri', sans-serif;
                "
              >
                <span
                  style="
                    font-size: 10.5pt;
                    font-family: 'segoe ui', sans-serif;
                    color: black;
                    background: white;
                  "
                >
                  &nbsp;
                </span>
              </p>
              <p
                class="MsoNormal"
                style="
                  margin: 0in;
                  font-size: 11pt;
                  font-family: 'calibri', sans-serif;
                "
              >
                <span
                  style="
                    font-size: 10.5pt;
                    font-family: 'segoe ui', sans-serif;
                    color: black;
                    background: white;
                  "
                  >Thanks
                </span>
              </p>
              <p
                class="MsoNormal"
                style="
                  margin: 0in;
                  font-size: 11pt;
                  font-family: 'calibri', sans-serif;
                "
              >
                <span
                  style="
                    font-size: 10.5pt;
                    font-family: 'segoe ui', sans-serif;
                    color: black;
                    background: white;
                  "
                  >Likitha</span
                >
              </p>
            </div>
          </div>
        </blockquote>
      </blockquote>
    </div>`;
export const fetchMockHistory = (id) => {
    return new Promise((res, rej) => {
        if (!id)
            rej(new Error('Email id is not provided'));
        setTimeout(() => {
            res(forwardedContent);
        }, 2000);
    });
};
//# sourceMappingURL=Email.mocks.jsx.map