<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
import { Redirect } from '@agent/workflows/theme/components/Redirect';
import { __ } from '@wordpress/i18n';
import { layout } from '@wordpress/icons';
import { SelectSiteDesign } from './components/change-site-design/SelectSiteDesign';

const { context, abilities } = window.extAgentData;

const workflow = {
	available: () =>
		abilities?.canEditThemes &&
		!context?.adminPage &&
		context?.postId &&
		!context?.isBlogPage &&
		context?.isBlockTheme,
	needsRedirect: () => !context?.isFrontPage,
	redirectComponent: () =>
		Redirect(
			__(
				'Hey there! It looks like you are trying to change your site design, but you are not on a page where we can do that.',
				'extendify-local',
			),
		),
	id: 'change-site-design',
	whenFinished: {
		component: SelectSiteDesign,
	},
	example: {
		text: __('Change website design', 'extendify-local'),
		agentResponse: {
			// translators: This message show above a UI where the user can select a different site design.
			reply: __(
				'Below you can select a different design for your website.',
				'extendify-local',
			),
			recommendations: [
				{
					id: 'change-theme-colors',
					icon: 'styles',
					label: __('Change website colors', 'extendify-local'),
					workflowId: 'change-theme-variation',
					available: { context: ['hasThemeVariations'] },
				},
				{
					id: 'change-site-title',
					icon: 'edit',
					label: __('Change website title', 'extendify-local'),
					workflowId: 'edit-wp-setting',
					available: { abilities: ['canEditSettings'] },
				},
				{
					id: 'change-website-logo',
					icon: 'siteLogo',
					label: __('Change website logo', 'extendify-local'),
					workflowId: 'update-logo',
					available: { abilities: ['canEditSettings', 'canUploadMedia'] },
				},
			],
			whenFinishedTool: {
				id: 'change-site-design',
				labels: {
					confirm: __('Updated the website design', 'extendify-local'),
					cancel: __('Canceled the website design update', 'extendify-local'),
				},
			},
		},
	},
	icon: layout,
};

export default workflow;
