"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var TimeSynchronization_exports = {};
__export(TimeSynchronization_exports, {
  TimeSynchronization: () => TimeSynchronization
});
module.exports = __toCommonJS(TimeSynchronization_exports);
var import_MatterDefinition = require("../MatterDefinition.js");
var import_elements = require("../../elements/index.js");
/**
 * @license
 * Copyright 2022-2024 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const TimeSynchronization = (0, import_elements.ClusterElement)({
  name: "TimeSynchronization",
  id: 56,
  classification: "node",
  pics: "TIMESYNC",
  details: "Accurate time is required for a number of reasons, including scheduling, display and validating security materials.\nThis section describes a mechanism for Nodes to achieve and maintain time synchronization. The Time Synchronization cluster provides attributes for reading a Node\u2019s current time. It also allows Administrators to set current time, time zone and daylight savings time (DST) settings.\nThe Time Synchronization cluster may be present on the root node endpoint, and shall NOT be present on any other Endpoint of any Node.",
  xref: { document: "core", section: "11.17" },
  children: [
    (0, import_elements.AttributeElement)({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 2 }),
    (0, import_elements.AttributeElement)({
      name: "FeatureMap",
      id: 65532,
      type: "FeatureMap",
      xref: { document: "core", section: "11.17.5" },
      children: [
        (0, import_elements.FieldElement)({
          name: "TZ",
          constraint: "0",
          description: "TimeZone",
          details: "Allows a server to translate a UTC time to a local time using the time zone and daylight savings time (DST) offsets. If a server supports the TimeZone feature, it shall support the SetTimeZone and SetDSTOffset commands, and TimeZone and DSTOffset attributes, and shall expose the local time through the LocalTime attribute.",
          xref: { document: "core", section: "11.17.5.1" }
        }),
        (0, import_elements.FieldElement)({
          name: "NTPC",
          constraint: "1",
          description: "NtpClient",
          details: "Allows a node to use NTP/SNTP for time synchronization.",
          xref: { document: "core", section: "11.17.5.2" }
        }),
        (0, import_elements.FieldElement)({
          name: "NTPS",
          constraint: "2",
          description: "NtpServer",
          details: "Allows a Node to host an NTP server for the network so that other Nodes can achieve a high accuracy time synchronization within the network. See Section 11.17.15, \u201CActing as an NTP Server\u201D.",
          xref: { document: "core", section: "11.17.5.3" }
        }),
        (0, import_elements.FieldElement)({
          name: "TSC",
          constraint: "3",
          description: "TimeSyncClient",
          details: "This node also supports a time synchronization client and can connect to and read time from other nodes.",
          xref: { document: "core", section: "11.17.5.4" }
        })
      ]
    }),
    (0, import_elements.AttributeElement)({
      name: "UtcTime",
      id: 0,
      type: "epoch-us",
      access: "R V",
      conformance: "M",
      default: null,
      quality: "X C",
      details: "If the node has achieved time synchronization, this shall indicate the current time as a UTC epoch-us (Epoch Time in Microseconds).\nIf the node has not achieved time synchronization, this shall be null. This attribute may be set when a SetUTCTime is received.",
      xref: { document: "core", section: "11.17.8.1" }
    }),
    (0, import_elements.AttributeElement)({
      name: "Granularity",
      id: 1,
      type: "GranularityEnum",
      access: "R V",
      conformance: "M",
      constraint: "desc",
      default: 0,
      details: "The granularity of the error that the node is willing to guarantee on the time synchronization. It is of type GranularityEnum.\nThis value shall be set to NoTimeGranularity if UTCTime is null and shall NOT be set to NoTimeGranularity if UTCTime is non-null.",
      xref: { document: "core", section: "11.17.8.2" }
    }),
    (0, import_elements.AttributeElement)({
      name: "TimeSource",
      id: 2,
      type: "TimeSourceEnum",
      access: "R V",
      conformance: "O",
      constraint: "desc",
      default: 0,
      details: "The node\u2019s time source. This attribute indicates what method the node is using to sync, whether the source uses NTS or not and whether the source is internal or external to the Matter network. This attribute may be used by a client to determine its level of trust in the UTCTime. It is of type TimeSourceEnum.\nIf a node is unsure if the selected NTP server is within the Matter network, it SHOULD select one of the NonMatter* values.\nThis value shall be set to None if UTCTime is null and shall NOT be set to None if UTCTime is non-null.",
      xref: { document: "core", section: "11.17.8.3" }
    }),
    (0, import_elements.AttributeElement)({
      name: "TrustedTimeSource",
      id: 3,
      type: "TrustedTimeSourceStruct",
      access: "R V",
      conformance: "TSC",
      default: null,
      quality: "X N",
      details: "A Node ID, endpoint, and associated fabric index of a Node that may be used as trusted time source. See Time source prioritization. This attribute reflects the last value set by an administrator using the SetTrustedTimeSource command. If the value is null, no trusted time source has yet been set.",
      xref: { document: "core", section: "11.17.8.4" }
    }),
    (0, import_elements.AttributeElement)({
      name: "DefaultNtp",
      id: 4,
      type: "string",
      access: "R V",
      conformance: "NTPC",
      constraint: "max 128",
      default: null,
      quality: "X N",
      details: "The default NTP server that this Node may use if other time sources are unavailable. This attribute is settable by an Administrator using the SetDefaultNTP command. It SHOULD be set by the Commissioner during commissioning. If no default NTP server is available, the Commissioner may set this value to null. The default IANA assigned NTP port of 123 shall be used to access the NTP server.\nIf set, the format of this attribute shall be a domain name or a static IPv6 address with no port, in text format, as specified in RFC 5952. The address format shall follow the recommendations in Section 4 and shall NOT contain a port number.",
      xref: { document: "core", section: "11.17.8.5" }
    }),
    (0, import_elements.AttributeElement)({
      name: "TimeZone",
      id: 5,
      type: "list",
      access: "R V",
      conformance: "TZ",
      constraint: "1 to 2",
      default: [{ type: "properties", properties: { offset: 0, validAt: 0 } }],
      quality: "N",
      details: "A list of time zone offsets from UTC and when they shall take effect. This attribute uses a list of time offset configurations to allow Nodes to handle scheduled regulatory time zone changes. This attribute shall NOT be used to indicate daylight savings time changes (see DSTOffset attribute for daylight savings time).\nThe first entry shall have a ValidAt entry of 0. If there is a second entry, it shall have a non-zero\nValidAt time.\nIf a node supports a TimeZoneDatabase, and it has data for the given time zone Name and the given Offset matches, the node may update its own DSTOffset attribute to add new DST change times as required, based on the Name fields of the TimeZoneStruct. Administrators may add additional entries to the DSTOffset of other Nodes with the same time zone, if required.\nIf a node does not support a TimeZoneDatabase, the Name field of the TimeZoneStruct is only applicable for client-side localization. In particular:\n  \u2022 If the node does not support a TimeZoneDatabase, the Name field shall NOT be used to calculate     the local time.\n  \u2022 If the node does not support a TimeZoneDatabase, the Name field shall NOT be used to calculate     DST start or end dates.\nWhen time passes, the node SHOULD remove any entries which are no longer active and change the ValidAt time for the currently used TimeZoneStruct list item to zero.\nThis attribute shall have at least one entry. If the node does not have a default time zone and no time zone has been set, it may set this value to a list containing a single TimeZoneStruct with an offset of 0 (UTC) and a ValidAt time of 0.",
      xref: { document: "core", section: "11.17.8.6" },
      children: [(0, import_elements.FieldElement)({ name: "entry", type: "TimeZoneStruct" })]
    }),
    (0, import_elements.AttributeElement)({
      name: "DstOffset",
      id: 6,
      type: "list",
      access: "R V",
      conformance: "TZ",
      default: [],
      quality: "N",
      details: "A list of offsets to apply for daylight savings time, and their validity period. List entries shall be sorted by ValidStarting time.\nA list entry shall NOT have a ValidStarting time that is smaller than the ValidUntil time of the previous entry. There shall be at most one list entry with a null ValidUntil time and, if such an entry is present, it shall appear last in the list.\nOver time, the node SHOULD remove any entries which are no longer active from the list.\nOver time, if the node supports a TimeZoneDatabase and it has information available for the given time zone name, it may update its own list to add additional entries.\nIf a time zone does not use DST, this shall be indicated by a single entry with a 0 offset and a null ValidUntil field.",
      xref: { document: "core", section: "11.17.8.7" },
      children: [(0, import_elements.FieldElement)({ name: "entry", type: "DSTOffsetStruct" })]
    }),
    (0, import_elements.AttributeElement)({
      name: "LocalTime",
      id: 7,
      type: "epoch-us",
      access: "R V",
      conformance: "TZ",
      default: null,
      quality: "X C",
      details: "The computed current local time of the node as a epoch-us (Epoch Time in Microseconds). The value of LocalTime shall be the sum of the UTCTime, the offset of the currently valid TimeZoneStruct from the TimeZone attribute (converted to microseconds), and the offset of the currently valid DSTOffsetStruct from the DSTOffset attribute (converted to microseconds), if such an entry exists.\nIf the node has not achieved time synchronization, this shall be null. If the node has an empty DSTOffset, this shall be null.",
      xref: { document: "core", section: "11.17.8.8" }
    }),
    (0, import_elements.AttributeElement)({
      name: "TimeZoneDatabase",
      id: 8,
      type: "TimeZoneDatabaseEnum",
      access: "R V",
      conformance: "TZ",
      default: 2,
      quality: "F",
      details: "Indicates whether the node has access to a time zone database. Nodes with a time zone database may update their own DSTOffset attribute to add new entries and may push DSTOffset updates to other Nodes in the same time zone as required.",
      xref: { document: "core", section: "11.17.8.9" }
    }),
    (0, import_elements.AttributeElement)({
      name: "NtpServerAvailable",
      id: 9,
      type: "bool",
      access: "R V",
      conformance: "NTPS",
      default: false,
      details: "If the node is running an RFC 5905 NTPv4 compliant server on port 123, this value shall be True. If the node is not currently running an NTP server, this value shall be False.",
      xref: { document: "core", section: "11.17.8.10" }
    }),
    (0, import_elements.AttributeElement)({
      name: "TimeZoneListMaxSize",
      id: 10,
      type: "uint8",
      access: "R V",
      conformance: "TZ",
      constraint: "1 to 2",
      quality: "F",
      details: "Number of supported list entries in the TimeZone attribute. This attribute may take the value of 1 or 2, where the optional second list entry may be used to handle scheduled regulatory time zone changes.",
      xref: { document: "core", section: "11.17.8.11" }
    }),
    (0, import_elements.AttributeElement)({
      name: "DstOffsetListMaxSize",
      id: 11,
      type: "uint8",
      access: "R V",
      conformance: "TZ",
      constraint: "min 1",
      quality: "F",
      details: "Number of supported list entries in DSTOffset attribute. This value must be at least 1.",
      xref: { document: "core", section: "11.17.8.12" }
    }),
    (0, import_elements.AttributeElement)({
      name: "SupportsDnsResolve",
      id: 12,
      type: "bool",
      access: "R V",
      conformance: "NTPC",
      default: false,
      quality: "F",
      details: "This attribute is true if the node supports resolving a domain name. DefaultNTP Address values for these nodes may include domain names. If this is False, the Address for a DefaultNTP shall be an IPv6 address.",
      xref: { document: "core", section: "11.17.8.13" }
    }),
    (0, import_elements.EventElement)({
      name: "DstTableEmpty",
      id: 0,
      access: "V",
      conformance: "TZ",
      priority: "info",
      details: "This event shall be generated when the node stops applying the current DSTOffset and there are no entries in the list with a larger ValidStarting time, indicating the need to possibly get new DST data. This event shall also be generated if the DSTOffset list is cleared either by a SetTimeZone command, or by a SetDSTOffset command with an empty list.\nThe node shall generate this event if the node has not generated a DSTTableEmpty event in the last hour, and the DSTOffset list is empty when the node attempts to update its time. DSTTableEmpty events corresponding to a time update SHOULD NOT be generated more often than once per hour.\nThere is no data for this event.",
      xref: { document: "core", section: "11.17.10.1" }
    }),
    (0, import_elements.EventElement)({
      name: "DstStatus",
      id: 1,
      access: "V",
      conformance: "TZ",
      priority: "info",
      details: "This event shall be generated when the node starts or stops applying a DST offset.\nDSTOffsetActive\nIndicates whether the current DST offset is being applied (i.e, daylight savings time is applied, as opposed to standard time).",
      xref: { document: "core", section: "11.17.10.2" },
      children: [(0, import_elements.FieldElement)({ name: "DstOffsetActive", id: 0, type: "bool", conformance: "M" })]
    }),
    (0, import_elements.EventElement)({
      name: "TimeZoneStatus",
      id: 2,
      access: "V",
      conformance: "TZ",
      priority: "info",
      details: "This event shall be generated when the node changes its time zone offset or name. It shall NOT be sent for DST changes that are not accompanied by a time zone change.",
      xref: { document: "core", section: "11.17.10.3" },
      children: [
        (0, import_elements.FieldElement)({
          name: "Offset",
          id: 0,
          type: "int32",
          conformance: "M",
          constraint: "-43200 to 50400",
          details: "Current time zone offset from UTC in seconds.",
          xref: { document: "core", section: "11.17.10.3.1" }
        }),
        (0, import_elements.FieldElement)({
          name: "Name",
          id: 1,
          type: "string",
          conformance: "O",
          constraint: "0 to 64",
          details: "Current time zone name. This name SHOULD use the country/city format specified by the IANA Time Zone Database.",
          xref: { document: "core", section: "11.17.10.3.2" }
        })
      ]
    }),
    (0, import_elements.EventElement)({
      name: "TimeFailure",
      id: 3,
      access: "V",
      conformance: "M",
      priority: "info",
      details: "This event shall be generated if the node has not generated a TimeFailure event in the last hour, and the node is unable to get a time from any source. This event SHOULD NOT be generated more often than once per hour.",
      xref: { document: "core", section: "11.17.10.4" }
    }),
    (0, import_elements.EventElement)({
      name: "MissingTrustedTimeSource",
      id: 4,
      access: "V",
      conformance: "TSC",
      priority: "info",
      details: "This event shall be generated if the TrustedTimeSource is set to null upon fabric removal or by a SetTrustedTimeSource command.\nThis event shall also be generated if the node has not generated a MissingTrustedTimeSource event in the last hour, and the node fails to update its time from the TrustedTimeSource because the TrustedTimeSource is null or the specified peer cannot be reached. MissingTrustedTimeSource events corresponding to a time update SHOULD NOT be generated more often than once per hour.",
      xref: { document: "core", section: "11.17.10.5" }
    }),
    (0, import_elements.CommandElement)({
      name: "SetUtcTime",
      id: 0,
      access: "A",
      conformance: "M",
      direction: "request",
      response: "status",
      details: "This command may be issued by Administrator to set the time. If the Commissioner does not have a valid time source, it may send a Granularity of NoTimeGranularity.\nUpon receipt of this command, the node may update its UTCTime attribute to match the time specified in the command, if the stated Granularity and TimeSource are acceptable. The node shall update its UTCTime attribute if its current Granularity is NoTimeGranularity.\nIf the time is updated, the node shall also update its Granularity attribute based on the granularity specified in the command and the expected clock drift of the node. This SHOULD normally be one level lower than the stated command Granularity. It shall also update its TimeSource attribute to Admin. It shall also update its Last Known Good UTC Time as defined in Section 3.5.6.1, \u201CLast Known Good UTC Time\u201D.\nIf the node updates its UTCTime attribute, it shall accept the command with a status code of SUCCESS. If it opts to not update its time, it shall fail the command with a cluster specific Status Code of TimeNotAccepted.",
      xref: { document: "core", section: "11.17.9.1" },
      children: [
        (0, import_elements.FieldElement)({
          name: "UtcTime",
          id: 0,
          type: "epoch-us",
          conformance: "M",
          default: 0,
          details: "This shall give the Client\u2019s UTC Time.",
          xref: { document: "core", section: "11.17.9.1.1" }
        }),
        (0, import_elements.FieldElement)({
          name: "Granularity",
          id: 1,
          type: "GranularityEnum",
          conformance: "M",
          default: 0,
          details: "This shall give the Client\u2019s Granularity, as described in Section 11.17.8.2, \u201CGranularity Attribute\u201D.",
          xref: { document: "core", section: "11.17.9.1.2" }
        }),
        (0, import_elements.FieldElement)({
          name: "TimeSource",
          id: 2,
          type: "TimeSourceEnum",
          conformance: "O",
          default: 0,
          details: "This shall give the Client\u2019s TimeSource, as described in Section 11.17.8.3, \u201CTimeSource Attribute\u201D.",
          xref: { document: "core", section: "11.17.9.1.3" }
        })
      ]
    }),
    (0, import_elements.CommandElement)({
      name: "SetTrustedTimeSource",
      id: 1,
      access: "F A",
      conformance: "TSC",
      direction: "request",
      response: "status",
      details: "This command shall set the TrustedTimeSource attribute. Upon receipt of this command, * If the TrustedTimeSource field in the command is null, the node shall set the TrustedTimeSource attribute to null and shall generate a MissingTrustedTimeSource event. * Otherwise, the node shall set the TrustedTimeSource attribute to a struct which has NodeID and Endpoint fields matching those in the TrustedTimeSource field and has its FabricIndex field set to the command\u2019s accessing fabric index.",
      xref: { document: "core", section: "11.17.9.2" },
      children: [
        (0, import_elements.FieldElement)({
          name: "TrustedTimeSource",
          id: 0,
          type: "FabricScopedTrustedTimeSourceStruct",
          access: "F",
          conformance: "M",
          quality: "X",
          details: "This field contains the Node ID and endpoint of a trusted time source on the accessing fabric.",
          xref: { document: "core", section: "11.17.9.2.1" }
        }),
        (0, import_elements.FieldElement)({ name: "FabricIndex", id: 254, type: "FabricIndex" })
      ]
    }),
    (0, import_elements.CommandElement)({
      name: "SetTimeZone",
      id: 2,
      access: "M",
      conformance: "TZ",
      direction: "request",
      response: "SetTimeZoneResponse",
      details: "This command is used to set the time zone of the node.\nIf the given list is larger than the TimeZoneListMaxSize, the node shall respond with RESOURCE_EXHAUSTED and the TimeZone attribute shall NOT be updated.\nIf the given list does not conform to the list requirements in TimeZone attribute the node shall respond with a CONSTRAINT_ERROR and the TimeZone attribute shall NOT be updated.\nIf there are no errors in the list, the TimeZone field shall be copied to the TimeZone attribute. A TimeZoneStatus event shall be generated with the new time zone information.\nIf the node supports a time zone database and it has information available for the time zone that will be applied, it may set its DSTOffset attribute, otherwise the DSTOffset attribute shall be set to an empty list. A DSTTableEmpty event shall be generated if the DSTOffset attribute is empty. A DSTStatus event shall be generated if the node was previously applying a DST offset.",
      xref: { document: "core", section: "11.17.9.3" },
      children: [(0, import_elements.FieldElement)({
        name: "TimeZone",
        id: 0,
        type: "list",
        conformance: "M",
        constraint: "1 to 2",
        children: [(0, import_elements.FieldElement)({ name: "entry", type: "TimeZoneStruct" })]
      })]
    }),
    (0, import_elements.CommandElement)({
      name: "SetTimeZoneResponse",
      id: 3,
      conformance: "TZ",
      direction: "response",
      details: "This command shall be generated in response to a SetTimeZone command.",
      xref: { document: "core", section: "11.17.9.4" },
      children: [(0, import_elements.FieldElement)({
        name: "DstOffsetsRequired",
        id: 0,
        type: "bool",
        conformance: "M",
        default: true,
        details: "If the node supports a time zone database with information for the time zone that will be applied, it\nmay use this information to set the DSTOffset attribute. If the node is setting its own DSTOffset attribute, the DSTOffsetsRequired field shall be set to false, otherwise it shall be set to true.",
        xref: { document: "core", section: "11.17.9.4.1" }
      })]
    }),
    (0, import_elements.CommandElement)({
      name: "SetDstOffset",
      id: 4,
      access: "M",
      conformance: "TZ",
      direction: "request",
      response: "status",
      details: "This command is used to set the DST offsets for a node.\n  \u2022 If the length of DSTOffset is larger than DSTOffsetListMaxSize, the node shall respond with     RESOURCE_EXHAUSTED.\n  \u2022 Else if the list entries do not conform to the list requirements for DSTOffset attribute, the     node shall respond with CONSTRAINT_ERROR.\nIf there are no errors in the list, the DSTOffset field shall be copied to the DSTOffset attribute.\nIf the DSTOffset attribute change causes a corresponding change to the DST state, a DSTStatus event shall be generated. If the list is empty, the node shall generate a DSTTableEmpty event.",
      xref: { document: "core", section: "11.17.9.5" },
      children: [(0, import_elements.FieldElement)({
        name: "DstOffset",
        id: 0,
        type: "list",
        conformance: "M",
        children: [(0, import_elements.FieldElement)({ name: "entry", type: "DSTOffsetStruct" })]
      })]
    }),
    (0, import_elements.CommandElement)({
      name: "SetDefaultNtp",
      id: 5,
      access: "A",
      conformance: "NTPC",
      direction: "request",
      response: "status",
      details: "This command is used to set the DefaultNTP attribute. If the DefaultNTP Address field does not conform to the requirements in the DefaultNTP attribute description, the command shall fail with a status code of INVALID_COMMAND. If the node does not support DNS resolution (as specified in SupportsDNSResolve) and the provided Address is a domain name, the command shall fail with a status code of INVALID_COMMAND. Otherwise, the node shall set the DefaultNTP attribute to match the DefaultNTP provided in this command.",
      xref: { document: "core", section: "11.17.9.6" },
      children: [(0, import_elements.FieldElement)({
        name: "DefaultNtp",
        id: 0,
        type: "string",
        conformance: "M",
        constraint: "max 128",
        quality: "X",
        details: "This field contains the address of an NTP server than can be used as a fallback for time synchronization. The format of this field shall follow the requirements in the DefaultNTP attribute description.",
        xref: { document: "core", section: "11.17.9.6.1" }
      })]
    }),
    (0, import_elements.DatatypeElement)({
      name: "GranularityEnum",
      type: "enum8",
      xref: { document: "core", section: "11.17.6.1" },
      children: [
        (0, import_elements.FieldElement)({
          name: "NoTimeGranularity",
          id: 0,
          conformance: "M",
          description: "This indicates that the node is not currently synchronized with a UTC Time source and its clock is based on the Last Known Good UTC Time only."
        }),
        (0, import_elements.FieldElement)({
          name: "MinutesGranularity",
          id: 1,
          conformance: "M",
          description: "This indicates the node was synchronized to an upstream source in the past, but sufficient clock drift has occurred such that the clock error is now > 5 seconds."
        }),
        (0, import_elements.FieldElement)({
          name: "SecondsGranularity",
          id: 2,
          conformance: "M",
          description: "This indicates the node is synchronized to an upstream source using a low resolution protocol. UTC Time is accurate to \xB1 5 seconds."
        }),
        (0, import_elements.FieldElement)({
          name: "MillisecondsGranularity",
          id: 3,
          conformance: "M",
          description: "This indicates the node is synchronized to an upstream source using high resolution time- synchronization protocol such as NTP, or has built-in GNSS with some amount of jitter applying its GNSS timestamp. UTC Time is accurate to \xB1 50 ms."
        }),
        (0, import_elements.FieldElement)({
          name: "MicrosecondsGranularity",
          id: 4,
          conformance: "M",
          description: "This indicates the node is synchronized to an upstream source using a highly precise time- synchronization protocol such as PTP, or has built-in GNSS. UTC time is accurate to \xB1 10 \u03BCs."
        })
      ]
    }),
    (0, import_elements.DatatypeElement)({
      name: "TimeSourceEnum",
      type: "enum8",
      xref: { document: "core", section: "11.17.6.2" },
      children: [
        (0, import_elements.FieldElement)({
          name: "None",
          id: 0,
          conformance: "M",
          description: "Node is not currently synchronized with a UTC Time source."
        }),
        (0, import_elements.FieldElement)({ name: "Unknown", id: 1, conformance: "M", description: "Node uses an unlisted time source." }),
        (0, import_elements.FieldElement)({
          name: "Admin",
          id: 2,
          conformance: "M",
          description: "Node received time from a client using the SetUTCTime Command."
        }),
        (0, import_elements.FieldElement)({
          name: "NodeTimeCluster",
          id: 3,
          conformance: "M",
          description: "Synchronized time by querying the Time Synchronization cluster of another Node."
        }),
        (0, import_elements.FieldElement)({
          name: "NonMatterSntp",
          id: 4,
          conformance: "M",
          description: "SNTP from a server not in the Matter network. NTS is not used."
        }),
        (0, import_elements.FieldElement)({
          name: "NonMatterNtp",
          id: 5,
          conformance: "M",
          description: "NTP from servers not in the Matter network. None of the servers used NTS."
        }),
        (0, import_elements.FieldElement)({
          name: "MatterSntp",
          id: 6,
          conformance: "M",
          description: "SNTP from a server within the Matter network. NTS is not used."
        }),
        (0, import_elements.FieldElement)({
          name: "MatterNtp",
          id: 7,
          conformance: "M",
          description: "NTP from servers within the Matter network. None of the servers used NTS."
        }),
        (0, import_elements.FieldElement)({
          name: "MixedNtp",
          id: 8,
          conformance: "M",
          description: "NTP from multiple servers in the Matter network and external. None of the servers used NTS."
        }),
        (0, import_elements.FieldElement)({
          name: "NonMatterSntpnts",
          id: 9,
          conformance: "M",
          description: "SNTP from a server not in the Matter network. NTS is used."
        }),
        (0, import_elements.FieldElement)({
          name: "NonMatterNtpnts",
          id: 10,
          conformance: "M",
          description: "NTP from servers not in the Matter network. NTS is used on at least one server."
        }),
        (0, import_elements.FieldElement)({
          name: "MatterSntpnts",
          id: 11,
          conformance: "M",
          description: "SNTP from a server within the Matter network. NTS is used."
        }),
        (0, import_elements.FieldElement)({
          name: "MatterNtpnts",
          id: 12,
          conformance: "M",
          description: "NTP from a server within the Matter network. NTS is used on at least one server."
        }),
        (0, import_elements.FieldElement)({
          name: "MixedNtpnts",
          id: 13,
          conformance: "M",
          description: "NTP from multiple servers in the Matter network and external. NTS is used on at least one server."
        }),
        (0, import_elements.FieldElement)({
          name: "CloudSource",
          id: 14,
          conformance: "M",
          description: 'Time synchronization comes from a vendor cloud-based source (e.g. "Date" header in authenticated HTTPS connection).'
        }),
        (0, import_elements.FieldElement)({ name: "Ptp", id: 15, conformance: "M", description: "Time synchronization comes from PTP." }),
        (0, import_elements.FieldElement)({
          name: "Gnss",
          id: 16,
          conformance: "M",
          description: "Time synchronization comes from a GNSS source."
        })
      ]
    }),
    (0, import_elements.DatatypeElement)({
      name: "TimeZoneDatabaseEnum",
      type: "enum8",
      details: "It indicates what the device knows about the contents of the IANA Time Zone Database. Partial support on a device may be used to omit historical data, less commonly used time zones, and/or time zones not related to the region a product is sold in.",
      xref: { document: "core", section: "11.17.6.3" },
      children: [
        (0, import_elements.FieldElement)({
          name: "Full",
          id: 0,
          conformance: "M",
          description: "Node has a full list of the available time zones"
        }),
        (0, import_elements.FieldElement)({
          name: "Partial",
          id: 1,
          conformance: "M",
          description: "Node has a partial list of the available time zones"
        }),
        (0, import_elements.FieldElement)({ name: "None", id: 2, conformance: "M", description: "Node does not have a time zone database" })
      ]
    }),
    (0, import_elements.DatatypeElement)({
      name: "TrustedTimeSourceStruct",
      type: "struct",
      xref: { document: "core", section: "11.17.6.4" },
      children: [
        (0, import_elements.FieldElement)({
          name: "FabricIndex",
          id: 0,
          type: "fabric-idx",
          conformance: "M",
          details: "The Fabric Index associated with the Fabric of the client which last set the value of the trusted time source node.",
          xref: { document: "core", section: "11.17.6.4.1" }
        }),
        (0, import_elements.FieldElement)({
          name: "NodeId",
          id: 1,
          type: "node-id",
          conformance: "M",
          details: "Node ID of the trusted time source node on the Fabric associated with the entry.",
          xref: { document: "core", section: "11.17.6.4.2" }
        }),
        (0, import_elements.FieldElement)({
          name: "Endpoint",
          id: 2,
          type: "endpoint-no",
          conformance: "M",
          details: "Endpoint on the trusted time source node that contains the Time Synchronization cluster server.",
          xref: { document: "core", section: "11.17.6.4.3" }
        })
      ]
    }),
    (0, import_elements.DatatypeElement)({
      name: "FabricScopedTrustedTimeSourceStruct",
      type: "struct",
      xref: { document: "core", section: "11.17.6.5" },
      children: [
        (0, import_elements.FieldElement)({
          name: "NodeId",
          id: 0,
          type: "node-id",
          conformance: "M",
          details: "Node ID of the trusted time source node on the Fabric of the issuer.",
          xref: { document: "core", section: "11.17.6.5.1" }
        }),
        (0, import_elements.FieldElement)({
          name: "Endpoint",
          id: 1,
          type: "endpoint-no",
          conformance: "M",
          details: "Endpoint on the trusted time source node that contains the Time Synchronization cluster server. This is provided to avoid having to do discovery of the location of that endpoint by walking over all endpoints and checking their Descriptor Cluster.",
          xref: { document: "core", section: "11.17.6.5.2" }
        })
      ]
    }),
    (0, import_elements.DatatypeElement)({
      name: "TimeZoneStruct",
      type: "struct",
      xref: { document: "core", section: "11.17.6.6" },
      children: [
        (0, import_elements.FieldElement)({
          name: "Offset",
          id: 0,
          type: "int32",
          conformance: "M",
          constraint: "-43200 to 50400",
          details: "The time zone offset from UTC in seconds.",
          xref: { document: "core", section: "11.17.6.6.1" }
        }),
        (0, import_elements.FieldElement)({
          name: "ValidAt",
          id: 1,
          type: "epoch-us",
          conformance: "M",
          details: "The UTC time when the offset shall be applied.",
          xref: { document: "core", section: "11.17.6.6.2" }
        }),
        (0, import_elements.FieldElement)({
          name: "Name",
          id: 2,
          type: "string",
          conformance: "O",
          constraint: "0 to 64",
          details: "The time zone name SHOULD provide a human-readable time zone name and it SHOULD use the country/city format specified by the IANA Time Zone Database. The Name field may be used for display. If the node supports a TimeZoneDatabase it may use the Name field to set its own DST offsets if it has database information for the supplied time zone Name and the given Offset matches.",
          xref: { document: "core", section: "11.17.6.6.3" }
        })
      ]
    }),
    (0, import_elements.DatatypeElement)({
      name: "DSTOffsetStruct",
      type: "struct",
      xref: { document: "core", section: "11.17.6.7" },
      children: [
        (0, import_elements.FieldElement)({
          name: "Offset",
          id: 0,
          type: "int32",
          conformance: "M",
          constraint: "desc",
          details: "The DST offset in seconds. Normally this is in the range of 0 to 3600 seconds (1 hour), but this field will accept any values in the int32 range to accommodate potential future legislation that does not fit with these assumptions.",
          xref: { document: "core", section: "11.17.6.7.1" }
        }),
        (0, import_elements.FieldElement)({
          name: "ValidStarting",
          id: 1,
          type: "epoch-us",
          conformance: "M",
          details: "The UTC time when the offset shall be applied.",
          xref: { document: "core", section: "11.17.6.7.2" }
        }),
        (0, import_elements.FieldElement)({
          name: "ValidUntil",
          id: 2,
          type: "epoch-us",
          conformance: "M",
          quality: "X",
          details: "The UTC time when the offset shall stop being applied. Providing a null value here indicates a permanent DST change. If this value is non-null the value shall be larger than the ValidStarting time.",
          xref: { document: "core", section: "11.17.6.7.3" }
        })
      ]
    }),
    (0, import_elements.DatatypeElement)({
      name: "StatusCodeEnum",
      type: "enum8",
      xref: { document: "core", section: "11.17.7.1" },
      children: [
        (0, import_elements.FieldElement)({ name: "TimeNotAccepted", id: 2, description: "Node rejected the attempt to set the UTC time" })
      ]
    })
  ]
});
import_MatterDefinition.MatterDefinition.children.push(TimeSynchronization);
//# sourceMappingURL=TimeSynchronization.js.map
