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,CAAyCC,CAA9C,EAAI,CAAC,CAAD,CAAC,MAAMD,CAAUE,CAAAA,OAAV,EAAoBC,CAAAA,UAApB,EAAP,GAAA,IAAA,CAAA,CAAA,CAAA,CAA0CF,CAA1C,CAACA,CAAyCA,CAAAA,IAA1C,GAAA,IAAA,CAAA,CAAA,CAA0CA,CAAM/2B,CAAAA,QAAhD,CAAyD,SAAzD,CAAJ,GACE82B,CAAUI,CAAAA,uBAAV,CAAkC,iBAAlC,CAAqD,oBAArD,CAA2E,CACzEtN,QAAS,CAAA,CADgE,CAA3E,CAHiD,CAArD;",
"sources":["blaze-out/k8-opt/bin/devtools/gerritcodereview/plugins/feedback/feedback_plugin_bin.jstrimmer_bootstrap.js","third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/util/defineproperty.js","third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/util/global.js","third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/util/polyfill.js","third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/es6/globalthis.js","third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/es6/dispose.js","third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/es6/string/replaceall.js","javascript/closure/base.js","third_party/javascript/custom_elements/src/native-shim-impl.js","javascript/polymer/detect_transpilation/detect_transpilation.ts","third_party/javascript/lit/packages/reactive-element/src/css-tag.ts","third_party/javascript/lit/packages/reactive-element/src/polyfill-support.ts","third_party/javascript/lit/packages/reactive-element/src/reactive-element.ts","third_party/javascript/lit/packages/lit-html/src/polyfill-support.ts","third_party/javascript/lit/packages/lit-element/src/polyfill-support.ts","third_party/javascript/safevalues/internals/trusted_types.ts","third_party/javascript/safevalues/internals/html_impl.ts","third_party/javascript/safevalues/internals/pure.ts","third_party/javascript/safevalues/internals/resource_url_impl.ts","third_party/javascript/safevalues/builders/url_builders.ts","third_party/javascript/safevalues/builders/resource_url_builders.ts","third_party/javascript/lit/packages/lit-html/src/internal-security.ts","third_party/javascript/lit/packages/lit-html/src/lit-html.ts","third_party/javascript/lit/packages/lit-element/src/lit-element.ts","third_party/javascript/closure/dom/nodetype.js","third_party/javascript/closure/array/array.js","third_party/javascript/closure/object/object.js","third_party/javascript/safevalues/dom/globals/window.ts","third_party/javascript/safevalues/dom/elements/script.ts","blaze-out/k8-opt/bin/third_party/javascript/closure/flags/flags.js","third_party/javascript/closure/labs/useragent/util.js","third_party/javascript/closure/useragent/useragent.js","third_party/javascript/closure/string/internal.js","third_party/javascript/closure/labs/useragent/engine.js","third_party/javascript/closure/dom/dom.js","third_party/javascript/closure/async/throwexception.js","javascript/common/bigint/platform.ts","javascript/common/bigint/index.ts","javascript/apps/jspb/internal_symbols.js","javascript/apps/jspb/internal_array_state.js","javascript/apps/jspb/internal.js","javascript/apps/jspb/exceptions.js","third_party/javascript/closure/debug/errorcontext.js","javascript/apps/jspb/internal_pivot_selectors.js","javascript/apps/jspb/internal_unknown_fields.js","javascript/apps/jspb/internal_copy.js","javascript/apps/jspb/dynamic_pivot_selection.js","javascript/apps/jspb/internal_construct.js","javascript/apps/jspb/internal_immutability.js","javascript/apps/jspb/internal_jspb_adapters.js","javascript/apps/jspb/internal_accessor_helpers.js","blaze-out/k8-opt/bin/uservoice/common/flags/flag_service_jspb/jspb$m$AlohaFormPropertiesResponse.js","javascript/apps/jspb/message.js","blaze-out/k8-opt/bin/uservoice/common/flags/flag_service_jspb/jspb$m$AlohaFlags.js","javascript/apps/jspb/internal_public.js","uservoice/feedback/client/web/shared/constants.ts","uservoice/feedback/client/web/languages/languages.ts","uservoice/feedback/client/web/loader/loader_util.ts","uservoice/feedback/client/web/loader/loader.ts","third_party/javascript/closure/dom/tagname.js","javascript/common/async/context/propagate.ts","third_party/javascript/closure/disposable/disposable.js","third_party/javascript/closure/events/event.js","third_party/javascript/closure/events/browserfeature.js","third_party/javascript/closure/events/browserevent.js","third_party/javascript/closure/events/eventtype.js","third_party/javascript/closure/events/listenable.js","third_party/javascript/closure/events/listenablekey.js","third_party/javascript/closure/events/listener.js","third_party/javascript/closure/events/listenermap.js","third_party/javascript/closure/events/events.js","third_party/javascript/closure/events/eventtarget.js","third_party/javascript/closure/json/json.js","third_party/javascript/closure/uri/utils.js","third_party/javascript/closure/net/xhrio.js","third_party/javascript/closure/net/eventtype.js","uservoice/feedback/client/web/service/properties_fetch_service.ts","third_party/javascript/closure/net/xmlhttp.js","third_party/javascript/closure/net/errorcode.js","third_party/javascript/closure/net/httpstatus.js","third_party/javascript/closure/json/hybrid.js","userfeedback/javascript/api/bootstrap.js","third_party/javascript/safevalues/restricted/reviewed.ts","third_party/javascript/tslib/tslib_closure.js","devtools/gerritcodereview/plugins/feedback/feedback.ts","third_party/javascript/lit/packages/reactive-element/src/decorators/custom-element.ts"],
"sourcesContent":["var CLOSURE_TOGGLE_ORDINALS = {\n  'GoogFlags__async_throw_on_unicode_to_byte__enable': false,\n  'GoogFlags__client_only_wiz_context_per_component__enable': false,\n  'GoogFlags__client_only_wiz_lazy_tsx__disable': false,\n  'GoogFlags__client_only_wiz_queue_effect_and_on_init_initial_runs__disable': false,\n  'GoogFlags__fixed_noopener_behavior__enable': false,\n  'GoogFlags__jspb_deserialize_binary_int64s_as_gbigint__disable': false,\n  'GoogFlags__jspb_disallow_message_tojson__enable': false,\n  'GoogFlags__jspb_serialize_with_dynamic_pivot_selector__enable': false,\n  'GoogFlags__jspb_throw_in_array_constructor_if_array_is_already_constructed__disable': false,\n  'GoogFlags__jspb_use_constant_default_pivot__enable': false,\n  'GoogFlags__jspb_write_back_bigint__enable': false,\n  'GoogFlags__optimize_get_ei_from_ved__enable': false,\n  'GoogFlags__override_disable_toggles': false,\n  'GoogFlags__testonly_debug_flag__enable': false,\n  'GoogFlags__testonly_disabled_flag__enable': false,\n  'GoogFlags__testonly_stable_flag__disable': false,\n  'GoogFlags__testonly_staging_flag__disable': false,\n  'GoogFlags__use_toggles': false,\n  'GoogFlags__use_user_agent_client_hints__enable': false,\n  'GoogFlags__wiz_enable_native_promise__enable': false,\n};\n","","","","","","","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Bootstrap for the Google JS Library (Closure).\n *\n * Avoid including base.js more than once. This is strictly discouraged and not\n * supported. goog.require(...) won't work properly in that case.\n *\n * @suppress {deprecated} Users cannot remove deprecated uses here.\n * @provideGoog\n */\n\n\n/**\n * @define {boolean} Overridden to true by the compiler.\n */\nvar COMPILED = false;\n\n\n/**\n * Base namespace for the Closure library.  Checks to see goog is already\n * defined in the current scope before assigning to prevent clobbering if\n * base.js is loaded more than once.\n *\n * @const\n */\nvar goog = goog || {};\n\n/**\n * Reference to the global object.\n * https://www.ecma-international.org/ecma-262/9.0/index.html#sec-global-object\n *\n * More info on this implementation here:\n * https://docs.google.com/document/d/1NAeW4Wk7I7FV0Y2tcUFvQdGMc89k2vdgSXInw8_nvCI/edit\n *\n * @const\n * @suppress {undefinedVars} self won't be referenced unless `this` is falsy.\n * @type {!Global}\n */\ngoog.global =\n    // Check `this` first for backwards compatibility.\n    // Valid unless running as an ES module or in a function wrapper called\n    //   without setting `this` properly.\n    // Note that base.js can't usefully be imported as an ES module, but it may\n    // be compiled into bundles that are loadable as ES modules.\n    this ||\n    // https://developer.mozilla.org/en-US/docs/Web/API/Window/self\n    // For in-page browser environments and workers.\n    self;\n\n\n/**\n * A hook for overriding the define values in uncompiled mode.\n *\n * In uncompiled mode, `CLOSURE_UNCOMPILED_DEFINES` may be defined before\n * loading base.js.  If a key is defined in `CLOSURE_UNCOMPILED_DEFINES`,\n * `goog.define` will use the value instead of the default value.  This\n * allows flags to be overwritten without compilation (this is normally\n * accomplished with the compiler's \"define\" flag).\n *\n * Example:\n * <pre>\n *   var CLOSURE_UNCOMPILED_DEFINES = {'goog.DEBUG': false};\n * </pre>\n *\n * @type {Object<string, (string|number|boolean)>|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n\n/**\n * A hook for overriding the define values in uncompiled or compiled mode,\n * like CLOSURE_UNCOMPILED_DEFINES but effective in compiled code.  In\n * uncompiled code CLOSURE_UNCOMPILED_DEFINES takes precedence.\n *\n * Also unlike CLOSURE_UNCOMPILED_DEFINES the values must be number, boolean or\n * string literals or the compiler will emit an error.\n *\n * While any @define value may be set, only those set with goog.define will be\n * effective for uncompiled code.\n *\n * Example:\n * <pre>\n *   var CLOSURE_DEFINES = {'goog.DEBUG': false} ;\n * </pre>\n *\n * Currently the Closure Compiler will only recognize very simple definitions of\n * this value when looking for values to apply to compiled code and ignore all\n * other references.  Specifically, it looks the value defined at the variable\n * declaration, as with the example above.\n *\n * TODO(b/202066289): Improve the recognized definitions.\n *\n * @type {!Object<string, (string|number|boolean)>|null|undefined}\n */\ngoog.global.CLOSURE_DEFINES;\n\n\n/**\n * Builds an object structure for the provided namespace path, ensuring that\n * names that already exist are not overwritten. For example:\n * \"a.b.c\" -> a = {};a.b={};a.b.c={};\n * Used by goog.provide and goog.exportSymbol.\n * @param {string} name The name of the object that this file defines.\n * @param {*=} object The object to expose at the end of the path.\n * @param {boolean=} overwriteImplicit If object is set and a previous call\n *     implicitly constructed the namespace given by name, this parameter\n *     controls whether object should overwrite the implicitly constructed\n *     namespace or be merged into it. Defaults to false.\n * @param {?Object=} objectToExportTo The object to add the path to; if this\n *     field is not specified, its value defaults to `goog.global`.\n * @private\n */\ngoog.exportPath_ = function(name, object, overwriteImplicit, objectToExportTo) {\n  var parts = name.split('.');\n  var cur = objectToExportTo || goog.global;\n\n  for (var part; parts.length && (part = parts.shift());) {\n    if (!parts.length && object !== undefined) {\n      if (!overwriteImplicit && goog.isObject(object) &&\n          goog.isObject(cur[part])) {\n        // Merge properties on object (the input parameter) with the existing\n        // implicitly defined namespace, so as to not clobber previously\n        // defined child namespaces.\n        for (var prop in object) {\n          if (object.hasOwnProperty(prop)) {\n            cur[part][prop] = object[prop];\n          }\n        }\n      } else {\n        // Either there is no existing implicit namespace, or overwriteImplicit\n        // is set to true, so directly assign object (the input parameter) to\n        // the namespace.\n        cur[part] = object;\n      }\n    } else if (cur[part] && cur[part] !== Object.prototype[part]) {\n      cur = cur[part];\n    } else {\n      cur = cur[part] = {};\n    }\n  }\n};\n\n/**\n * Defines local copies for isolation of multiple chunk set. These values must\n * be set before closure base in order to have goog.define properly work.\n *\n * @suppress {checkVars}\n */\ngoog.CLOSURE_DEFINES = typeof CLOSURE_DEFINES !== 'undefined' ?\n    CLOSURE_DEFINES :\n    goog.global.CLOSURE_DEFINES;\n/**\n * @suppress {checkVars}\n */\ngoog.CLOSURE_UNCOMPILED_DEFINES =\n    typeof CLOSURE_UNCOMPILED_DEFINES !== 'undefined' ?\n    CLOSURE_UNCOMPILED_DEFINES :\n    goog.global.CLOSURE_UNCOMPILED_DEFINES;\n\n/**\n * Defines a named value. In uncompiled mode, the value is retrieved from\n * CLOSURE_DEFINES or CLOSURE_UNCOMPILED_DEFINES if the object is defined and\n * has the property specified, and otherwise used the defined defaultValue.\n * When compiled the default can be overridden using the compiler options or the\n * value set in the CLOSURE_DEFINES object. Returns the defined value so that it\n * can be used safely in modules. Note that the value type MUST be either\n * boolean, number, or string.\n *\n * @suppress {checkVars|lintChecks}\n *\n * @param {string} name The distinguished name to provide.\n * @param {T} defaultValue\n * @return {T} The defined value.\n * @template T\n * @tsType (name: string, defaultValue: boolean): boolean\n * @tsType (name: string, defaultValue: number): number\n * @tsType (name: string, defaultValue: string): string\n */\ngoog.define = function(name, defaultValue) {\n  var value = defaultValue;\n  if (!COMPILED) {\n    // Fallback to goog.global.CLOSURE_UNCOMPILED_DEFINES in the\n    // case that the value is set after closure base. This keeps existing code\n    // working.\n    var uncompiledDefines = goog.CLOSURE_UNCOMPILED_DEFINES ?\n        goog.CLOSURE_UNCOMPILED_DEFINES :\n        goog.global.CLOSURE_UNCOMPILED_DEFINES;\n    // Fallback to goog.global.CLOSURE_DEFINES in the case that the\n    // value is set after closure base. This keeps existing code working.\n    var defines = goog.CLOSURE_DEFINES ? goog.CLOSURE_DEFINES :\n                                         goog.global.CLOSURE_DEFINES;\n    if (uncompiledDefines &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        /** @type {?} */ (uncompiledDefines).nodeType === undefined &&\n        Object.prototype.hasOwnProperty.call(uncompiledDefines, name)) {\n      value = uncompiledDefines[name];\n    } else if (\n        defines &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        /** @type {?} */ (defines).nodeType === undefined &&\n        Object.prototype.hasOwnProperty.call(defines, name)) {\n      value = defines[name];\n    }\n  }\n  return value;\n};\n\n\n/**\n * @define {number} Integer year indicating the set of browser features that are\n * guaranteed to be present.  This is defined to include exactly features that\n * work correctly on all \"modern\" browsers that are stable on January 1 of the\n * specified year.  For example,\n * ```js\n * if (goog.FEATURESET_YEAR >= 2019) {\n *   // use APIs known to be available on all major stable browsers Jan 1, 2019\n * } else {\n *   // polyfill for older browsers\n * }\n * ```\n * This is intended to be the primary define for removing\n * unnecessary browser compatibility code (such as ponyfills and workarounds),\n * and should inform the default value for most other defines:\n * ```js\n * const ASSUME_NATIVE_PROMISE =\n *     goog.define('ASSUME_NATIVE_PROMISE', goog.FEATURESET_YEAR >= 2016);\n * ```\n *\n * The default assumption is that IE9 is the lowest supported browser, which was\n * first available Jan 1, 2012.\n *\n * TODO(mathiasb): Reference more thorough documentation when it's available.\n */\ngoog.FEATURESET_YEAR = goog.define('goog.FEATURESET_YEAR', 2012);\n\n\n/**\n * @define {boolean} DEBUG is provided as a convenience so that debugging code\n * that should not be included in a production. It can be easily stripped\n * by specifying --define goog.DEBUG=false to the Closure Compiler aka\n * JSCompiler. For example, most toString() methods should be declared inside an\n * \"if (goog.DEBUG)\" conditional because they are generally used for debugging\n * purposes and it is difficult for the JSCompiler to statically determine\n * whether they are used.\n */\ngoog.DEBUG = goog.define('goog.DEBUG', true);\n\n\n/**\n * @define {string} LOCALE defines the locale being used for compilation. It is\n * used to select locale specific data to be compiled in js binary. BUILD rule\n * can specify this value by \"--define goog.LOCALE=<locale_name>\" as a compiler\n * option.\n *\n * Take into account that the locale code format is important. You should use\n * the canonical Unicode format with hyphen as a delimiter. Language must be\n * lowercase, Language Script - Capitalized, Region - UPPERCASE.\n * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN.\n *\n * See more info about locale codes here:\n * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers\n *\n * For language codes you should use values defined by ISO 693-1. See it here\n * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from\n * this rule: the Hebrew language. For legacy reasons the old code (iw) should\n * be used instead of the new code (he).\n *\n * MOE:begin_intracomment_strip\n * See http://g3doc/i18n/identifiers/g3doc/synonyms.\n * MOE:end_intracomment_strip\n */\ngoog.LOCALE = goog.define('goog.LOCALE', 'en');  // default to en\n\n\n/**\n * @define {boolean} Whether this code is running on trusted sites.\n *\n * On untrusted sites, several native functions can be defined or overridden by\n * external libraries like Prototype, Datejs, and JQuery and setting this flag\n * to false forces closure to use its own implementations when possible.\n *\n * If your JavaScript can be loaded by a third party site and you are wary about\n * relying on non-standard implementations, specify\n * \"--define goog.TRUSTED_SITE=false\" to the compiler.\n */\ngoog.TRUSTED_SITE = goog.define('goog.TRUSTED_SITE', true);\n\n\n/**\n * @define {boolean} Whether code that calls {@link goog.setTestOnly} should\n *     be disallowed in the compilation unit.\n */\ngoog.DISALLOW_TEST_ONLY_CODE =\n    goog.define('goog.DISALLOW_TEST_ONLY_CODE', COMPILED && !goog.DEBUG);\n\n\n/**\n * @define {boolean} Whether to use a Chrome app CSP-compliant method for\n *     loading scripts via goog.require. @see appendScriptSrcNode_.\n */\ngoog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING =\n    goog.define('goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING', false);\n\n\n// MOE:begin_strip\n/**\n * Read a flag from the runtime flags object.\n * @param {number} googFlagId Enum ordinal\n * @param {boolean} defaultValue Value to return if the flag is not given\n * @return {boolean}\n */\ngoog.readFlagInternalDoNotUseOrElse = function(googFlagId, defaultValue) {\n  var obj = goog.getObjectByName(goog.FLAGS_OBJECT_);\n  var val = obj && obj[googFlagId];\n  return val != null ? val : defaultValue;\n};\n\n\n/**\n * Name of the object to look for when looking up runtime flag values.  May be a\n * fully qualified object name (e.g. 'foo.bar').\n * @define {string}\n * @private\n */\ngoog.FLAGS_OBJECT_ = goog.define('goog.FLAGS_OBJECT', 'CLOSURE_FLAGS');\n\n\n/**\n * Default value for the STAGING flag.  Defaults to `true`, indicating that\n * flags are enabled by default once they reach the STAGING lifecycle stage.\n * Risk-averse products should set this to `false` in their production builds.\n * This is only necessary for non-Boq products because Boq Web configures this\n * via the goog.flag system by default.\n *\n * @define {boolean}\n */\ngoog.FLAGS_STAGING_DEFAULT = goog.define('goog.FLAGS_STAGING_DEFAULT', true);\n\n/**\n * Defines a local copy for multiple chunk set namespace isolation.\n *\n * @suppress {checkVars}\n */\ngoog.CLOSURE_TOGGLE_ORDINALS = typeof CLOSURE_TOGGLE_ORDINALS === 'object' ?\n    CLOSURE_TOGGLE_ORDINALS :\n    goog.global.CLOSURE_TOGGLE_ORDINALS;\n\n/**\n * Read a toggle's value.  This should not be called directly.  Use the\n * `toggle_provider` build rule instead.  See go/toggle-provider.\n * @param {string} name\n * @return {boolean}\n */\ngoog.readToggleInternalDoNotCallDirectly = function(name) {\n  var ordinals = goog.CLOSURE_TOGGLE_ORDINALS;\n  var ordinal = ordinals && ordinals[name];\n  if (typeof ordinal !== 'number') return Boolean(ordinal);\n  return Boolean(\n      goog.TOGGLES_[Math.floor(ordinal / 30)] & (1 << (ordinal % 30)));\n};\n\n\n/**\n * Bootstrap variable mapping toggle names to ordinals.  This is intended to be\n * read by JSCompiler to replace goog.readToggle...() calls with direct lookups,\n * but is also used by the debug-mode version of the toggle reader.\n * @const {!Object<string, number|boolean>|undefined}\n */\ngoog.global.CLOSURE_TOGGLE_ORDINALS;\n\n\n/**\n * @define {string} Global variable to check for toggles.\n * @private\n */\ngoog.TOGGLE_VAR_ = goog.define('goog.TOGGLE_VAR', '_F_toggles');\n\n\n/** @private @const {!Array<number>} */\ngoog.TOGGLES_ = goog.global[goog.TOGGLE_VAR_] || [];\n// MOE:end_strip\n\n/** @define {boolean} */\ngoog.GENDERED_MESSAGES_ENABLED =\n    goog.define('goog.GENDERED_MESSAGES_ENABLED', true);\n\n/** @private @enum {number} */\ngoog.GrammaticalGender_ = {\n  OTHER: 0,\n  MASCULINE: 1,\n  FEMININE: 2,\n  NEUTER: 3,\n};\n\n/**\n * See go/grammatical-gender-in-capabilities and\n * go/gender-appropriate-ui-jscompiler\n * @private @const {!Object<string, !goog.GrammaticalGender_>}\n */\ngoog.GRAMMATICAL_GENDER_MAP_ = {\n  'FEMININE': goog.GrammaticalGender_.FEMININE,\n  'MASCULINE': goog.GrammaticalGender_.MASCULINE,\n  'NEUTER': goog.GrammaticalGender_.NEUTER,\n};\n\n/**\n * Defines a local copy of viewers grammatical gender for use in gendered\n * messages.  Unknown values are mapped to `OTHER`\n * @private @const {!goog.GrammaticalGender_}\n */\ngoog.viewerGrammaticalGender_ =\n    goog.GRAMMATICAL_GENDER_MAP_[goog.GENDERED_MESSAGES_ENABLED && goog.global['_F_VIEWER_GRAMMATICAL_GENDER']] ||\n    goog.GrammaticalGender_.OTHER;\n\n/**\n * Shared constants for gendered messages based on the value of\n * `goog.viewerGrammaticalGender`\n */\n/** @const */\ngoog.msgKind = {};\n\n/**\n * @const\n * @noinline\n */\ngoog.msgKind.MASCULINE =\n    (goog.viewerGrammaticalGender_ === goog.GrammaticalGender_.MASCULINE);\n\n/**\n * @const\n * @noinline\n */\ngoog.msgKind.FEMININE =\n    (goog.viewerGrammaticalGender_ === goog.GrammaticalGender_.FEMININE);\n\n/**\n * @const\n * @noinline\n */\ngoog.msgKind.NEUTER =\n    (goog.viewerGrammaticalGender_ === goog.GrammaticalGender_.NEUTER);\n\nif (COMPILED && goog.LOCALE == '') {\n  // This code should never execute.  It is here to ensure that the compiler\n  // does not remove the values until goog.LOCALE is defined.\n  goog.logToConsole_('' + [\n    goog.msgKind.MASCULINE, goog.msgKind.FEMININE, goog.msgKind.NEUTER\n  ]);\n}\n\n/**\n * A hook for providing an object that should be used to track the \"legacy\n * namespaces\". The legacy namespace is where symbols from `goog.provide` as\n * well as symbols from `goog.module` with\n * `goog.module.declareLegacyNamespace` are placed.\n *\n * If this isn't specified, `goog.global` will be considered the legacy\n * namespace object.\n *\n * @type {!Object|undefined}\n */\ngoog.global.CLOSURE_UNCOMPILED_LEGACY_NAMESPACE_OBJECT;\n\n\n/**\n * @type {!Object}\n * @private\n */\ngoog.LEGACY_NAMESPACE_OBJECT_ =\n    (!COMPILED &&\n     typeof CLOSURE_UNCOMPILED_LEGACY_NAMESPACE_OBJECT !== 'undefined') ?\n    CLOSURE_UNCOMPILED_LEGACY_NAMESPACE_OBJECT :\n    goog.global;\n\n\n/**\n * Defines a namespace in Closure.\n *\n * A namespace may only be defined once in a codebase. It may be defined using\n * goog.provide() or goog.module().\n *\n * The presence of one or more goog.provide() calls in a file indicates\n * that the file defines the given objects/namespaces.\n * Provided symbols must not be null or undefined.\n *\n * In addition, goog.provide() creates the object stubs for a namespace\n * (for example, goog.provide(\"goog.foo.bar\") will create the object\n * goog.foo.bar if it does not already exist).\n *\n * Build tools also scan for provide/require/module statements\n * to discern dependencies, build dependency files (see deps.js), etc.\n *\n * @see goog.require\n * @see goog.module\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\".\n * deprecated Use goog.module (see b/159289405)\n */\ngoog.provide = function(name) {\n  if (goog.isInModuleLoader_()) {\n    throw new Error('goog.provide cannot be used within a module.');\n  }\n  if (!COMPILED) {\n    // Ensure that the same namespace isn't provided twice.\n    // A goog.module/goog.provide maps a goog.require to a specific file\n    if (goog.isProvided_(name)) {\n      throw new Error('Namespace \"' + name + '\" already declared.');\n    }\n  }\n\n  goog.constructNamespace_(name);\n};\n\n\n/**\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\".\n * @param {?Object=} object The object to embed in the namespace.\n * @param {boolean=} overwriteImplicit If object is set and a previous call\n *     implicitly constructed the namespace given by name, this parameter\n *     controls whether opt_obj should overwrite the implicitly constructed\n *     namespace or be merged into it. Defaults to false.\n * @private\n */\ngoog.constructNamespace_ = function(name, object, overwriteImplicit) {\n  if (!COMPILED) {\n    delete goog.implicitNamespaces_[name];\n\n    var namespace = name;\n    while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) {\n      if (goog.getObjectByName(namespace, goog.LEGACY_NAMESPACE_OBJECT_)) {\n        break;\n      }\n      goog.implicitNamespaces_[namespace] = true;\n    }\n  }\n\n  goog.exportPath_(\n      name, object, overwriteImplicit, goog.LEGACY_NAMESPACE_OBJECT_);\n};\n\n\n/**\n * According to the CSP3 spec a nonce must be a valid base64 string.\n * @see https://www.w3.org/TR/CSP3/#grammardef-base64-value\n * @private @const\n */\ngoog.NONCE_PATTERN_ = /^[\\w+/_-]+[=]{0,2}$/;\n\n\n/**\n * Returns CSP nonce, if set for any script tag.\n * @param {?Window=} opt_window The window context used to retrieve the nonce.\n *     Defaults to global context.\n * @return {string} CSP nonce or empty string if no nonce is present.\n * @private\n */\ngoog.getScriptNonce_ = function(opt_window) {\n  var doc = (opt_window || goog.global).document;\n  var script = doc.querySelector && doc.querySelector('script[nonce]');\n  if (script) {\n    // Try to get the nonce from the IDL property first, because browsers that\n    // implement additional nonce protection features (currently only Chrome) to\n    // prevent nonce stealing via CSS do not expose the nonce via attributes.\n    // See https://github.com/whatwg/html/issues/2369\n    var nonce = script['nonce'] || script.getAttribute('nonce');\n    if (nonce && goog.NONCE_PATTERN_.test(nonce)) {\n      return nonce;\n    }\n  }\n  return '';\n};\n\n\n/**\n * Module identifier validation regexp.\n * Note: This is a conservative check, it is very possible to be more lenient,\n *   the primary exclusion here is \"/\" and \"\\\" and a leading \".\", these\n *   restrictions are intended to leave the door open for using goog.require\n *   with relative file paths rather than module identifiers.\n * @private\n */\ngoog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/;\n\n\n/**\n * Defines a module in Closure.\n *\n * Marks that this file must be loaded as a module and claims the namespace.\n *\n * A namespace may only be defined once in a codebase. It may be defined using\n * goog.provide() or goog.module().\n *\n * goog.module() has three requirements:\n * - goog.module may not be used in the same file as goog.provide.\n * - goog.module must be the first statement in the file.\n * - only one goog.module is allowed per file.\n *\n * When a goog.module annotated file is loaded, it is enclosed in\n * a strict function closure. This means that:\n * - any variables declared in a goog.module file are private to the file\n * (not global), though the compiler is expected to inline the module.\n * - The code must obey all the rules of \"strict\" JavaScript.\n * - the file will be marked as \"use strict\"\n *\n * NOTE: unlike goog.provide, goog.module does not declare any symbols by\n * itself. If declared symbols are desired, use\n * goog.module.declareLegacyNamespace().\n *\n * MOE:begin_intracomment_strip\n * See the goog.module announcement at http://go/goog.module-announce\n * MOE:end_intracomment_strip\n *\n * See the public goog.module proposal: http://goo.gl/Va1hin\n *\n * @param {string} name Namespace provided by this file in the form\n *     \"goog.package.part\", is expected but not required.\n * @return {void}\n */\ngoog.module = function(name) {\n  if (COMPILED) {\n    // In the optimized code, goog.module calls are complete removed but\n    // due to b/389129315 the function itself is retained.\n    return;\n  }\n  if (typeof name !== 'string' || !name ||\n      name.search(goog.VALID_MODULE_RE_) == -1) {\n    throw new Error('Invalid module identifier');\n  }\n  if (!goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'Module ' + name + ' has been loaded incorrectly. Note, ' +\n        'modules cannot be loaded as normal scripts. They require some kind of ' +\n        'pre-processing step. You\\'re likely trying to load a module via a ' +\n        'script tag or as a part of a concatenated bundle without rewriting the ' +\n        'module. For more info see: ' +\n        'https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.');\n  }\n  if (goog.moduleLoaderState_.moduleName) {\n    throw new Error('goog.module may only be called once per module.');\n  }\n\n  // Store the module name for the loader.\n  goog.moduleLoaderState_.moduleName = name;\n  // Ensure that the same namespace isn't provided twice.\n  // A goog.module/goog.provide maps a goog.require to a specific file\n  if (goog.isProvided_(name)) {\n    throw new Error('Namespace \"' + name + '\" already declared.');\n  }\n  delete goog.implicitNamespaces_[name];\n};\n\n\n/**\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n *\n * Note: This is not an alternative to goog.require, it does not\n * indicate a hard dependency, instead it is used to indicate\n * an optional dependency or to access the exports of a module\n * that has already been loaded.\n * @suppress {missingProvide}\n */\ngoog.module.get = function(name) {\n  return COMPILED ? null : goog.module.getInternal_(name);\n};\n\n\n/**\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n * @private\n */\ngoog.module.getInternal_ = function(name) {\n  if (!COMPILED) {\n    if (name in goog.loadedModules_) {\n      return goog.loadedModules_[name].exports;\n    } else if (!goog.implicitNamespaces_[name]) {\n      var ns = goog.getObjectByName(name, goog.LEGACY_NAMESPACE_OBJECT_);\n      return ns != null ? ns : null;\n    }\n  }\n  return null;\n};\n\n// MOE:begin_strip\n/**\n * Defines dynamic import execution path for uncompiled mode.\n *\n * @param {string} name The module identifier.\n * @return {?} The module exports for an already loaded module or null.\n *\n * NOTE: In compiled code, JsCompiler will transpile this function call.\n * DO NOT OPENSOURCE\n */\ngoog.requireDynamic = function(name) {\n  if (!COMPILED) {\n    if (!goog.importHandler_ || !goog.uncompiledChunkIdHandler_) {\n      throw new Error('Need to setup import handler and chunk id handler.');\n    }\n    return goog.importHandler_(goog.uncompiledChunkIdHandler_(name))\n        .then(function() {\n          var module = goog.module.getInternal_(name);\n          if (module == null) {\n            throw new Error('Module ' + name + ' is not loaded.');\n          }\n          return module;\n        });\n  }\n  return null;\n};\n\n\n/**\n * Handler for dynamic import.\n * DO NOT OPENSOURCE\n */\ngoog.importHandler_ = null;\n\n\n/**\n * Chunk ID calculator.\n * @private {?function(string)}\n * DO NOT OPENSOURCE\n */\ngoog.uncompiledChunkIdHandler_ = null;\n\n\n/**\n * Sets import handler.\n * @param {function(string)} fn\n * DO NOT OPENSOURCE\n */\ngoog.setImportHandlerInternalDoNotCallOrElse = function(fn) {\n  goog.importHandler_ = fn;\n};\n\n\n/**\n * Sets chunk ID calculator.\n * @param {function(string)} fn\n * NOTE: The chunk ID calculator is only used in uncompiled mode.\n * DO NOT OPENSOURCE\n */\ngoog.setUncompiledChunkIdHandlerInternalDoNotCallOrElse = function(fn) {\n  goog.uncompiledChunkIdHandler_ = fn;\n};\n\n\n/**\n * This exists purely as a hint to JsTrimmer, so that it can convert it to\n * goog.require in certain circumstances.\n *\n * @param {string} namespace\n * DO NOT OPENSOURCE\n */\ngoog.maybeRequireFrameworkInternalOnlyDoNotCallOrElse = function(namespace) {};\n// MOE:end_strip\n\n/**\n * Types of modules the debug loader can load.\n * @enum {string}\n */\ngoog.ModuleType = {\n  ES6: 'es6',\n  GOOG: 'goog'\n};\n\n\n/**\n * @private {?{\n *   moduleName: (string|undefined),\n *   declareLegacyNamespace:boolean,\n *   preventModuleExportSealing:boolean,\n *   type: ?goog.ModuleType\n * }}\n */\ngoog.moduleLoaderState_ = null;\n\n\n/**\n * @private\n * @return {boolean} Whether a goog.module or an es6 module is currently being\n *     initialized.\n */\ngoog.isInModuleLoader_ = function() {\n  return goog.isInGoogModuleLoader_() || goog.isInEs6ModuleLoader_();\n};\n\n\n/**\n * @private\n * @return {boolean} Whether a goog.module is currently being initialized.\n */\ngoog.isInGoogModuleLoader_ = function() {\n  return !!goog.moduleLoaderState_ &&\n      goog.moduleLoaderState_.type == goog.ModuleType.GOOG;\n};\n\n\n/**\n * @private\n * @return {boolean} Whether an es6 module is currently being initialized.\n */\ngoog.isInEs6ModuleLoader_ = function() {\n  var inLoader = !!goog.moduleLoaderState_ &&\n      goog.moduleLoaderState_.type == goog.ModuleType.ES6;\n\n  if (inLoader) {\n    return true;\n  }\n\n  var jscomp = goog.LEGACY_NAMESPACE_OBJECT_['$jscomp'];\n\n  if (jscomp) {\n    // jscomp may not have getCurrentModulePath if this is a compiled bundle\n    // that has some of the runtime, but not all of it. This can happen if\n    // optimizations are turned on so the unused runtime is removed but renaming\n    // and Closure pass are off (so $jscomp is still named $jscomp and the\n    // goog.provide/require calls still exist).\n    if (typeof jscomp.getCurrentModulePath != 'function') {\n      return false;\n    }\n\n    // Bundled ES6 module.\n    return !!jscomp.getCurrentModulePath();\n  }\n\n  return false;\n};\n\n\n/**\n * Provide the module's exports as a globally accessible object under the\n * module's declared name.  This is intended to ease migration to goog.module\n * for files that have existing usages.\n * @suppress {missingProvide}\n */\ngoog.module.declareLegacyNamespace = function() {\n  if (!COMPILED && !goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'goog.module.declareLegacyNamespace must be called from ' +\n        'within a goog.module');\n  }\n  if (!COMPILED && !goog.moduleLoaderState_.moduleName) {\n    throw new Error(\n        'goog.module must be called prior to ' +\n        'goog.module.declareLegacyNamespace.');\n  }\n  goog.moduleLoaderState_.declareLegacyNamespace = true;\n};\n\n\n/**\n * Ensures that a module's exports object is not sealed after the module is\n * evaluated.\n * @suppress {missingProvide}\n */\ngoog.module.preventModuleExportSealing = function() {\n  if (!COMPILED && !goog.isInGoogModuleLoader_()) {\n    throw new Error(\n        'goog.module.preventModuleExportSealing must be called from ' +\n        'within a goog.module');\n  }\n  if (!COMPILED && !goog.moduleLoaderState_.moduleName) {\n    throw new Error(\n        'goog.module must be called prior to ' +\n        'goog.module.preventModuleExportSealing.');\n  }\n  goog.moduleLoaderState_.preventModuleExportSealing = true;\n};\n\n\n/**\n * Associates an ES6 module with a Closure module ID so that is available via\n * goog.require. The associated ID  acts like a goog.module ID - it does not\n * create any global names, it is merely available via goog.require /\n * goog.module.get / goog.forwardDeclare / goog.requireType. goog.require and\n * goog.module.get will return the entire module as if it was import *'d. This\n * allows Closure files to reference ES6 modules for the sake of migration.\n *\n * @param {string} namespace\n * @suppress {missingProvide}\n */\ngoog.declareModuleId = function(namespace) {\n  if (!COMPILED) {\n    if (!goog.isInEs6ModuleLoader_()) {\n      throw new Error(\n          'goog.declareModuleId may only be called from ' +\n          'within an ES6 module');\n    }\n    if (goog.moduleLoaderState_ && goog.moduleLoaderState_.moduleName) {\n      throw new Error(\n          'goog.declareModuleId may only be called once per module.');\n    }\n    if (namespace in goog.loadedModules_) {\n      throw new Error(\n          'Module with namespace \"' + namespace + '\" already exists.');\n    }\n  }\n  if (goog.moduleLoaderState_) {\n    // Not bundled - debug loading.\n    goog.moduleLoaderState_.moduleName = namespace;\n  } else {\n    // Bundled - not debug loading, no module loader state.\n    var jscomp = goog.LEGACY_NAMESPACE_OBJECT_['$jscomp'];\n    if (!jscomp || typeof jscomp.getCurrentModulePath != 'function') {\n      throw new Error(\n          'Module with namespace \"' + namespace +\n          '\" has been loaded incorrectly.');\n    }\n    var exports = jscomp.require(jscomp.getCurrentModulePath());\n    goog.loadedModules_[namespace] = {\n      exports: exports,\n      type: goog.ModuleType.ES6,\n      moduleId: namespace\n    };\n  }\n};\n\n\n/**\n * Marks that the current file should only be used for testing, and never for\n * live code in production.\n *\n * In the case of unit tests, the message may optionally be an exact namespace\n * for the test (e.g. 'goog.stringTest'). The linter will then ignore the extra\n * provide (if not explicitly defined in the code).\n *\n * @param {string=} opt_message Optional message to add to the error that's\n *     raised when used in production code.\n */\ngoog.setTestOnly = function(opt_message) {\n  if (goog.DISALLOW_TEST_ONLY_CODE) {\n    opt_message = opt_message || '';\n    throw new Error(\n        'Importing test-only code into non-debug environment' +\n        (opt_message ? ': ' + opt_message : '.'));\n  }\n};\n\n\n/**\n * Forward declares a symbol. This is an indication to the compiler that the\n * symbol may be used in the source yet is not required and may not be provided\n * in compilation.\n *\n * The most common usage of forward declaration is code that takes a type as a\n * function parameter but does not need to require it. By forward declaring\n * instead of requiring, no hard dependency is made, and (if not required\n * elsewhere) the namespace may never be required and thus, not be pulled\n * into the JavaScript binary. If it is required elsewhere, it will be type\n * checked as normal.\n *\n * Before using goog.forwardDeclare, please read the documentation at\n * https://github.com/google/closure-compiler/wiki/Bad-Type-Annotation to\n * understand the options and tradeoffs when working with forward declarations.\n *\n * @param {string} name The namespace to forward declare in the form of\n *     \"goog.package.part\".\n * @deprecated See go/noforwarddeclaration, Use `goog.requireType` instead.\n */\ngoog.forwardDeclare = function(name) {};\n\nif (!COMPILED) {\n  /**\n   * Check if the given name has been goog.provided. This will return false for\n   * names that are available only as implicit namespaces.\n   * @param {string} name name of the object to look for.\n   * @return {boolean} Whether the name has been provided.\n   * @private\n   */\n  goog.isProvided_ = function(name) {\n    return (name in goog.loadedModules_) ||\n        (!goog.implicitNamespaces_[name] &&\n         goog.getObjectByName(name, goog.LEGACY_NAMESPACE_OBJECT_) != null);\n  };\n\n  /**\n   * Namespaces implicitly defined by goog.provide. For example,\n   * goog.provide('goog.events.Event') implicitly declares that 'goog' and\n   * 'goog.events' must be namespaces.\n   *\n   * @type {!Object<string, (boolean|undefined)>}\n   * @private\n   */\n  goog.implicitNamespaces_ = {'goog.module': true};\n\n  // NOTE: We add goog.module as an implicit namespace as goog.module is defined\n  // here and because the existing module package has not been moved yet out of\n  // the goog.module namespace. This satisfies both the debug loader and\n  // ahead-of-time dependency management.\n}\n\n\n/**\n * Returns an object based on its fully qualified external name.  The object\n * is not found if null or undefined.  If you are using a compilation pass that\n * renames property names beware that using this function will not find renamed\n * properties.\n *\n * @param {string} name The fully qualified name.\n * @param {Object=} opt_obj The object within which to look; default is\n *     |goog.global|.\n * @return {?} The value (object or primitive) or, if not found, null.\n */\ngoog.getObjectByName = function(name, opt_obj) {\n  var parts = name.split('.');\n  var cur = opt_obj || goog.global;\n  for (var i = 0; i < parts.length; i++) {\n    cur = cur[parts[i]];\n    if (cur == null) {\n      return null;\n    }\n  }\n  return cur;\n};\n\n\n/**\n * Adds a dependency from a file to the files it requires.\n * @param {string} relPath The path to the js file.\n * @param {!Array<string>} provides An array of strings with\n *     the names of the objects this file provides.\n * @param {!Array<string>} requires An array of strings with\n *     the names of the objects this file requires.\n * @param {boolean|!Object<string>=} opt_loadFlags Parameters indicating\n *     how the file must be loaded.  The boolean 'true' is equivalent\n *     to {'module': 'goog'} for backwards-compatibility.  Valid properties\n *     and values include {'module': 'goog'} and {'lang': 'es6'}.\n */\ngoog.addDependency = function(relPath, provides, requires, opt_loadFlags) {\n  if (!COMPILED && goog.DEPENDENCIES_ENABLED) {\n    goog.debugLoader_.addDependency(relPath, provides, requires, opt_loadFlags);\n  }\n};\n\n\n// NOTE(nnaze): The debug DOM loader was included in base.js as an original way\n// to do \"debug-mode\" development.  The dependency system can sometimes be\n// confusing, as can the debug DOM loader's asynchronous nature.\n//\n// With the DOM loader, a call to goog.require() is not blocking -- the script\n// will not load until some point after the current script.  If a namespace is\n// needed at runtime, it needs to be defined in a previous script, or loaded via\n// require() with its registered dependencies.\n//\n// User-defined namespaces may need their own deps file. For a reference on\n// creating a deps file, see:\n// MOE:begin_strip\n// Internally: http://go/deps-files and http://go/be#js_deps\n// MOE:end_strip\n// Externally: https://developers.google.com/closure/library/docs/depswriter\n//\n// Because of legacy clients, the DOM loader can't be easily removed from\n// base.js.  Work was done to make it disableable or replaceable for\n// different environments (DOM-less JavaScript interpreters like Rhino or V8,\n// for example). See bootstrap/ for more information.\n\n\n/**\n * @define {boolean} Whether to enable the debug loader.\n *\n * If enabled, a call to goog.require() will attempt to load the namespace by\n * appending a script tag to the DOM (if the namespace has been registered).\n *\n * If disabled, goog.require() will simply assert that the namespace has been\n * provided (and depend on the fact that some outside tool correctly ordered\n * the script).\n */\ngoog.ENABLE_DEBUG_LOADER = goog.define('goog.ENABLE_DEBUG_LOADER', false);\n\n\n/**\n * @param {string} msg\n * @private\n */\ngoog.logToConsole_ = function(msg) {\n  if (goog.global.console) {\n    goog.global.console['error'](msg);\n  }\n};\n\n\n/**\n * Implements a system for the dynamic resolution of dependencies that works in\n * parallel with the BUILD system.\n *\n * Note that all calls to goog.require will be stripped by the compiler.\n *\n * @see goog.provide\n * @param {string} namespace Namespace (as was given in goog.provide,\n *     goog.module, or goog.declareModuleId) in the form\n *     \"goog.package.part\".\n * @return {?} If called within a goog.module or ES6 module file, the associated\n *     namespace or module otherwise null.\n */\ngoog.require = function(namespace) {\n  if (!COMPILED) {\n    // Might need to lazy load on old IE.\n    if (goog.ENABLE_DEBUG_LOADER) {\n      goog.debugLoader_.requested(namespace);\n    }\n\n    // If the object already exists we do not need to do anything.\n    if (goog.isProvided_(namespace)) {\n      if (goog.isInModuleLoader_()) {\n        return goog.module.getInternal_(namespace);\n      }\n    } else if (goog.ENABLE_DEBUG_LOADER) {\n      var moduleLoaderState = goog.moduleLoaderState_;\n      goog.moduleLoaderState_ = null;\n      try {\n        goog.debugLoader_.load_(namespace);\n      } finally {\n        goog.moduleLoaderState_ = moduleLoaderState;\n      }\n    }\n\n    return null;\n  }\n};\n\n\n/**\n * Requires a symbol for its type information. This is an indication to the\n * compiler that the symbol may appear in type annotations, yet it is not\n * referenced at runtime.\n *\n * When called within a goog.module or ES6 module file, the return value may be\n * assigned to or destructured into a variable, but it may not be otherwise used\n * in code outside of a type annotation.\n *\n * Note that all calls to goog.requireType will be stripped by the compiler.\n *\n * @param {string} namespace Namespace (as was given in goog.provide,\n *     goog.module, or goog.declareModuleId) in the form\n *     \"goog.package.part\".\n * @return {?}\n */\ngoog.requireType = function(namespace) {\n  // Return an empty object so that single-level destructuring of the return\n  // value doesn't crash at runtime when using the debug loader. Multi-level\n  // destructuring isn't supported.\n  return {};\n};\n\n\n/**\n * Path for included scripts.\n * @type {string}\n */\ngoog.basePath = '';\n\n\n/**\n * A hook for overriding the base path.\n * @type {string|undefined}\n */\ngoog.global.CLOSURE_BASE_PATH;\n\n\n/**\n * A function to import a single script. This is meant to be overridden when\n * Closure is being run in non-HTML contexts, such as web workers. It's defined\n * in the global scope so that it can be set before base.js is loaded, which\n * allows deps.js to be imported properly.\n *\n * The first parameter the script source, which is a relative URI. The second,\n * optional parameter is the script contents, in the event the script needed\n * transformation. It should return true if the script was imported, false\n * otherwise.\n * @type {(function(string, string=): boolean)|undefined}\n */\ngoog.global.CLOSURE_IMPORT_SCRIPT;\n\n\n/**\n * When defining a class Foo with an abstract method bar(), you can do:\n * Foo.prototype.bar = goog.abstractMethod\n *\n * Now if a subclass of Foo fails to override bar(), an error will be thrown\n * when bar() is invoked.\n *\n * @type {!Function}\n * @throws {Error} when invoked to indicate the method should be overridden.\n * @deprecated Use \"@abstract\" annotation instead of goog.abstractMethod in new\n *     code. See\n *     https://github.com/google/closure-compiler/wiki/@abstract-classes-and-methods\n */\ngoog.abstractMethod = function() {\n  throw new Error('unimplemented abstract method');\n};\n\n\n/**\n * Adds a `getInstance` static method that always returns the same\n * instance object.\n * @param {!Function} ctor The constructor for the class to add the static\n *     method to.\n * @suppress {missingProperties} 'instance_' isn't a property on 'Function'\n *     but we don't have a better type to use here.\n */\ngoog.addSingletonGetter = function(ctor) {\n  // instance_ is immediately set to prevent issues with sealed constructors\n  // such as are encountered when a constructor is returned as the export object\n  // of a goog.module in unoptimized code.\n  // Declare type to avoid conformance violations that ctor.instance_ is unknown\n  /** @type {undefined|!Object} @suppress {underscore} */\n  ctor.instance_ = undefined;\n  ctor.getInstance = function() {\n    if (ctor.instance_) {\n      return ctor.instance_;\n    }\n    if (goog.DEBUG) {\n      // NOTE: JSCompiler can't optimize away Array#push.\n      goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor;\n    }\n    // Cast to avoid conformance violations that ctor.instance_ is unknown\n    return /** @type {!Object|undefined} */ (ctor.instance_) = new ctor;\n  };\n};\n\n\n/**\n * All singleton classes that have been instantiated, for testing. Don't read\n * it directly, use the `goog.testing.singleton` module. The compiler\n * removes this variable if unused.\n * @type {!Array<!Function>}\n * @private\n */\ngoog.instantiatedSingletons_ = [];\n\n\n/**\n * @define {boolean} Whether to load goog.modules using `eval` when using\n * the debug loader.  This provides a better debugging experience as the\n * source is unmodified and can be edited using Chrome Workspaces or similar.\n * However in some environments the use of `eval` is banned\n * so we provide an alternative.\n */\ngoog.LOAD_MODULE_USING_EVAL = goog.define('goog.LOAD_MODULE_USING_EVAL', true);\n\n\n/**\n * @define {boolean} Whether the exports of goog.modules should be sealed when\n * possible.\n */\ngoog.SEAL_MODULE_EXPORTS = goog.define('goog.SEAL_MODULE_EXPORTS', goog.DEBUG);\n\n\n/**\n * The registry of initialized modules:\n * The module identifier or path to module exports map.\n * @private @const {!Object<string, {exports:?,type:string,moduleId:string}>}\n */\ngoog.loadedModules_ = {};\n\n\n/**\n * True if the debug loader enabled and used.\n * @const {boolean}\n */\ngoog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;\n\n\n\n/**\n * @define {boolean} If true assume that ES modules have already been\n * transpiled by the jscompiler (in the same way that transpile.js would\n * transpile them - to jscomp modules). Useful only for servers that wish to use\n * the debug loader and transpile server side. Thus this is only respected if\n * goog.TRANSPILE is \"never\".\n */\ngoog.ASSUME_ES_MODULES_TRANSPILED =\n    goog.define('goog.ASSUME_ES_MODULES_TRANSPILED', false);\n\n\n/**\n * @define {string} Trusted Types policy name. If non-empty then Closure will\n * use Trusted Types.\n */\ngoog.TRUSTED_TYPES_POLICY_NAME =\n    goog.define('goog.TRUSTED_TYPES_POLICY_NAME', 'goog');\n\n\n/**\n * @param {function(?):?|string} moduleDef The module definition.\n */\ngoog.loadModule = function(moduleDef) {\n  // NOTE: we allow function definitions to be either in the from\n  // of a string to eval (which keeps the original source intact) or\n  // in a eval forbidden environment (CSP) we allow a function definition\n  // which in its body must call `goog.module`, and return the exports\n  // of the module.\n  var previousState = goog.moduleLoaderState_;\n  try {\n    goog.moduleLoaderState_ = {\n      moduleName: '',\n      declareLegacyNamespace: false,\n      preventModuleExportSealing: false,\n      type: goog.ModuleType.GOOG\n    };\n    var origExports = {};\n    var exports = origExports;\n    if (typeof moduleDef === 'function') {\n      exports = moduleDef.call(undefined, exports);\n    } else if (typeof moduleDef === 'string') {\n      exports = goog.loadModuleFromSource_.call(undefined, exports, moduleDef);\n    } else {\n      throw new Error('Invalid module definition');\n    }\n\n    var moduleName = goog.moduleLoaderState_.moduleName;\n    if (typeof moduleName === 'string' && moduleName) {\n      // Don't seal legacy namespaces as they may be used as a parent of\n      // another namespace\n      if (goog.moduleLoaderState_.declareLegacyNamespace) {\n        // Whether exports was overwritten via default export assignment.\n        // This is important for legacy namespaces as it dictates whether\n        // previously a previously loaded implicit namespace should be clobbered\n        // or not.\n        var isDefaultExport = origExports !== exports;\n        goog.constructNamespace_(moduleName, exports, isDefaultExport);\n      } else if (\n          goog.SEAL_MODULE_EXPORTS && Object.seal &&\n          typeof exports == 'object' && exports != null &&\n          !goog.moduleLoaderState_.preventModuleExportSealing) {\n        Object.seal(exports);\n      }\n\n      var data = {\n        exports: exports,\n        type: goog.ModuleType.GOOG,\n        moduleId: goog.moduleLoaderState_.moduleName\n      };\n      goog.loadedModules_[moduleName] = data;\n    } else {\n      throw new Error('Invalid module name \\\"' + moduleName + '\\\"');\n    }\n  } finally {\n    goog.moduleLoaderState_ = previousState;\n  }\n};\n\n\n/**\n * @private @const\n */\ngoog.loadModuleFromSource_ =\n    /** @type {function(!Object, string):?} */ (function(exports) {\n      // NOTE: we avoid declaring parameters or local variables here to avoid\n      // masking globals or leaking values into the module definition.\n      'use strict';\n      eval(goog.CLOSURE_EVAL_PREFILTER_.createScript(arguments[1]));\n      return exports;\n    });\n\n\n/**\n * Normalize a file path by removing redundant \"..\" and extraneous \".\" file\n * path components.\n * @param {string} path\n * @return {string}\n * @private\n */\ngoog.normalizePath_ = function(path) {\n  var components = path.split('/');\n  var i = 0;\n  while (i < components.length) {\n    if (components[i] == '.') {\n      components.splice(i, 1);\n    } else if (\n        i && components[i] == '..' && components[i - 1] &&\n        components[i - 1] != '..') {\n      components.splice(--i, 2);\n    } else {\n      i++;\n    }\n  }\n  return components.join('/');\n};\n\n\n/**\n * Provides a hook for loading a file when using Closure's goog.require() API\n * with goog.modules.  In particular this hook is provided to support Node.js.\n *\n * @type {(function(string):string)|undefined}\n */\ngoog.global.CLOSURE_LOAD_FILE_SYNC;\n\n\n/**\n * Loads file by synchronous XHR. Should not be used in production environments.\n * @param {string} src Source URL.\n * @return {?string} File contents, or null if load failed.\n * @private\n */\ngoog.loadFileSync_ = function(src) {\n  if (goog.global.CLOSURE_LOAD_FILE_SYNC) {\n    return goog.global.CLOSURE_LOAD_FILE_SYNC(src);\n  } else {\n    try {\n      /** @type {XMLHttpRequest} */\n      var xhr = new goog.global['XMLHttpRequest']();\n      xhr.open('get', src, false);\n      xhr.send();\n      // NOTE: Successful http: requests have a status of 200, but successful\n      // file: requests may have a status of zero.  Any other status, or a\n      // thrown exception (particularly in case of file: requests) indicates\n      // some sort of error, which we treat as a missing or unavailable file.\n      return xhr.status == 0 || xhr.status == 200 ? xhr.responseText : null;\n    } catch (err) {\n      // No need to rethrow or log, since errors should show up on their own.\n      return null;\n    }\n  }\n};\n\n//==============================================================================\n// Language Enhancements\n//==============================================================================\n\n\n/**\n * This is a \"fixed\" version of the typeof operator.  It differs from the typeof\n * operator in such a way that null returns 'null' and arrays return 'array'.\n * @param {?} value The value to get the type of.\n * @return {string} The name of the type.\n */\ngoog.typeOf = function(value) {\n  var s = typeof value;\n\n  if (s != 'object') {\n    return s;\n  }\n\n  if (!value) {\n    return 'null';\n  }\n\n  if (Array.isArray(value)) {\n    return 'array';\n  }\n  return s;\n};\n\n\n/**\n * Returns true if the object looks like an array. To qualify as array like\n * the value needs to be either a NodeList or an object with a Number length\n * property. Note that for this function neither strings nor functions are\n * considered \"array-like\".\n *\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is an array.\n */\ngoog.isArrayLike = function(val) {\n  var type = goog.typeOf(val);\n  // We do not use goog.isObject here in order to exclude function values.\n  return type == 'array' || type == 'object' && typeof val.length == 'number';\n};\n\n\n/**\n * Returns true if the object looks like a Date. To qualify as Date-like the\n * value needs to be an object and have a getFullYear() function.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is a like a Date.\n */\ngoog.isDateLike = function(val) {\n  return goog.isObject(val) && typeof val.getFullYear == 'function';\n};\n\n\n/**\n * Returns true if the specified value is an object.  This includes arrays and\n * functions.\n * @param {?} val Variable to test.\n * @return {boolean} Whether variable is an object.\n */\ngoog.isObject = function(val) {\n  var type = typeof val;\n  return type == 'object' && val != null || type == 'function';\n  // return Object(val) === val also works, but is slower, especially if val is\n  // not an object.\n};\n\n\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. The unique ID is\n * guaranteed to be unique across the current session amongst objects that are\n * passed into `getUid`. There is no guarantee that the ID is unique or\n * consistent across sessions. It is unsafe to generate unique ID for function\n * prototypes.\n *\n * @param {Object} obj The object to get the unique ID for.\n * @return {number} The unique ID for the object.\n */\ngoog.getUid = function(obj) {\n  // TODO(arv): Make the type stricter, do not accept null.\n  return Object.prototype.hasOwnProperty.call(obj, goog.UID_PROPERTY_) &&\n      obj[goog.UID_PROPERTY_] ||\n      (obj[goog.UID_PROPERTY_] = ++goog.uidCounter_);\n};\n\n\n/**\n * Whether the given object is already assigned a unique ID.\n *\n * This does not modify the object.\n *\n * @param {!Object} obj The object to check.\n * @return {boolean} Whether there is an assigned unique id for the object.\n */\ngoog.hasUid = function(obj) {\n  return !!obj[goog.UID_PROPERTY_];\n};\n\n\n/**\n * Removes the unique ID from an object. This is useful if the object was\n * previously mutated using `goog.getUid` in which case the mutation is\n * undone.\n * @param {Object} obj The object to remove the unique ID field from.\n */\ngoog.removeUid = function(obj) {\n  // TODO(arv): Make the type stricter, do not accept null.\n\n  // In IE, DOM nodes are not instances of Object and throw an exception if we\n  // try to delete.  Instead we try to use removeAttribute.\n  if (obj !== null && 'removeAttribute' in obj) {\n    obj.removeAttribute(goog.UID_PROPERTY_);\n  }\n\n  try {\n    delete obj[goog.UID_PROPERTY_];\n  } catch (ex) {\n  }\n};\n\n\n/**\n * Name for unique ID property. Initialized in a way to help avoid collisions\n * with other closure JavaScript on the same page.\n * @type {string}\n * @private\n */\ngoog.UID_PROPERTY_ = 'closure_uid_' + ((Math.random() * 1e9) >>> 0);\n\n\n/**\n * Counter for UID.\n * @type {number}\n * @private\n */\ngoog.uidCounter_ = 0;\n\n\n/**\n * Clones a value. The input may be an Object, Array, or basic type. Objects and\n * arrays will be cloned recursively.\n *\n * WARNINGS:\n * <code>goog.cloneObject</code> does not detect reference loops. Objects that\n * refer to themselves will cause infinite recursion.\n *\n * <code>goog.cloneObject</code> is unaware of unique identifiers, and copies\n * UIDs created by <code>getUid</code> into cloned results.\n *\n * @param {*} obj The value to clone.\n * @return {*} A clone of the input value.\n * @deprecated goog.cloneObject is unsafe. Prefer the goog.object methods.\n */\ngoog.cloneObject = function(obj) {\n  var type = goog.typeOf(obj);\n  if (type == 'object' || type == 'array') {\n    if (typeof obj.clone === 'function') {\n      return obj.clone();\n    }\n    if (typeof Map !== 'undefined' && obj instanceof Map) {\n      return new Map(obj);\n    } else if (typeof Set !== 'undefined' && obj instanceof Set) {\n      return new Set(obj);\n    }\n    var clone = type == 'array' ? [] : {};\n    for (var key in obj) {\n      clone[key] = goog.cloneObject(obj[key]);\n    }\n    return clone;\n  }\n\n  return obj;\n};\n\n\n/**\n * A native implementation of goog.bind.\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @private\n */\ngoog.bindNative_ = function(fn, selfObj, var_args) {\n  return /** @type {!Function} */ (fn.call.apply(fn.bind, arguments));\n};\n\n\n/**\n * A pure-JS implementation of goog.bind.\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @private\n */\ngoog.bindJs_ = function(fn, selfObj, var_args) {\n  if (!fn) {\n    throw new Error();\n  }\n\n  if (arguments.length > 2) {\n    var boundArgs = Array.prototype.slice.call(arguments, 2);\n    return function() {\n      // Prepend the bound arguments to the current arguments.\n      var newArgs = Array.prototype.slice.call(arguments);\n      Array.prototype.unshift.apply(newArgs, boundArgs);\n      return fn.apply(selfObj, newArgs);\n    };\n\n  } else {\n    return function() {\n      return fn.apply(selfObj, arguments);\n    };\n  }\n};\n\n\n/**\n * Partially applies this function to a particular 'this object' and zero or\n * more arguments. The result is a new function with some arguments of the first\n * function pre-filled and the value of this 'pre-specified'.\n *\n * Remaining arguments specified at call-time are appended to the pre-specified\n * ones.\n *\n * Also see: {@link #partial}.\n *\n * Usage:\n * <pre>var barMethBound = goog.bind(myFunction, myObj, 'arg1', 'arg2');\n * barMethBound('arg3', 'arg4');</pre>\n *\n * @param {?function(this:T, ...)} fn A function to partially apply.\n * @param {T} selfObj Specifies the object which this should point to when the\n *     function is run.\n * @param {...*} var_args Additional arguments that are partially applied to the\n *     function.\n * @return {!Function} A partially-applied form of the function goog.bind() was\n *     invoked as a method of.\n * @template T\n * @suppress {deprecated} See above.\n * @deprecated use `=> {}` or Function.prototype.bind instead.\n */\ngoog.bind = function(fn, selfObj, var_args) {\n  // TODO(nicksantos): narrow the type signature.\n  if ((goog.TRUSTED_SITE && goog.FEATURESET_YEAR > 2012) ||\n      (Function.prototype.bind &&\n       // NOTE(nicksantos): Somebody pulled base.js into the default Chrome\n       // extension environment. This means that for Chrome extensions, they get\n       // the implementation of Function.prototype.bind that calls goog.bind\n       // instead of the native one. Even worse, we don't want to introduce a\n       // circular dependency between goog.bind and Function.prototype.bind, so\n       // we have to hack this to make sure it works correctly.\n       Function.prototype.bind.toString().indexOf('native code') != -1)) {\n    goog.bind = goog.bindNative_;\n  } else {\n    goog.bind = goog.bindJs_;\n  }\n  return goog.bind.apply(null, arguments);\n};\n\n\n/**\n * Like goog.bind(), except that a 'this object' is not required. Useful when\n * the target function is already bound.\n *\n * Usage:\n * var g = goog.partial(f, arg1, arg2);\n * g(arg3, arg4);\n *\n * @param {Function} fn A function to partially apply.\n * @param {...*} var_args Additional arguments that are partially applied to fn.\n * @return {!Function} A partially-applied form of the function goog.partial()\n *     was invoked as a method of.\n */\ngoog.partial = function(fn, var_args) {\n  var args = Array.prototype.slice.call(arguments, 1);\n  return function() {\n    // Clone the array (with slice()) and append additional arguments\n    // to the existing arguments.\n    var newArgs = args.slice();\n    newArgs.push.apply(newArgs, arguments);\n    return fn.apply(/** @type {?} */ (this), newArgs);\n  };\n};\n\n\n/**\n * @return {number} An integer value representing the number of milliseconds\n *     between midnight, January 1, 1970 and the current time.\n * @deprecated Use Date.now\n */\ngoog.now = function() {\n  return Date.now();\n};\n\n\n/**\n * Evals JavaScript in the global scope.\n *\n * Throws an exception if eval is not defined.\n * @param {string|!TrustedScript} script JavaScript string.\n */\ngoog.globalEval = function(script) {\n  (0, eval)(script);\n};\n\n\n/**\n * Optional map of CSS class names to obfuscated names used with\n * goog.getCssName().\n * @private {!Object<string, string>|undefined}\n * @see goog.setCssNameMapping\n */\ngoog.cssNameMapping_;\n\n\n/**\n * Optional obfuscation style for CSS class names. Should be set to either\n * 'BY_WHOLE' or 'BY_PART' if defined.\n * @type {string|undefined}\n * @private\n * @see goog.setCssNameMapping\n */\ngoog.cssNameMappingStyle_;\n\n\n\n/**\n * A hook for modifying the default behavior goog.getCssName. The function\n * if present, will receive the standard output of the goog.getCssName as\n * its input.\n *\n * @type {(function(string):string)|undefined}\n */\ngoog.global.CLOSURE_CSS_NAME_MAP_FN;\n\n\n/**\n * Handles strings that are intended to be used as CSS class names.\n *\n * This function works in tandem with @see goog.setCssNameMapping.\n *\n * Without any mapping set, the arguments are simple joined with a hyphen and\n * passed through unaltered.\n *\n * When there is a mapping, there are two possible styles in which these\n * mappings are used. In the BY_PART style, each part (i.e. in between hyphens)\n * of the passed in css name is rewritten according to the map. In the BY_WHOLE\n * style, the full css name is looked up in the map directly. If a rewrite is\n * not specified by the map, the compiler will output a warning.\n *\n * When the mapping is passed to the compiler, it will replace calls to\n * goog.getCssName with the strings from the mapping, e.g.\n *     var x = goog.getCssName('foo');\n *     var y = goog.getCssName(this.baseClass, 'active');\n *  becomes:\n *     var x = 'foo';\n *     var y = this.baseClass + '-active';\n *\n * If one argument is passed it will be processed, if two are passed only the\n * modifier will be processed, as it is assumed the first argument was generated\n * as a result of calling goog.getCssName.\n *\n * @param {string} className The class name.\n * @param {string=} opt_modifier A modifier to be appended to the class name.\n * @return {string} The class name or the concatenation of the class name and\n *     the modifier.\n */\ngoog.getCssName = function(className, opt_modifier) {\n  // String() is used for compatibility with compiled soy where the passed\n  // className can be non-string objects.\n  if (String(className).charAt(0) == '.') {\n    throw new Error(\n        'className passed in goog.getCssName must not start with \".\".' +\n        ' You passed: ' + className);\n  }\n\n  var getMapping = function(cssName) {\n    return goog.cssNameMapping_[cssName] || cssName;\n  };\n\n  var renameByParts = function(cssName) {\n    // Remap all the parts individually.\n    var parts = cssName.split('-');\n    var mapped = [];\n    for (var i = 0; i < parts.length; i++) {\n      mapped.push(getMapping(parts[i]));\n    }\n    return mapped.join('-');\n  };\n\n  var rename;\n  if (goog.cssNameMapping_) {\n    rename =\n        goog.cssNameMappingStyle_ == 'BY_WHOLE' ? getMapping : renameByParts;\n  } else {\n    rename = function(a) {\n      return a;\n    };\n  }\n\n  var result =\n      opt_modifier ? className + '-' + rename(opt_modifier) : rename(className);\n\n  // The special CLOSURE_CSS_NAME_MAP_FN allows users to specify further\n  // processing of the class name.\n  if (goog.global.CLOSURE_CSS_NAME_MAP_FN) {\n    return goog.global.CLOSURE_CSS_NAME_MAP_FN(result);\n  }\n\n  return result;\n};\n\n\n/**\n * Sets the map to check when returning a value from goog.getCssName(). Example:\n * <pre>\n * goog.setCssNameMapping({\n *   \"goog\": \"a\",\n *   \"disabled\": \"b\",\n * });\n *\n * var x = goog.getCssName('goog');\n * // The following evaluates to: \"a a-b\".\n * goog.getCssName('goog') + ' ' + goog.getCssName(x, 'disabled')\n * </pre>\n * When declared as a map of string literals to string literals, the JSCompiler\n * will replace all calls to goog.getCssName() using the supplied map if the\n * --process_closure_primitives flag is set.\n *\n * @param {!Object} mapping A map of strings to strings where keys are possible\n *     arguments to goog.getCssName() and values are the corresponding values\n *     that should be returned.\n * @param {string=} opt_style The style of css name mapping. There are two valid\n *     options: 'BY_PART', and 'BY_WHOLE'.\n * @see goog.getCssName for a description.\n */\ngoog.setCssNameMapping = function(mapping, opt_style) {\n  goog.cssNameMapping_ = mapping;\n  goog.cssNameMappingStyle_ = opt_style;\n};\n\n\n/**\n * To use CSS renaming in compiled mode, one of the input files should have a\n * call to goog.setCssNameMapping() with an object literal that the JSCompiler\n * can extract and use to replace all calls to goog.getCssName(). In uncompiled\n * mode, JavaScript code should be loaded before this base.js file that declares\n * a global variable, CLOSURE_CSS_NAME_MAPPING, which is used below. This is\n * to ensure that the mapping is loaded before any calls to goog.getCssName()\n * are made in uncompiled mode.\n *\n * A hook for overriding the CSS name mapping.\n * @type {!Object<string, string>|undefined}\n */\ngoog.global.CLOSURE_CSS_NAME_MAPPING;\n\n\nif (!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING) {\n  // This does not call goog.setCssNameMapping() because the JSCompiler\n  // requires that goog.setCssNameMapping() be called with an object literal.\n  goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING;\n}\n\n/**\n * Options bag type for `goog.getMsg()` third argument.\n *\n * It is important to note that these options need to be known at compile time,\n * so they must always be provided to `goog.getMsg()` as an actual object\n * literal in the function call. Otherwise, closure-compiler will report an\n * error.\n * @record\n */\ngoog.GetMsgOptions = function() {};\n\n/**\n * If `true`, escape '<' in the message string to '&lt;'.\n *\n * Used by Closure Templates where the generated code size and performance is\n * critical which is why {@link goog.html.SafeHtmlFormatter} is not used.\n * The value must be literal `true` or `false`.\n * @type {boolean|undefined}\n */\ngoog.GetMsgOptions.prototype.html;\n\n/**\n * If `true`, unescape common html entities: &gt;, &lt;, &apos;, &quot; and\n * &amp;.\n *\n * Used for messages not in HTML context, such as with the `textContent`\n * property.\n * The value must be literal `true` or `false`.\n * @type {boolean|undefined}\n */\ngoog.GetMsgOptions.prototype.unescapeHtmlEntities;\n\n/**\n * Associates placeholder names with strings showing how their values are\n * obtained.\n *\n * This field is intended for use in automatically generated JS code.\n * Human-written code should use meaningful placeholder names instead.\n *\n * closure-compiler uses this as the contents of the `<ph>` tag in the\n * XMB file it generates or defaults to `-` for historical reasons.\n *\n * Must be an object literal.\n * Ignored at runtime.\n * Keys are placeholder names.\n * Values are string literals indicating how the value is obtained.\n * Typically this is a snippet of source code.\n * @type {!Object<string, string>|undefined}\n */\ngoog.GetMsgOptions.prototype.original_code;\n\n/**\n * Associates placeholder names with example values.\n *\n * closure-compiler uses this as the contents of the `<ex>` tag in the\n * XMB file it generates or defaults to `-` for historical reasons.\n *\n * Must be an object literal.\n * Ignored at runtime.\n * Keys are placeholder names.\n * Values are string literals containing example placeholder values.\n * (e.g. \"George McFly\" for a name placeholder)\n * @type {!Object<string, string>|undefined}\n */\ngoog.GetMsgOptions.prototype.example;\n\n/**\n * A hook for providing a custom message retrieval function to\n * augment `goog.getMsg`.\n *\n * If an object is assigned to `CLOSURE_P16N_GET_MSG` in the global scope\n * *before* base.js is loaded, `goog.getMsg` will use the function provided\n * under the key 'goog.getMsg' on this object instead of its default\n * implementation. This allows a \"p16n library\" to take over the message\n * localization process.\n *\n * The provided object is expected to have the following structure:\n * <pre>\n *   {\n *     'goog.getMsg': function(string, !Object<string, string>=,\n * !goog.GetMsgOptions=): string, 'declareIcuTemplate': function(string, string,\n * !Object<string, string>=, !goog.GetMsgOptions=): string\n *   }\n * </pre>\n *\n * Example:\n * <pre>\n *   // In a script loaded *before* base.js:\n *   window.CLOSURE_P16N_GET_MSG = {\n *     'goog.getMsg': function(str, opt_values, opt_options) {\n *       // Custom logic to fetch and format the message from a p16n system.\n *       // 'str' is the original message string.\n *       // 'opt_values' is the placeholder map.\n *       // 'opt_options' are options like html/unescapeHtmlEntities.\n *       return p16nLibrary.getLocalizedMessage(str, opt_values, opt_options);\n *     },\n *     'declareIcuTemplate': function(templateString, name, opt_values,\n * opt_options) {\n *       // Custom logic to declare an ICU template.\n *       return p16nLibrary.declareIcuTemplate(templateString, name, opt_values,\n * opt_options);\n *     }\n *   };\n * </pre>\n *\n *\n * @type {({\n *   'goog.getMsg': (function(string, !Object<string, string>=,\n * !goog.GetMsgOptions=): string), 'declareIcuTemplate': (function(string,\n * string, !Object<string, string>=, !goog.GetMsgOptions=): string)\n * }|undefined)}\n */\ngoog.global.CLOSURE_P16N_GET_MSG;\n\n/**\n * @define {boolean} Whether to use the global CLOSURE_P16N_GET_MSG override for\n * goog.getMsg.\n */\ngoog.USE_GET_MSG_OVERRIDE = goog.define('goog.USE_GET_MSG_OVERRIDE', false);\n\n/**\n * Gets a localized message.\n *\n * This function is a compiler primitive. If you give the compiler a localized\n * message bundle, it will replace the string at compile-time with a localized\n * version, and expand goog.getMsg call to a concatenated string.\n *\n * Messages must be initialized in the form:\n * <code>\n * var MSG_NAME = goog.getMsg('Hello {$placeholder}', {'placeholder': 'world'});\n * </code>\n *\n * This function produces a string which should be treated as plain text. Use\n * {@link goog.html.SafeHtmlFormatter} in conjunction with goog.getMsg to\n * produce SafeHtml.\n *\n * @param {string} str Translatable string, places holders in the form {$foo}.\n * @param {!Object<string, string>=} opt_values Maps place holder name to value.\n * @param {!goog.GetMsgOptions=} opt_options see `goog.GetMsgOptions`\n * @return {string} message with placeholders filled.\n */\ngoog.getMsg = function(str, opt_values, opt_options) {\n  if (goog.USE_GET_MSG_OVERRIDE && !COMPILED) {\n    if (goog.global.CLOSURE_P16N_GET_MSG &&\n        goog.global.CLOSURE_P16N_GET_MSG['goog.getMsg'] != undefined) {\n      str = goog.global.CLOSURE_P16N_GET_MSG['goog.getMsg'](\n          str, opt_values, opt_options);\n    } else {\n      throw new Error('Closure p16n getMsg override is not available.');\n    }\n  }\n  if (opt_options && opt_options.html) {\n    // Note that '&' is not replaced because the translation can contain HTML\n    // entities.\n    str = str.replace(/</g, '&lt;');\n  }\n  if (opt_options && opt_options.unescapeHtmlEntities) {\n    // Note that \"&amp;\" must be the last to avoid \"creating\" new entities.\n    str = str.replace(/&lt;/g, '<')\n              .replace(/&gt;/g, '>')\n              .replace(/&apos;/g, '\\'')\n              .replace(/&quot;/g, '\"')\n              .replace(/&amp;/g, '&');\n  }\n  if (opt_values) {\n    str = str.replace(/\\{\\$([^}]+)}/g, function(match, key) {\n      return (opt_values != null && key in opt_values) ? opt_values[key] :\n                                                         match;\n    });\n  }\n  return str;\n};\n\n\n/**\n * Gets a localized message. If the message does not have a translation, gives a\n * fallback message.\n *\n * This is useful when introducing a new message that has not yet been\n * translated into all languages.\n *\n * This function is a compiler primitive. Must be used in the form:\n * <code>var x = goog.getMsgWithFallback(MSG_A, MSG_B);</code>\n * where MSG_A and MSG_B were initialized with goog.getMsg.\n *\n * @param {string} a The preferred message.\n * @param {string} b The fallback message.\n * @return {string} The best translated message.\n */\ngoog.getMsgWithFallback = function(a, b) {\n  return a;\n};\n\n\n/**\n * Exposes an unobfuscated global namespace path for the given object.\n * Note that fields of the exported object *will* be obfuscated, unless they are\n * exported in turn via this function or goog.exportProperty.\n *\n * Also handy for making public items that are defined in anonymous closures.\n *\n * ex. goog.exportSymbol('public.path.Foo', Foo);\n *\n * ex. goog.exportSymbol('public.path.Foo.staticFunction', Foo.staticFunction);\n *     public.path.Foo.staticFunction();\n *\n * ex. goog.exportSymbol('public.path.Foo.prototype.myMethod',\n *                       Foo.prototype.myMethod);\n *     new public.path.Foo().myMethod();\n *\n * @param {string} publicPath Unobfuscated name to export.\n * @param {*} object Object the name should point to.\n * @param {?Object=} objectToExportTo The object to add the path to; default\n *     is goog.global.\n */\ngoog.exportSymbol = function(publicPath, object, objectToExportTo) {\n  goog.exportPath_(\n      publicPath, object, /* overwriteImplicit= */ true, objectToExportTo);\n};\n\n\n/**\n * Exports a property unobfuscated into the object's namespace.\n * ex. goog.exportProperty(Foo, 'staticFunction', Foo.staticFunction);\n * ex. goog.exportProperty(Foo.prototype, 'myMethod', Foo.prototype.myMethod);\n * @param {Object} object Object whose static property is being exported.\n * @param {string} publicName Unobfuscated name to export.\n * @param {*} symbol Object the name should point to.\n */\ngoog.exportProperty = function(object, publicName, symbol) {\n  object[publicName] = symbol;\n};\n\n\n/**\n * Returns the value of a given name, or undefined if there are no other\n * references to the name.\n *\n * This function is evaluated statically, at compile time, as long as the\n * appropriate compiler passes are enabled.  If these compiler passes are not\n * enabled, the function is a no-op, and will just return its argument\n * unmodified.\n *\n * Usage:\n * <pre>\n * // If there are other references to `x`, `xOrUndefined` will be `x`.\n * // Otherwise, `xOrUndefined` will be `undefined`.\n * var xOrUndefined = goog.weakUsage(x);\n * </pre>\n *\n * It is an error to call `goog.weakUsage` with an argument that is not a name.\n *\n * @param {T} name A symbol name to reference weakly.\n * @return {T|undefined} The object or undefined.\n * @template T\n * @noinline\n */\ngoog.weakUsage = function(name) {\n  return name;\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * Usage:\n * <pre>\n * function ParentClass(a, b) { }\n * ParentClass.prototype.foo = function(a) { };\n *\n * function ChildClass(a, b, c) {\n *   ChildClass.base(this, 'constructor', a, b);\n * }\n * goog.inherits(ChildClass, ParentClass);\n *\n * var child = new ChildClass('a', 'b', 'see');\n * child.foo(); // This works.\n * </pre>\n *\n * @param {!Function} childCtor Child class.\n * @param {!Function} parentCtor Parent class.\n * @suppress {strictMissingProperties} superClass_ and base is not defined on\n *    Function.\n * @deprecated Use ECMAScript class syntax instead.\n */\ngoog.inherits = function(childCtor, parentCtor) {\n  /** @constructor */\n  function tempCtor() {}\n  tempCtor.prototype = parentCtor.prototype;\n  childCtor.superClass_ = parentCtor.prototype;\n  childCtor.prototype = new tempCtor();\n  /** @override */\n  childCtor.prototype.constructor = childCtor;\n\n  /**\n   * Calls superclass constructor/method.\n   *\n   * This function is only available if you use goog.inherits to\n   * express inheritance relationships between classes.\n   *\n   * NOTE: This is a replacement for goog.base and for superClass_\n   * property defined in childCtor.\n   *\n   * @param {!Object} me Should always be \"this\".\n   * @param {string} methodName The method name to call. Calling\n   *     superclass constructor can be done with the special string\n   *     'constructor'.\n   * @param {...*} var_args The arguments to pass to superclass\n   *     method/constructor.\n   * @return {*} The return value of the superclass method/constructor.\n   */\n  childCtor.base = function(me, methodName, var_args) {\n    // Copying using loop to avoid deop due to passing arguments object to\n    // function. This is faster in many JS engines as of late 2014.\n    var args = new Array(arguments.length - 2);\n    for (var i = 2; i < arguments.length; i++) {\n      args[i - 2] = arguments[i];\n    }\n    return parentCtor.prototype[methodName].apply(me, args);\n  };\n};\n\n\n/**\n * Allow for aliasing within scope functions.  This function exists for\n * uncompiled code - in compiled code the calls will be inlined and the aliases\n * applied.  In uncompiled code the function is simply run since the aliases as\n * written are valid JavaScript.\n *\n * MOE:begin_intracomment_strip\n * See the goog.scope document at http://go/goog.scope\n *\n * For more on goog.scope deprecation, see the style guide entry:\n * http://go/jsstyle#appendices-legacy-exceptions-goog-scope\n * MOE:end_intracomment_strip\n *\n * @param {function()} fn Function to call.  This function can contain aliases\n *     to namespaces (e.g. \"var dom = goog.dom\") or classes\n *     (e.g. \"var Timer = goog.Timer\").\n * @deprecated Use goog.module instead.\n */\ngoog.scope = function(fn) {\n  if (goog.isInModuleLoader_()) {\n    throw new Error('goog.scope is not supported within a module.');\n  }\n  fn.call(goog.global);\n};\n\n\n/*\n * To support uncompiled, strict mode bundles that use eval to divide source\n * like so:\n *    eval('someSource;//# sourceUrl sourcefile.js');\n * We need to export the globally defined symbols \"goog\" and \"COMPILED\".\n * Exporting \"goog\" breaks the compiler optimizations, so we required that\n * be defined externally.\n * NOTE: We don't use goog.exportSymbol here because we don't want to trigger\n * extern generation when that compiler option is enabled.\n */\nif (!COMPILED) {\n  goog.LEGACY_NAMESPACE_OBJECT_['COMPILED'] = COMPILED;\n}\n\n/**\n * Returns the parameter.\n * @param {string} s\n * @return {string}\n * @private\n */\ngoog.identity_ = function(s) {\n  return s;\n};\n\n\n/**\n * Creates Trusted Types policy if Trusted Types are supported by the browser.\n * The policy just blesses any string as a Trusted Type. It is not visibility\n * restricted because anyone can also call trustedTypes.createPolicy directly.\n * However, the allowed names should be restricted by a HTTP header and the\n * reference to the created policy should be visibility restricted.\n * @param {string} name\n * @return {?TrustedTypePolicy}\n */\ngoog.createTrustedTypesPolicy = function(name) {\n  var policy = null;\n  var policyFactory = goog.global.trustedTypes;\n  if (!policyFactory || !policyFactory.createPolicy) {\n    return policy;\n  }\n  // trustedTypes.createPolicy throws if called with a name that is already\n  // registered, even in report-only mode. Until the API changes, catch the\n  // error not to break the applications functionally. In such case, the code\n  // will fall back to using regular Safe Types.\n  // TODO(koto): Remove catching once createPolicy API stops throwing.\n  try {\n    policy = policyFactory.createPolicy(name, {\n      createHTML: goog.identity_,\n      createScript: goog.identity_,\n      createScriptURL: goog.identity_\n    });\n  } catch (e) {\n    goog.logToConsole_(e.message);\n  }\n  return policy;\n};\n\n// There's a bug in the compiler where without collapse properties the\n// Closure namespace defines do not guard code correctly. To help reduce code\n// size also check for !COMPILED even though it redundant until this is fixed.\nif (!COMPILED && goog.DEPENDENCIES_ENABLED) {\n  // MOE:begin_strip\n  // TODO(b/67050526) This object is obsolete but some people are relying on\n  // it internally. Keep it around until we migrate them.\n  /**\n   * @private\n   * @type {{\n   *   loadFlags: !Object<string, !Object<string, string>>,\n   *   nameToPath: !Object<string, string>,\n   *   requires: !Object<string, !Object<string, boolean>>,\n   *   visited: !Object<string, boolean>,\n   *   written: !Object<string, boolean>,\n   *   deferred: !Object<string, string>\n   * }}\n   */\n  goog.dependencies_ = {\n    loadFlags: {},  // 1 to 1\n\n    nameToPath: {},  // 1 to 1\n\n    requires: {},  // 1 to many\n\n    // Used when resolving dependencies to prevent us from visiting file\n    // twice.\n    visited: {},\n\n    written: {},  // Used to keep track of script files we have written.\n\n    deferred: {}  // Used to track deferred module evaluations in old IEs\n  };\n\n  /**\n   * @return {!Object}\n   * @private\n   */\n  goog.getLoader_ = function() {\n    return {\n      dependencies_: goog.dependencies_,\n      writeScriptTag_: goog.writeScriptTag_\n    };\n  };\n\n\n  /**\n   * @param {string} src The script url.\n   * @param {string=} opt_sourceText The optionally source text to evaluate\n   * @return {boolean} True if the script was imported, false otherwise.\n   * @private\n   */\n  goog.writeScriptTag_ = function(src, opt_sourceText) {\n    if (goog.inHtmlDocument_()) {\n      /** @type {!HTMLDocument} */\n      var doc = goog.global.document;\n\n      // If the user tries to require a new symbol after document load,\n      // something has gone terribly wrong. Doing a document.write would\n      // wipe out the page. This does not apply to the CSP-compliant method\n      // of writing script tags.\n      if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING &&\n          doc.readyState == 'complete') {\n        // Certain test frameworks load base.js multiple times, which tries\n        // to write deps.js each time. If that happens, just fail silently.\n        // These frameworks wipe the page between each load of base.js, so this\n        // is OK.\n        var isDeps = /\\bdeps.js$/.test(src);\n        if (isDeps) {\n          return false;\n        } else {\n          throw Error('Cannot write \"' + src + '\" after document load');\n        }\n      }\n\n      var nonceAttr = '';\n      var nonce = goog.getScriptNonce_();\n      if (nonce) {\n        nonceAttr = ' nonce=\"' + nonce + '\"';\n      }\n\n      if (opt_sourceText === undefined) {\n        var script = '<script src=\"' + src + '\"' + nonceAttr + '></' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      } else {\n        var script = '<script' + nonceAttr + '>' +\n            goog.protectScriptTag_(opt_sourceText) + '</' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      }\n      return true;\n    } else {\n      return false;\n    }\n  };\n  // MOE:end_strip\n\n\n  /**\n   * Tries to detect whether is in the context of an HTML document.\n   * @return {boolean} True if it looks like HTML document.\n   * @private\n   */\n  goog.inHtmlDocument_ = function() {\n    /** @type {!Document} */\n    var doc = goog.global.document;\n    return doc != null && 'write' in doc;  // XULDocument misses write.\n  };\n\n\n  /**\n   * We'd like to check for if the document readyState is 'loading'; however\n   * there are bugs on IE 10 and below where the readyState being anything other\n   * than 'complete' is not reliable.\n   * @return {boolean}\n   * @private\n   */\n  goog.isDocumentLoading_ = function() {\n    // attachEvent is available on IE 6 thru 10 only, and thus can be used to\n    // detect those browsers.\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n    return doc.attachEvent ? doc.readyState != 'complete' :\n                             doc.readyState == 'loading';\n  };\n\n\n  /**\n   * Tries to detect the base path of base.js script that bootstraps Closure.\n   * @private\n   */\n  goog.findBasePath_ = function() {\n    if (goog.global.CLOSURE_BASE_PATH != undefined &&\n        // Anti DOM-clobbering runtime check (b/37736576).\n        typeof goog.global.CLOSURE_BASE_PATH === 'string') {\n      goog.basePath = goog.global.CLOSURE_BASE_PATH;\n      return;\n    } else if (!goog.inHtmlDocument_()) {\n      return;\n    }\n    /** @type {!Document} */\n    var doc = goog.global.document;\n    // If we have a currentScript available, use it exclusively.\n    var currentScript = doc.currentScript;\n    if (currentScript) {\n      var scripts = [currentScript];\n    } else {\n      var scripts = doc.getElementsByTagName('SCRIPT');\n    }\n    // Search backwards since the current script is in almost all cases the one\n    // that has base.js.\n    for (var i = scripts.length - 1; i >= 0; --i) {\n      var script = /** @type {!HTMLScriptElement} */ (scripts[i]);\n      var src = script.src;\n      var qmark = src.lastIndexOf('?');\n      var l = qmark == -1 ? src.length : qmark;\n      if (src.slice(l - 7, l) == 'base.js') {\n        goog.basePath = src.slice(0, l - 7);\n        return;\n      }\n    }\n  };\n\n  goog.findBasePath_();\n\n  /**\n   * Rewrites closing script tags in input to avoid ending an enclosing script\n   * tag.\n   *\n   * @param {string} str\n   * @return {string}\n   * @private\n   */\n  goog.protectScriptTag_ = function(str) {\n    return str.replace(/<\\/(SCRIPT)/ig, '\\\\x3c/$1');\n  };\n\n\n  /**\n   * A debug loader is responsible for downloading and executing javascript\n   * files in an unbundled, uncompiled environment.\n   *\n   * This can be custimized via the setDependencyFactory method, or by\n   * CLOSURE_IMPORT_SCRIPT/CLOSURE_LOAD_FILE_SYNC.\n   *\n   * @struct @constructor @final @private\n   */\n  goog.DebugLoader_ = function() {\n    /** @private @const {!Object<string, !goog.Dependency>} */\n    this.dependencies_ = {};\n    /** @private @const {!Object<string, string>} */\n    this.idToPath_ = {};\n    /** @private @const {!Object<string, boolean>} */\n    this.written_ = {};\n    /** @private @const {!Array<!goog.Dependency>} */\n    this.loadingDeps_ = [];\n    /** @private {!Array<!goog.Dependency>} */\n    this.depsToLoad_ = [];\n    /** @private {boolean} */\n    this.paused_ = false;\n    /** @private {!goog.DependencyFactory} */\n    this.factory_ = new goog.DependencyFactory();\n    /** @private @const {!Object<string, !Function>} */\n    this.deferredCallbacks_ = {};\n    /** @private @const {!Array<string>} */\n    this.deferredQueue_ = [];\n  };\n\n\n  /**\n   * Loads the Closure deps.js file.\n   *\n   * Exposed a function so after base is loaded, and\n   * then this can be called to load the closure deps.js file.\n   */\n  goog.DebugLoader_.prototype.loadClosureDeps = function() {\n    // Circumvent addDependency, which would try to transpile deps.js if\n    // transpile is set to always.\n    var relPath = 'deps.js';\n    this.depsToLoad_.push(this.factory_.createDependency(\n        goog.normalizePath_(goog.basePath + relPath), relPath, [], [], {}));\n    this.loadDeps_();\n  };\n\n\n  /**\n   * Notifies the debug loader when a dependency has been requested.\n   *\n   * @param {string} absPathOrId Path of the dependency or goog id.\n   * @param {boolean=} opt_force\n   */\n  goog.DebugLoader_.prototype.requested = function(absPathOrId, opt_force) {\n    var path = this.getPathFromDeps_(absPathOrId);\n    if (path &&\n        (opt_force || this.areDepsLoaded_(this.dependencies_[path].requires))) {\n      var callback = this.deferredCallbacks_[path];\n      if (callback) {\n        delete this.deferredCallbacks_[path];\n        callback();\n      }\n    }\n  };\n\n\n  /**\n   * Sets the dependency factory, which can be used to create custom\n   * goog.Dependency implementations to control how dependencies are loaded.\n   *\n   * @param {!goog.DependencyFactory} factory\n   */\n  goog.DebugLoader_.prototype.setDependencyFactory = function(factory) {\n    this.factory_ = factory;\n  };\n\n\n  /**\n   * Travserses the dependency graph and queues the given dependency, and all of\n   * its transitive dependencies, for loading and then starts loading if not\n   * paused.\n   *\n   * @param {string} namespace\n   * @private\n   */\n  goog.DebugLoader_.prototype.load_ = function(namespace) {\n    if (!this.getPathFromDeps_(namespace)) {\n      var errorMessage = 'goog.require could not find: ' + namespace;\n      goog.logToConsole_(errorMessage);\n    } else {\n      var loader = this;\n\n      var deps = [];\n\n      /** @param {string} namespace */\n      var visit = function(namespace) {\n        var path = loader.getPathFromDeps_(namespace);\n\n        if (!path) {\n          throw new Error('Bad dependency path or symbol: ' + namespace);\n        }\n\n        if (loader.written_[path]) {\n          return;\n        }\n\n        loader.written_[path] = true;\n\n        var dep = loader.dependencies_[path];\n        // MOE:begin_strip\n        if (goog.dependencies_.written[dep.relativePath]) {\n          return;\n        }\n        // MOE:end_strip\n        for (var i = 0; i < dep.requires.length; i++) {\n          if (!goog.isProvided_(dep.requires[i])) {\n            visit(dep.requires[i]);\n          }\n        }\n\n        deps.push(dep);\n      };\n\n      visit(namespace);\n\n      var wasLoading = !!this.depsToLoad_.length;\n      this.depsToLoad_ = this.depsToLoad_.concat(deps);\n\n      if (!this.paused_ && !wasLoading) {\n        this.loadDeps_();\n      }\n    }\n  };\n\n\n  /**\n   * Loads any queued dependencies until they are all loaded or paused.\n   *\n   * @private\n   */\n  goog.DebugLoader_.prototype.loadDeps_ = function() {\n    var loader = this;\n    var paused = this.paused_;\n\n    while (this.depsToLoad_.length && !paused) {\n      (function() {\n        var loadCallDone = false;\n        var dep = loader.depsToLoad_.shift();\n\n        var loaded = false;\n        loader.loading_(dep);\n\n        var controller = {\n          pause: function() {\n            if (loadCallDone) {\n              throw new Error('Cannot call pause after the call to load.');\n            } else {\n              paused = true;\n            }\n          },\n          resume: function() {\n            if (loadCallDone) {\n              loader.resume_();\n            } else {\n              // Some dep called pause and then resume in the same load call.\n              // Just keep running this same loop.\n              paused = false;\n            }\n          },\n          loaded: function() {\n            if (loaded) {\n              throw new Error('Double call to loaded.');\n            }\n\n            loaded = true;\n            loader.loaded_(dep);\n          },\n          pending: function() {\n            // Defensive copy.\n            var pending = [];\n            for (var i = 0; i < loader.loadingDeps_.length; i++) {\n              pending.push(loader.loadingDeps_[i]);\n            }\n            return pending;\n          },\n          /**\n           * @param {goog.ModuleType} type\n           */\n          setModuleState: function(type) {\n            goog.moduleLoaderState_ = {\n              type: type,\n              moduleName: '',\n              declareLegacyNamespace: false,\n              preventModuleExportSealing: false,\n            };\n          },\n          /** @type {function(string, string, string=)} */\n          registerEs6ModuleExports: function(\n              path, exports, opt_closureNamespace) {\n            if (opt_closureNamespace) {\n              goog.loadedModules_[opt_closureNamespace] = {\n                exports: exports,\n                type: goog.ModuleType.ES6,\n                moduleId: opt_closureNamespace || ''\n              };\n            }\n          },\n          /** @type {function(string, ?)} */\n          registerGoogModuleExports: function(moduleId, exports) {\n            goog.loadedModules_[moduleId] = {\n              exports: exports,\n              type: goog.ModuleType.GOOG,\n              moduleId: moduleId\n            };\n          },\n          clearModuleState: function() {\n            goog.moduleLoaderState_ = null;\n          },\n          defer: function(callback) {\n            if (loadCallDone) {\n              throw new Error(\n                  'Cannot register with defer after the call to load.');\n            }\n            loader.defer_(dep, callback);\n          },\n          areDepsLoaded: function() {\n            return loader.areDepsLoaded_(dep.requires);\n          }\n        };\n\n        try {\n          dep.load(controller);\n        } finally {\n          loadCallDone = true;\n        }\n      })();\n    }\n\n    if (paused) {\n      this.pause_();\n    }\n  };\n\n\n  /** @private */\n  goog.DebugLoader_.prototype.pause_ = function() {\n    this.paused_ = true;\n  };\n\n\n  /** @private */\n  goog.DebugLoader_.prototype.resume_ = function() {\n    if (this.paused_) {\n      this.paused_ = false;\n      this.loadDeps_();\n    }\n  };\n\n\n  /**\n   * Marks the given dependency as loading (load has been called but it has not\n   * yet marked itself as finished). Useful for dependencies that want to know\n   * what else is loading. Example: goog.modules cannot eval if there are\n   * loading dependencies.\n   *\n   * @param {!goog.Dependency} dep\n   * @private\n   */\n  goog.DebugLoader_.prototype.loading_ = function(dep) {\n    this.loadingDeps_.push(dep);\n  };\n\n\n  /**\n   * Marks the given dependency as having finished loading and being available\n   * for require.\n   *\n   * @param {!goog.Dependency} dep\n   * @private\n   */\n  goog.DebugLoader_.prototype.loaded_ = function(dep) {\n    for (var i = 0; i < this.loadingDeps_.length; i++) {\n      if (this.loadingDeps_[i] == dep) {\n        this.loadingDeps_.splice(i, 1);\n        break;\n      }\n    }\n\n    for (var i = 0; i < this.deferredQueue_.length; i++) {\n      if (this.deferredQueue_[i] == dep.path) {\n        this.deferredQueue_.splice(i, 1);\n        break;\n      }\n    }\n\n    if (this.loadingDeps_.length == this.deferredQueue_.length &&\n        !this.depsToLoad_.length) {\n      // Something has asked to load these, but they may not be directly\n      // required again later, so load them now that we know we're done loading\n      // everything else. e.g. a goog module entry point.\n      while (this.deferredQueue_.length) {\n        this.requested(this.deferredQueue_.shift(), true);\n      }\n    }\n\n    dep.loaded();\n  };\n\n\n  /**\n   * @param {!Array<string>} pathsOrIds\n   * @return {boolean}\n   * @private\n   */\n  goog.DebugLoader_.prototype.areDepsLoaded_ = function(pathsOrIds) {\n    for (var i = 0; i < pathsOrIds.length; i++) {\n      var path = this.getPathFromDeps_(pathsOrIds[i]);\n      if (!path ||\n          (!(path in this.deferredCallbacks_) &&\n           !goog.isProvided_(pathsOrIds[i]))) {\n        return false;\n      }\n    }\n\n    return true;\n  };\n\n\n  /**\n   * @param {string} absPathOrId\n   * @return {?string}\n   * @private\n   */\n  goog.DebugLoader_.prototype.getPathFromDeps_ = function(absPathOrId) {\n    if (absPathOrId in this.idToPath_) {\n      return this.idToPath_[absPathOrId];\n    } else if (absPathOrId in this.dependencies_) {\n      return absPathOrId;\n    } else {\n      return null;\n    }\n  };\n\n\n  /**\n   * @param {!goog.Dependency} dependency\n   * @param {!Function} callback\n   * @private\n   */\n  goog.DebugLoader_.prototype.defer_ = function(dependency, callback) {\n    this.deferredCallbacks_[dependency.path] = callback;\n    this.deferredQueue_.push(dependency.path);\n  };\n\n\n  /**\n   * Interface for goog.Dependency implementations to have some control over\n   * loading of dependencies.\n   *\n   * @record\n   */\n  goog.LoadController = function() {};\n\n\n  /**\n   * Tells the controller to halt loading of more dependencies.\n   */\n  goog.LoadController.prototype.pause = function() {};\n\n\n  /**\n   * Tells the controller to resume loading of more dependencies if paused.\n   */\n  goog.LoadController.prototype.resume = function() {};\n\n\n  /**\n   * Tells the controller that this dependency has finished loading.\n   *\n   * This causes this to be removed from pending() and any load callbacks to\n   * fire.\n   */\n  goog.LoadController.prototype.loaded = function() {};\n\n\n  /**\n   * List of dependencies on which load has been called but which have not\n   * called loaded on their controller. This includes the current dependency.\n   *\n   * @return {!Array<!goog.Dependency>}\n   */\n  goog.LoadController.prototype.pending = function() {};\n\n\n  /**\n   * Registers an object as an ES6 module's exports so that goog.modules may\n   * require it by path.\n   *\n   * @param {string} path Full path of the module.\n   * @param {?} exports\n   * @param {string=} opt_closureNamespace Closure namespace to associate with\n   *     this module.\n   */\n  goog.LoadController.prototype.registerEs6ModuleExports = function(\n      path, exports, opt_closureNamespace) {};\n\n\n  /**\n   * Sets the current module state.\n   *\n   * @param {goog.ModuleType} type Type of module.\n   */\n  goog.LoadController.prototype.setModuleState = function(type) {};\n\n\n  /**\n   * Clears the current module state.\n   */\n  goog.LoadController.prototype.clearModuleState = function() {};\n\n\n  /**\n   * Registers a callback to call once the dependency is actually requested\n   * via goog.require + all of the immediate dependencies have been loaded or\n   * all other files have been loaded. Allows for lazy loading until\n   * require'd without pausing dependency loading, which is needed on old IE.\n   *\n   * @param {!Function} callback\n   */\n  goog.LoadController.prototype.defer = function(callback) {};\n\n\n  /**\n   * @return {boolean}\n   */\n  goog.LoadController.prototype.areDepsLoaded = function() {};\n\n\n  /**\n   * Basic super class for all dependencies Closure Library can load.\n   *\n   * This default implementation is designed to load untranspiled, non-module\n   * scripts in a web broswer.\n   *\n   * For goog.modules see {@see goog.GoogModuleDependency}.\n   * For untranspiled ES6 modules {@see goog.Es6ModuleDependency}.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   */\n  goog.Dependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    /** @const */\n    this.path = path;\n    /** @const */\n    this.relativePath = relativePath;\n    /** @const */\n    this.provides = provides;\n    /** @const */\n    this.requires = requires;\n    /** @const */\n    this.loadFlags = loadFlags;\n    /** @private {boolean} */\n    this.loaded_ = false;\n    /** @private {!Array<function()>} */\n    this.loadCallbacks_ = [];\n  };\n\n\n  /**\n   * @return {string} The pathname part of this dependency's path if it is a\n   *     URI.\n   */\n  goog.Dependency.prototype.getPathName = function() {\n    var pathName = this.path;\n    var protocolIndex = pathName.indexOf('://');\n    if (protocolIndex >= 0) {\n      pathName = pathName.substring(protocolIndex + 3);\n      var slashIndex = pathName.indexOf('/');\n      if (slashIndex >= 0) {\n        pathName = pathName.substring(slashIndex + 1);\n      }\n    }\n    return pathName;\n  };\n\n\n  /**\n   * @param {function()} callback Callback to fire as soon as this has loaded.\n   * @final\n   */\n  goog.Dependency.prototype.onLoad = function(callback) {\n    if (this.loaded_) {\n      callback();\n    } else {\n      this.loadCallbacks_.push(callback);\n    }\n  };\n\n\n  /**\n   * Marks this dependency as loaded and fires any callbacks registered with\n   * onLoad.\n   * @final\n   */\n  goog.Dependency.prototype.loaded = function() {\n    this.loaded_ = true;\n    var callbacks = this.loadCallbacks_;\n    this.loadCallbacks_ = [];\n    for (var i = 0; i < callbacks.length; i++) {\n      callbacks[i]();\n    }\n  };\n\n\n  /**\n   * Whether or not document.written / appended script tags should be deferred.\n   *\n   * @private {boolean}\n   */\n  goog.Dependency.defer_ = false;\n\n\n  /**\n   * Map of script ready / state change callbacks. Old IE cannot handle putting\n   * these properties on goog.global.\n   *\n   * @private @const {!Object<string, function(?):undefined>}\n   */\n  goog.Dependency.callbackMap_ = {};\n\n\n  /**\n   * @param {function(...?):?} callback\n   * @return {string}\n   * @private\n   */\n  goog.Dependency.registerCallback_ = function(callback) {\n    var key = Math.random().toString(32);\n    goog.Dependency.callbackMap_[key] = callback;\n    return key;\n  };\n\n\n  /**\n   * @param {string} key\n   * @private\n   */\n  goog.Dependency.unregisterCallback_ = function(key) {\n    delete goog.Dependency.callbackMap_[key];\n  };\n\n\n  /**\n   * @param {string} key\n   * @param {...?} var_args\n   * @private\n   */\n  goog.Dependency.callback_ = function(key, var_args) {\n    if (key in goog.Dependency.callbackMap_) {\n      var callback = goog.Dependency.callbackMap_[key];\n      var args = [];\n      for (var i = 1; i < arguments.length; i++) {\n        args.push(arguments[i]);\n      }\n      callback.apply(undefined, args);\n    } else {\n      var errorMessage = 'Callback key ' + key +\n          ' does not exist (was base.js loaded more than once?).';\n      // MOE:begin_strip\n      // TODO(johnplaisted): Some people internally are mistakenly loading\n      // base.js twice, and this can happen while a dependency is loading,\n      // wiping out state.\n      goog.logToConsole_(errorMessage);\n      // MOE:end_strip\n      // MOE:insert throw Error(errorMessage);\n    }\n  };\n\n\n  /**\n   * Starts loading this dependency. This dependency can pause loading if it\n   * needs to and resume it later via the controller interface.\n   *\n   * When this is loaded it should call controller.loaded(). Note that this will\n   * end up calling the loaded method of this dependency; there is no need to\n   * call it explicitly.\n   *\n   * @param {!goog.LoadController} controller\n   */\n  goog.Dependency.prototype.load = function(controller) {\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      if (goog.global.CLOSURE_IMPORT_SCRIPT(this.path)) {\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    if (!goog.inHtmlDocument_()) {\n      goog.logToConsole_(\n          'Cannot use default debug loader outside of HTML documents.');\n      if (this.relativePath == 'deps.js') {\n        // CLOSURE_IMPORT_SCRIPT should be set *before* base.js is loaded.\n        goog.logToConsole_(\n            'Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js.');\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n\n    // If the user tries to require a new symbol after document load,\n    // something has gone terribly wrong. Doing a document.write would\n    // wipe out the page. This does not apply to the CSP-compliant method\n    // of writing script tags.\n    if (doc.readyState == 'complete' &&\n        !goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING) {\n      // Certain test frameworks load base.js multiple times, which tries\n      // to write deps.js each time. If that happens, just fail silently.\n      // These frameworks wipe the page between each load of base.js, so this\n      // is OK.\n      var isDeps = /\\bdeps.js$/.test(this.path);\n      if (isDeps) {\n        controller.loaded();\n        return;\n      } else {\n        throw Error('Cannot write \"' + this.path + '\" after document load');\n      }\n    }\n\n    var nonce = goog.getScriptNonce_();\n    if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING &&\n        goog.isDocumentLoading_()) {\n      var key;\n      var callback = function(script) {\n        if (script.readyState && script.readyState != 'complete') {\n          script.onload = callback;\n          return;\n        }\n        goog.Dependency.unregisterCallback_(key);\n        controller.loaded();\n      };\n      key = goog.Dependency.registerCallback_(callback);\n\n      var defer = goog.Dependency.defer_ ? ' defer' : '';\n      var nonceAttr = nonce ? ' nonce=\"' + nonce + '\"' : '';\n      var script = '<script src=\"' + this.path + '\"' + nonceAttr + defer +\n          ' id=\"script-' + key + '\"><\\/script>';\n\n      script += '<script' + nonceAttr + '>';\n\n      if (goog.Dependency.defer_) {\n        script += 'document.getElementById(\\'script-' + key +\n            '\\').onload = function() {\\n' +\n            '  goog.Dependency.callback_(\\'' + key + '\\', this);\\n' +\n            '};\\n';\n      } else {\n        script += 'goog.Dependency.callback_(\\'' + key +\n            '\\', document.getElementById(\\'script-' + key + '\\'));';\n      }\n\n      script += '<\\/script>';\n\n      doc.write(\n          goog.TRUSTED_TYPES_POLICY_ ?\n              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n              script);\n    } else {\n      var scriptEl =\n          /** @type {!HTMLScriptElement} */ (doc.createElement('script'));\n      scriptEl.defer = goog.Dependency.defer_;\n      scriptEl.async = false;\n\n      // If CSP nonces are used, propagate them to dynamically created scripts.\n      // This is necessary to allow nonce-based CSPs without 'strict-dynamic'.\n      if (nonce) {\n        scriptEl.nonce = nonce;\n      }\n\n      scriptEl.onload = function() {\n        scriptEl.onload = null;\n        controller.loaded();\n      };\n\n      scriptEl.src = goog.TRUSTED_TYPES_POLICY_ ?\n          goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path) :\n          this.path;\n      doc.head.appendChild(scriptEl);\n    }\n  };\n\n\n  /**\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides Should be an empty array.\n   *     TODO(johnplaisted) add support for adding closure namespaces to ES6\n   *     modules for interop purposes.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.Dependency}\n   */\n  goog.Es6ModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.Es6ModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(goog.Es6ModuleDependency, goog.Dependency);\n\n\n  /**\n   * @override\n   * @param {!goog.LoadController} controller\n   */\n  goog.Es6ModuleDependency.prototype.load = function(controller) {\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      if (goog.global.CLOSURE_IMPORT_SCRIPT(this.path)) {\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n    if (!goog.inHtmlDocument_()) {\n      goog.logToConsole_(\n          'Cannot use default debug loader outside of HTML documents.');\n      controller.pause();\n      return;\n    }\n\n    /** @type {!HTMLDocument} */\n    var doc = goog.global.document;\n\n    var dep = this;\n\n    // TODO(johnplaisted): Does document.writing really speed up anything? Any\n    // difference between this and just waiting for interactive mode and then\n    // appending?\n    function write(src, contents) {\n      var nonceAttr = '';\n      var nonce = goog.getScriptNonce_();\n      if (nonce) {\n        nonceAttr = ' nonce=\"' + nonce + '\"';\n      }\n\n      if (contents) {\n        var script = '<script type=\"module\" crossorigin' + nonceAttr + '>' +\n            contents + '</' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      } else {\n        var script = '<script type=\"module\" crossorigin src=\"' + src + '\"' +\n            nonceAttr + '></' +\n            'script>';\n        doc.write(\n            goog.TRUSTED_TYPES_POLICY_ ?\n                goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n                script);\n      }\n    }\n\n    function append(src, contents) {\n      var scriptEl =\n          /** @type {!HTMLScriptElement} */ (doc.createElement('script'));\n      scriptEl.defer = true;\n      scriptEl.async = false;\n      scriptEl.type = 'module';\n      scriptEl.setAttribute('crossorigin', true);\n\n      // If CSP nonces are used, propagate them to dynamically created scripts.\n      // This is necessary to allow nonce-based CSPs without 'strict-dynamic'.\n      var nonce = goog.getScriptNonce_();\n      if (nonce) {\n        scriptEl.nonce = nonce;\n      }\n\n      if (contents) {\n        scriptEl.text = goog.TRUSTED_TYPES_POLICY_ ?\n            goog.TRUSTED_TYPES_POLICY_.createScript(contents) :\n            contents;\n      } else {\n        scriptEl.src = goog.TRUSTED_TYPES_POLICY_ ?\n            goog.TRUSTED_TYPES_POLICY_.createScriptURL(src) :\n            src;\n      }\n\n      doc.head.appendChild(scriptEl);\n    }\n\n    var create;\n\n    if (goog.isDocumentLoading_()) {\n      create = write;\n      // We can ONLY call document.write if we are guaranteed that any\n      // non-module script tags document.written after this are deferred.\n      // Small optimization, in theory document.writing is faster.\n      goog.Dependency.defer_ = true;\n    } else {\n      create = append;\n    }\n\n    // Write 4 separate tags here:\n    // 1) Sets the module state at the correct time (just before execution).\n    // 2) A src node for this, which just hopefully lets the browser load it a\n    //    little early (no need to parse #3).\n    // 3) Import the module and register it.\n    // 4) Clear the module state at the correct time. Guaranteed to run even\n    //    if there is an error in the module (#3 will not run if there is an\n    //    error in the module).\n    var beforeKey = goog.Dependency.registerCallback_(function() {\n      goog.Dependency.unregisterCallback_(beforeKey);\n      controller.setModuleState(goog.ModuleType.ES6);\n    });\n    create(undefined, 'goog.Dependency.callback_(\"' + beforeKey + '\")');\n\n    // TODO(johnplaisted): Does this really speed up anything?\n    create(this.path, undefined);\n\n    var registerKey = goog.Dependency.registerCallback_(function(exports) {\n      goog.Dependency.unregisterCallback_(registerKey);\n      controller.registerEs6ModuleExports(\n          dep.path, exports, goog.moduleLoaderState_.moduleName);\n    });\n    create(\n        undefined,\n        'import * as m from \"' + this.path + '\"; goog.Dependency.callback_(\"' +\n            registerKey + '\", m)');\n\n    var afterKey = goog.Dependency.registerCallback_(function() {\n      goog.Dependency.unregisterCallback_(afterKey);\n      controller.clearModuleState();\n      controller.loaded();\n    });\n    create(undefined, 'goog.Dependency.callback_(\"' + afterKey + '\")');\n  };\n\n\n  /**\n   * Superclass of any dependency that needs to be loaded into memory,\n   * transformed, and then eval'd (goog.modules and transpiled files).\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor @abstract\n   * @extends {goog.Dependency}\n   */\n  goog.TransformedDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.TransformedDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n    /** @private {?string} */\n    this.contents_ = null;\n\n    /**\n     * Whether to lazily make the synchronous XHR (when goog.require'd) or make\n     * the synchronous XHR when initially loading. On FireFox 61 there is a bug\n     * where an ES6 module cannot make a synchronous XHR (rather, it can, but if\n     * it does then no other ES6 modules will load after).\n     *\n     * tl;dr we lazy load due to bugs on older browsers and eager load due to\n     * bugs on newer ones.\n     *\n     * https://bugzilla.mozilla.org/show_bug.cgi?id=1477090\n     *\n     * @private @const {boolean}\n     */\n    this.lazyFetch_ = !goog.inHtmlDocument_() ||\n        !('noModule' in goog.global.document.createElement('script'));\n  };\n  goog.inherits(goog.TransformedDependency, goog.Dependency);\n\n\n  /**\n   * @override\n   * @param {!goog.LoadController} controller\n   */\n  goog.TransformedDependency.prototype.load = function(controller) {\n    var dep = this;\n\n    function fetch() {\n      dep.contents_ = goog.loadFileSync_(dep.path);\n\n      if (dep.contents_) {\n        dep.contents_ = dep.transform(dep.contents_);\n        if (dep.contents_) {\n          dep.contents_ += '\\n//# sourceURL=' + dep.path;\n        }\n      }\n    }\n\n    if (goog.global.CLOSURE_IMPORT_SCRIPT) {\n      fetch();\n      if (this.contents_ &&\n          goog.global.CLOSURE_IMPORT_SCRIPT('', this.contents_)) {\n        this.contents_ = null;\n        controller.loaded();\n      } else {\n        controller.pause();\n      }\n      return;\n    }\n\n\n    var isEs6 = this.loadFlags['module'] == goog.ModuleType.ES6;\n\n    if (!this.lazyFetch_) {\n      fetch();\n    }\n\n    function load() {\n      if (dep.lazyFetch_) {\n        fetch();\n      }\n\n      if (!dep.contents_) {\n        // loadFileSync_ or transform are responsible. Assume they logged an\n        // error.\n        return;\n      }\n\n      if (isEs6) {\n        controller.setModuleState(goog.ModuleType.ES6);\n      }\n\n      var namespace;\n\n      try {\n        var contents = dep.contents_;\n        dep.contents_ = null;\n        goog.globalEval(goog.CLOSURE_EVAL_PREFILTER_.createScript(contents));\n        if (isEs6) {\n          namespace = goog.moduleLoaderState_.moduleName;\n        }\n      } finally {\n        if (isEs6) {\n          controller.clearModuleState();\n        }\n      }\n\n      if (isEs6) {\n        // Due to circular dependencies this may not be available for require\n        // right now.\n        goog.LEGACY_NAMESPACE_OBJECT_['$jscomp']['require']['ensure'](\n            [dep.getPathName()], function() {\n              controller.registerEs6ModuleExports(\n                  dep.path,\n                  goog.LEGACY_NAMESPACE_OBJECT_['$jscomp']['require'](\n                      dep.getPathName()),\n                  namespace);\n            });\n      }\n\n      controller.loaded();\n    }\n\n    // Do not fetch now; in FireFox 47 the synchronous XHR doesn't block all\n    // events. If we fetched now and then document.write'd the contents the\n    // document.write would be an eval and would execute too soon! Instead write\n    // a script tag to fetch and eval synchronously at the correct time.\n    function fetchInOwnScriptThenLoad() {\n      /** @type {!HTMLDocument} */\n      var doc = goog.global.document;\n\n      var key = goog.Dependency.registerCallback_(function() {\n        goog.Dependency.unregisterCallback_(key);\n        load();\n      });\n\n      var nonce = goog.getScriptNonce_();\n      var nonceAttr = nonce ? ' nonce=\"' + nonce + '\"' : '';\n      var script = '<script' + nonceAttr + '>' +\n          goog.protectScriptTag_('goog.Dependency.callback_(\"' + key + '\");') +\n          '</' +\n          'script>';\n      doc.write(\n          goog.TRUSTED_TYPES_POLICY_ ?\n              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :\n              script);\n    }\n\n    // If one thing is pending it is this.\n    var anythingElsePending = controller.pending().length > 1;\n\n    // Additionally if we are meant to defer scripts but the page is still\n    // loading (e.g. an ES6 module is loading) then also defer. Or if we are\n    // meant to defer and anything else is pending then defer (those may be\n    // scripts that did not need transformation and are just script tags with\n    // defer set to true, and we need to evaluate after that deferred script).\n    var needsAsyncLoading = goog.Dependency.defer_ &&\n        (anythingElsePending || goog.isDocumentLoading_());\n\n    if (needsAsyncLoading) {\n      // Note that we only defer when we have to rather than 100% of the time.\n      // Always defering would work, but then in theory the order of\n      // goog.require calls would then matter. We want to enforce that most of\n      // the time the order of the require calls does not matter.\n      controller.defer(function() {\n        load();\n      });\n      return;\n    }\n    // TODO(johnplaisted): Externs are missing onreadystatechange for\n    // HTMLDocument.\n    /** @type {?} */\n    var doc = goog.global.document;\n\n    if (isEs6 && goog.inHtmlDocument_() && goog.isDocumentLoading_()) {\n      goog.Dependency.defer_ = true;\n      // Transpiled ES6 modules still need to load like regular ES6 modules,\n      // aka only after the document is interactive.\n      controller.pause();\n      var oldCallback = doc.onreadystatechange;\n      doc.onreadystatechange = function() {\n        if (doc.readyState == 'interactive') {\n          doc.onreadystatechange = oldCallback;\n          load();\n          controller.resume();\n        }\n        if (typeof oldCallback === 'function') {\n          oldCallback.apply(undefined, arguments);\n        }\n      };\n    } else {\n      // Always eval on old IE.\n      if (!goog.inHtmlDocument_() || !goog.isDocumentLoading_()) {\n        load();\n      } else {\n        fetchInOwnScriptThenLoad();\n      }\n    }\n  };\n\n\n  /**\n   * @param {string} contents\n   * @return {string}\n   * @abstract\n   */\n  goog.TransformedDependency.prototype.transform = function(contents) {};\n\n\n  /**\n   * An ES6 module dependency that was transpiled to a jscomp module outside\n   * of the debug loader, e.g. server side.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.TransformedDependency}\n   */\n  goog.PreTranspiledEs6ModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.PreTranspiledEs6ModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(\n      goog.PreTranspiledEs6ModuleDependency, goog.TransformedDependency);\n\n\n  /**\n   * @override\n   * @param {string} contents\n   * @return {string}\n   */\n  goog.PreTranspiledEs6ModuleDependency.prototype.transform = function(\n      contents) {\n    return contents;\n  };\n\n\n  /**\n   * A goog.module, transpiled or not. Will always perform some minimal\n   * transformation even when not transpiled to wrap in a goog.loadModule\n   * statement.\n   *\n   * @param {string} path Absolute path of this script.\n   * @param {string} relativePath Path of this script relative to goog.basePath.\n   * @param {!Array<string>} provides goog.provided or goog.module symbols\n   *     in this file.\n   * @param {!Array<string>} requires goog symbols or relative paths to Closure\n   *     this depends on.\n   * @param {!Object<string, string>} loadFlags\n   * @struct @constructor\n   * @extends {goog.TransformedDependency}\n   */\n  goog.GoogModuleDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    goog.GoogModuleDependency.base(\n        this, 'constructor', path, relativePath, provides, requires, loadFlags);\n  };\n  goog.inherits(goog.GoogModuleDependency, goog.TransformedDependency);\n\n\n  /**\n   * @override\n   * @param {string} contents\n   * @return {string}\n   */\n  goog.GoogModuleDependency.prototype.transform = function(contents) {\n    if (!goog.LOAD_MODULE_USING_EVAL || goog.global.JSON === undefined) {\n      return '' +\n          'goog.loadModule(function(exports) {' +\n          '\"use strict\";' + contents +\n          '\\n' +  // terminate any trailing single line comment.\n          ';return exports' +\n          '});' +\n          '\\n//# sourceURL=' + this.path + '\\n';\n    } else {\n      return '' +\n          'goog.loadModule(' +\n          goog.global.JSON.stringify(\n              contents + '\\n//# sourceURL=' + this.path + '\\n') +\n          ');';\n    }\n  };\n\n\n  /**\n   * @param {string} relPath\n   * @param {!Array<string>|undefined} provides\n   * @param {!Array<string>} requires\n   * @param {boolean|!Object<string>=} opt_loadFlags\n   * @see goog.addDependency\n   */\n  goog.DebugLoader_.prototype.addDependency = function(\n      relPath, provides, requires, opt_loadFlags) {\n    provides = provides || [];\n    relPath = relPath.replace(/\\\\/g, '/');\n    var path = goog.normalizePath_(goog.basePath + relPath);\n    if (!opt_loadFlags || typeof opt_loadFlags === 'boolean') {\n      opt_loadFlags = opt_loadFlags ? {'module': goog.ModuleType.GOOG} : {};\n    }\n    var dep = this.factory_.createDependency(\n        path, relPath, provides, requires, opt_loadFlags);\n    this.dependencies_[path] = dep;\n    for (var i = 0; i < provides.length; i++) {\n      this.idToPath_[provides[i]] = path;\n    }\n    this.idToPath_[relPath] = path;\n  };\n\n\n  /**\n   * Creates goog.Dependency instances for the debug loader to load.\n   *\n   * Should be overridden to have the debug loader use custom subclasses of\n   * goog.Dependency.\n   *\n   * @struct @constructor\n   */\n  goog.DependencyFactory = function() {};\n\n\n  /**\n   * @param {string} path Absolute path of the file.\n   * @param {string} relativePath Path relative to closure\u2019s base.js.\n   * @param {!Array<string>} provides Array of provided goog.provide/module ids.\n   * @param {!Array<string>} requires Array of required goog.provide/module /\n   *     relative ES6 module paths.\n   * @param {!Object<string, string>} loadFlags\n   * @return {!goog.Dependency}\n   */\n  goog.DependencyFactory.prototype.createDependency = function(\n      path, relativePath, provides, requires, loadFlags) {\n    // MOE:begin_strip\n    var provide, require;\n    for (var i = 0; provide = provides[i]; i++) {\n      goog.dependencies_.nameToPath[provide] = relativePath;\n      goog.dependencies_.loadFlags[relativePath] = loadFlags;\n    }\n    for (var j = 0; require = requires[j]; j++) {\n      if (!(relativePath in goog.dependencies_.requires)) {\n        goog.dependencies_.requires[relativePath] = {};\n      }\n      goog.dependencies_.requires[relativePath][require] = true;\n    }\n    // MOE:end_strip\n\n    if (loadFlags['module'] == goog.ModuleType.GOOG) {\n      return new goog.GoogModuleDependency(\n          path, relativePath, provides, requires, loadFlags);\n    } else {\n      if (loadFlags['module'] == goog.ModuleType.ES6) {\n        if (goog.ASSUME_ES_MODULES_TRANSPILED) {\n          return new goog.PreTranspiledEs6ModuleDependency(\n              path, relativePath, provides, requires, loadFlags);\n        } else {\n          return new goog.Es6ModuleDependency(\n              path, relativePath, provides, requires, loadFlags);\n        }\n      } else {\n        return new goog.Dependency(\n            path, relativePath, provides, requires, loadFlags);\n      }\n    }\n  };\n\n\n  /** @private @const */\n  goog.debugLoader_ = new goog.DebugLoader_();\n\n\n  /**\n   * Loads the Closure deps.js file.\n   *\n   * Exposed a public function so after base is loaded, and\n   * then this can be called to load the closure deps.js file.\n   */\n  goog.loadClosureDeps = function() {\n    goog.debugLoader_.loadClosureDeps();\n  };\n\n\n  /**\n   * Sets the dependency factory, which can be used to create custom\n   * goog.Dependency implementations to control how dependencies are loaded.\n   *\n   * Note:\n   * You can call goog.loadClosureDeps to load the Closure dependency file\n   * later, after your factory is injected.\n   *\n   * @param {!goog.DependencyFactory} factory\n   */\n  goog.setDependencyFactory = function(factory) {\n    goog.debugLoader_.setDependencyFactory(factory);\n  };\n\n\n  /**\n   * Trusted Types policy for the debug loader.\n   * @private @const {?TrustedTypePolicy}\n   */\n  goog.TRUSTED_TYPES_POLICY_ = goog.TRUSTED_TYPES_POLICY_NAME ?\n      goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME + '#base') :\n      null;\n}\n\n\nif (!COMPILED) {\n  /**\n   * Trusted Types for running dev servers.\n   *\n   * @private @const\n   */\n  goog.CLOSURE_EVAL_PREFILTER_ = goog.global.trustedTypes &&\n          goog.createTrustedTypesPolicy('goog#base#devonly#eval') ||\n      {createScript: goog.identity_};\n}\n\n/**\n * go/goog-code-location-design\n * @enum {string}\n */\ngoog.CodeLocation = {\n  // Enums cannot be empty,\n  DO_NOT_USE: '',\n  // and need multiple distinct values so TS doesn't think `goog.CodeLocation`\n  // returns a unique singleton value.\n  DO_NOT_USE_ME_EITHER: '.',\n};\n\n/**\n * Returns the stack location of this function's caller's caller.\n * e.g:\n *   1| function foo() {\n *   2|    console.log(goog.callerLocation());\n *   3| }\n *   4| function bar() {\n *   5|    foo(); // this is the code location that goog.callerLocation returns\n *   6| }\n *   7| bar();\n *\n *  -> prints \"at bar (...filepath.ts:5:4)\" (i.e. foo() call on line 5)\n *\n * @return {!goog.CodeLocation}\n */\ngoog.callerLocation = function() {\n  if (!COMPILED) {\n    var err = new Error();\n    var stack = err.stack;\n    /**\n     * We\u2019re using index 3 for the stack split because:\n     * - index [1] returns `const err = new Error();` in base.js (above line)\n     * - index [2] returns function annotated with a goog.CodeLocation default\n     * parameter, which does the call to goog.callerLocation\n     * - index [3] returns\n     * the users call to the function which calls goog.callerLocation\n     */\n    if (stack) stack = stack.split(/\\n/g)[3];\n    if (stack) stack = stack.trim();\n    return /** @type {!goog.CodeLocation} */ (stack || '');\n  }\n  return /** @type {!goog.CodeLocation} */ ('');\n};\n\n\n/**\n * Returns a stable relatively short obfuscated string for a given input\n * string literal.\n *\n * It is guaranteed that:\n * 1. goog.callerLocationIdInternalDoNotCallOrElse(\"foo\") !=\n * goog.callerLocationIdInternalDoNotCallOrElse(\"bar\")\n * 2. goog.callerLocationIdInternalDoNotCallOrElse(\"foo\") ==\n * goog.callerLocationIdInternalDoNotCallOrElse(\"foo\")\n *\n * In unobfuscated mode, the string is just returned with '_' appended to mark\n * the processing. Unobfuscated mode is the \"u\"  and \"du\" modes in MSS, or\n * running a web dev server.\n * @param {string} id The identifier to obfuscate.\n * @return {!goog.CodeLocation}\n *\n * @idGenerator {consistent}\n */\ngoog.callerLocationIdInternalDoNotCallOrElse = function(id) {\n  return /** @type {!goog.CodeLocation} */ (id);\n};\n","/**\n * @license\n * Copyright 2016 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Patches the built-in HTMLElement constructor to work around a compiler bug.\n *\n * For more info, see http://go/es5-custom-elements\n */\n\ngoog.module('webcomponentsjs.custom_elements.es5_shim_implementation');\nconst detectTranspilation = goog.require('google3.javascript.polymer.detect_transpilation.detect_transpilation');\n// Side-effect require the dom shim for NODE_MODE. Should be a noop unless\n// NODE_MODE is true.\n/** @suppress {extraRequire} */\ngoog.require('google3.third_party.javascript.lit.packages.labs.ssr$2ddom$2dshim.src.index');\n\n/**\n * If you use the fast shim, you can save a few bytes by setting this to true.\n *\n * Very few users use the fast shim (or should). If you're looking for faster\n * instantiation, we'd instead recommend serving ES2015+.\n *\n * @define {boolean}\n */\nconst DISABLE_AUTO_CE_ES5_SHIM = goog.define('DISABLE_AUTO_CE_ES5_SHIM', false);\n\n/** @type {boolean} */\nconst shimNotNeeded = DISABLE_AUTO_CE_ES5_SHIM ||\n    !detectTranspilation.wasTranspiledToEs5 ||\n    // An es5 shim is already loaded, don't load again.\n    HTMLElement['es5Shimmed'] ||\n    // No Reflect, no classes, no need for shim because native custom\n    // elements require ES2015 classes or Reflect.\n    goog.global.Reflect === undefined ||\n    goog.global.customElements === undefined ||\n    // The webcomponentsjs custom elements polyfill doesn't require\n    // ES2015-compatible construction (`super()` or `Reflect.construct`).\n    goog.global.customElements['polyfillWrapFlushCallback'] || false;\n\nlet useGlobalsForDev = false;\nexports.devOnlyForceGlobals = () => {\n  if (!goog.DEBUG) {\n    throw new Error('devOnlyForceGlobals can only be called in DEBUG builds');\n  }\n  if (useGlobalsForDev === true) {\n    return;\n  }\n  useGlobalsForDev = true;\n  exports.applyShim();\n};\n\n/**\n * @type {?}\n */\nlet patchedHTMLElement;\n\n/**\n * A ponyfill. You can reference this instead of the global HTMLElement in order\n * to get the shim's behavior without patching the global HTMLElement.\n */\nexports.getHTMLElement = () => {\n  const BuiltInHTMLElement = HTMLElement;\n  if (shimNotNeeded) {\n    return BuiltInHTMLElement;\n  }\n  if (useGlobalsForDev) {\n    // Might be patched, e.g. for go/hot-elements\n    return HTMLElement;\n  }\n\n  if (patchedHTMLElement !== undefined) {\n    return patchedHTMLElement;\n  }\n\n  // So that we can access the page's Reflect, rather than any polyfilled\n  // reflect. We know that the page has a Reflect implementation, because\n  // otherwise shimNotNeeded would be true and we wouldn't have reached\n  // this point.\n  // This is needed for compat with --isolate_polyfills.\n  // TODO(b/276312149): just reference Reflect directly.\n  const reflect = goog.global.Reflect;\n  /**\n   * With jscompiler's RECOMMENDED_FLAGS the function name will be optimized\n   * away. However, if we declare the function as a property on an object\n   * literal, and use quotes for the property name, then closure will leave that\n   * much intact, which is enough for the JS VM to correctly set\n   * Function.prototype.name.\n   */\n  const wrapperForTheName = {\n    'HTMLElement': /** @this {!Object} */ function HTMLElement() {\n      if (goog.DEBUG) {\n        try {\n          return reflect.construct(\n              BuiltInHTMLElement, [],\n              /** @type {!Function} */ (this.constructor));\n        } catch (e) {\n          if (/Illegal constructor/i.test(e.message)) {\n            const className = this.constructor.name || 'the class';\n            e.message += ` - Did you register ${\n                className} in the custom elements registry?`;\n          }\n          throw e;\n        }\n      }\n      return reflect.construct(\n          BuiltInHTMLElement, [], /** @type {!Function} */ (this.constructor));\n    }\n  };\n  const shim = wrapperForTheName['HTMLElement'];\n  shim.prototype = BuiltInHTMLElement.prototype;\n  shim.prototype.constructor = shim;\n  shim.es5Shimmed = true;\n  Object.setPrototypeOf(shim, BuiltInHTMLElement);\n  patchedHTMLElement = shim;\n  return patchedHTMLElement;\n};\n\n\nlet applied = false;\n\n/**\n * Applies the shim globally if needed, overwriting the global HTMLElement.\n */\nexports.applyShim = () => {\n  if (!useGlobalsForDev && shimNotNeeded) {\n    return;\n  }\n  if (applied) {\n    return;\n  }\n  applied = true;\n  goog.global['HTMLElement'] = exports.getHTMLElement();\n};\n","// goog.FEATURESET_YEAR is a common way to opt into compiling for modern\n// browsers. We assume here that if you target FEATURESET_YEAR >= 2019 then\n// you're also going to be transpiling to ES2015 or greater.\nconst isModernFeaturesetYear = goog.FEATURESET_YEAR >= 2019;\n\n// A runtime check that looks for ES2015 classes.\n//\n// Will be true if and only if basic class syntax is not transpiled to ES5.\n// Unlike isModernFeaturesetYear this can't be evaluated at compile time.\nconst servingRawClasses = /^\\s*class\\s*\\{\\s*\\}\\s*$/.test(class {}.toString());\n\n/**\n * This constant should be true if and only if some code in the current\n * runtime environment has been transpiled to ES5.\n *\n * This file is written in TypeScript because ts_development_sources will\n * (in some configurations) transpile TypeScript but not JavaScript.\n * I'm not aware of any cases of the reverse.\n *\n * When compiled with a --browser_featureset_year of 2019 or greater (the first\n * featureset_year above 2012), this will be a compile-time constant, suitable\n * for dead code elimination.\n */\nexport const wasTranspiledToEs5: boolean =\n  isModernFeaturesetYear === true ? false : !servingRawClasses;\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {IS_SERVERSIDE as NODE_MODE} from 'google3/javascript/lit/is_serverside';\n\n// Allows minifiers to rename references to globalThis\nconst global = goog.global;\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets: boolean =\n  // Safari got it in 16.4 which by go/bfy means 2024.\n  goog.FEATURESET_YEAR >= 2024 ||\n  (global.ShadowRoot &&\n    (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&\n    'adoptedStyleSheets' in Document.prototype &&\n    'replace' in CSSStyleSheet.prototype);\n\n/**\n * A CSSResult or native CSSStyleSheet.\n *\n * In browsers that support constructible CSS style sheets, CSSStyleSheet\n * object can be used for styling along side CSSResult from the `css`\n * template tag.\n */\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\n/**\n * A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.\n */\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nconst cssTagCache = new WeakMap<TemplateStringsArray, CSSStyleSheet>();\n\n/**\n * A container for a string of CSS text, that may be used to create a CSSStyleSheet.\n *\n * CSSResult is the return value of `css`-tagged template literals and\n * `unsafeCSS()`. In order to ensure that CSSResults are only created via the\n * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.\n */\nexport class CSSResult {\n  // This property needs to remain unminified.\n  ['_$cssResult$'] = true;\n  readonly cssText: string;\n  private _styleSheet?: CSSStyleSheet;\n  private _strings: TemplateStringsArray | undefined;\n\n  private constructor(\n    cssText: string,\n    strings: TemplateStringsArray | undefined,\n    safeToken: symbol\n  ) {\n    if (safeToken !== constructionToken) {\n      throw new Error(\n        'CSSResult is not constructable. Use `unsafeCSS` or `css` instead.'\n      );\n    }\n    this.cssText = cssText;\n    this._strings = strings;\n  }\n\n  private debugOnlyCachedStyleSheet: CSSStyleSheet|undefined = undefined;\n  // This is a getter so that it's lazy. In practice, this means stylesheets\n  // are not created until the first element instance is made.\n  get styleSheet(): CSSStyleSheet | undefined {\n    if (goog.DEBUG) {\n      // In prod mode, a CSSResult is immutable, and we never change a\n      // CSSStyleSheet's text\n      // In debug mode though, a hot module reload might update our cssText\n      // so we don't want to share a CSSStyleSheet across different CSSResults\n      if (supportsAdoptingStyleSheets &&\n          this.debugOnlyCachedStyleSheet === undefined) {\n        this.debugOnlyCachedStyleSheet = new CSSStyleSheet();\n        this.debugOnlyCachedStyleSheet.replaceSync(this.cssText);\n      }\n      return this.debugOnlyCachedStyleSheet;\n    }\n    // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is\n    // constructable.\n    let styleSheet = this._styleSheet;\n    const strings = this._strings;\n    if (supportsAdoptingStyleSheets && styleSheet === undefined) {\n      const cacheable = strings !== undefined && strings.length === 1;\n      if (cacheable) {\n        styleSheet = cssTagCache.get(strings);\n      }\n      if (styleSheet === undefined) {\n        (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(\n          this.cssText\n        );\n        if (cacheable) {\n          cssTagCache.set(strings, styleSheet);\n        }\n      }\n    }\n    return styleSheet;\n  }\n\n  toString(): string {\n    return this.cssText;\n  }\n\n  /**\n   * Used in the generated output of lit_css_module to implement\n   * hot module reloading for css modules.\n   *\n   * Does nothing in production, and doesn't replace existing references\n   * unless the current browser supports adopting stylesheets (at time of\n   * writing that Chrome only).\n   */\n  notifyOnHotReplace(newVal: CSSResult) {\n    if (goog.DEBUG) {\n      const sheet = this.styleSheet;\n      // Only works with constructable stylesheets\n      if (!sheet) {\n        return;\n      }\n      (this as any).cssText = newVal.cssText;\n      sheet.replaceSync(newVal.cssText);\n    }\n  }\n}\n\ntype ConstructableCSSResult = CSSResult & {\n  new (\n    cssText: string,\n    strings: TemplateStringsArray | undefined,\n    safeToken: symbol\n  ): CSSResult;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n  // This property needs to remain unminified.\n  if ((value as CSSResult)['_$cssResult$'] === true) {\n    return (value as CSSResult).cssText;\n  } else if (typeof value === 'number') {\n    return value;\n  } else {\n    throw new Error(\n      `Value passed to 'css' function must be a 'css' function result: ` +\n        `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +\n        `to ensure page security.`\n    );\n  }\n};\n\n/**\n * Wrap a value for interpolation in a {@linkcode css} tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nconst unsafeCSS = (value: unknown) =>\n  new (CSSResult as ConstructableCSSResult)(\n    typeof value === 'string' ? value : String(value),\n    undefined,\n    constructionToken\n  );\n\n/**\n * A template literal tag which can be used with LitElement's\n * {@linkcode LitElement.styles} property to set element styles.\n *\n * For security reasons, only literal string values and number may be used in\n * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}\n * may be used inside an expression.\n */\nexport const css = (\n  strings: TemplateStringsArray,\n  ...values: (CSSResultGroup | number)[]\n): CSSResult => {\n  return {valueOf() {\n  const cssText =\n    strings.length === 1\n      ? strings[0]\n      : values.reduce(\n          (acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1],\n          strings[0]\n        );\n  return new (CSSResult as ConstructableCSSResult)(\n    cssText,\n    strings,\n    constructionToken\n  )}}.valueOf();\n};\n\n/**\n * Applies the given styles to a `shadowRoot`. When Shadow DOM is\n * available but `adoptedStyleSheets` is not, styles are appended to the\n * `shadowRoot` to [mimic the native feature](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/adoptedStyleSheets).\n * Note, when shimming is used, any styles that are subsequently placed into\n * the shadowRoot should be placed *before* any shimmed adopted styles. This\n * will match spec behavior that gives adopted sheets precedence over styles in\n * shadowRoot.\n */\nexport const adoptStyles = (\n  renderRoot: ShadowRoot,\n  styles: Array<CSSResultOrNative>\n) => {\n  if (supportsAdoptingStyleSheets) {\n    (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n      s instanceof CSSStyleSheet ? s : s.styleSheet!\n    );\n  } else {\n    for (const s of styles) {\n      const style = document.createElement('style');\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const nonce = (global as any)['litNonce'];\n      if (nonce !== undefined) {\n        style.setAttribute('nonce', nonce);\n      }\n      style.textContent = (s as CSSResult).cssText;\n      renderRoot.appendChild(style);\n    }\n  }\n};\n\nconst cssResultFromStyleSheet = (sheet: CSSStyleSheet) => {\n  let cssText = '';\n  for (const rule of sheet.cssRules) {\n    cssText += rule.cssText;\n  }\n  return unsafeCSS(cssText);\n};\n\nexport const getCompatibleStyle =\n  supportsAdoptingStyleSheets ||\n  (NODE_MODE && global.CSSStyleSheet === undefined)\n    ? (s: CSSResultOrNative) => s\n    : (s: CSSResultOrNative) =>\n        s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * ReactiveElement patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill, but\n * support for Shadow DOM like css scoping is opt-in. This module uses ShadyCSS\n * to scope styles defined via the `static styles` property.\n *\n * (COPYBARA: packageDocumentation)\n */\n\nexport {};\n\ninterface RenderOptions {\n  readonly renderBefore?: ChildNode | null;\n  scope?: string;\n}\n\nconst SCOPED = '__scoped';\n\ntype CSSResults = Array<{cssText: string} | CSSStyleSheet>;\n\ninterface PatchableReactiveElementConstructor {\n  [SCOPED]: boolean;\n  elementStyles: CSSResults;\n  shadowRootOptions: ShadowRootInit;\n  _$handlesPrepareStyles?: boolean;\n}\n\ninterface PatchableReactiveElement extends HTMLElement {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n  new (...args: any[]): PatchableReactiveElement;\n  constructor: PatchableReactiveElementConstructor;\n  connectedCallback(): void;\n  hasUpdated: boolean;\n  _$didUpdate(changedProperties: unknown): void;\n  createRenderRoot(): Element | ShadowRoot;\n  renderOptions: RenderOptions;\n}\n\n// Note, explicitly use `var` here so that this can be re-defined when\n// bundled.\n// eslint-disable-next-line no-var\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: var\n\nconst polyfillSupport = ({\n  ReactiveElement,\n}: {\n  ReactiveElement: PatchableReactiveElement;\n}) => {\n  // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n  // We test at the point of patching, which makes it safe to load\n  // webcomponentsjs and polyfill-support in either order\n  if (\n    globalThis.ShadyCSS === undefined ||\n    (globalThis.ShadyCSS.nativeShadow && !globalThis.ShadyCSS.ApplyShim)\n  ) {\n    return;\n  }\n\n  // console.log(\n  //   '%c Making ReactiveElement compatible with ShadyDOM/CSS.',\n  //   'color: lightgreen; font-style: italic'\n  // );\n\n  const elementProto = ReactiveElement.prototype;\n\n  // In noPatch mode, patch the ReactiveElement prototype so that no\n  // ReactiveElements must be wrapped.\n  if (\n    globalThis.ShadyDOM &&\n    globalThis.ShadyDOM.inUse &&\n    globalThis.ShadyDOM.noPatch === true\n  ) {\n    globalThis.ShadyDOM.patchElementProto(elementProto);\n  }\n\n  /**\n   * Patch to apply adoptedStyleSheets via ShadyCSS\n   */\n  const createRenderRoot = elementProto.createRenderRoot;\n  elementProto.createRenderRoot = function (this: PatchableReactiveElement) {\n    // Pass the scope to render options so that it gets to lit-html for proper\n    // scoping via ShadyCSS.\n    const name = this.localName;\n    // If using native Shadow DOM must adoptStyles normally,\n    // otherwise do nothing.\n    if (globalThis.ShadyCSS!.nativeShadow) {\n      return createRenderRoot.call(this);\n    } else {\n      if (!this.constructor.hasOwnProperty(SCOPED)) {\n        (this.constructor as PatchableReactiveElementConstructor)[SCOPED] =\n          true;\n        // Use ShadyCSS's `prepareAdoptedCssText` to shim adoptedStyleSheets.\n        const css = (\n          this.constructor as PatchableReactiveElementConstructor\n        ).elementStyles.map((v) =>\n          v instanceof CSSStyleSheet\n            ? Array.from(v.cssRules).reduce(\n                (a: string, r: CSSRule) => (a += r.cssText),\n                '',\n              )\n            : v.cssText,\n        );\n        globalThis.ShadyCSS?.ScopingShim?.prepareAdoptedCssText(css, name);\n        if (this.constructor._$handlesPrepareStyles === undefined) {\n          globalThis.ShadyCSS!.prepareTemplateStyles(\n            document.createElement('template'),\n            name,\n          );\n        }\n      }\n      return (\n        this.shadowRoot ??\n        this.attachShadow(\n          (this.constructor as PatchableReactiveElementConstructor)\n            .shadowRootOptions,\n        )\n      );\n    }\n  };\n\n  /**\n   * Patch connectedCallback to apply ShadyCSS custom properties shimming.\n   */\n  const connectedCallback = elementProto.connectedCallback;\n  elementProto.connectedCallback = function (this: PatchableReactiveElement) {\n    connectedCallback.call(this);\n    // Note, must do first update separately so that we're ensured\n    // that rendering has completed before calling this.\n    if (this.hasUpdated) {\n      globalThis.ShadyCSS!.styleElement(this);\n    }\n  };\n\n  /**\n   * Patch update to apply ShadyCSS custom properties shimming for first\n   * update.\n   */\n  const didUpdate = elementProto._$didUpdate;\n  elementProto._$didUpdate = function (\n    this: PatchableReactiveElement,\n    changedProperties: unknown,\n  ) {\n    // Note, must do first update here so rendering has completed before\n    // calling this and styles are correct by updated/firstUpdated.\n    if (!this.hasUpdated) {\n      globalThis.ShadyCSS!.styleElement(this);\n    }\n    didUpdate.call(this, changedProperties);\n  };\n};\n\nif (DEV_MODE) {\n  globalThis.reactiveElementPolyfillSupportDevMode ??= polyfillSupport;\n} else if (goog.FEATURESET_YEAR < 2020) {\n  globalThis.reactiveElementPolyfillSupport ??= polyfillSupport;\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport './polyfill-support';\nimport {noAwait} from 'google3/javascript/typescript/contrib/async';\nimport {objectProperty} from 'google3/third_party/javascript/closure/reflect/reflect';\n\n\n/**\n * Use this module if you want to create your own base class extending\n * {@link ReactiveElement}.\n * (COPYBARA: packageDocumentation)\n */\n\nimport {\n  getCompatibleStyle,\n  adoptStyles,\n  CSSResultGroup,\n  CSSResultOrNative,\n} from './css-tag.js';\nimport type {\n  ReactiveController,\n  ReactiveControllerHost,\n} from './reactive-controller.js';\n\n// So that custom elements work after compilation to es5.\nimport {getHTMLElement, applyShim} from 'google3/third_party/javascript/custom_elements/src/native-shim-impl';\nif (goog.TRUSTED_SITE) {\n  applyShim();\n}\nconst HTMLElement = getHTMLElement() as unknown as typeof globalThis.HTMLElement;\ntype HTMLElement = globalThis.HTMLElement;\n\n// In the Node build, this import will be injected by Rollup:\n// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';\n\nexport * from './css-tag.js';\nexport /* COPYBARA: type */ {\n  ReactiveController,\n  ReactiveControllerHost,\n} from './reactive-controller.js';\n\n/**\n * Removes the `readonly` modifier from properties in the union K.\n *\n * This is a safer way to cast a value to a type with a mutable version of a\n * readonly field, than casting to an interface with the field re-declared\n * because it preserves the type of all the fields and warns on typos.\n */\ntype Mutable<T, K extends keyof T> = Omit<T, K> & {\n  -readonly [P in keyof Pick<T, K>]: P extends K ? T[P] : never;\n};\n\n// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022\nconst {\n  is,\n  defineProperty,\n  getOwnPropertyDescriptor,\n  getOwnPropertyNames,\n  getOwnPropertySymbols,\n  getPrototypeOf,\n} = Object;\n\nimport {IS_SERVERSIDE as NODE_MODE} from 'google3/javascript/lit/is_serverside';\n\n// Lets a minifier replace globalThis references with a minified name\nconst global = goog.global;\n\nif (NODE_MODE) {\n  global.customElements ??= customElements;\n}\n\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: const\n\nlet issueWarning: (code: string, warning: string) => void;\n\nconst trustedTypes = (global as unknown as {trustedTypes?: {emptyScript: ''}})\n  .trustedTypes;\n\n// Temporary workaround for https://crbug.com/993268\n// Currently, any attribute starting with \"on\" is considered to be a\n// TrustedScript source. Such boolean attributes must be set to the equivalent\n// trusted emptyScript value.\nconst emptyStringForBooleanAttribute = trustedTypes\n  ? (trustedTypes.emptyScript as unknown as '')\n  : '';\n\nconst polyfillSupport = DEV_MODE\n  ? global.reactiveElementPolyfillSupportDevMode\n  : global.reactiveElementPolyfillSupport;\n\nif (DEV_MODE) {\n  // Ensure warnings are issued only 1x, even if multiple versions of Lit\n  // are loaded.\n  global.litIssuedWarnings ??= new Set();\n\n  /**\n   * Issue a warning if we haven't already, based either on `code` or `warning`.\n   * Warnings are disabled automatically only by `warning`; disabling via `code`\n   * can be done by users.\n   */\n  issueWarning = (code: string, warning: string) => {\n    warning += ` See https://lit.dev/msg/${code} for more information.`;\n    if (\n      !global.litIssuedWarnings!.has(warning) &&\n      !global.litIssuedWarnings!.has(code)\n    ) {\n      console.warn(warning);\n      global.litIssuedWarnings!.add(warning);\n    }\n  };\n\n  Promise.resolve().then(() => {\n\n    // Issue polyfill support warning.\n    if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {\n      issueWarning(\n        'polyfill-support-missing',\n        `Shadow DOM is being polyfilled via \\`ShadyDOM\\` but ` +\n          `the \\`polyfill-support\\` module has not been loaded.`\n      );\n    }\n  });\n}\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReactiveUnstable {\n  /**\n   * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n   * we will emit 'lit-debug' events to window, with live details about the update and render\n   * lifecycle. These can be useful for writing debug tooling and visualizations.\n   *\n   * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n   * making certain operations that are normally very cheap (like a no-op render) much slower,\n   * because we must copy data and dispatch events.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  export namespace DebugLog {\n    export type Entry = Update;\n    export interface Update {\n      kind: 'update';\n    }\n  }\n}\n\ninterface DebugLoggingWindow {\n  // Even in dev mode, we generally don't want to emit these events, as that's\n  // another level of cost, so only emit them when DEV_MODE is true _and_ when\n  // window.emitLitDebugEvents is true.\n  emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n  ? (event: ReactiveUnstable.DebugLog.Entry) => {\n      const shouldEmit = (global as unknown as DebugLoggingWindow)\n        .emitLitDebugLogEvents;\n      if (!shouldEmit) {\n        return;\n      }\n      global.dispatchEvent(\n        new CustomEvent<ReactiveUnstable.DebugLog.Entry>('lit-debug', {\n          detail: event,\n        })\n      );\n    }\n  : undefined;\n\n// COPYBARA: JSCompiler_renameProperty\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n  /**\n   * Called to convert an attribute value to a property\n   * value.\n   */\n  fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n  /**\n   * Called to convert a property value to an attribute\n   * value.\n   *\n   * It returns unknown instead of string, to be compatible with\n   * https://github.com/WICG/trusted-types (and similar efforts).\n   */\n  toAttribute?(value: Type, type?: TypeHint): unknown;\n}\n\ntype AttributeConverter<Type = unknown, TypeHint = unknown> =\n  | ComplexAttributeConverter<Type>\n  | ((value: string | null, type?: TypeHint) => Type);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {\n  /**\n   * When set to `true`, indicates the property is internal private state. The\n   * property should not be set by users. When using TypeScript, this property\n   * should be marked as `private` or `protected`, and it is also a common\n   * practice to use a leading `_` in the name. The property is not added to\n   * `observedAttributes`.\n   */\n  readonly state?: boolean;\n\n  /**\n   * Indicates how and whether the property becomes an observed attribute.\n   * If the value is `false`, the property is not added to `observedAttributes`.\n   * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n   * becomes `foobar`). If a string, the string value is observed (e.g\n   * `attribute: 'foo-bar'`).\n   */\n  readonly attribute?: boolean | string;\n\n  /**\n   * Indicates the type of the property. This is used only as a hint for the\n   * `converter` to determine how to convert the attribute\n   * to/from a property.\n   */\n  readonly type?: TypeHint;\n\n  /**\n   * Indicates how to convert the attribute to/from a property. If this value\n   * is a function, it is used to convert the attribute value a the property\n   * value. If it's an object, it can have keys for `fromAttribute` and\n   * `toAttribute`. If no `toAttribute` function is provided and\n   * `reflect` is set to `true`, the property value is set directly to the\n   * attribute. A default `converter` is used if none is provided; it supports\n   * `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,\n   * when a property changes and the converter is used to update the attribute,\n   * the property is never updated again as a result of the attribute changing,\n   * and vice versa.\n   */\n  readonly converter?: AttributeConverter<Type, TypeHint>;\n\n  /**\n   * Indicates if the property should reflect to an attribute.\n   * If `true`, when the property is set, the attribute is set using the\n   * attribute name determined according to the rules for the `attribute`\n   * property option and the value of the property converted using the rules\n   * from the `converter` property option.\n   */\n  readonly reflect?: boolean;\n\n  /**\n   * A function that indicates if a property should be considered changed when\n   * it is set. The function should take the `newValue` and `oldValue` and\n   * return `true` if an update should be requested.\n   */\n  hasChanged?(value: Type, oldValue: Type): boolean;\n\n  /**\n   * Indicates whether an accessor will be created for this property. By\n   * default, an accessor will be generated for this property that requests an\n   * update when set. If this flag is `true`, no accessor will be created, and\n   * it will be the user's responsibility to call\n   * `this.requestUpdate(propertyName, oldValue)` to request an update when\n   * the property changes.\n   */\n  readonly noAccessor?: boolean;\n\n  /**\n   * Whether this property is wrapping accessors. This is set by `@property`\n   * to control the initial value change and reflection logic.\n   *\n   * @internal\n   */\n  wrapped?: boolean;\n\n  /**\n   * When `true`, uses the initial value of the property as the default value,\n   * which changes how attributes are handled:\n   *  - The initial value does *not* reflect, even if the `reflect` option is `true`.\n   *    Subsequent changes to the property will reflect, even if they are equal to the\n   *     default value.\n   *  - When the attribute is removed, the property is set to the default value\n   *  - The initial value will not trigger an old value in the `changedProperties` map\n   *    argument to update lifecycle methods.\n   *\n   * When set, properties must be initialized, either with a field initializer, or an\n   * assignment in the constructor. Not initializing the property may lead to\n   * improper handling of subsequent property assignments.\n   *\n   * While this behavior is opt-in, most properties that reflect to attributes should\n   * use `useDefault: true` so that their initial values do not reflect.\n   */\n  useDefault?: boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n  readonly [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\n/**\n * A Map of property keys to values.\n *\n * Takes an optional type parameter T, which when specified as a non-any,\n * non-unknown type, will make the Map more strongly-typed, associating the map\n * keys with their corresponding value type on T.\n *\n * Use `PropertyValues<this>` when overriding ReactiveElement.update() and\n * other lifecycle methods in order to get stronger type-checking on keys\n * and values.\n */\n// This type is conditional so that if the parameter T is not specified, or\n// is `any`, the type will include `Map<PropertyKey, unknown>`. Since T is not\n// given in the uses of PropertyValues in this file, all uses here fallback to\n// meaning `Map<PropertyKey, unknown>`, but if a developer uses\n// `PropertyValues<this>` (or any other value for T) they will get a\n// strongly-typed Map type.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = T extends object\n  ? PropertyValueMap<T>\n  : Map<PropertyKey, unknown>;\n\n/**\n * Do not use, instead prefer {@linkcode PropertyValues}.\n */\n// This type must be exported such that JavaScript generated by the Google\n// Closure Compiler can import a type reference.\nexport interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {\n  get<K extends keyof T>(k: K): T[K] | undefined;\n  set<K extends keyof T>(key: K, value: T[K]): this;\n  has<K extends keyof T>(k: K): boolean;\n  delete<K extends keyof T>(k: K): boolean;\n}\n\nexport const defaultConverter: ComplexAttributeConverter = {\n  toAttribute(value: unknown, type?: unknown): unknown {\n    switch (type) {\n      case Boolean:\n        value = value ? emptyStringForBooleanAttribute : null;\n        break;\n      case Object:\n      case Array:\n        // if the value is `null` or `undefined` pass this through\n        // to allow removing/no change behavior.\n        value = value == null ? value : JSON.stringify(value);\n        break;\n    }\n    return value;\n  },\n\n  fromAttribute(value: string | null, type?: unknown) {\n    let fromValue: unknown = value;\n    switch (type) {\n      case Boolean:\n        fromValue = value !== null;\n        break;\n      case Number:\n        fromValue = value === null ? null : Number(value);\n        break;\n      case Object:\n      case Array:\n        // Do *not* generate exception when invalid JSON is set as elements\n        // don't normally complain on being mis-configured.\n        // TODO(sorvell): Do generate exception in *dev mode*.\n        try {\n          // Assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n          fromValue = JSON.parse(value!) as unknown;\n        } catch (e) {\n          fromValue = null;\n        }\n        break;\n    }\n    return fromValue;\n  },\n};\n\nexport interface HasChanged {\n  (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean =>\n  !is(value, old);\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n  attribute: true,\n  type: String,\n  converter: defaultConverter,\n  reflect: false,\n  useDefault: false,\n  hasChanged: notEqual,\n};\n\n/**\n * A string representing one of the supported dev mode warning categories.\n */\nexport type WarningKind =\n  | 'change-in-update'\n  | 'migration'\n  | 'async-perform-update';\n\nexport type Initializer = (element: ReactiveElement) => void;\n\n// Temporary, until google3 is on TypeScript 5.2\ndeclare global {\n  interface SymbolConstructor {\n    readonly metadata: unique symbol;\n  }\n}\n\n// Ensure metadata is enabled. TypeScript does not polyfill\n// symbolMetadata, so we must ensure that it exists.\nconst symbolMetadata: unique symbol =\n    ({\n      valueOf() {\n        if (Symbol.metadata == null) {\n          (Symbol as {metadata: symbol}).metadata = Symbol('metadata');\n        }\n        return Symbol.metadata;\n      }\n    }).valueOf() as any;\n\nexport const litPropertyMetadata =\n    new WeakMap<object, Map<PropertyKey, PropertyDeclaration>>();\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclasses to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n  // In the Node build, this `extends` clause will be substituted with\n  // `(globalThis.HTMLElement ?? HTMLElement)`.\n  //\n  // This way, we will first prefer any global `HTMLElement` polyfill that the\n  // user has assigned, and then fall back to the `HTMLElement` shim which has\n  // been imported (see note at the top of this file about how this import is\n  // generated by Rollup). Note that the `HTMLElement` variable has been\n  // shadowed by this import, so it no longer refers to the global.\n  extends HTMLElement\n  implements ReactiveControllerHost\n{\n  // Note: these are patched in only in DEV_MODE.\n  /**\n   * Read or set all the enabled warning categories for this class.\n   *\n   * This property is only used in development builds.\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static enabledWarnings?: WarningKind[];\n\n  /**\n   * Enable the given warning category for this class.\n   *\n   * This method only exists in development builds, so it should be accessed\n   * with a guard like:\n   *\n   * ```ts\n   * // Enable for all ReactiveElement subclasses\n   * ReactiveElement.enableWarning?.('migration');\n   *\n   * // Enable for only MyElement and subclasses\n   * MyElement.enableWarning?.('migration');\n   * ```\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static enableWarning?: (warningKind: WarningKind) => void;\n\n  /**\n   * Disable the given warning category for this class.\n   *\n   * This method only exists in development builds, so it should be accessed\n   * with a guard like:\n   *\n   * ```ts\n   * // Disable for all ReactiveElement subclasses\n   * ReactiveElement.disableWarning?.('migration');\n   *\n   * // Disable for only MyElement and subclasses\n   * MyElement.disableWarning?.('migration');\n   * ```\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static disableWarning?: (warningKind: WarningKind) => void;\n\n  /**\n   * Adds an initializer function to the class that is called during instance\n   * construction.\n   *\n   * This is useful for code that runs against a `ReactiveElement`\n   * subclass, such as a decorator, that needs to do work for each\n   * instance, such as setting up a `ReactiveController`.\n   *\n   * ```ts\n   * const myDecorator = (target: typeof ReactiveElement, key: string) => {\n   *   target.addInitializer((instance: ReactiveElement) => {\n   *     // This is run during construction of the element\n   *     new MyController(instance);\n   *   });\n   * }\n   * ```\n   *\n   * Decorating a field will then cause each instance to run an initializer\n   * that adds a controller:\n   *\n   * ```ts\n   * class MyElement extends LitElement {\n   *   @myDecorator foo;\n   * }\n   * ```\n   *\n   * Initializers are stored per-constructor. Adding an initializer to a\n   * subclass does not add it to a superclass. Since initializers are run in\n   * constructors, initializers will run in order of the class hierarchy,\n   * starting with superclasses and progressing to the instance's class.\n   *\n   * @nocollapse\n   */\n  static addInitializer(initializer: Initializer) {\n    this.__prepare();\n    (this._initializers ??= []).push(initializer);\n  }\n\n  static _initializers?: Initializer[];\n\n  /*\n   * Due to closure compiler ES6 compilation bugs, @nocollapse is required on\n   * all static methods and properties with initializers.  Reference:\n   * - https://github.com/google/closure-compiler/issues/1776\n   */\n\n  /**\n   * Maps attribute names to properties; for example `foobar` attribute to\n   * `fooBar` property. Created lazily on user subclasses when finalizing the\n   * class.\n   * @nocollapse\n   */\n  private static __attributeToPropertyMap: AttributeMap;\n\n  /**\n   * Marks class as having been finalized, which includes creating properties\n   * from `static properties`, but does *not* include all properties created\n   * from decorators.\n   * @nocollapse\n   */\n  protected static finalized: true | undefined;\n\n  /**\n   * Memoized list of all element properties, including any superclass\n   * properties. Created lazily on user subclasses when finalizing the class.\n   *\n   * @nocollapse\n   * @category properties\n   */\n  static elementProperties: PropertyDeclarationMap;\n\n  /**\n   * User-supplied object that maps property names to `PropertyDeclaration`\n   * objects containing options for configuring reactive properties. When\n   * a reactive property is set the element will update and render.\n   *\n   * By default properties are public fields, and as such, they should be\n   * considered as primarily settable by element users, either via attribute or\n   * the property itself.\n   *\n   * Generally, properties that are changed by the element should be private or\n   * protected fields and should use the `state: true` option. Properties\n   * marked as `state` do not reflect from the corresponding attribute\n   *\n   * However, sometimes element code does need to set a public property. This\n   * should typically only be done in response to user interaction, and an event\n   * should be fired informing the user; for example, a checkbox sets its\n   * `checked` property when clicked and fires a `changed` event. Mutating\n   * public properties should typically not be done for non-primitive (object or\n   * array) properties. In other cases when an element needs to manage state, a\n   * private property set with the `state: true` option should be used. When\n   * needed, state properties can be initialized via public properties to\n   * facilitate complex interactions.\n   * @nocollapse\n   * @category properties\n   */\n  static properties: PropertyDeclarations;\n\n  /**\n   * Memoized list of all element styles.\n   * Created lazily on user subclasses when finalizing the class.\n   * @nocollapse\n   * @category styles\n   */\n  static elementStyles: Array<CSSResultOrNative> = [];\n\n  /**\n   * Array of styles to apply to the element. The styles should be defined\n   * using the {@linkcode css} tag function, via constructible stylesheets, or\n   * imported from native CSS module scripts.\n   *\n   * Note on Content Security Policy:\n   *\n   * Element styles are implemented with `<style>` tags when the browser doesn't\n   * support adopted StyleSheets. To use such `<style>` tags with the style-src\n   * CSP directive, the style-src value must either include 'unsafe-inline' or\n   * `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated\n   * nonce.\n   *\n   * To provide a nonce to use on generated `<style>` elements, set\n   * `window.litNonce` to a server-generated nonce in your page's HTML, before\n   * loading application code:\n   *\n   * ```html\n   * <script>\n   *   // Generated and unique per request:\n   *   window.litNonce = 'a1b2c3d4';\n   * \u003c/script>\n   * ```\n   * @nocollapse\n   * @category styles\n   */\n  static styles?: CSSResultGroup;\n\n  /**\n   * Returns a list of attributes corresponding to the registered properties.\n   * @nocollapse\n   * @category attributes\n   */\n  static get observedAttributes() {\n    // Ensure we've created all properties\n    this.finalize();\n    // this.__attributeToPropertyMap is only undefined after finalize() in\n    // ReactiveElement itself. ReactiveElement.observedAttributes is only\n    // accessed with ReactiveElement as the receiver when a subclass or mixin\n    // calls super.observedAttributes\n    return (\n      this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n    );\n  }\n\n  private __instanceProperties?: PropertyValues = undefined;\n\n  /**\n   * Creates a property accessor on the element prototype if one does not exist\n   * and stores a {@linkcode PropertyDeclaration} for the property with the\n   * given options. The property setter calls the property's `hasChanged`\n   * property option or uses a strict identity check to determine whether or not\n   * to request an update.\n   *\n   * This method may be overridden to customize properties; however,\n   * when doing so, it's important to call `super.createProperty` to ensure\n   * the property is setup correctly. This method calls\n   * `getPropertyDescriptor` internally to get a descriptor to install.\n   * To customize what properties do when they are get or set, override\n   * `getPropertyDescriptor`. To customize the options for a property,\n   * implement `createProperty` like this:\n   *\n   * ```ts\n   * static createProperty(name, options) {\n   *   options = Object.assign(options, {myOption: true});\n   *   super.createProperty(name, options);\n   * }\n   * ```\n   *\n   * @nocollapse\n   * @category properties\n   */\n  static createProperty(\n    name: PropertyKey,\n    options: PropertyDeclaration = defaultPropertyDeclaration\n  ) {\n    // If this is a state property, force the attribute to false.\n    if (options.state) {\n      (options as Mutable<PropertyDeclaration, 'attribute'>).attribute = false;\n    }\n    this.__prepare();\n    // Whether this property is wrapping accessors.\n    // Helps control the initial value change and reflection logic.\n    if (this.prototype.hasOwnProperty(name)) {\n      options = Object.create(options);\n      options.wrapped = true;\n    }\n    this.elementProperties.set(name, options);\n    if (!options.noAccessor) {\n      const key = DEV_MODE\n        ? // Use Symbol.for in dev mode to make it easier to maintain state\n          // when doing HMR.\n          `${String(name)} (@property() cache)`\n        : Symbol();\n      const descriptor = this.getPropertyDescriptor(name, key, options);\n      if (descriptor !== undefined) {\n        defineProperty(this.prototype, name, descriptor);\n      }\n    }\n  }\n\n  /**\n   * Returns a property descriptor to be defined on the given named property.\n   * If no descriptor is returned, the property will not become an accessor.\n   * For example,\n   *\n   * ```ts\n   * class MyElement extends LitElement {\n   *   static getPropertyDescriptor(name, key, options) {\n   *     const defaultDescriptor =\n   *         super.getPropertyDescriptor(name, key, options);\n   *     const setter = defaultDescriptor.set;\n   *     return {\n   *       get: defaultDescriptor.get,\n   *       set(value) {\n   *         setter.call(this, value);\n   *         // custom action.\n   *       },\n   *       configurable: true,\n   *       enumerable: true\n   *     }\n   *   }\n   * }\n   * ```\n   *\n   * @nocollapse\n   * @category properties\n   */\n  protected static getPropertyDescriptor(\n    name: PropertyKey,\n    key: string | symbol,\n    options: PropertyDeclaration\n  ): PropertyDescriptor | undefined {\n    const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n      get(this: ReactiveElement) {\n        return this[key as keyof typeof this];\n      },\n      set(this: ReactiveElement, v: unknown) {\n        (this as unknown as Record<string | symbol, unknown>)[key] = v;\n      },\n    };\n    if (DEV_MODE && get == null) {\n      if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n        throw new Error(\n          `Field ${JSON.stringify(String(name))} on ` +\n            `${this.name} was declared as a reactive property ` +\n            `but it's actually declared as a value on the prototype. ` +\n            `Usually this is due to using @property or @state on a method.`\n        );\n      }\n      issueWarning(\n        'reactive-property-without-getter',\n        `Field ${JSON.stringify(String(name))} on ` +\n          `${this.name} was declared as a reactive property ` +\n          `but it does not have a getter. This will be an error in a ` +\n          `future version of Lit.`\n      );\n    }\n    return {\n      get,\n      set(this: ReactiveElement, value: unknown) {\n        const oldValue = get?.call(this);\n        set?.call(this, value);\n        this.requestUpdate(name, oldValue, options);\n      },\n      configurable: true,\n      enumerable: true,\n    };\n  }\n\n  /**\n   * Returns the property options associated with the given property.\n   * These options are defined with a `PropertyDeclaration` via the `properties`\n   * object or the `@property` decorator and are registered in\n   * `createProperty(...)`.\n   *\n   * Note, this method should be considered \"final\" and not overridden. To\n   * customize the options for a given property, override\n   * {@linkcode createProperty}.\n   *\n   * @nocollapse\n   * @final\n   * @category properties\n   */\n  static getPropertyOptions(name: PropertyKey) {\n    return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n  }\n\n  // Temporary, until google3 is on TypeScript 5.2\n  declare static [symbolMetadata]: object & Record<PropertyKey, unknown>;\n\n  /**\n   * Initializes static own properties of the class used in bookkeeping\n   * for element properties, initializers, etc.\n   *\n   * Can be called multiple times by code that needs to ensure these\n   * properties exist before using them.\n   *\n   * This method ensures the superclass is finalized so that inherited\n   * property metadata can be copied down.\n   * @nocollapse\n   */\n  private static __prepare() {\n    if (\n      this.hasOwnProperty(objectProperty('elementProperties', this))\n    ) {\n      // Already prepared\n      return;\n    }\n    // Finalize any superclasses\n    const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n    superCtor.finalize();\n\n    // Create own set of initializers for this class if any exist on the\n    // superclass and copy them down. Note, for a small perf boost, avoid\n    // creating initializers unless needed.\n    if (superCtor._initializers !== undefined) {\n      this._initializers = [...superCtor._initializers];\n    }\n    // Initialize elementProperties from the superclass\n    this.elementProperties = new Map(superCtor.elementProperties);\n  }\n\n  /**\n   * Finishes setting up the class so that it's ready to be registered\n   * as a custom element and instantiated.\n   *\n   * This method is called by the ReactiveElement.observedAttributes getter.\n   * If you override the observedAttributes getter, you must either call\n   * super.observedAttributes to trigger finalization, or call finalize()\n   * yourself.\n   *\n   * @nocollapse\n   */\n  protected static finalize() {\n    oneTimeWork();\n    if (this.hasOwnProperty(objectProperty('finalized', this))) {\n      return;\n    }\n    this.finalized = true;\n    this.__prepare();\n\n    // Create properties from the static properties block:\n    if (this.hasOwnProperty(objectProperty('properties', this))) {\n      const props = this.properties;\n      const propKeys = [\n        ...getOwnPropertyNames(props),\n        ...getOwnPropertySymbols(props),\n      ] as Array<keyof typeof props>;\n      for (const p of propKeys) {\n        this.createProperty(p, props[p]);\n      }\n    }\n\n    // Create properties from standard decorator metadata:\n    const metadata = this[symbolMetadata];\n    if (metadata !== null) {\n      const properties = litPropertyMetadata.get(metadata);\n      if (properties !== undefined) {\n        for (const [p, options] of properties) {\n          this.elementProperties.set(p, options);\n        }\n      }\n    }\n\n    // Create the attribute-to-property map\n    this.__attributeToPropertyMap = new Map();\n    for (const [p, options] of this.elementProperties) {\n      const attr = this.__attributeNameForProperty(p, options);\n      if (attr !== undefined) {\n        this.__attributeToPropertyMap.set(attr, p);\n      }\n    }\n\n    this.elementStyles = this.finalizeStyles(this.styles);\n\n    if (DEV_MODE) {\n      if (this.hasOwnProperty('createProperty')) {\n        issueWarning(\n          'no-override-create-property',\n          'Overriding ReactiveElement.createProperty() is deprecated. ' +\n            'The override will not be called with standard decorators'\n        );\n      }\n      if (this.hasOwnProperty('getPropertyDescriptor')) {\n        issueWarning(\n          'no-override-get-property-descriptor',\n          'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n            'The override will not be called with standard decorators'\n        );\n      }\n    }\n  }\n\n  /**\n   * Options used when calling `attachShadow`. Set this property to customize\n   * the options for the shadowRoot; for example, to create a closed\n   * shadowRoot: `{mode: 'closed'}`.\n   *\n   * Note, these options are used in `createRenderRoot`. If this method\n   * is customized, options should be respected if possible.\n   * @nocollapse\n   * @category rendering\n   */\n  static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n  /**\n   * Takes the styles the user supplied via the `static styles` property and\n   * returns the array of styles to apply to the element.\n   * Override this method to integrate into a style management system.\n   *\n   * Styles are deduplicated preserving the _last_ instance in the list. This\n   * is a performance optimization to avoid duplicated styles that can occur\n   * especially when composing via subclassing. The last item is kept to try\n   * to preserve the cascade order with the assumption that it's most important\n   * that last added styles override previous styles.\n   *\n   * @nocollapse\n   * @category styles\n   */\n  protected static finalizeStyles(\n    styles?: CSSResultGroup\n  ): Array<CSSResultOrNative> {\n    const elementStyles = [];\n    if (Array.isArray(styles)) {\n      // Dedupe the flattened array in reverse order to preserve the last items.\n      // Casting to Array<unknown> works around TS error that\n      // appears to come from trying to flatten a type CSSResultArray.\n      const set = new Set((styles as Array<unknown>).flat(Infinity).reverse());\n      // Then preserve original order by adding the set items in reverse order.\n      for (const s of set) {\n        elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n      }\n    } else if (styles !== undefined) {\n      elementStyles.push(getCompatibleStyle(styles));\n    }\n    return elementStyles;\n  }\n\n  /**\n   * Node or ShadowRoot into which element DOM should be rendered. Defaults\n   * to an open shadowRoot.\n   * @category rendering\n   */\n  readonly renderRoot!: HTMLElement | DocumentFragment;\n\n  /**\n   * Returns the property name for the given attribute `name`.\n   * @nocollapse\n   */\n  private static __attributeNameForProperty(\n    name: PropertyKey,\n    options: PropertyDeclaration\n  ) {\n    const attribute = options.attribute;\n    return attribute === false\n      ? undefined\n      : typeof attribute === 'string'\n        ? attribute\n        : typeof name === 'string'\n          ? name.toLowerCase()\n          : undefined;\n  }\n\n  // Initialize to an unresolved Promise so we can make sure the element has\n  // connected before first update.\n  private __updatePromise!: Promise<boolean>;\n\n  /**\n   * True if there is a pending update as a result of calling `requestUpdate()`.\n   * Should only be read.\n   * @category updates\n   */\n  isUpdatePending = false;\n\n  /**\n   * Is set to `true` after the first update. The element code cannot assume\n   * that `renderRoot` exists before the element `hasUpdated`.\n   * @category updates\n   */\n  hasUpdated = false;\n\n  /**\n   * Map with keys for any properties that have changed since the last\n   * update cycle with previous values.\n   *\n   * @internal\n   */\n  _$changedProperties!: PropertyValues;\n\n  /**\n   * Records property default values when the\n   * `useDefault` option is used.\n   */\n  private __defaultValues?: Map<PropertyKey, unknown>;\n\n  /**\n   * Properties that should be reflected when updated.\n   */\n  private __reflectingProperties?: Set<PropertyKey>;\n\n  /**\n   * Name of currently reflecting property\n   */\n  private __reflectingProperty: PropertyKey | null = null;\n\n  /**\n   * Set of controllers.\n   */\n  private __controllers?: Set<ReactiveController>;\n\n  protected squelchUpdateErrorsDuringLit2Migration?: boolean;\n\n  constructor() {\n    super();\n    this.__initialize();\n  }\n\n  /**\n   * Internal only override point for customizing work done when elements\n   * are constructed.\n   */\n  private __initialize() {\n    this.__updatePromise = new Promise<boolean>(\n      (res) => (this.enableUpdating = res)\n    );\n    this._$changedProperties = new Map();\n    // This enqueues a microtask that must run before the first update, so it\n    // must be called before requestUpdate()\n    this.__saveInstanceProperties();\n    // ensures first update will be caught by an early access of\n    // `updateComplete`\n    this.requestUpdate();\n    (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n      i(this)\n    );\n  }\n\n  /**\n   * Registers a `ReactiveController` to participate in the element's reactive\n   * update cycle. The element automatically calls into any registered\n   * controllers during its lifecycle callbacks.\n   *\n   * If the element is connected when `addController()` is called, the\n   * controller's `hostConnected()` callback will be immediately called.\n   * @category controllers\n   */\n  addController(controller: ReactiveController) {\n    (this.__controllers ??= new Set()).add(controller);\n    // If a controller is added after the element has been connected,\n    // call hostConnected. Note, re-using existence of `renderRoot` here\n    // (which is set in connectedCallback) to avoid the need to track a\n    // first connected state.\n    if (this.renderRoot !== undefined && this.isConnected) {\n      controller.hostConnected?.();\n    }\n  }\n\n  /**\n   * Removes a `ReactiveController` from the element.\n   * @category controllers\n   */\n  removeController(controller: ReactiveController) {\n    this.__controllers?.delete(controller);\n  }\n\n  /**\n   * Fixes any properties set on the instance before upgrade time.\n   * Otherwise these would shadow the accessor and break these properties.\n   * The properties are stored in a Map which is played back after the\n   * constructor runs.\n   */\n  private __saveInstanceProperties() {\n    const instanceProperties = new Map<PropertyKey, unknown>();\n    const elementProperties = (this.constructor as typeof ReactiveElement)\n      .elementProperties;\n    for (const p of elementProperties.keys() as IterableIterator<keyof this>) {\n      if (this.hasOwnProperty(p)) {\n        instanceProperties.set(p, this[p]);\n        delete this[p];\n      }\n    }\n    if (instanceProperties.size > 0) {\n      this.__instanceProperties = instanceProperties;\n    }\n  }\n\n  /**\n   * Returns the node into which the element should render and by default\n   * creates and returns an open shadowRoot. Implement to customize where the\n   * element's DOM is rendered. For example, to render into the element's\n   * childNodes, return `this`.\n   *\n   * @return Returns a node into which to render.\n   * @category rendering\n   */\n  protected createRenderRoot(): HTMLElement | DocumentFragment {\n    const renderRoot =\n      this.shadowRoot ??\n      this.attachShadow(\n        (this.constructor as typeof ReactiveElement).shadowRootOptions\n      );\n    adoptStyles(\n      renderRoot,\n      (this.constructor as typeof ReactiveElement).elementStyles\n    );\n    return renderRoot;\n  }\n\n  /**\n   * On first connection, creates the element's renderRoot, sets up\n   * element styling, and enables updating.\n   * @category lifecycle\n   */\n  connectedCallback() {\n    // Create renderRoot before controllers `hostConnected`\n    (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n      this.createRenderRoot();\n    this.enableUpdating(true);\n    this.__controllers?.forEach((c) => c.hostConnected?.());\n  }\n\n  /**\n   * Note, this method should be considered final and not overridden. It is\n   * overridden on the element instance with a function that triggers the first\n   * update.\n   * @category updates\n   */\n  protected enableUpdating(_requestedUpdate: boolean) {}\n\n  /**\n   * Allows for `super.disconnectedCallback()` in extensions while\n   * reserving the possibility of making non-breaking feature additions\n   * when disconnecting at some point in the future.\n   * @category lifecycle\n   */\n  disconnectedCallback() {\n    this.__controllers?.forEach((c) => c.hostDisconnected?.());\n  }\n\n  /**\n   * Synchronizes property values when attributes change.\n   *\n   * Specifically, when an attribute is set, the corresponding property is set.\n   * You should rarely need to implement this callback. If this method is\n   * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n   * called.\n   *\n   * See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)\n   * on MDN for more information about the `attributeChangedCallback`.\n   * @category attributes\n   */\n  attributeChangedCallback(\n    name: string,\n    _old: string | null,\n    value: string | null\n  ) {\n    this._$attributeToProperty(name, value);\n  }\n\n  private __propertyToAttribute(name: PropertyKey, value: unknown) {\n    const elemProperties: PropertyDeclarationMap = (\n      this.constructor as typeof ReactiveElement\n    ).elementProperties;\n    const options = elemProperties.get(name)!;\n    const attr = (\n      this.constructor as typeof ReactiveElement\n    ).__attributeNameForProperty(name, options);\n    if (attr !== undefined && options.reflect === true) {\n      const converter =\n        (options.converter as ComplexAttributeConverter)?.toAttribute !==\n        undefined\n          ? (options.converter as ComplexAttributeConverter)\n          : defaultConverter;\n      const attrValue = converter.toAttribute!(value, options.type);\n      if (\n        DEV_MODE &&\n        (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n          'migration'\n        ) &&\n        attrValue === undefined\n      ) {\n        issueWarning(\n          'undefined-attribute-value',\n          `The attribute value for the ${name as string} property is ` +\n            `undefined on element ${this.localName}. The attribute will be ` +\n            `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n            `the attribute would not have changed.`\n        );\n      }\n      // Track if the property is being reflected to avoid\n      // setting the property again via `attributeChangedCallback`. Note:\n      // 1. this takes advantage of the fact that the callback is synchronous.\n      // 2. will behave incorrectly if multiple attributes are in the reaction\n      // stack at time of calling. However, since we process attributes\n      // in `update` this should not be possible (or an extreme corner case\n      // that we'd like to discover).\n      // mark state reflecting\n      this.__reflectingProperty = name;\n      if (attrValue == null) {\n        this.removeAttribute(attr);\n      } else {\n        this.setAttribute(attr, attrValue as string);\n      }\n      // mark state not reflecting\n      this.__reflectingProperty = null;\n    }\n  }\n\n  /** @internal */\n  _$attributeToProperty(name: string, value: string | null) {\n    const ctor = this.constructor as typeof ReactiveElement;\n    // Note, hint this as an `AttributeMap` so closure clearly understands\n    // the type; it has issues with tracking types through statics\n    const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n    // Use tracking info to avoid reflecting a property value to an attribute\n    // if it was just set because the attribute changed.\n    if (propName !== undefined && this.__reflectingProperty !== propName) {\n      const options = ctor.getPropertyOptions(propName);\n      const converter =\n        typeof options.converter === 'function'\n          ? {fromAttribute: options.converter}\n          : options.converter?.fromAttribute !== undefined\n            ? options.converter\n            : defaultConverter;\n      // mark state reflecting\n      this.__reflectingProperty = propName;\n      const converterResult = converter.fromAttribute!(value, options.type);\n      this[propName as keyof this] =\n        converterResult ??\n        this.__defaultValues?.get(propName) ??\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        converterResult as any;\n      // mark state not reflecting\n      this.__reflectingProperty = null;\n    }\n  }\n\n  /**\n   * Requests an update which is processed asynchronously. This should be called\n   * when an element should update based on some state not triggered by setting\n   * a reactive property. In this case, pass no arguments. It should also be\n   * called when manually implementing a property setter. In this case, pass the\n   * property `name` and `oldValue` to ensure that any configured property\n   * options are honored.\n   *\n   * @param name name of requesting property\n   * @param oldValue old value of requesting property\n   * @param options property options to use instead of the previously\n   *     configured options\n   * @category updates\n   */\n  requestUpdate(\n    name?: PropertyKey,\n    oldValue?: unknown,\n    options?: PropertyDeclaration\n  ): void {\n    // If we have a property key, perform property update steps.\n    if (name !== undefined) {\n      if (DEV_MODE && (name as unknown) instanceof Event) {\n        issueWarning(\n          ``,\n          `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n        );\n      }\n      const ctor = this.constructor as typeof ReactiveElement;\n      const newValue = this[name as keyof this];\n      options ??= ctor.getPropertyOptions(name);\n      const changed =\n        (options.hasChanged ?? notEqual)(newValue, oldValue) ||\n        // When there is no change, check a corner case that can occur when\n        // 1. there's a initial value which was not reflected\n        // 2. the property is subsequently set to this value.\n        // For example, `prop: {useDefault: true, reflect: true}`\n        // and el.prop = 'foo'. This should be considered a change if the\n        // attribute is not set because we will now reflect the property to the attribute.\n        (options.useDefault &&\n          options.reflect &&\n          newValue === this.__defaultValues?.get(name) &&\n          !this.hasAttribute(ctor.__attributeNameForProperty(name, options)!));\n      if (changed) {\n        this._$changeProperty(name, oldValue, options);\n      } else {\n        // Abort the request if the property should not be considered changed.\n        return;\n      }\n    }\n    if (this.isUpdatePending === false) {\n      this.__updatePromise = this.__enqueueUpdate();\n    }\n  }\n\n  /**\n   * @internal\n   */\n  _$changeProperty(\n    name: PropertyKey,\n    oldValue: unknown,\n    {useDefault, reflect, wrapped}: PropertyDeclaration,\n    initializeValue?: unknown\n  ) {\n    // Record default value when useDefault is used. This allows us to\n    // restore this value when the attribute is removed.\n    if (useDefault && !(this.__defaultValues ??= new Map()).has(name)) {\n      this.__defaultValues.set(\n        name,\n        initializeValue ?? oldValue ?? this[name as keyof this]\n      );\n      // if this is not wrapping an accessor, it must be an initial setting\n      // and in this case we do not want to record the change or reflect.\n      if (wrapped !== true || initializeValue !== undefined) {\n        return;\n      }\n    }\n    // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n    // vs just Map.set()\n    if (!this._$changedProperties.has(name)) {\n      // On the initial change, the old value should be `undefined`, except\n      // with `useDefault`\n      if (!this.hasUpdated && !useDefault) {\n        oldValue = undefined;\n      }\n      this._$changedProperties.set(name, oldValue);\n    }\n    // Add to reflecting properties set.\n    // Note, it's important that every change has a chance to add the\n    // property to `__reflectingProperties`. This ensures setting\n    // attribute + property reflects correctly.\n    if (reflect === true && this.__reflectingProperty !== name) {\n      (this.__reflectingProperties ??= new Set<PropertyKey>()).add(name);\n    }\n  }\n\n  /**\n   * Sets up the element to asynchronously update.\n   */\n  private async __enqueueUpdate() {\n    this.isUpdatePending = true;\n    try {\n      // Ensure any previous update has resolved before updating.\n      // This `await` also ensures that property changes are batched.\n      await this.__updatePromise;\n    } catch (e) {\n      // Refire any previous errors async so they do not disrupt the update\n      // cycle. Errors are refired so developers have a chance to observe\n      // them, and this can be done by implementing\n      // `window.onunhandledrejection`.\n      if (!this.squelchUpdateErrorsDuringLit2Migration) {\n        noAwait(Promise.reject(e));\n      }\n    }\n    const result = this.scheduleUpdate();\n    // If `scheduleUpdate` returns a Promise, we await it. This is done to\n    // enable coordinating updates with a scheduler. Note, the result is\n    // checked to avoid delaying an additional microtask unless we need to.\n    if (result != null) {\n      await result;\n    }\n    return !this.isUpdatePending;\n  }\n\n  /**\n   * Schedules an element update. You can override this method to change the\n   * timing of updates by returning a Promise. The update will await the\n   * returned Promise, and you should resolve the Promise to allow the update\n   * to proceed. If this method is overridden, `super.scheduleUpdate()`\n   * must be called.\n   *\n   * For instance, to schedule updates to occur just before the next frame:\n   *\n   * ```ts\n   * override protected async scheduleUpdate(): Promise<unknown> {\n   *   await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n   *   super.scheduleUpdate();\n   * }\n   * ```\n   * @category updates\n   */\n  protected scheduleUpdate(): void | Promise<unknown> {\n    const result = this.performUpdate();\n    if (\n      DEV_MODE &&\n      (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n        'async-perform-update'\n      ) &&\n      typeof (result as unknown as Promise<unknown> | undefined)?.then ===\n        'function'\n    ) {\n      issueWarning(\n        'async-perform-update',\n        `Element ${this.localName} returned a Promise from performUpdate(). ` +\n          `This behavior is deprecated and will be removed in a future ` +\n          `version of ReactiveElement.`\n      );\n    }\n    return result;\n  }\n\n  /**\n   * Performs an element update. Note, if an exception is thrown during the\n   * update, `firstUpdated` and `updated` will not be called.\n   *\n   * Call `performUpdate()` to immediately process a pending update. This should\n   * generally not be needed, but it can be done in rare cases when you need to\n   * update synchronously.\n   *\n   * @category updates\n   */\n  protected performUpdate(): void {\n    // Abort any update if one is not pending when this is called.\n    // This can happen if `performUpdate` is called early to \"flush\"\n    // the update.\n    if (!this.isUpdatePending) {\n      return;\n    }\n    debugLogEvent != null && debugLogEvent?.({kind: 'update'});\n    if (!this.hasUpdated) {\n      // Create renderRoot before first update. This occurs in `connectedCallback`\n      // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n      (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n        this.createRenderRoot();\n      if (DEV_MODE) {\n        // Produce warning if any reactive properties on the prototype are\n        // shadowed by class fields. Instance fields set before upgrade are\n        // deleted by this point, so any own property is caused by class field\n        // initialization in the constructor.\n        const ctor = this.constructor as typeof ReactiveElement;\n        const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n          (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n        );\n        if (shadowedProperties.length &&\n            !(this as any).__allowInstanceProperties) {\n          throw new Error(\n            `The following properties on element ${this.localName} will not ` +\n              `trigger updates as expected because they are set using class ` +\n              `fields: ${shadowedProperties.join(', ')}. ` +\n              `Native class fields and some compiled output will overwrite ` +\n              `accessors used for detecting changes. See ` +\n              `https://lit.dev/msg/class-field-shadowing ` +\n              `for more information.`\n          );\n        }\n      }\n      // Mixin instance properties once, if they exist.\n      if (this.__instanceProperties) {\n        // TODO (justinfagnani): should we use the stored value? Could a new value\n        // have been set since we stored the own property value?\n        for (const [p, value] of this.__instanceProperties) {\n          this[p as keyof this] = value as this[keyof this];\n        }\n        this.__instanceProperties = undefined;\n      }\n      // Trigger initial value reflection and populate the initial\n      // `changedProperties` map, but only for the case of properties created\n      // via `createProperty` on accessors, which will not have already\n      // populated the `changedProperties` map since they are not set.\n      // We can't know if these accessors had initializers, so we just set\n      // them anyway - a difference from experimental decorators on fields and\n      // standard decorators on auto-accessors.\n      // For context see:\n      // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n      const elementProperties = (this.constructor as typeof ReactiveElement)\n        .elementProperties;\n      if (elementProperties.size > 0) {\n        for (const [p, options] of elementProperties) {\n          const {wrapped} = options;\n          const value = this[p as keyof this];\n          if (\n            wrapped === true &&\n            !this._$changedProperties.has(p) &&\n            value !== undefined\n          ) {\n            this._$changeProperty(p, undefined, options, value);\n          }\n        }\n      }\n    }\n    let shouldUpdate = false;\n    const changedProperties = this._$changedProperties;\n    try {\n      shouldUpdate = this.shouldUpdate(changedProperties);\n      if (shouldUpdate) {\n        this.willUpdate(changedProperties);\n        this.__controllers?.forEach((c) => c.hostUpdate?.());\n        this.update(changedProperties);\n      } else {\n        this.__markUpdated();\n      }\n    } catch (e) {\n      // Prevent `firstUpdated` and `updated` from running when there's an\n      // update exception.\n      shouldUpdate = false;\n      // Ensure element can accept additional updates after an exception.\n      this.__markUpdated();\n      throw e;\n    }\n    // The update is no longer considered pending and further updates are now allowed.\n    if (shouldUpdate) {\n      this._$didUpdate(changedProperties);\n    }\n  }\n\n  /**\n   * Invoked before `update()` to compute values needed during the update.\n   *\n   * Implement `willUpdate` to compute property values that depend on other\n   * properties and are used in the rest of the update process.\n   *\n   * ```ts\n   * willUpdate(changedProperties) {\n   *   // only need to check changed properties for an expensive computation.\n   *   if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n   *     this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n   *   }\n   * }\n   *\n   * render() {\n   *   return html`SHA: ${this.sha}`;\n   * }\n   * ```\n   *\n   * @category updates\n   */\n  protected willUpdate(_changedProperties: PropertyValues): void {}\n\n  // Note, this is an override point for polyfill-support.\n  // @internal\n  _$didUpdate(changedProperties: PropertyValues) {\n    this.__controllers?.forEach((c) => c.hostUpdated?.());\n    if (!this.hasUpdated) {\n      this.hasUpdated = true;\n      this.firstUpdated(changedProperties);\n    }\n    this.updated(changedProperties);\n    if (\n      DEV_MODE &&\n      this.isUpdatePending &&\n      (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n        'change-in-update'\n      )\n    ) {\n      issueWarning(\n        'change-in-update',\n        `Element ${this.localName} scheduled an update ` +\n          `(generally because a property was set) ` +\n          `after an update completed, causing a new update to be scheduled. ` +\n          `This is inefficient and should be avoided unless the next update ` +\n          `can only be scheduled as a side effect of the previous update.`\n      );\n    }\n  }\n\n  private __markUpdated() {\n    this._$changedProperties = new Map();\n    this.isUpdatePending = false;\n  }\n\n  /**\n   * Returns a Promise that resolves when the element has completed updating.\n   * The Promise value is a boolean that is `true` if the element completed the\n   * update without triggering another update. The Promise result is `false` if\n   * a property was set inside `updated()`. If the Promise is rejected, an\n   * exception was thrown during the update.\n   *\n   * To await additional asynchronous work, override the `getUpdateComplete`\n   * method. For example, it is sometimes useful to await a rendered element\n   * before fulfilling this Promise. To do this, first await\n   * `super.getUpdateComplete()`, then any subsequent state.\n   *\n   * @return A promise of a boolean that resolves to true if the update completed\n   *     without triggering another update.\n   * @category updates\n   */\n  get updateComplete(): Promise<boolean> {\n    return this.getUpdateComplete();\n  }\n\n  /**\n   * Override point for the `updateComplete` promise.\n   *\n   * It is not safe to override the `updateComplete` getter directly due to a\n   * limitation in TypeScript which means it is not possible to call a\n   * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n   * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n   * This method should be overridden instead. For example:\n   *\n   * ```ts\n   * class MyElement extends LitElement {\n   *   override async getUpdateComplete() {\n   *     const result = await super.getUpdateComplete();\n   *     await this._myChild.updateComplete;\n   *     return result;\n   *   }\n   * }\n   * ```\n   *\n   * @return A promise of a boolean that resolves to true if the update completed\n   *     without triggering another update.\n   * @category updates\n   */\n  protected getUpdateComplete(): Promise<boolean> {\n    return this.__updatePromise;\n  }\n\n  /**\n   * Controls whether or not `update()` should be called when the element requests\n   * an update. By default, this method always returns `true`, but this can be\n   * customized to control when to update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n    return true;\n  }\n\n  /**\n   * Updates the element. This method reflects property values to attributes.\n   * It can be overridden to render and keep updated element DOM.\n   * Setting properties inside this method will *not* trigger\n   * another update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected update(_changedProperties: PropertyValues) {\n    // The forEach() expression will only run when __reflectingProperties is\n    // defined, and it returns undefined, setting __reflectingProperties to\n    // undefined\n    this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n      this.__propertyToAttribute(p, this[p as keyof this])\n    ) as undefined;\n    this.__markUpdated();\n  }\n\n  /**\n   * Invoked whenever the element is updated. Implement to perform\n   * post-updating tasks via DOM APIs, for example, focusing an element.\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected updated(_changedProperties: PropertyValues) {}\n\n  /**\n   * Invoked when the element is first updated. Implement to perform one time\n   * work on the element after update.\n   *\n   * ```ts\n   * firstUpdated() {\n   *   this.renderRoot.getElementById('my-text-area').focus();\n   * }\n   * ```\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record<string, unknown>)[\n  objectProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record<string, unknown>)[\n  objectProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\nif (goog.FEATURESET_YEAR < 2020) {\n  polyfillSupport?.({ReactiveElement});\n}\n\n// Dev mode warnings...\nif (DEV_MODE) {\n  // Default warning set.\n  ReactiveElement.enabledWarnings = [\n    'change-in-update',\n    'async-perform-update',\n  ];\n  const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n    if (\n      !ctor.hasOwnProperty(objectProperty('enabledWarnings', ctor))\n    ) {\n      ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n    }\n  };\n  ReactiveElement.enableWarning = function (\n    this: typeof ReactiveElement,\n    warning: WarningKind\n  ) {\n    ensureOwnWarnings(this);\n    if (!this.enabledWarnings!.includes(warning)) {\n      this.enabledWarnings!.push(warning);\n    }\n  };\n  ReactiveElement.disableWarning = function (\n    this: typeof ReactiveElement,\n    warning: WarningKind\n  ) {\n    ensureOwnWarnings(this);\n    const i = this.enabledWarnings!.indexOf(warning);\n    if (i >= 0) {\n      this.enabledWarnings!.splice(i, 1);\n    }\n  };\n}\n\nlet oneTimeWork = () => {\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.0.4');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n  Promise.resolve().then(() => {\n    issueWarning!(\n      'multiple-versions',\n      `Multiple versions of Lit loaded. Loading multiple versions ` +\n        `is not recommended.`\n    );\n  });\n}\noneTimeWork = () => {};\n};\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * lit-html patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill.\n * Scoping classes are added to DOM nodes to facilitate CSS scoping that\n * simulates the style scoping Shadow DOM provides. ShadyDOM does this scoping\n * to all elements added to the DOM. This module provides an important\n * optimization for this process by pre-scoping lit-html template\n * DOM. This means ShadyDOM does not have to scope each instance of the\n * template DOM. Instead, each template is scoped only once.\n *\n * Creating scoped CSS is not covered by this module. It is, however, integrated\n * into the lit-element and @lit/reactive-element packages. See the ShadyCSS docs\n * for how to apply scoping to CSS:\n * https://github.com/webcomponents/polyfills/tree/master/packages/shadycss#usage.\n *\n * (COPYBARA: packageDocumentation)\n */\n\nexport {};\n\ninterface RenderOptions {\n  readonly renderBefore?: ChildNode | null;\n  scope?: string;\n  readonly renderContainer?: Element;\n}\n\ninterface ShadyTemplateResult {\n  strings: TemplateStringsArray;\n  // This property needs to remain unminified.\n  ['_$litType$']?: string;\n}\n\n// Note, this is a dummy type as the full type here is big.\ninterface Directive {\n  __directive?: Directive;\n}\n\ninterface DirectiveParent {\n  _$parent?: DirectiveParent;\n  __directive?: Directive;\n  __directives?: Array<Directive | undefined>;\n}\n\ninterface PatchableChildPartConstructor {\n  // tslint:disable-next-line:no-any, @typescript-eslint/no-misused-new\n  new (...args: any[]): PatchableChildPart;\n}\n\ninterface PatchableChildPart {\n  __directive?: Directive;\n  _$committedValue: unknown;\n  _$startNode: ChildNode;\n  _$endNode: ChildNode | null;\n  options: RenderOptions;\n  _$setValue(value: unknown, directiveParent: DirectiveParent): void;\n  _$getTemplate(result: ShadyTemplateResult): HTMLTemplateElement;\n}\n\ninterface PatchableTemplate {\n  el: HTMLTemplateElement;\n}\n\ninterface PatchableTemplateConstructor {\n  // tslint:disable-next-line:no-any, @typescript-eslint/no-misused-new\n  new (...args: any[]): PatchableTemplate;\n  createElement(html: string, options?: RenderOptions): HTMLTemplateElement;\n}\n\ninterface PatchableTemplateInstance {\n  _$template: PatchableTemplate;\n}\n\n// Scopes that have had styling prepared. Note, must only be done once per\n// scope.\nconst styledScopes = new Set<string>();\n// Map of css per scope. This is collected during first scope render, used when\n// styling is prepared, and then discarded.\nconst scopeCssStore = new Map<string, string[]>();\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\n// Note, explicitly use `var` here so that this can be re-defined when\n// bundled.\n// eslint-disable-next-line no-var\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: var\n\n/**\n * lit-html patches. These properties cannot be renamed.\n * * ChildPart.prototype._$getTemplate\n * * ChildPart.prototype._$setValue\n */\nconst polyfillSupport: NonNullable<typeof litHtmlPolyfillSupport> = (\n  Template: PatchableTemplateConstructor,\n  ChildPart: PatchableChildPartConstructor,\n) => {\n  // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n  // We test at the point of patching, which makes it safe to load\n  // webcomponentsjs and polyfill-support in either order\n  if (\n    globalThis.ShadyCSS === undefined ||\n    (globalThis.ShadyCSS.nativeShadow && !globalThis.ShadyCSS.ApplyShim)\n  ) {\n    return;\n  }\n\n  // console.log(\n  //   '%c Making lit-html compatible with ShadyDOM/CSS.',\n  //   'color: lightgreen; font-style: italic'\n  // );\n\n  const wrap =\n    ENABLE_SHADYDOM_NOPATCH &&\n    globalThis.ShadyDOM?.inUse &&\n    globalThis.ShadyDOM?.noPatch === true\n      ? globalThis.ShadyDOM!.wrap\n      : (node: Node) => node;\n\n  const needsPrepareStyles = (name: string | undefined) =>\n    name !== undefined && !styledScopes.has(name);\n\n  const cssForScope = (name: string) => {\n    let scopeCss = scopeCssStore.get(name);\n    if (scopeCss === undefined) {\n      scopeCssStore.set(name, (scopeCss = []));\n    }\n    return scopeCss;\n  };\n\n  const prepareStyles = (name: string, template: HTMLTemplateElement) => {\n    // Get styles\n    const scopeCss = cssForScope(name);\n    const hasScopeCss = scopeCss.length !== 0;\n    if (hasScopeCss) {\n      const style = document.createElement('style');\n      style.textContent = scopeCss.join('\\n');\n      // Note, it's important to add the style to the *end* of the template so\n      // it doesn't mess up part indices.\n      template.content.appendChild(style);\n    }\n    // Mark this scope as styled.\n    styledScopes.add(name);\n    // Remove stored data since it's no longer needed.\n    scopeCssStore.delete(name);\n    // ShadyCSS removes scopes and removes the style under ShadyDOM and leaves\n    // it under native Shadow DOM\n    globalThis.ShadyCSS!.prepareTemplateStyles(template, name);\n    // Note, under native Shadow DOM, the style is added to the beginning of the\n    // template. It must be moved to the *end* of the template so it doesn't\n    // mess up part indices.\n    if (hasScopeCss && globalThis.ShadyCSS!.nativeShadow) {\n      // If there were styles but the CSS text was empty, ShadyCSS will\n      // eliminate the style altogether, so the style here could be null\n      const style = template.content.querySelector('style');\n      if (style !== null) {\n        template.content.appendChild(style);\n      }\n    }\n  };\n\n  const scopedTemplateCache = new Map<\n    string | undefined,\n    Map<TemplateStringsArray, PatchableTemplate>\n  >();\n\n  /**\n   * Override to extract style elements from the template\n   * and store all style.textContent in the shady scope data.\n   * Note, it's ok to patch Template since it's only used via ChildPart.\n   */\n  const originalCreateElement = Template.createElement;\n  Template.createElement = function (html: string, options?: RenderOptions) {\n    const element = originalCreateElement.call(Template, html, options);\n    const scope = options?.scope;\n    if (scope !== undefined) {\n      if (!globalThis.ShadyCSS!.nativeShadow) {\n        globalThis.ShadyCSS!.prepareTemplateDom(element, scope);\n      }\n      // Process styles only if this scope is being prepared. Otherwise,\n      // leave styles as is for back compat with Lit1.\n      if (needsPrepareStyles(scope)) {\n        const scopeCss = cssForScope(scope);\n        // Remove styles and store textContent.\n        const styles = element.content.querySelectorAll(\n          'style',\n        ) as NodeListOf<HTMLStyleElement>;\n        // Store the css in this template in the scope css and remove the <style>\n        // from the template _before_ the node-walk captures part indices\n        scopeCss.push(\n          ...Array.from(styles).map((style) => {\n            style.parentNode?.removeChild(style);\n            return style.textContent!;\n          }),\n        );\n      }\n    }\n    return element;\n  };\n\n  const renderContainer = document.createDocumentFragment();\n  const renderContainerMarker = document.createComment('');\n\n  const childPartProto = ChildPart.prototype;\n  /**\n   * Patch to apply gathered css via ShadyCSS. This is done only once per scope.\n   */\n  const setValue = childPartProto._$setValue;\n  childPartProto._$setValue = function (\n    this: PatchableChildPart,\n    value: unknown,\n    directiveParent: DirectiveParent = this,\n  ) {\n    const container = wrap(this._$startNode).parentNode!;\n    const scope = this.options?.scope;\n    if (\n      (container instanceof ShadowRoot ||\n        // TODO(sorvell): Remove when Lit2 migration is complete in favor of\n        // cl/386884682.\n        container === this.options?.renderContainer) &&\n      needsPrepareStyles(scope)\n    ) {\n      // Note, @apply requires outer => inner scope rendering on initial\n      // scope renders to apply property values correctly. Style preparation\n      // is tied to rendering into `shadowRoot`'s and this is typically done by\n      // custom elements. If this is done in `connectedCallback`, as is typical,\n      // the code below ensures the right order since content is rendered\n      // into a fragment first so the hosting element can prepare styles first.\n      // If rendering is done in the constructor, this won't work, but that's\n      // not supported in ShadyDOM anyway.\n      const startNode = this._$startNode;\n      const endNode = this._$endNode;\n\n      // Temporarily move this part into the renderContainer.\n      renderContainer.appendChild(renderContainerMarker);\n      this._$startNode = renderContainerMarker;\n      this._$endNode = null;\n\n      // Note, any nested template results render here and their styles will\n      // be extracted and collected.\n      setValue.call(this, value, directiveParent);\n\n      // Get the template for this result or create a dummy one if a result\n      // is not being rendered.\n      // This property needs to remain unminified.\n      const template = (value as ShadyTemplateResult)?.['_$litType$']\n        ? (this._$committedValue as PatchableTemplateInstance)._$template.el\n        : document.createElement('template');\n      prepareStyles(scope!, template);\n\n      // Note, this is the temporary startNode.\n      renderContainer.removeChild(renderContainerMarker);\n      // When using native Shadow DOM, include prepared style in shadowRoot.\n      if (globalThis.ShadyCSS?.nativeShadow) {\n        const style = template.content.querySelector('style');\n        if (style !== null) {\n          renderContainer.appendChild(style.cloneNode(true));\n        }\n      }\n      container.insertBefore(renderContainer, endNode);\n      // Move part back to original container.\n      this._$startNode = startNode;\n      this._$endNode = endNode;\n    } else {\n      setValue.call(this, value, directiveParent);\n    }\n  };\n\n  /**\n   * Patch ChildPart._$getTemplate to look up templates in a cache bucketed\n   * by element name.\n   */\n  childPartProto._$getTemplate = function (\n    this: PatchableChildPart,\n    result: ShadyTemplateResult,\n  ) {\n    const scope = this.options?.scope;\n    let templateCache = scopedTemplateCache.get(scope);\n    if (templateCache === undefined) {\n      scopedTemplateCache.set(scope, (templateCache = new Map()));\n    }\n    let template = templateCache.get(result.strings);\n    if (template === undefined) {\n      templateCache.set(\n        result.strings,\n        (template = new Template(result, this.options)),\n      );\n    }\n    return template;\n  };\n};\n\nif (ENABLE_SHADYDOM_NOPATCH) {\n  polyfillSupport.noPatchSupported = ENABLE_SHADYDOM_NOPATCH;\n}\n\nif (DEV_MODE) {\n  /* COPYBARA: globalThis */ globalThis.litHtmlPolyfillSupportDevMode ??=\n    polyfillSupport;\n} else if (goog.FEATURESET_YEAR < 2020) {\n  /* COPYBARA: globalThis */ globalThis.litHtmlPolyfillSupport ??= polyfillSupport;\n}\n\nlet symbolKey = '';\nif (goog.FEATURESET_YEAR < 2019 && (globalThis.Symbol as unknown)) {\n  const s = Symbol();\n  if (typeof s !== 'symbol') {\n    // This key can sometimes be renamed so we just look at the first key and\n    // assume there's just one.\n    symbolKey = Object.keys(s)[0];\n  }\n}\n\nconst needsSymbolSupport = symbolKey !== '';\n\n/**\n * Checks if a value is specifically a closure polyfilled symbol. We expose\n * this directly since it's not possible to polyfill `typeof v === 'symbol'`.\n */\nexport const isPolyfilledSymbol = (() => {\n  if (needsSymbolSupport) {\n    return (value: unknown) =>\n      value != null &&\n      // tslint:disable-next-line:no-any\n      (value as any)[symbolKey] !== undefined;\n  } else {\n    return (value: unknown) => false;\n  }\n})();\n\n// tslint:disable-next-line:no-any\nif (needsSymbolSupport) {\n  // TODO(sorvell): Remove when/if b/187749613 is addressed.\n  if (!globalThis.Symbol.for) {\n    const map = new Map<string, symbol>();\n    globalThis.Symbol.for = (key) => {\n      if (!map.has(key)) {\n        map.set(key, Symbol(key));\n      }\n      return map.get(key)!;\n    };\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * LitElement patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill, but\n * support for Shadow DOM like css scoping is opt-in. This module uses ShadyCSS\n * to scope styles defined via the `static styles` property and styles included\n * in the render method. There are some limitations to be aware of:\n * * only styles that are included in the first render of a component are scoped.\n * * In addition, support for the deprecated `@apply` feature of ShadyCSS is\n * only provided for styles included in the template and not styles provided\n * via the static styles property.\n * * Lit parts cannot be used in styles included in the template.\n *\n * (COPYBARA: packageDocumentation)\n */\n\nimport '@lit/reactive-element/polyfill-support.js';\nimport 'lit-html/polyfill-support.js';\n\ninterface RenderOptions {\n  readonly renderBefore?: ChildNode | null;\n  scope?: string;\n}\n\ninterface PatchableLitElementConstructor {\n  _$handlesPrepareStyles?: boolean;\n}\n\ninterface PatchableLitElement extends HTMLElement {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n  new (...args: any[]): PatchableLitElement;\n  constructor: PatchableLitElementConstructor;\n  createRenderRoot(): Element | ShadowRoot;\n  renderOptions: RenderOptions;\n}\n\n// Note, explicitly use `var` here so that this can be re-defined when\n// bundled.\n// eslint-disable-next-line no-var\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: var\n\nconst polyfillSupport = ({LitElement}: {LitElement: PatchableLitElement}) => {\n  // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n  // We test at the point of patching, which makes it safe to load\n  // webcomponentsjs and polyfill-support in either order\n  if (\n    globalThis.ShadyCSS === undefined ||\n    (globalThis.ShadyCSS.nativeShadow && !globalThis.ShadyCSS.ApplyShim)\n  ) {\n    return;\n  }\n\n  // console.log(\n  //   '%c Making LitElement compatible with ShadyDOM/CSS.',\n  //   'color: lightgreen; font-style: italic'\n  // );\n\n  (\n    LitElement as unknown as PatchableLitElementConstructor\n  )._$handlesPrepareStyles = true;\n\n  /**\n   * Patch to apply adoptedStyleSheets via ShadyCSS\n   */\n  const litElementProto = LitElement.prototype;\n  const createRenderRoot = litElementProto.createRenderRoot;\n  litElementProto.createRenderRoot = function (this: PatchableLitElement) {\n    // Pass the scope to render options so that it gets to lit-html for proper\n    // scoping via ShadyCSS. This is needed under Shady and also Shadow DOM,\n    // due to @apply.\n    this.renderOptions.scope = this.localName;\n    return createRenderRoot.call(this);\n  };\n};\n\nif (DEV_MODE) {\n  globalThis.litElementPolyfillSupportDevMode ??= polyfillSupport;\n} else if (goog.FEATURESET_YEAR < 2020) {\n  globalThis.litElementPolyfillSupport ??= polyfillSupport;\n}\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for interacting with Trusted Types, create and/or\n * retrieve the policy for the library.\n */\n\nimport {DEV_MODE} from '../environment/dev';\nimport {\n  GlobalWithTrustedTypes,\n  TrustedTypePolicy,\n  TrustedTypePolicyFactory,\n} from './trusted_types_typings';\n\n\ntype ExposeTrustedTypes = true;  // LINE-INTERNAL\n// LINE-EXTERNAL type ExposeTrustedTypes = false;\n\n/**\n * Controls whether to expose Trusted Types to the user through unwrapper\n * functions.\n */\nexport type UnwrapType<T> = ExposeTrustedTypes extends true ? T : {toString(): string};\n\n// BEGIN-INTERNAL\n/**\n * The name of the Trusted Types policy used by the library, or empty\n * to disable Trusted Types.\n *\n * TODO(b/365132434): Migrate everyone to stop relying on goog.TRUSTED_TYPES_POLICY_NAME\n *\n * @define\n */\nconst configuredPolicyName = goog.define(\n  'goog.html.trustedtypes.POLICY_NAME',\n  goog.TRUSTED_TYPES_POLICY_NAME\n    ? goog.TRUSTED_TYPES_POLICY_NAME + '#html'\n    : '',\n);\n// END-INTERNAL\n// BEGIN-EXTERNAL\n// /**\n//  * The name of the Trusted Types policy used by the library, or empty\n//  * to disable Trusted Types.\n//  */\n// const configuredPolicyName = 'google#safe';\n// END-EXTERNAL\n\n/** Mutable version of the policy name so it is testable. */\nlet policyName = configuredPolicyName;\n\n/** Re-exports the global trustedTypes object for convenience. */\nexport const trustedTypes: TrustedTypePolicyFactory | undefined = (\n  globalThis as GlobalWithTrustedTypes\n).trustedTypes;\n\n/**\n * Mutable version of trustedTypes object so it is testable\n *\n * Note: we need to mark this as not inlineable to prevent the compiler from\n * inlining it and causing soy conformance tests to fail.\n * @noinline\n */\nlet trustedTypesInternal = trustedTypes;\n\n/**\n * Cached Trusted Types policy:\n *  - `null` if Trusted Types are not enabled/supported\n *  - `undefined` if the policy has not been created yet.\n */\nlet policy: TrustedTypePolicy | null | undefined;\n\nfunction createPolicy(): TrustedTypePolicy | null {\n  let policy: TrustedTypePolicy | null = null;\n  if (policyName === '') {\n    // Binary is not configured to use Trusted Types.\n    return policy;\n  }\n\n  if (!trustedTypesInternal) {\n    return policy;\n  }\n  // trustedTypes.createPolicy throws in some older versions of chrome if\n  // called with a name that is already registered, even in report-only mode.\n  // Until the API changes, catch the error not to break the applications\n  // functionally. In such case, the code will fall back to using strings.\n  // TODO(engels): Check if this code can be simplified now.  // LINE-INTERNAL\n  try {\n    const identity = (x: string) => x;\n    policy = trustedTypesInternal.createPolicy(policyName, {\n      createHTML: identity,\n      createScript: identity,\n      createScriptURL: identity,\n    });\n  } catch (e) {\n    if (DEV_MODE) {\n      throw e as Error;\n    }\n  }\n  return policy;\n}\n\n/**\n * Returns the Trusted Types policy used by safevalues, or null if Trusted\n * Types are not enabled/supported.\n *\n * The first call to this function will create the policy, and all subsequent\n * calls will return the same policy.\n */\nexport function getPolicy(): TrustedTypePolicy | null {\n  if (policy === undefined) {\n    policy = createPolicy();\n  }\n  return policy;\n}\n\n/** Helpers for tests. */\nexport const TEST_ONLY = {\n  setPolicyName(name: string): void {\n    policyName = name;\n  },\n  setTrustedTypes(\n    mockTrustedTypes: TrustedTypePolicyFactory | undefined,\n  ): void {\n    trustedTypesInternal = mockTrustedTypes;\n  },\n  resetDefaults(): void {\n    policy = undefined;\n    policyName = configuredPolicyName;\n    trustedTypesInternal = trustedTypes;\n  },\n};\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** @fileoverview Internal implementations of SafeHtml. */\n\nimport {getPolicy, trustedTypes, UnwrapType} from './trusted_types';\nimport {TrustedHTML} from './trusted_types_typings';\n\nimport {DEV_MODE} from '../environment/dev';\n\nimport {pure} from './pure';\nimport {ensureTokenIsValid, secretToken} from './secrets';\n\n/**\n * String that is safe to use in HTML contexts in DOM APIs and HTML documents.\n *\n * @final\n */\nexport class SafeHtml {\n  private readonly privateDoNotAccessOrElseWrappedHtml: TrustedHTML | string;\n\n  private constructor(token: object, value: TrustedHTML | string) {\n    if (DEV_MODE) {\n      ensureTokenIsValid(token);\n    }\n\n    this.privateDoNotAccessOrElseWrappedHtml = value;\n  }\n\n  toString(): string {\n    // String coercion minimizes code size.\n    // tslint:disable-next-line:restrict-plus-operands\n    return this.privateDoNotAccessOrElseWrappedHtml + '';\n  }\n}\n\n/**\n * Internal interface for `SafeHtml`.\n *\n * `SafeHtml` should remain an opaque type to users & they should never be able\n * to instantiate it directly, but we still need to create values.\n *\n * There are multiple ways to do this, but the following is the one that\n * minimizes code size.\n */\ninterface HtmlImpl {\n  privateDoNotAccessOrElseWrappedHtml: TrustedHTML | string;\n}\nconst HtmlImpl = SafeHtml as {\n  new (token: object, value: TrustedHTML | string): SafeHtml;\n};\n\nfunction constructHtml(value: TrustedHTML | string): SafeHtml {\n  return new HtmlImpl(secretToken, value);\n}\n\n/**\n * Builds a new `SafeHtml` from the given string, without enforcing\n * safety guarantees. It may cause side effects by creating a Trusted Types\n * policy. This shouldn't be exposed to application developers, and must only be\n * used as a step towards safe builders or safe constants.\n */\nexport function createHtmlInternal(value: string): SafeHtml {\n  // Inlining this variable can cause large codesize increases when it is a\n  // large constant string. See sizetests/examples/constants for an example.\n  /** @noinline */\n  const noinlineValue = value;\n  const policy = getPolicy();\n  return constructHtml(\n    policy ? policy.createHTML(noinlineValue) : noinlineValue,\n  );\n}\n\n/**\n * An empty `SafeHtml` constant.\n * Unlike the functions above, using this will not create a policy.\n */\nexport const EMPTY_HTML: SafeHtml = pure(() =>\n  constructHtml(trustedTypes ? trustedTypes.emptyHTML : ''),\n);\n\n/** Checks if the given value is a `SafeHtml` instance */\nexport function isHtml(value: unknown): value is SafeHtml {\n  return value instanceof SafeHtml;\n}\n\n/**\n * Returns the value of the passed `SafeHtml` object while ensuring it\n * has the correct type.\n * Using this function directly is not common. Safe types are not meant to be\n * unwrapped, but rather passed to other APIs that consume them, like the DOM\n * wrappers in safevalues/dom.\n *\n * Returns a native `TrustedHTML` or a string if Trusted Types are disabled.  // LINE-INTERNAL\n// LINE-EXTERNAL * Returns a native `TrustedHTML` instance typed as {toString(): string} or a string if Trusted Types are disabled.\n */\nexport function unwrapHtml(value: SafeHtml): UnwrapType<TrustedHTML> | string {\n  if (isHtml(value)) {\n    return (value as unknown as HtmlImpl).privateDoNotAccessOrElseWrappedHtml;\n  } else {\n    let message = '';\n    if (DEV_MODE) {\n      message = 'Unexpected type when unwrapping SafeHtml';\n    }\n    throw new Error(message);\n  }\n}\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** Mark an expression as being free of side effects. */\nexport function pure<T>(valueOf: () => T): T {\n  // This odd looking expression is a workaround specific to the Closure\n  // compiler to mark an expression as pure.\n  // BEGIN-INTERNAL\n  // Note: @nosideeffects can get dropped if calls to this function get inlined,\n  // whereas this expression is better preserved across inlining, resulting in\n  // smaller sizes in most cases. See\n  // https://groups.google.com/a/google.com/g/ise-web/c/vh4Ky_0KunY for context.\n  // END-INTERNAL\n  return {valueOf}.valueOf();\n}\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** @fileoverview Internal implementations of TrustedResourceUrl. */\n\nimport {getPolicy, UnwrapType} from './trusted_types';\nimport {TrustedScriptURL} from './trusted_types_typings';\n\nimport {DEV_MODE} from '../environment/dev';\n\nimport {ensureTokenIsValid, secretToken} from './secrets';\n\n/**\n * String that is safe to use in all URL contexts in DOM APIs and HTML\n * documents; even as a reference to resources that may load in the current\n * origin (e.g. scripts and stylesheets).\n *\n * @final\n */\nexport class TrustedResourceUrl {\n  private readonly privateDoNotAccessOrElseWrappedResourceUrl:\n    | TrustedScriptURL\n    | string;\n\n  private constructor(token: object, value: TrustedScriptURL | string) {\n    if (DEV_MODE) {\n      ensureTokenIsValid(token);\n    }\n\n    this.privateDoNotAccessOrElseWrappedResourceUrl = value;\n  }\n\n  toString(): string {\n    // String coercion minimizes code size.\n    // tslint:disable-next-line:restrict-plus-operands\n    return this.privateDoNotAccessOrElseWrappedResourceUrl + '';\n  }\n}\n\n/**\n * Internal interface for `TrustedResourceUrl`.\n *\n * `TrustedResourceUrl` should remain an opaque type to users & they should never be able\n * to instantiate it directly, but we still need to create values.\n *\n * There are multiple ways to do this, but the following is the one that\n * minimizes code size.\n */\ninterface ResourceUrlImpl {\n  privateDoNotAccessOrElseWrappedResourceUrl: TrustedScriptURL | string;\n}\nconst ResourceUrlImpl = TrustedResourceUrl as {\n  new (token: object, value: TrustedScriptURL | string): TrustedResourceUrl;\n};\n\nfunction constructResourceUrl(\n  value: TrustedScriptURL | string,\n): TrustedResourceUrl {\n  return new ResourceUrlImpl(secretToken, value);\n}\n\n/**\n * Builds a new `TrustedResourceUrl` from the given string, without enforcing\n * safety guarantees. It may cause side effects by creating a Trusted Types\n * policy. This shouldn't be exposed to application developers, and must only be\n * used as a step towards safe builders or safe constants.\n */\nexport function createResourceUrlInternal(value: string): TrustedResourceUrl {\n  // Inlining this variable can cause large codesize increases when it is a\n  // large constant string. See sizetests/examples/constants for an example.\n  /** @noinline */\n  const noinlineValue = value;\n  const policy = getPolicy();\n  return constructResourceUrl(\n    policy ? policy.createScriptURL(noinlineValue) : noinlineValue,\n  );\n}\n\n/** Checks if the given value is a `TrustedResourceUrl` instance */\nexport function isResourceUrl(value: unknown): value is TrustedResourceUrl {\n  return value instanceof TrustedResourceUrl;\n}\n\n/**\n * Returns the value of the passed `TrustedResourceUrl` object while ensuring it\n * has the correct type.\n * Using this function directly is not common. Safe types are not meant to be\n * unwrapped, but rather passed to other APIs that consume them, like the DOM\n * wrappers in safevalues/dom.\n *\n * Returns a native `TrustedScriptURL` or a string if Trusted Types are disabled.  // LINE-INTERNAL\n// LINE-EXTERNAL * Returns a native `TrustedScriptURL` instance typed as {toString(): string} or a string if Trusted Types are disabled.\n */\nexport function unwrapResourceUrl(\n  value: TrustedResourceUrl,\n): UnwrapType<TrustedScriptURL> | string {\n  if (isResourceUrl(value)) {\n    return (value as unknown as ResourceUrlImpl)\n      .privateDoNotAccessOrElseWrappedResourceUrl;\n  } else {\n    let message = '';\n    if (DEV_MODE) {\n      message = 'Unexpected type when unwrapping TrustedResourceUrl';\n    }\n    throw new Error(message);\n  }\n}\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {DEV_MODE} from '../environment/dev';\n\n// BEGIN-INTERNAL\nimport {pure} from '../internals/pure';\nimport {\n  TrustedResourceUrl,\n  unwrapResourceUrl,\n} from '../internals/resource_url_impl';\nimport {assertIsTemplateObject} from '../internals/string_literal';\nimport {\n  INNOCUOUS_URL,\n  SafeUrl,\n  createUrlInternal,\n  isUrl,\n  unwrapUrl,\n} from '../internals/url_impl';\n// END-INTERNAL\n\n// BEGIN-INTERNAL\n/**\n * A pattern that matches safe MIME types. Only matches image, video, audio and\n * application/octet-stream types, with some parameter support (most notably, we\n * haven't implemented the more complex parts like %-encoded characters or\n * non-alphanumerical ones for simplicity's sake). Also, the specs are fairly\n * complex, and they don't necessarily agree with Chrome on some aspects, and so\n * we settled on a subset where the behavior makes sense to all parties\n * involved.\n * Use application/octet-stream for blobs that are meant to be downloaded.\n *\n * The spec is available at https://mimesniff.spec.whatwg.org/ (and see\n * https://tools.ietf.org/html/rfc2397 for data: urls, which override some of\n * it).\n */\nfunction isSafeMimeType(mimeType: string): boolean {\n  if (mimeType.toLowerCase() === 'application/octet-stream') {\n    return true;\n  }\n  const match = mimeType.match(/^([^;]+)(?:;\\w+=(?:\\w+|\"[\\w;,= ]+\"))*$/i);\n  return (\n    match?.length === 2 &&\n    (isSafeImageMimeType(match[1]) ||\n      isSafeVideoMimeType(match[1]) ||\n      isSafeAudioMimeType(match[1]) ||\n      isSafeFontMimeType(match[1]))\n  );\n}\n\nfunction isSafeImageMimeType(mimeType: string): boolean {\n  return /^image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon|heic|heif|avif|x-ms-bmp)$/i.test(\n    mimeType,\n  );\n}\n\nfunction isSafeVideoMimeType(mimeType: string): boolean {\n  return /^video\\/(?:3gpp|avi|mpeg|mpg|mp4|ogg|webm|x-flv|x-matroska|quicktime|x-ms-wmv)$/i.test(\n    mimeType,\n  );\n}\n\nfunction isSafeAudioMimeType(mimeType: string): boolean {\n  return /^audio\\/(?:3gpp2|3gpp|aac|amr|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)$/i.test(\n    mimeType,\n  );\n}\n\nfunction isSafeFontMimeType(mimeType: string): boolean {\n  return /^font\\/[\\w-]+$/i.test(mimeType);\n}\n\n/**\n * Interface representing a scheme that sanitizeUrl can optionally accommodate.\n * Even though this interface could be implemented by user code, the code will\n * ignore any implementation that doesn't come from this file.\n */\nexport interface Scheme {\n  isValid(url: string): boolean;\n}\n\nclass SchemeImpl implements Scheme {\n  constructor(readonly isValid: (url: string) => boolean) {}\n}\n\nfunction isValidScheme(scheme: Scheme): boolean {\n  return scheme instanceof SchemeImpl;\n}\n\nfunction simpleScheme(scheme: string): Scheme {\n  return new SchemeImpl((url: string) => {\n    return url.substr(0, scheme.length + 1).toLowerCase() === scheme + ':';\n  });\n}\n\nconst RELATIVE_SCHEME: Scheme = new SchemeImpl((url: string) =>\n  /^[^:]*([/?#]|$)/.test(url),\n);\n\nconst CALLTO_SCHEME: Scheme = new SchemeImpl((url: string) =>\n  /^callto:\\+?\\d*$/i.test(url),\n);\n\nconst SSH_SCHEME: Scheme = new SchemeImpl(\n  (url: string) => url.indexOf('ssh://') === 0,\n);\n\nconst EXTENSION_SCHEME: Scheme = new SchemeImpl((url: string) => {\n  return (\n    url.indexOf('chrome-extension://') === 0 ||\n    url.indexOf('moz-extension://') === 0 ||\n    url.indexOf('ms-browser-extension://') === 0 ||\n    url.indexOf('safari-web-extension://') === 0\n  );\n});\n\nconst SIP_SCHEME: Scheme = new SchemeImpl((url: string) => {\n  return url.indexOf('sip:') === 0 || url.indexOf('sips:') === 0;\n});\n\n// This used to be an enum, we preserved the name avoid changing the API.\n// tslint:disable:enforce-name-casing\n/** The list of schemes sanitizeUrl can optionally accommodate. */\nexport const SanitizableUrlScheme: {\n  TEL: Scheme;\n  CALLTO: Scheme;\n  SSH: Scheme;\n  RTSP: Scheme;\n  DATA: Scheme;\n  HTTP: Scheme;\n  HTTPS: Scheme;\n  EXTENSION: Scheme;\n  FTP: Scheme;\n  RELATIVE: Scheme;\n  MAILTO: Scheme;\n  INTENT: Scheme;\n  MARKET: Scheme;\n  ITMS: Scheme;\n  ITMS_APPSS: Scheme;\n  ITMS_SERVICES: Scheme;\n  FACEBOOK_MESSENGER: Scheme;\n  WHATSAPP: Scheme;\n  SIP: Scheme;\n  SMS: Scheme;\n  VND_YOUTUBE: Scheme;\n  GOOGLEHOME: Scheme;\n  GOOGLEHOMESDK: Scheme;\n  LINE: Scheme;\n} = {\n  TEL: simpleScheme('tel'),\n  CALLTO: CALLTO_SCHEME,\n  SSH: SSH_SCHEME,\n  RTSP: simpleScheme('rtsp'),\n  DATA: simpleScheme('data'),\n  HTTP: simpleScheme('http'),\n  HTTPS: simpleScheme('https'),\n  EXTENSION: EXTENSION_SCHEME,\n  FTP: simpleScheme('ftp'),\n  RELATIVE: RELATIVE_SCHEME,\n  MAILTO: simpleScheme('mailto'),\n  INTENT: simpleScheme('intent'),\n  MARKET: simpleScheme('market'),\n  ITMS: simpleScheme('itms'),\n  ITMS_APPSS: simpleScheme('itms-appss'),\n  ITMS_SERVICES: simpleScheme('itms-services'),\n  FACEBOOK_MESSENGER: simpleScheme('fb-messenger'),\n  WHATSAPP: simpleScheme('whatsapp'),\n  SIP: SIP_SCHEME,\n  SMS: simpleScheme('sms'),\n  VND_YOUTUBE: simpleScheme('vnd.youtube'),\n  GOOGLEHOME: simpleScheme('googlehome'),\n  GOOGLEHOMESDK: simpleScheme('googlehomesdk'),\n  LINE: simpleScheme('line'),\n};\n// tslint:enable:enforce-name-casing\n\n/** List of schemes used by default. */\nconst DEFAULT_SCHEMES = [\n  SanitizableUrlScheme.DATA,\n  SanitizableUrlScheme.HTTP,\n  SanitizableUrlScheme.HTTPS,\n  SanitizableUrlScheme.MAILTO,\n  SanitizableUrlScheme.FTP,\n  SanitizableUrlScheme.RELATIVE,\n];\n\n/**\n * Creates a SafeUrl object from a string `url` by sanitizing it.\n *\n * Note: If your url is partially known statically, you should prefer using the\n * `safeUrl` function directly.\n *\n * The input string is validated against the set of `allowedSchemes`, which\n * defaults to a set of commonly used safe URL schemes. If validation fails,\n * `undefined` is returned.\n *\n * If no `allowedSchemes` are passed, the `url` may use the http, https, mailto,\n * ftp or data schemes, or a relative URL (i.e., a URL without a scheme;\n * specifically, a scheme-relative, absolute-path-relative, or path-relative\n * URL).\n *\n * Other supported schemes don't have direct security issues (i.e. no JS\n * execution), but their inherent capabilities are not touched: for instance, if\n * you allow TEL only, you won't get javascript execution, but the resulting\n * link could still potentially be used to call toll numbers.\n */\nexport function trySanitizeUrl(\n  url: string | SafeUrl,\n  allowedSchemes: readonly Scheme[] = DEFAULT_SCHEMES,\n): SafeUrl | undefined {\n  if (isUrl(url)) {\n    return url;\n  }\n  // Using simple iteration because the compiler doesn't optimize this well for\n  // es5.\n  for (let i = 0; i < allowedSchemes.length; ++i) {\n    const scheme = allowedSchemes[i];\n    if (isValidScheme(scheme) && scheme.isValid(url)) {\n      return createUrlInternal(url);\n    }\n  }\n  return undefined;\n}\n\n/**\n * Creates a SafeUrl object from a string `url` by sanitizing it.\n *\n * Works the same way as `trySanitizeUrl`, but returns an innocuous url instead\n * of `undefined`.\n * Triggers the sanitization callbacks if the url is sanitized away (see\n * addJavaScriptUrlSanitizationCallback).\n */\nexport function sanitizeUrl(\n  url: string | SafeUrl,\n  allowedSchemes: readonly Scheme[] = DEFAULT_SCHEMES,\n): SafeUrl {\n  const sanitizedUrl = trySanitizeUrl(url, allowedSchemes);\n  if (sanitizedUrl === undefined) {\n    triggerCallbacks(url.toString());\n  }\n  return sanitizedUrl || INNOCUOUS_URL;\n}\n\n/**\n * Creates a SafeUrl object from a Blob or MediaSource. For blobs, the function\n * validates that the Blob's type is amongst the safe MIME types, and throws if\n * that's not the case.\n *\n * Caller must call `URL.revokeObjectUrl()` on the stringified url to\n * release the underlying `Blob`.\n */\nexport function objectUrlFromSafeSource(source: Blob | MediaSource): SafeUrl {\n  // MediaSource support in Safari is limited\n  // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource#browser_compatibility\n\n  // If we declare ManagedMediaSource or anything in this TS file, it will\n  // generate an extern that will be added to all JS files which import this\n  // file. We have issues like this before with conflicting externs and it is\n  // hard to root cause the issue. So instead we would rather use\n  // window['ManagedMediaSource'] directly by casting the window to any.\n  // tslint:disable-next-line:no-any\n  const windowAsAny = window as any;\n  if (\n    (typeof MediaSource !== 'undefined' && source instanceof MediaSource) ||\n    (typeof windowAsAny['ManagedMediaSource'] !== 'undefined' &&\n      source instanceof windowAsAny['ManagedMediaSource'])\n  ) {\n    return createUrlInternal(URL.createObjectURL(source));\n  }\n  const blob = source as Blob;\n  if (!isSafeMimeType(blob.type)) {\n    let message = '';\n    if (DEV_MODE) {\n      message = `unsafe blob MIME type: ${blob.type}`;\n    }\n    throw new Error(message);\n  }\n  return createUrlInternal(URL.createObjectURL(blob));\n}\n\n/**\n * Creates a SafeUrl object from a MediaSource.\n * @deprecated Use objectUrlFromSafeSource.\n */\nexport function fromMediaSource(media: MediaSource): SafeUrl {\n  // MediaSource support in Safari is limited\n  // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource#browser_compatibility\n  if (typeof MediaSource !== 'undefined' && media instanceof MediaSource) {\n    return createUrlInternal(URL.createObjectURL(media));\n  }\n  let message = '';\n  if (DEV_MODE) {\n    message = `fromMediaSource only accepts MediaSource instances, but was called with ${media}.`;\n  }\n  throw new Error(message);\n}\n\n/**\n * Builds SafeUrl object from a TrustedResourceUrl. This is safe because\n * TrustedResourceUrl is more tightly restricted than SafeUrl.\n * @deprecated Unwrap to string instead. SafeUrl sinks accept string values.\n */\nexport function fromTrustedResourceUrl(url: TrustedResourceUrl): SafeUrl {\n  return createUrlInternal(unwrapResourceUrl(url).toString());\n}\n\n/**\n * Checks whether this url prefix contains:\n *  - a fully specified and valid scheme\n *  - a character forcing it to be a relative url\n *\n * Since this function is only called with compile-time constants, we don't need\n * to be as careful as in `sanitizeUrl` and we can just check that the scheme is\n * valid and non-'javascript:'. If we discover other dangerous schemes we want\n * to prevent, we can statically find all instances and refactor them. See\n * https://url.spec.whatwg.org/#url-scheme-string for scheme validation.\n */\nfunction isSafeUrlPrefix(prefix: string, isWholeUrl: boolean): boolean {\n  const markerIdx = prefix.search(/[:/?#]/);\n  if (markerIdx < 0) {\n    // If we don't find a marker, but there is no interpolation, the url is\n    // relative\n    return isWholeUrl;\n  }\n  if (prefix.charAt(markerIdx) !== ':') {\n    // Relative URL\n    return true;\n  }\n\n  const scheme = prefix.substring(0, markerIdx).toLowerCase();\n  return /^[a-z][a-z\\d+.-]*$/.test(scheme) && scheme !== 'javascript';\n}\n\n/**\n * Builds a SafeUrl from a template literal.\n *\n * Use this function if your url has a static prefix containing the whole scheme\n * of the url.\n *\n * This factory is a template literal tag function. It should be called with\n * a template literal, with or without embedded expressions. For example,\n *               safeUrl`./somepath.html`;\n * or\n *               safeUrl`data:text/html;base64,${btoa('<div></div>')}`;\n *\n * To be successfully built, we must ensure that the scheme is correctly defined\n * and not dangerous. In practice this means the first chunk of the template\n * must satisfy one of the following conditions:\n * - Start with an explicit scheme that is valid and is not `javascript`\n *    (e.g. safeUrl`https:${...}`)\n * - Start with a prefix that ensures the url is relative\n *    (e.g. safeUrl`./${...}` or safeUrl`#${...}`)\n * Embedded expressions are interpolated as-is and no URL encoding is applied.\n */\nexport function safeUrl(\n  templateObj: TemplateStringsArray,\n  ...rest: unknown[]\n): SafeUrl {\n  if (DEV_MODE) {\n    assertIsTemplateObject(templateObj, rest.length);\n  }\n\n  const prefix = templateObj[0];\n  if (DEV_MODE) {\n    if (!isSafeUrlPrefix(prefix, rest.length === 0)) {\n      throw new Error(\n        `Trying to interpolate with unsupported prefix: ${prefix}`,\n      );\n    }\n  }\n\n  const urlParts = [prefix];\n  for (let i = 0; i < rest.length; i++) {\n    urlParts.push(String(rest[i]));\n    urlParts.push(templateObj[i + 1]);\n  }\n  return createUrlInternal(urlParts.join(''));\n}\n\n/**\n * @define\n */\nconst ASSUME_IMPLEMENTS_URL_API = goog.define(\n  'ASSUME_IMPLEMENTS_URL_API',\n  // TODO(b/154845327) narrow this down if earlier featureset years allow,\n  // if they get defined. FY2020 does NOT include Edge (EdgeHTML), which is\n  // good as workarounds are needed for spec compliance and a searchParams\n  // polyfill.\n  goog.FEATURESET_YEAR >= 2020,\n);\n\n// Tests for URL browser API support. e.g. IE doesn't support it.\nconst supportsURLAPI = pure(() => {\n  if (ASSUME_IMPLEMENTS_URL_API) {\n    return true;\n  }\n  return typeof URL === 'function';\n});\n\nfunction legacyExtractScheme(url: string): string | undefined {\n  const aTag = document.createElement('a');\n  try {\n    // We don't use the safe wrapper here because we don't want to sanitize the\n    // URL (which would lead to a dependency loop anyway). This is safe because\n    // this node is NEVER attached to the DOM.\n    aTag.href = url;\n  } catch (e) {\n    return undefined;\n  }\n  // Chrome and Firefox resolve relative scheme to https directly,\n  // while IE keeps a ':' or empty string protocol.\n  const protocol = aTag.protocol;\n  return protocol === ':' || protocol === '' ? 'https:' : protocol;\n}\n\ntype JavaScriptUrlSanitizationCallback = (url: string) => void;\n// END-INTERNAL\n\n/**\n * Extracts the scheme from the given URL. If the URL is relative, https: is\n * assumed.\n * @param url The URL to extract the scheme from.\n * @return the URL scheme.\n */\nexport function extractScheme(url: string): string | undefined {\n  // BEGIN-INTERNAL\n  // We defer to the browser URL parsing as much as possible to detect\n  // javascript: schemes. However, old browsers like IE don't support it.\n  if (!supportsURLAPI) {\n    return legacyExtractScheme(url);\n  }\n  // END-INTERNAL\n  let parsedUrl;\n  try {\n    parsedUrl = new URL(url);\n  } catch (e) {\n    // According to https://url.spec.whatwg.org/#constructors, the URL\n    // constructor with one parameter throws if `url` is not absolute. In this\n    // case, we are sure that no explicit scheme (javascript: ) is set.\n    // This can also be a URL parsing error, but in this case the URL won't be\n    // run anyway.\n    return 'https:';\n  }\n  return parsedUrl.protocol;\n}\n\n// We can't use an ES6 Set here because gws somehow depends on this code and\n// doesn't want to pay the cost of a polyfill.\nconst ALLOWED_SCHEMES = ['data:', 'http:', 'https:', 'mailto:', 'ftp:'];\n\n/**\n * A pattern that blocks javascript: URLs. Matches\n * (a) Urls with an explicit scheme that is not javascript and that only has\n *     alphanumeric or [.-+_] characters; or\n * (b) Urls with no explicit scheme. The pattern allows the first colon\n *     (`:`) character to appear after one of  the `/` `?` or `#` characters,\n *     which means the colon appears in path, query or fragment part of the URL.\n */\nexport const IS_NOT_JAVASCRIPT_URL_PATTERN: RegExp =\n  /^\\s*(?!javascript:)(?:[\\w+.-]+:|[^:/?#]*(?:[/?#]|$))/i;\n\n/**\n * Checks whether a urls has a `javascript:` scheme.\n * If the url has a `javascript:` scheme, reports it and returns true.\n * Otherwise, returns false.\n */\nexport function reportJavaScriptUrl(url: string): boolean {\n  const hasJavascriptUrlScheme = !IS_NOT_JAVASCRIPT_URL_PATTERN.test(url);\n  if (hasJavascriptUrlScheme) {\n    // BEGIN-EXTERNAL\n    // if (DEV_MODE) {\n    //   console.error(`A URL with content '${url}' was sanitized away.`);\n    // }\n    // END-EXTERNAL\n    triggerCallbacks(url); // LINE-INTERNAL\n  }\n  return hasJavascriptUrlScheme;\n}\n\n/**\n * Checks that the URL scheme is not javascript.\n * The URL parsing relies on the URL API in browsers that support it.\n * @param url The URL to sanitize for a SafeUrl sink.\n * @return undefined if url has a javascript: scheme, the original URL\n *     otherwise.\n */\nexport function sanitizeJavaScriptUrl(url: string): string | undefined {\n  if (reportJavaScriptUrl(url)) {\n    return undefined;\n  }\n  return url;\n}\n\n// BEGIN-INTERNAL\n/**\n * Sanitizes a URL by blocking javascript: URLs.\n *\n * This function is a temporary solution to refactor SafeUrl builders that can\n * bless javascript: URLs as SafeUrl. It sanitizes the URL and returns an\n * innocuous URL if the URL is sanitized away. This is part of go/safeurl-deletion-steps.\n */\nexport function sanitizeUrlForMigration(url: string): SafeUrl {\n  const sanitizedUrl = sanitizeJavaScriptUrl(url);\n  if (sanitizedUrl === undefined) {\n    return INNOCUOUS_URL;\n  }\n  return createUrlInternal(sanitizedUrl);\n}\n\n/**\n * Type alias for URLs passed to DOM sink wrappers.\n */\nexport type Url = string | SafeUrl;\n// END-INTERNAL\n// BEGIN-EXTERNAL\n// /**\n//  * Type alias for URLs passed to DOM sink wrappers.\n//  */\n// export type Url = string;\n// END-EXTERNAL\n\n// BEGIN-EXTERNAL\n// /**\n//  * Adapter to sanitize string URLs in DOM sink wrappers.\n//  * @return undefined if the URL was sanitized.\n//  */\n// END-EXTERNAL\n// BEGIN-INTERNAL\n/**\n * Adapter to support string and SafeUrl in DOM sink wrappers.\n * @return undefined if the URL was sanitized.\n */\n// END-INTERNAL\nexport function unwrapUrlOrSanitize(url: Url): string | undefined {\n  // BEGIN-INTERNAL\n  return url instanceof SafeUrl ? unwrapUrl(url) : sanitizeJavaScriptUrl(url);\n  // END-INTERNAL\n  // LINE-EXTERNAL return sanitizeJavaScriptUrl(url);\n}\n\n/**\n * Sanitizes a URL restrictively.\n * This sanitizer protects against XSS and potentially other uncommon and\n * undesirable schemes that an attacker could use e.g. phishing (tel:, callto:\n * ssh: etc schemes). This sanitizer is primarily meant to be used by the HTML\n * sanitizer.\n */\nexport function restrictivelySanitizeUrl(url: string): string {\n  const parsedScheme = extractScheme(url);\n  if (\n    parsedScheme !== undefined &&\n    ALLOWED_SCHEMES.indexOf(parsedScheme.toLowerCase()) !== -1\n  ) {\n    return url;\n  }\n  // BEGIN-INTERNAL\n  // The sanitizer used to sanitize URLs with SafeUrl's sanitizeUrl which\n  // returns this innocuous URL. We need to keep this behavior here because some\n  // golden tests still expect this value.\n  // TODO(b/238861489): return a short innocuous URL\n  // END-INTERNAL\n  return 'about:invalid#zClosurez';\n}\n\n// BEGIN-INTERNAL\n\n// We need to avoid using ES6 Sets here to avoid the expenssive ES5 polyfill.\n// This is acceptable anyway because this array should have only few elements.\nconst sanitizationCallbacks: JavaScriptUrlSanitizationCallback[] = [];\n\n// This callback is re-defined when a new callback is registered/removed.\n// When no callback is registered, there are no references to the\n// sanitizationCallbacks array, which make it possible for the compiler to\n// optimize it away.\nlet triggerCallbacks: (url: string) => void = (url: string) => {};\nif (DEV_MODE) {\n  addJavaScriptUrlSanitizationCallback((url: string) => {\n    console.warn(`A URL with content '${url}' was sanitized away.`);\n  });\n}\n\n/**\n * Registers a sanitization callback that is called whenever a javascript: URL\n * is sanitized away.\n */\nexport function addJavaScriptUrlSanitizationCallback(\n  callback: JavaScriptUrlSanitizationCallback,\n): void {\n  if (sanitizationCallbacks.indexOf(callback) === -1) {\n    sanitizationCallbacks.push(callback);\n  }\n  triggerCallbacks = (url: string) => {\n    sanitizationCallbacks.forEach((callback) => {\n      callback(url);\n    });\n  };\n}\n\n/**\n * Unregister the JavaScript URL sanitization callback.\n */\nexport function removeJavaScriptUrlSanitizationCallback(\n  callback: JavaScriptUrlSanitizationCallback,\n): void {\n  const callbackIndex = sanitizationCallbacks.indexOf(callback);\n  if (callbackIndex !== -1) {\n    sanitizationCallbacks.splice(callbackIndex, 1);\n  }\n}\n// END-INTERNAL\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {DEV_MODE} from '../environment/dev';\nimport {\n  createResourceUrlInternal,\n  TrustedResourceUrl,\n  unwrapResourceUrl,\n} from '../internals/resource_url_impl';\nimport {SafeScript, unwrapScript} from '../internals/script_impl';\nimport {assertIsTemplateObject} from '../internals/string_literal';\n\n/** Type that we know how to interpolate */\ntype Primitive = string | number | boolean;\n\n/**\n * Check whether the base url contains a valid origin,\n *\n * A string for an origin must contain only alphanumeric or any of the\n * following: `-.:`, and must not be an IP address. Remember that, as per the\n * documentation for TrustedResourceUrl, the origin must be trustworthy.\n *\n * @param base The base url that contains an origin.\n */\nfunction hasValidOrigin(base: string): boolean {\n  if (!(/^https:\\/\\//.test(base) || /^\\/\\//.test(base))) {\n    return false;\n  }\n\n  const originStart = base.indexOf('//') + 2;\n  const originEnd = base.indexOf('/', originStart);\n  // If the base url only contains the prefix (e.g. //), or the slash\n  // for the origin is right after the prefix (e.g. ///), the origin is\n  // missing.\n  if (originEnd <= originStart) {\n    throw new Error(\n      `Can't interpolate data in a url's origin, ` +\n        `Please make sure to fully specify the origin, terminated with '/'.`,\n    );\n  }\n\n  const origin = base.substring(originStart, originEnd);\n  if (!/^[0-9a-z.:-]+$/i.test(origin)) {\n    throw new Error('The origin contains unsupported characters.');\n  }\n  if (!/^[^:]*(:[0-9]+)?$/i.test(origin)) {\n    throw new Error('Invalid port number.');\n  }\n  if (!/(^|\\.)[a-z][^.]*$/i.test(origin)) {\n    throw new Error('The top-level domain must start with a letter.');\n  }\n  return true;\n}\n\n/**\n * Check whether the base url contains a valid about url at its beginning.\n *\n * An about url is either exactly 'about:blank' or 'about:blank#<str>' where\n * <str> can be an arbitrary string.\n *\n * @param base The base url.\n */\nfunction isValidAboutUrl(base: string): boolean {\n  if (!/^about:blank/.test(base)) {\n    return false;\n  }\n  if (base !== 'about:blank' && !/^about:blank#/.test(base)) {\n    throw new Error('The about url is invalid.');\n  }\n  return true;\n}\n\n/**\n * Check whether the base url contains a valid path start at its beginning.\n *\n * A valid path start is either a '/' or a '/' followed by at least one\n * character that is not '/' or '\\'.\n *\n * @param base The base url.\n */\nfunction isValidPathStart(base: string): boolean {\n  if (!/^\\//.test(base)) {\n    return false;\n  }\n  if (\n    base === '/' ||\n    (base.length > 1 && base[1] !== '/' && base[1] !== '\\\\')\n  ) {\n    return true;\n  }\n  throw new Error('The path start in the url is invalid.');\n}\n\n/**\n * Check whether the base url contains a valid relative path start at its\n * beginning.\n *\n * A valid relative path start is a non empty string that has no ':', '/' nor\n * '\\', and that is followed by a '/'.\n *\n * @param base The base url.\n */\nfunction isValidRelativePathStart(base: string): boolean {\n  // Using the RegExp syntax as the native JS RegExp syntax is not well handled\n  // by some downstream bundlers with this regex.\n  return new RegExp('^[^:\\\\s\\\\\\\\/]+/').test(base);\n}\n\ninterface UrlSegments {\n  readonly urlPath: string;\n  readonly params: string;\n  readonly fragment: string;\n}\n\n/**\n * Splits an url into segments using '?' and '#' delimiters.\n *\n * The URL can later be put back together by concatenating the returned segments\n * like: path + params + hash. Note that the delimiters '?' and '#' will\n * already be included in 'params' and 'hash' values respectively when these are\n * not empty.\n *\n * @param url The url to split.\n */\nfunction getUrlSegments(url: string): UrlSegments {\n  const parts = url.split(/[?#]/);\n  const params = /[?]/.test(url) ? '?' + parts[1] : '';\n  const fragment = /[#]/.test(url) ? '#' + (params ? parts[2] : parts[1]) : '';\n  return {urlPath: parts[0], params, fragment};\n}\n\n/**\n * Builds TrustedResourceUrl from a template literal.\n *\n * This factory is a template literal tag function. It should be called with\n * a template literal, with or without embedded expressions. For example,\n *               trustedResourceUrl`//example.com/${bar}`;\n * or\n *               trustedResourceUrl`//example.com`;\n *\n * When this function is called with a template literal without any embedded\n * expressions, the template string may contain anything as the whole URL is\n * a compile-time string constant.\n *\n * When this function is called with a template literal that contains embedded\n * expressions, the template must start with one of the following:\n * - `https://<origin>/`\n * - `//<origin>/`\n * - `/<pathStart>`\n * - `<relativePathStart>/`\n * - `about:blank`\n * - `data:`\n *\n * `<origin>` must contain only alphanumeric or any of the following: `-.:`.\n * Remember that, as per the documentation for TrustedResourceUrl, the origin\n * must be trustworthy. An origin of \"example.com\" could be set with this\n * method, but would tie the security of your site to the security of\n * example.com. Similarly, formats that potentially cover redirects hosted\n * on a trusted origin are problematic, since that could lead to untrusted\n * origins.\n *\n * `<pathStart>` is either an empty string, or a non empty string that does not\n * start with '/' or '\\'.\n * In other words, `/<pathStart>` is either a '/' or a\n * '/' followed by at least one character that is not '/' or '\\'.\n *\n * `<relativePathStart> is a non empty string that has no ':', '/' nor '\\'.\n *\n * `data:` (data URL) does not allow embedded expressions in the template\n * literal input.\n *\n * All embedded expressions are URL encoded when they are interpolated. Do not\n * embed expressions that are already URL encoded as they will be double encoded\n * by the builder.\n *\n * @param templateObj This contains the literal part of the template literal.\n * @param rest This represents the template's embedded expressions.\n */\nexport function trustedResourceUrl(\n  templateObj: TemplateStringsArray,\n  ...rest: Primitive[]\n): TrustedResourceUrl {\n  // Check if templateObj is actually from a template literal.\n  if (DEV_MODE) {\n    assertIsTemplateObject(templateObj, rest.length);\n  }\n\n  if (rest.length === 0) {\n    return createResourceUrlInternal(templateObj[0]);\n  }\n\n  const base = templateObj[0].toLowerCase();\n\n  if (DEV_MODE) {\n    if (/^data:/.test(base)) {\n      throw new Error(\n        'Data URLs cannot have expressions in the template literal input.',\n      );\n    }\n\n    if (\n      !hasValidOrigin(base) &&\n      !isValidPathStart(base) &&\n      !isValidRelativePathStart(base) &&\n      !isValidAboutUrl(base)\n    ) {\n      throw new Error(\n        'Trying to interpolate expressions in an unsupported url format.',\n      );\n    }\n  }\n\n  let url = templateObj[0];\n  for (let i = 0; i < rest.length; i++) {\n    url += encodeURIComponent(rest[i]) + templateObj[i + 1];\n  }\n  return createResourceUrlInternal(url);\n}\n\n/**\n * Similar to iterable, but using the concrete types so we don't rely on the\n * iterable protocol, which needs a poyfill in ES5\n */\ntype IterableEntries<U> =\n  | ReadonlyMap<string, U>\n  | ReadonlyArray<[string, U]>\n  | Readonly<Record<string, U>>;\ntype SearchParams =\n  | IterableEntries<\n      Primitive | null | undefined | ReadonlyArray<Primitive | null | undefined>\n    >\n  // BEGIN-INTERNAL\n  | IterableEntries<string>\n  // Explicit type union for compatibility with the Closure compiler since it\n  // doesn't support covariance.\n  // END-INTERNAL\n  | URLSearchParams;\n\n/**\n * Creates a new TrustedResourceUrl with params to replace the URL's existing\n * search parameters.\n *\n * @param params What to add to the URL. Parameters with value `null` or\n * `undefined` are skipped. Both keys and values will be encoded. Do not pass\n * pre-encoded values as this will result them being double encoded. If the\n * value is an array then the same parameter is added for every element in the\n * array.\n */\nexport function replaceParams(\n  trustedUrl: TrustedResourceUrl,\n  params: SearchParams,\n): TrustedResourceUrl {\n  const urlSegments = getUrlSegments(unwrapResourceUrl(trustedUrl).toString());\n  return appendParamsInternal(\n    urlSegments.urlPath,\n    '',\n    urlSegments.fragment,\n    params,\n  );\n}\n\n/**\n * Creates a new TrustedResourceUrl with params added to the URL's search\n * parameters.\n *\n * @param params What to add to the URL. Parameters with value `null` or\n * `undefined` are skipped. Both keys and values will be encoded. Do not pass\n * pre-encoded values as this will result them being double encoded. If the\n * value is an array then the same parameter is added for every element in the\n * array.\n */\nexport function appendParams(\n  trustedUrl: TrustedResourceUrl,\n  params: SearchParams,\n): TrustedResourceUrl {\n  const urlSegments = getUrlSegments(unwrapResourceUrl(trustedUrl).toString());\n  return appendParamsInternal(\n    urlSegments.urlPath,\n    urlSegments.params,\n    urlSegments.fragment,\n    params,\n  );\n}\n\nfunction appendParamsInternal(\n  path: string,\n  params: string,\n  hash: string,\n  newParams: SearchParams,\n): TrustedResourceUrl {\n  let separator = params.length ? '&' : '?';\n\n  function addParam(\n    value:\n      | Primitive\n      | null\n      | undefined\n      | ReadonlyArray<Primitive | null | undefined>,\n    key: string,\n  ): void {\n    if (value == null) {\n      return;\n    }\n\n    if (isArray(value)) {\n      // tslint:disable-next-line:g3-no-void-expression\n      value.forEach((v) => addParam(v, key));\n    } else {\n      params +=\n        separator + encodeURIComponent(key) + '=' + encodeURIComponent(value);\n      separator = '&';\n    }\n  }\n\n  if (isPlainObject(newParams)) {\n    newParams = Object.entries(newParams);\n  }\n\n  // Avoids for-of and/or Array.from which has a big polyfill in ES5.\n  if (isArray(newParams)) {\n    // tslint:disable-next-line:g3-no-void-expression\n    newParams.forEach((pair) => addParam(pair[1], pair[0]));\n  } else {\n    // tslint:disable-next-line:g3-no-void-expression\n    newParams.forEach(addParam);\n  }\n\n  return createResourceUrlInternal(path + params + hash);\n}\n\nfunction isArray<T>(x: unknown | readonly T[]): x is readonly T[] {\n  return Array.isArray(x);\n}\n\nfunction isPlainObject<T>(\n  x: object | Record<string, T>,\n): x is Record<string, T> {\n  return x.constructor === Object;\n}\n\nconst BEFORE_FRAGMENT_REGEXP = /[^#]*/;\n\n/**\n * Creates a new TrustedResourceUrl based on an existing one but with the\n * addition of a fragment (the part after `#`). If the URL already has a\n * fragment, it is replaced with the new one.\n * @param fragment The fragment to add to the URL, verbatim, without the leading\n * `#`. No additional escaping is applied.\n */\nexport function replaceFragment(\n  trustedUrl: TrustedResourceUrl,\n  fragment: string,\n): TrustedResourceUrl {\n  const urlString = unwrapResourceUrl(trustedUrl).toString();\n  return createResourceUrlInternal(\n    BEFORE_FRAGMENT_REGEXP.exec(urlString)![0] +\n      (fragment.trim() ? '#' + fragment : ''),\n  );\n}\n\n/**\n * Creates a new TrustedResourceUrl based on an existing one with a single\n * subpath segment added to the end of the existing path and prior to any query\n * parameters and/or fragments that already exist in the URL.\n * @param pathSegment The singular sub path being added to the URL. Do not pass\n *     a pre-encoded value as this will result in it being double encoded.\n */\nexport function appendPathSegment(\n  trustedUrl: TrustedResourceUrl,\n  pathSegment: string,\n): TrustedResourceUrl {\n  const urlSegments = getUrlSegments(unwrapResourceUrl(trustedUrl).toString());\n\n  const separator = urlSegments.urlPath.slice(-1) === '/' ? '' : '/';\n  const newPath =\n    urlSegments.urlPath + separator + encodeURIComponent(pathSegment);\n\n  return createResourceUrlInternal(\n    newPath + urlSegments.params + urlSegments.fragment,\n  );\n}\n\n/**\n * Creates a `TrustedResourceUrl` by generating a `Blob` from a\n * `SafeScript` and then calling `URL.createObjectURL` with that `Blob`.\n *\n * Caller must call `URL.revokeObjectURL()` on the stringified url to\n * release the underlying `Blob`.\n */\nexport function objectUrlFromScript(\n  safeScript: SafeScript,\n): TrustedResourceUrl {\n  const scriptContent = unwrapScript(safeScript).toString();\n  const blob = new Blob([scriptContent], {type: 'text/javascript'});\n  return createResourceUrlInternal(URL.createObjectURL(blob));\n}\n\n/**\n * A function to safely retrieve the base URI from the Window object and set it\n * at the beginning of a given path-relative (starts with \"/\") resource url.\n *\n * @param pathRelativeUrl The resource to which the origin shall be prepended.\n */\nexport function toAbsoluteResourceUrl(\n  pathRelativeUrl: TrustedResourceUrl,\n): TrustedResourceUrl {\n  const originalUrl = unwrapResourceUrl(pathRelativeUrl).toString();\n  const qualifiedUrl = new URL(originalUrl, window.document.baseURI);\n  return createResourceUrlInternal(qualifiedUrl.toString());\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * This is internal-only because enabling sanitization by default would be a\n * breaking change, and we don't want to have a mandatory dep on safevalues.\n *\n * However we'd like to open source this as an optional way of using lit-html.\n */\n\nimport {EMPTY_HTML, isHtml, isResourceUrl, trustedResourceUrl, unwrapHtml, unwrapResourceUrl} from 'safevalues';\n\n/**\n * A system for validating the security properties of Lit attribute and property\n * bindings.\n *\n * Part of our trusted type support, while also providing many of the benefits\n * of enabling trusted types to Lit attribute and property bindings even in\n * browsers without trusted type support.\n */\nexport const sanitizerFactory =\n    goog.DEBUG ? debugSanitizerFactory : realSanitizerFactory;\n\nfunction realSanitizerFactory(\n    node: Node, rawName: string, type: 'property'|'attribute'): ValueSanitizer {\n  // We're only concerned with setting attributes or properties on elements.\n  if (node.nodeType !== 1 /* NodeType.ELEMENT */) {\n    return allowAnything;\n  }\n  const name = rawName.toLowerCase() as Lowercase<string>;\n  if (name === 'innerhtml' || name === 'innertext' || name === 'textcontent' ||\n      name === 'outerhtml') {\n    if (goog.DEBUG) {\n      if (name === 'innerhtml' || name === 'outerhtml') {\n        debugLog(\n            `When Lit is running in high security mode, it can't be used to set ${\n                rawName}. Use the SafeHTML directive instead.`);\n      } else {\n        debugLog(`When Lit is running in high security mode, it can't be used to set ${\n            rawName}. Instead you can bind a string directly as a child of the element.`);\n      }\n    }\n    return (unused: unknown) => unwrapHtml(EMPTY_HTML);\n  }\n  const contract =\n      securityContracts.get(`${(node as Element).tagName as TagName} ${name}`);\n  if (contract !== undefined) {\n    return contract;\n  }\n  /**\n   * We want to forbid built in onevent attributes, as the browser will\n   * eval the attribute value. Since every custom element extends HTMLElement,\n   * we only need to worry about those events that are on its prototype.\n   *\n   * Properties are fine, because they must be set to a function object, which\n   * we assume an attacker can't construct, as to do that they already\n   * have code execution ability in the page and so are inside the perimeter.\n   *\n   * Custom elements might also declare properties with the same names as\n   * these onevent attributes, like an onInput property. That's fine, as long\n   * as it's never set as an attribute.\n   */\n  if (/^on/.test(name) && type === 'attribute') {\n    const baseToCheck = !(node as Element).tagName.includes('-') ?\n        /**\n         * By default we look to see if there's a property on the node since\n         * that's consistently there for the dangerous onevent attributes.\n         *\n         * We want to look on the node because a small number of elements have\n         * non-bubbling events, so their onevent handlers are only on their\n         * specific class. See:\n         * https://lit.dev/playground/#gist=a53869560f84fd0f310681438ef1ad87 for\n         * a current list of these cases. If this wasn't the case we could just\n         * look on HTMLElement.prototype for all cases.\n         */\n        node :\n         /**\n          * However, for custom elements, we do want to check\n          * HTMLElement.prototype, because every custom element extends\n          * HTMLElement, but an individual custom element might have its own\n          * fields that start with \"on\" that are unrelated to the dangerous\n          * native onevent attributes.\n          *\n          * We can do a simple check for a hyphen in the tag name because none\n          * of the built in elements with nonbubbling events have a hyphen.\n          */\n         HTMLElement.prototype;\n    if (name in baseToCheck) {\n      return (value: unknown) => {\n        let message = 'invalid binding';\n        if (goog.DEBUG) {\n          message =\n              `The ${\n                  name} attribute looks like a string based event listener. ` +\n              `These are insecure, and not supported in Lit's high security ` +\n              `mode. Use an event binding instead, like this:\n@${name.slice(2)}=\\${(event) => {${value}}}`;\n        }\n        throw new Error(message);\n      };\n    }\n  }\n  // This binding has no known security constraints.\n  return allowAnything;\n}\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n */\ntype ValueSanitizer = (value: unknown) => unknown;\n\n/**\n * A pattern that blocks javascript: URLs. Matches\n * (a) Urls with no explicit scheme; or\n * (b) Urls with an explicit scheme that is not javascript and that only has\n *     alphanumeric or [.-+] characters.\n * This pattern is taken from the Soy URL sanitizer and is reviewed by the\n *   go/safehtml-team.\n */\nconst BLOCK_JAVASCRIPT_URL_PATTERN =\n    /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\\/?#]*(?:[\\/?#]|$))/i;\n\n/**\n * A safe and meaningless URL that we use instead of unsafe values.\n */\nconst fallbackTrustedUrl = {\n  valueOf() {\n    return unwrapResourceUrl(trustedResourceUrl`about:invalid#zClosurez`);\n  }\n}.valueOf();\n\n// Value sanitizers\n// One of these functions runs for every value that's bound into an attribute or\n// property in a lit-html template.\nconst allowAnything = (value: unknown) => value;\nconst onlyForbidJavascriptUrls = (url: unknown) => {\n  if (!BLOCK_JAVASCRIPT_URL_PATTERN.test(String(url))) {\n    if (goog.DEBUG) {\n      debugModeThrowValueSanitizerError({\n        message: `Blocked javascript: url. ` +\n            `These are not supported in Lit high security mode.`,\n        fallbackValue: fallbackTrustedUrl,\n        badValue: url,\n      });\n    }\n    return fallbackTrustedUrl;\n  }\n  return url;\n};\nconst forbidEverythingBecauseFieldIsUnsupported = (value: unknown) => {\n  if (goog.DEBUG) {\n    debugModeThrowValueSanitizerError({\n      message: `Unsupported field in Lit high security mode.`,\n      fallbackValue: fallbackTrustedUrl,\n      badValue: value\n    });\n  }\n  return fallbackTrustedUrl;\n};\nconst requireSafeHtml = (maybeSafeHtml: unknown) => {\n  if (!isHtml(maybeSafeHtml)) {\n    if (goog.DEBUG) {\n      debugModeThrowValueSanitizerError({\n        message: `This field requires SafeHtml.`,\n        fallbackValue: unwrapHtml(EMPTY_HTML),\n        badValue: maybeSafeHtml\n      });\n    }\n    return unwrapHtml(EMPTY_HTML);\n  }\n  return unwrapHtml(maybeSafeHtml);\n};\nconst requireTrustedResourceUrl = (maybeResourceUrl: unknown) => {\n  if (!isResourceUrl(maybeResourceUrl)) {\n    if (goog.DEBUG) {\n      debugModeThrowValueSanitizerError({\n        message: `This field requires TrustedResourceUrl.`,\n        fallbackValue: fallbackTrustedUrl,\n        badValue: maybeResourceUrl\n      });\n    }\n    return fallbackTrustedUrl;\n  }\n  return unwrapResourceUrl(maybeResourceUrl);\n};\n\ntype UpperLetter = 'A'|'B'|'C'|'D'|'E'|'F'|'G'|'H'|'I'|'J'|'K'|'L'|'M'|'N'|'O'|\n    'P'|'Q'|'R'|'S'|'T'|'U'|'V'|'W'|'X'|'Y'|'Z';\n// At least one letter, all upper case.\ntype TagName = `${UpperLetter}${Uppercase < string >}`;\n\n// We key security contracts by the uppercased tag name, followed by the type\n// of the binding, followed by the binding's name. The tag name and the type\n// can't include spaces, so we don't need to do any escaping.\ntype SecurityContractName = `${TagName} ${Lowercase < string >}`;\n\n// Up to date with go/controlled-web-apis as of August 3rd 2023.\nconst securityContracts = new Map<SecurityContractName, ValueSanitizer>([\n  // go/keep-sorted start\n  ['A href', onlyForbidJavascriptUrls],  //\n  ['AREA href', onlyForbidJavascriptUrls],\n  ['BASE href', forbidEverythingBecauseFieldIsUnsupported],\n  ['BUTTON formaction', onlyForbidJavascriptUrls],\n  ['EMBED src', forbidEverythingBecauseFieldIsUnsupported],\n  ['FORM action', onlyForbidJavascriptUrls],\n  ['FRAME src', forbidEverythingBecauseFieldIsUnsupported],\n  ['IFRAME src', requireTrustedResourceUrl],  //\n  ['IFRAME srcdoc', requireSafeHtml],\n  ['INPUT formaction', onlyForbidJavascriptUrls],\n  ['LINK href', requireTrustedResourceUrl],\n  ['OBJECT codebase', forbidEverythingBecauseFieldIsUnsupported],\n  ['OBJECT data', forbidEverythingBecauseFieldIsUnsupported],\n  // We don't know of an attack vector whereby the browser will execute a\n  // <script> element created with Lit, but since it's such a well known attack\n  // surface for arbitrary code execution, it seems better to err on the side\n  // of caution.\n  ['SCRIPT href', requireTrustedResourceUrl],  // for SVG scripts\n  ['SCRIPT src', requireTrustedResourceUrl],\n  ['SCRIPT text', forbidEverythingBecauseFieldIsUnsupported],\n  ['USE href', requireTrustedResourceUrl],\n  // go/keep-sorted end\n]);\n\n/**\n * This behaves the same as realSanitizerFactory, but when run in debug mode\n * it will debugLog with more information when a value is unsanitary.\n */\nfunction debugSanitizerFactory(\n    node: Node, name: string, type: 'property'|'attribute'): ValueSanitizer {\n  const result = realSanitizerFactory(node, name, type);\n  if (result === allowAnything) {\n    return result;\n  }\n  return (value: unknown) => {\n    try {\n      return result(value);\n    } catch (error: unknown) {\n      if (!isValueSanitizerErrorInfo(error)) {\n        throw error;\n      }\n      debugLog(\n          `Security error: \"${error.message}\" encountered when setting ${\n              type} named ${JSON.stringify(name)} on `,\n          node, ` to value: `, error.badValue);\n      return error.fallbackValue;\n    }\n  };\n}\n\n// Thrown by debugModeThrowValueSanitizerError so that debugSanitizerFactory\n// can log more info about an invalid value.\ninterface ValueSanitizerErrorInfo extends Error {\n  [brand]: true;\n  fallbackValue: unknown;\n  badValue: unknown;\n}\nconst brand = Symbol();\nfunction isValueSanitizerErrorInfo(error: unknown):\n    error is ValueSanitizerErrorInfo {\n  return (error as null | Partial<ValueSanitizerErrorInfo>)?.[brand] === true;\n}\n\nfunction debugModeThrowValueSanitizerError(\n    opts: {message: string, fallbackValue: unknown, badValue: unknown}) {\n  const error = new Error(opts.message) as ValueSanitizerErrorInfo;\n  error[brand] = true;\n  error.fallbackValue = opts.fallbackValue;\n  error.badValue = opts.badValue;\n  throw error;\n}\n\n/**\n * Like console.error, only it does nothing in prod, and it gets around\n * a GWS conformance check that's concerned about logging in prod:\n * go/gws-js-conformance#goog-console\n *\n * Using googLog.error is insufficient, as we want the ability to log a Node\n * and not just a string. This is useful in the browser debugger because you\n * can right click on it and see it in the elements panel, getting more context\n * on where the offending node is in your app.\n */\nfunction debugLog(...values: unknown[]) {\n  if (!goog.DEBUG) {\n    return;\n  }\n  const key = 'console';\n  const c = window[key];\n  c.error.apply(c, values);\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {isPolyfilledSymbol} from './polyfill-support';\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\ntype TrustedTypesWindow = Window;\n\nimport {sanitizerFactory as google3SanitizerFactory} from './internal-security.js';\nimport {disableSanitizationCapability} from './disable_sanitization_capability.js';\n\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: const\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nimport {IS_SERVERSIDE as NODE_MODE} from 'google3/javascript/lit/is_serverside';\n\n// Allows minifiers to rename references to globalThis\nconst global = goog.global;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n  /**\n   * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n   * we will emit 'lit-debug' events to window, with live details about the update and render\n   * lifecycle. These can be useful for writing debug tooling and visualizations.\n   *\n   * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n   * making certain operations that are normally very cheap (like a no-op render) much slower,\n   * because we must copy data and dispatch events.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  export namespace DebugLog {\n    export type Entry =\n      | TemplatePrep\n      | TemplateInstantiated\n      | TemplateInstantiatedAndUpdated\n      | TemplateUpdating\n      | BeginRender\n      | EndRender\n      | CommitPartEntry\n      | SetPartValue;\n    export interface TemplatePrep {\n      kind: 'template prep';\n      template: Template;\n      strings: TemplateStringsArray;\n      clonableTemplate: HTMLTemplateElement;\n      parts: TemplatePart[];\n    }\n    export interface BeginRender {\n      kind: 'begin render';\n      id: number;\n      value: unknown;\n      container: HTMLElement | DocumentFragment;\n      options: RenderOptions | undefined;\n      part: ChildPart | undefined;\n    }\n    export interface EndRender {\n      kind: 'end render';\n      id: number;\n      value: unknown;\n      container: HTMLElement | DocumentFragment;\n      options: RenderOptions | undefined;\n      part: ChildPart;\n    }\n    export interface TemplateInstantiated {\n      kind: 'template instantiated';\n      template: Template | CompiledTemplate;\n      instance: TemplateInstance;\n      options: RenderOptions | undefined;\n      fragment: Node;\n      parts: Array<Part | undefined>;\n      values: unknown[];\n    }\n    export interface TemplateInstantiatedAndUpdated {\n      kind: 'template instantiated and updated';\n      template: Template | CompiledTemplate;\n      instance: TemplateInstance;\n      options: RenderOptions | undefined;\n      fragment: Node;\n      parts: Array<Part | undefined>;\n      values: unknown[];\n    }\n    export interface TemplateUpdating {\n      kind: 'template updating';\n      template: Template | CompiledTemplate;\n      instance: TemplateInstance;\n      options: RenderOptions | undefined;\n      parts: Array<Part | undefined>;\n      values: unknown[];\n    }\n    export interface SetPartValue {\n      kind: 'set part';\n      part: Part;\n      value: unknown;\n      valueIndex: number;\n      values: unknown[];\n      templateInstance: TemplateInstance;\n    }\n\n    export type CommitPartEntry =\n      | CommitNothingToChildEntry\n      | CommitText\n      | CommitNode\n      | CommitAttribute\n      | CommitProperty\n      | CommitBooleanAttribute\n      | CommitEventListener\n      | CommitToElementBinding;\n\n    export interface CommitNothingToChildEntry {\n      kind: 'commit nothing to child';\n      start: ChildNode;\n      end: ChildNode | null;\n      parent: Disconnectable | undefined;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitText {\n      kind: 'commit text';\n      node: Text;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitNode {\n      kind: 'commit node';\n      start: Node;\n      parent: Disconnectable | undefined;\n      value: Node;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitAttribute {\n      kind: 'commit attribute';\n      element: Element;\n      name: string;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitProperty {\n      kind: 'commit property';\n      element: Element;\n      name: string;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitBooleanAttribute {\n      kind: 'commit boolean attribute';\n      element: Element;\n      name: string;\n      value: boolean;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitEventListener {\n      kind: 'commit event listener';\n      element: Element;\n      name: string;\n      value: unknown;\n      oldListener: unknown;\n      options: RenderOptions | undefined;\n      // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n      removeListener: boolean;\n      // True if we're adding a new event listener (e.g. because first render, or settings changed)\n      addListener: boolean;\n    }\n\n    export interface CommitToElementBinding {\n      kind: 'commit to element binding';\n      element: Element;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n  }\n}\n\ninterface DebugLoggingWindow {\n  // Even in dev mode, we generally don't want to emit these events, as that's\n  // another level of cost, so only emit them when DEV_MODE is true _and_ when\n  // window.emitLitDebugEvents is true.\n  emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n  ? (event: LitUnstable.DebugLog.Entry) => {\n      const shouldEmit = (global as unknown as DebugLoggingWindow)\n        .emitLitDebugLogEvents;\n      if (!shouldEmit) {\n        return;\n      }\n      global.dispatchEvent(\n        new CustomEvent<LitUnstable.DebugLog.Entry>('lit-debug', {\n          detail: event,\n        })\n      );\n    }\n  : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n  global.litIssuedWarnings ??= new Set();\n\n  /**\n   * Issue a warning if we haven't already, based either on `code` or `warning`.\n   * Warnings are disabled automatically only by `warning`; disabling via `code`\n   * can be done by users.\n   */\n  issueWarning = (code: string, warning: string) => {\n    warning += code\n      ? ` See https://lit.dev/msg/${code} for more information.`\n      : '';\n    if (\n      !global.litIssuedWarnings!.has(warning) &&\n      !global.litIssuedWarnings!.has(code)\n    ) {\n      console.warn(warning);\n      global.litIssuedWarnings!.add(warning);\n    }\n  };\n}\n\nconst wrap =\n  ENABLE_SHADYDOM_NOPATCH &&\n  global.ShadyDOM?.inUse &&\n  (global.ShadyDOM?.noPatch === true ||\n                        global.ShadyDOM?.noPatch === 'on-demand')\n    ? (global.ShadyDOM!.wrap as <T extends Node>(node: T) => T)\n    : <T extends Node>(node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = {valueOf: () => trustedTypes\n  ? trustedTypes.createPolicy('lit-html', {\n      createHTML: (s) => s,\n    })\n  : undefined}.valueOf();\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n *     is being written to. Note that this is just an exemplar node, the write\n *     may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n *     be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n  node: Node,\n  name: string,\n  type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n *     the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n *     unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n  _node: Node,\n  _name: string,\n  _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n  if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n    return;\n  }\n  if (sanitizerFactoryInternal !== noopSanitizer) {\n    throw new Error(\n      `Attempted to overwrite existing lit-html security policy.` +\n        ` setSanitizeDOMValueFactory should be called at most once.`\n    );\n  }\n  sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n  sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst templateStringContentsToTemplates = new Map<string, Template>();\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n  return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n  NODE_MODE && global.document === undefined\n    ? ({\n        createTreeWalker() {\n          return {};\n        },\n      } as unknown as Document)\n    : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive => value === null ||\n    (typeof value != 'object' && typeof value != 'function') ||\n    isPolyfilledSymbol(value);\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n  isArray(value) ||\n  // tslint:disable-next-line:no-any\n  typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n *   (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /--\u003e/g;\n/**\n * Comments not started with \u003c!--, like </{, can be ended by a single `>`\n */\nconst comment2EndRegex = />/g;\n\n/**\n * The tagEnd regex matches the end of the \"inside an opening\" tag syntax\n * position. It either matches a `>`, an attribute-like sequence, or the end\n * of the string after a space (attribute-name position ending).\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\t\\n\\f\\r\" are HTML space characters:\n * https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * So an attribute is:\n *  * The name: any character except a whitespace character, (\"), ('), \">\",\n *    \"=\", or \"/\". Note: this is different from the HTML spec which also excludes control characters.\n *  * Followed by zero or more space characters\n *  * Followed by \"=\"\n *  * Followed by zero or more space characters\n *  * Followed by:\n *    * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n *    * (\") then any non-(\"), or\n *    * (') then any non-(')\n */\nconst tagEndRegex = new RegExp(\n  `>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|(\"|')|))|$)`,\n  'g'\n);\nconst ENTIRE_MATCH = 0;\nconst ATTRIBUTE_NAME = 1;\nconst SPACES_AND_EQUALS = 2;\nconst QUOTE_CHAR = 3;\n\nconst singleQuoteAttrEndRegex = /'/g;\nconst doubleQuoteAttrEndRegex = /\"/g;\n/**\n * Matches the raw text elements.\n *\n * Comments are not parsed within raw text elements, so we need to search their\n * text content for marker strings.\n */\nconst rawTextElement = /^(?:script|style|textarea|title)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\nconst MATHML_RESULT = 3;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;\n\n// TemplatePart types\n// IMPORTANT: these must match the values in PartType\nconst ATTRIBUTE_PART = 1;\nconst CHILD_PART = 2;\nconst PROPERTY_PART = 3;\nconst BOOLEAN_ATTRIBUTE_PART = 4;\nconst EVENT_PART = 5;\nconst ELEMENT_PART = 6;\nconst COMMENT_PART = 7;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n */\nexport type UncompiledTemplateResult<T extends ResultType = ResultType> = {\n  // This property needs to remain unminified.\n  ['_$litType$']: T;\n  strings: TemplateStringsArray;\n  values: unknown[];\n};\n\n/**\n * This is a template result that may be either uncompiled or compiled.\n *\n * In the future, TemplateResult will be this type. If you want to explicitly\n * note that a template result is potentially compiled, you can reference this\n * type and it will continue to behave the same through the next major version\n * of Lit. This can be useful for code that wants to prepare for the next\n * major version of Lit.\n */\nexport type MaybeCompiledTemplateResult<T extends ResultType = ResultType> =\n  | UncompiledTemplateResult<T>\n  | CompiledTemplateResult;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg}.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n * In Lit 4, this type will be an alias of\n * MaybeCompiledTemplateResult, so that code will get type errors if it assumes\n * that Lit templates are not compiled. When deliberately working with only\n * one, use either {@linkcode CompiledTemplateResult} or\n * {@linkcode UncompiledTemplateResult} explicitly.\n */\nexport type TemplateResult<T extends ResultType = ResultType> =\n  MaybeCompiledTemplateResult<T>;\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\n\nexport type MathMLTemplateResult = TemplateResult<typeof MATHML_RESULT>;\n\n/**\n * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the\n * prepare step.\n */\nexport interface CompiledTemplateResult {\n  // This is a factory in order to make template initialization lazy\n  // and allow ShadyRenderOptions scope to be passed in.\n  // This property needs to remain unminified.\n  ['_$litType$']: CompiledTemplate;\n  values: unknown[];\n}\n\nexport interface CompiledTemplate extends Omit<Template, 'el'> {\n  // el is overridden to be optional. We initialize it on first render\n  el?: HTMLTemplateElement;\n\n  // The prepared HTML string to create a template element from.\n  // The type is a TemplateStringsArray to guarantee that the value came from\n  // source code, preventing a JSON injection attack.\n  h: TemplateStringsArray;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag =\n  <T extends ResultType>(type: T) =>\n  (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<T> => {\n    // Warn against templates octal escape sequences\n    // We do this here rather than in render so that the warning is closer to the\n    // template definition.\n    if (DEV_MODE && strings.some((s) => s === undefined)) {\n      console.warn(\n        'Some template strings are undefined.\\n' +\n          'This is probably caused by illegal octal escape sequences.'\n      );\n    }\n    if (DEV_MODE) {\n      // Import static-html.js results in a circular dependency which g3 doesn't\n      // handle. Instead we know that static values must have the field\n      // `_$litStatic$`.\n      if (\n        values.some((val) => (val as {_$litStatic$: unknown})?.['_$litStatic$'])\n      ) {\n        issueWarning(\n          '',\n          `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\\n` +\n            `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`\n        );\n      }\n    }\n    return {\n      // This property needs to remain unminified.\n      ['_$litType$']: type,\n      strings,\n      values,\n    };\n  };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * ```ts\n * const header = (title: string) => html`<h1>${title}</h1>`;\n * ```\n *\n * The `html` tag returns a description of the DOM to render as a value. It is\n * lazy, meaning no work is done until the template is rendered. When rendering,\n * if a template comes from the same expression as a previously rendered result,\n * it's efficiently updated instead of replaced.\n */\nexport const html = (strings: TemplateStringsArray, ...values: unknown[]):\n    TemplateResult<typeof HTML_RESULT> => {\n      return {\n        // This property needs to remain unminified.\n        ['_$litType$']: HTML_RESULT,\n        strings,\n        values,\n      };\n    };\n\n/**\n * Interprets a template literal as an SVG fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const rect = svg`<rect width=\"10\" height=\"10\"></rect>`;\n *\n * const myImage = html`\n *   <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\">\n *     ${rect}\n *   </svg>`;\n * ```\n *\n * The `svg` *tag function* should only be used for SVG fragments, or elements\n * that would be contained **inside** an `<svg>` HTML element. A common error is\n * placing an `<svg>` *element* in a template tagged with the `svg` tag\n * function. The `<svg>` element is an HTML element and should be used within a\n * template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an SVG fragment from the\n * `render()` method, as the SVG fragment will be contained within the element's\n * shadow root and thus not be properly contained within an `<svg>` HTML\n * element.\n */\nexport const svg = (strings: TemplateStringsArray, ...values: unknown[]):\n    TemplateResult<typeof SVG_RESULT> => {\n      return {\n        // This property needs to remain unminified.\n        ['_$litType$']: SVG_RESULT,\n        strings,\n        values,\n      };\n    };\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const num = mathml`<mn>1</mn>`;\n *\n * const eq = html`\n *   <math>\n *     ${num}\n *   </math>`;\n * ```\n *\n * The `mathml` *tag function* should only be used for MathML fragments, or\n * elements that would be contained **inside** a `<math>` HTML element. A common\n * error is placing a `<math>` *element* in a template tagged with the `mathml`\n * tag function. The `<math>` element is an HTML element and should be used\n * within a template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an MathML fragment from the\n * `render()` method, as the MathML fragment will be contained within the\n * element's shadow root and thus not be properly contained within a `<math>`\n * HTML element.\n */\nexport const mathml = tag(MATHML_RESULT);\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange: unique symbol = {valueOf: () => Symbol.for ? Symbol.for('lit-noChange') : Symbol('lit-noChange')}.valueOf() as any;\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n *\n * ```ts\n * const button = html`${\n *  user.isAdmin\n *    ? html`<button>DELETE</button>`\n *    : nothing\n * }`;\n * ```\n *\n * Prefer using `nothing` over other falsy values as it provides a consistent\n * behavior between various expression binding contexts.\n *\n * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the\n * same and render no nodes. In attribute expressions, `nothing` _removes_ the\n * attribute, while `undefined` and `null` will render an empty string. In\n * property expressions `nothing` becomes `undefined`.\n */\nexport const nothing: unique symbol = {valueOf: () => Symbol.for ? Symbol.for('lit-nothing') : Symbol('lit-nothing')}.valueOf() as any;\n\n/**\n * The cache of prepared templates, keyed by the tagged TemplateStringsArray\n * and _not_ accounting for the specific template tag used. This means that\n * template tags cannot be dynamic - they must statically be one of html, svg,\n * or attr. This restriction simplifies the cache lookup, which is on the hot\n * path for rendering.\n */\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n/**\n * Object specifying options for controlling lit-html rendering. Note that\n * while `render` may be called multiple times on the same `container` (and\n * `renderBefore` reference node) to efficiently update the rendered content,\n * only the options passed in during the first render are respected during\n * the lifetime of renders to that unique `container` + `renderBefore`\n * combination.\n */\nexport interface RenderOptions {\n  /**\n   * An object to use as the `this` value for event listeners. It's often\n   * useful to set this to the host component rendering a template.\n   */\n  host?: object;\n  /**\n   * A DOM node before which to render content in the container.\n   */\n  renderBefore?: ChildNode | null;\n  /**\n   * Node used for cloning the template (`importNode` will be called on this\n   * node). This controls the `ownerDocument` of the rendered DOM, along with\n   * any inherited context. Defaults to the global `document`.\n   */\n  creationScope?: {importNode(node: Node, deep?: boolean): Node};\n  /**\n   * The initial connected state for the top-level part being rendered. If no\n   * `isConnected` option is set, `AsyncDirective`s will be connected by\n   * default. Set to `false` if the initial render occurs in a disconnected tree\n   * and `AsyncDirective`s should see `isConnected === false` for their initial\n   * render. The `part.setConnected()` method must be used subsequent to initial\n   * render to change the connected state of the part.\n   */\n  isConnected?: boolean;\n}\n\nconst walker = {valueOf: () =>d.createTreeWalker(\n  d,\n  129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */\n)}.valueOf();\n\nlet sanitizerFactoryInternal: SanitizerFactory = google3SanitizerFactory;\n\n/**\n * Disables resin.\n *\n * This will be removed soon, see the docs on\n * //third_party/javascript/lit_html:disable_sanitization_capability\n */\nexport const deprecatedUnsafeDisableSecurity = (capability: object) => {\n  // Use the disableSanitizationCapability to visibility-restrict the\n  // ability to disable sanitization, so that we can eventually remove\n  // that capability entirely.\n  if (capability !== disableSanitizationCapability) {\n    throw new Error(\n        `To disable sanitization of lit-html expressions you must pass ` +\n        `in the disableSanitizationCapability object.`);\n  }\n  sanitizerFactoryInternal = noopSanitizer;\n};\n\n\n//\n// Classes only below here, const variable declarations only above here...\n//\n// Keeping variable declarations and classes together improves minification.\n// Interfaces and type aliases can be interleaved freely.\n//\n\n// Type for classes that have a `_directive` or `_directives[]` field, used by\n// `resolveDirective`\nexport interface DirectiveParent {\n  _$parent?: DirectiveParent;\n  _$isConnected: boolean;\n  __directive?: Directive;\n  __directives?: Array<Directive | undefined>;\n}\n\nfunction trustFromTemplateString(\n  tsa: TemplateStringsArray,\n  stringFromTSA: string\n): TrustedHTML {\n  // A security check to prevent spoofing of Lit template results.\n  // In the future, we may be able to replace this with Array.isTemplateObject,\n  // though we might need to make that check inside of the html and svg\n  // functions, because precompiled templates don't come in as\n  // TemplateStringArray objects.\n  if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {\n    let message = 'invalid template strings array';\n    if (DEV_MODE) {\n      message = `\n          Internal Error: expected template strings to be an array\n          with a 'raw' field. Faking a template strings array by\n          calling html or svg like an ordinary function is effectively\n          the same as calling unsafeHtml and can lead to major security\n          issues, e.g. opening your code up to XSS attacks.\n          If you're using the html or svg tagged template functions normally\n          and still seeing this error, please file a bug at\n          https://github.com/lit/lit/issues/new?template=bug_report.md\n          and include information about your build tooling, if any.\n        `\n        .trim()\n        .replace(/\\n */g, '\\n');\n    }\n    throw new Error(message);\n  }\n  return policy !== undefined\n    ? policy.createHTML(stringFromTSA)\n    : (stringFromTSA as unknown as TrustedHTML);\n}\n\n/**\n * Returns an HTML string for the given TemplateStringsArray and result type\n * (HTML or SVG), along with the case-sensitive bound attribute names in\n * template order. The HTML contains comment markers denoting the `ChildPart`s\n * and suffixes on bound attributes denoting the `AttributeParts`.\n *\n * @param strings template strings array\n * @param type HTML or SVG\n * @return Array containing `[html, attrNames]` (array returned for terseness,\n *     to avoid object fields since this code is shared with non-minified SSR\n *     code)\n */\nconst getTemplateHtml = (\n  strings: TemplateStringsArray,\n  type: ResultType\n): [TrustedHTML, Array<string>] => {\n  // Insert makers into the template HTML to represent the position of\n  // bindings. The following code scans the template strings to determine the\n  // syntactic position of the bindings. They can be in text position, where\n  // we insert an HTML comment, attribute value position, where we insert a\n  // sentinel string and re-write the attribute name, or inside a tag where\n  // we insert the sentinel string.\n  const l = strings.length - 1;\n  // Stores the case-sensitive bound attribute names in the order of their\n  // parts. ElementParts are also reflected in this array as undefined\n  // rather than a string, to disambiguate from attribute bindings.\n  const attrNames: Array<string> = [];\n  let html =\n    type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';\n\n  // When we're inside a raw text tag (not it's text content), the regex\n  // will still be tagRegex so we can find attributes, but will switch to\n  // this regex when the tag ends.\n  let rawTextEndRegex: RegExp | undefined;\n\n  // The current parsing state, represented as a reference to one of the\n  // regexes\n  let regex = textEndRegex;\n\n  for (let i = 0; i < l; i++) {\n    const s = strings[i];\n    // The index of the end of the last attribute name. When this is\n    // positive at end of a string, it means we're in an attribute value\n    // position and need to rewrite the attribute name.\n    // We also use a special value of -2 to indicate that we encountered\n    // the end of a string in attribute name position.\n    let attrNameEndIndex = -1;\n    let attrName: string | undefined;\n    let lastIndex = 0;\n    let match!: RegExpExecArray | null;\n\n    // The conditions in this loop handle the current parse state, and the\n    // assignments to the `regex` variable are the state transitions.\n    while (lastIndex < s.length) {\n      // Make sure we start searching from where we previously left off\n      regex.lastIndex = lastIndex;\n      match = regex.exec(s);\n      if (match === null) {\n        break;\n      }\n      lastIndex = regex.lastIndex;\n      if (regex === textEndRegex) {\n        if (match[COMMENT_START] === '!--') {\n          regex = commentEndRegex;\n        } else if (match[COMMENT_START] !== undefined) {\n          // We started a weird comment, like </{\n          regex = comment2EndRegex;\n        } else if (match[TAG_NAME] !== undefined) {\n          if (rawTextElement.test(match[TAG_NAME])) {\n            // Record if we encounter a raw-text element. We'll switch to\n            // this regex at the end of the tag.\n            rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');\n          }\n          regex = tagEndRegex;\n        } else if (match[DYNAMIC_TAG_NAME] !== undefined) {\n          if (DEV_MODE) {\n            throw new Error(\n              'Bindings in tag names are not supported. Please use static templates instead. ' +\n                'See https://lit.dev/docs/templates/expressions/#static-expressions'\n            );\n          }\n          regex = tagEndRegex;\n        }\n      } else if (regex === tagEndRegex) {\n        if (match[ENTIRE_MATCH] === '>') {\n          // End of a tag. If we had started a raw-text element, use that\n          // regex\n          regex = rawTextEndRegex ?? textEndRegex;\n          // We may be ending an unquoted attribute value, so make sure we\n          // clear any pending attrNameEndIndex\n          attrNameEndIndex = -1;\n        } else if (match[ATTRIBUTE_NAME] === undefined) {\n          // Attribute name position\n          attrNameEndIndex = -2;\n        } else {\n          attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;\n          attrName = match[ATTRIBUTE_NAME];\n          regex =\n            match[QUOTE_CHAR] === undefined\n              ? tagEndRegex\n              : match[QUOTE_CHAR] === '\"'\n                ? doubleQuoteAttrEndRegex\n                : singleQuoteAttrEndRegex;\n        }\n      } else if (\n        regex === doubleQuoteAttrEndRegex ||\n        regex === singleQuoteAttrEndRegex\n      ) {\n        regex = tagEndRegex;\n      } else if (regex === commentEndRegex || regex === comment2EndRegex) {\n        regex = textEndRegex;\n      } else {\n        // Not one of the five state regexes, so it must be the dynamically\n        // created raw text regex and we're at the close of that element.\n        regex = tagEndRegex;\n        rawTextEndRegex = undefined;\n      }\n    }\n\n    if (DEV_MODE) {\n      // If we have a attrNameEndIndex, which indicates that we should\n      // rewrite the attribute name, assert that we're in a valid attribute\n      // position - either in a tag, or a quoted attribute value.\n      console.assert(\n        attrNameEndIndex === -1 ||\n          regex === tagEndRegex ||\n          regex === singleQuoteAttrEndRegex ||\n          regex === doubleQuoteAttrEndRegex,\n        'unexpected parse state B'\n      );\n    }\n\n    // We have four cases:\n    //  1. We're in text position, and not in a raw text element\n    //     (regex === textEndRegex): insert a comment marker.\n    //  2. We have a non-negative attrNameEndIndex which means we need to\n    //     rewrite the attribute name to add a bound attribute suffix.\n    //  3. We're at the non-first binding in a multi-binding attribute, use a\n    //     plain marker.\n    //  4. We're somewhere else inside the tag. If we're in attribute name\n    //     position (attrNameEndIndex === -2), add a sequential suffix to\n    //     generate a unique attribute name.\n\n    // Detect a binding next to self-closing tag end and insert a space to\n    // separate the marker from the tag end:\n    const end =\n      regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';\n    html +=\n      regex === textEndRegex\n        ? s + nodeMarker\n        : attrNameEndIndex >= 0\n          ? (attrNames.push(attrName!),\n            s.slice(0, attrNameEndIndex) +\n              boundAttributeSuffix +\n              s.slice(attrNameEndIndex)) +\n            marker +\n            end\n          : s + marker + (attrNameEndIndex === -2 ? i : end);\n  }\n\n  const htmlResult: string | TrustedHTML =\n    html +\n    (strings[l] || '<?>') +\n    (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');\n\n  // Returned as an array for terseness\n  return [trustFromTemplateString(strings, htmlResult), attrNames];\n};\n\n/** @internal */\nexport /* COPYBARA: type */ {Template};\nclass Template {\n  /** @internal */\n  el!: HTMLTemplateElement;\n\n  parts: Array<TemplatePart> = [];\n\n  constructor(\n    // This property needs to remain unminified.\n    {strings, ['_$litType$']: type}: UncompiledTemplateResult,\n    options?: RenderOptions\n  ) {\n    let node: Node | null;\n    let nodeIndex = 0;\n    let attrNameIndex = 0;\n    const partCount = strings.length - 1;\n    const parts = this.parts;\n\n    // Create template element\n    const [html, attrNames] = getTemplateHtml(strings, type);\n    this.el = Template.createElement(html, options);\n    walker.currentNode = this.el.content;\n\n    // Re-parent SVG or MathML nodes into template root\n    if (type === SVG_RESULT || type === MATHML_RESULT) {\n      const wrapper = this.el.content.firstChild!;\n      wrapper.replaceWith(...wrapper.childNodes);\n    }\n\n    // Walk the template to find binding markers and create TemplateParts\n    while ((node = walker.nextNode()) !== null && parts.length < partCount) {\n      if (node.nodeType === 1) {\n        if (DEV_MODE) {\n          const tag = (node as Element).localName;\n          // Warn if `textarea` includes an expression and throw if `template`\n          // does since these are not supported. We do this by checking\n          // innerHTML for anything that looks like a marker. This catches\n          // cases like bindings in textarea there markers turn into text nodes.\n          if (\n            /^(?:textarea|template)$/i!.test(tag) &&\n            (node as Element).innerHTML.includes(marker)\n          ) {\n            const m =\n              `Expressions are not supported inside \\`${tag}\\` ` +\n              `elements. See https://lit.dev/msg/expression-in-${tag} for more ` +\n              `information.`;\n            if (tag === 'template') {\n              throw new Error(m);\n            } else issueWarning('', m);\n          }\n        }\n        // TODO (justinfagnani): for attempted dynamic tag names, we don't\n        // increment the bindingIndex, and it'll be off by 1 in the element\n        // and off by two after it.\n        if ((node as Element).hasAttributes()) {\n          for (const name of (node as Element).getAttributeNames()) {\n            if (name.endsWith(boundAttributeSuffix)) {\n              const realName = attrNames[attrNameIndex++];\n              const value = (node as Element).getAttribute(name)!;\n              const statics = value.split(marker);\n              const m = /([.?@])?(.*)/.exec(realName)!;\n              parts.push({\n                type: ATTRIBUTE_PART,\n                index: nodeIndex,\n                name: m[2],\n                strings: statics,\n                ctor:\n                  m[1] === '.'\n                    ? PropertyPart\n                    : m[1] === '?'\n                      ? BooleanAttributePart\n                      : m[1] === '@'\n                        ? EventPart\n                        : AttributePart,\n              });\n              (node as Element).removeAttribute(name);\n            } else if (name.startsWith(marker)) {\n              parts.push({\n                type: ELEMENT_PART,\n                index: nodeIndex,\n              });\n              (node as Element).removeAttribute(name);\n            }\n          }\n        }\n        // TODO (justinfagnani): benchmark the regex against testing for each\n        // of the 3 raw text element names.\n        if (rawTextElement.test((node as Element).tagName)) {\n          // For raw text elements we need to split the text content on\n          // markers, create a Text node for each segment, and create\n          // a TemplatePart for each marker.\n          const strings = (node as Element).textContent!.split(marker);\n          const lastIndex = strings.length - 1;\n          if (lastIndex > 0) {\n            (node as Element).textContent = trustedTypes\n              ? (trustedTypes.emptyScript as unknown as '')\n              : '';\n            // Generate a new text node for each literal section\n            // These nodes are also used as the markers for child parts\n            for (let i = 0; i < lastIndex; i++) {\n              (node as Element).append(strings[i], createMarker());\n              // Walk past the marker node we just added\n              walker.nextNode();\n              parts.push({type: CHILD_PART, index: ++nodeIndex});\n            }\n            // Note because this marker is added after the walker's current\n            // node, it will be walked to in the outer loop (and ignored), so\n            // we don't need to adjust nodeIndex here\n            (node as Element).append(strings[lastIndex], createMarker());\n          }\n        }\n      } else if (node.nodeType === 8) {\n        const data = (node as Comment).data;\n        if (data === markerMatch) {\n          parts.push({type: CHILD_PART, index: nodeIndex});\n        } else {\n          let i = -1;\n          while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n            // Comment node has a binding marker inside, make an inactive part\n            // The binding won't work, but subsequent bindings will\n            parts.push({type: COMMENT_PART, index: nodeIndex});\n            // Move to the end of the match\n            i += marker.length - 1;\n          }\n        }\n      }\n      nodeIndex++;\n    }\n\n    if (DEV_MODE) {\n      // If there was a duplicate attribute on a tag, then when the tag is\n      // parsed into an element the attribute gets de-duplicated. We can detect\n      // this mismatch if we haven't precisely consumed every attribute name\n      // when preparing the template. This works because `attrNames` is built\n      // from the template string and `attrNameIndex` comes from processing the\n      // resulting DOM.\n      if (attrNames.length !== attrNameIndex) {\n        throw new Error(\n          `Detected duplicate attribute bindings. This occurs if your template ` +\n            `has duplicate attributes on an element tag. For example ` +\n            `\"<input ?disabled=\\${true} ?disabled=\\${false}>\" contains a ` +\n            `duplicate \"disabled\" attribute. The error was detected in ` +\n            `the following template: \\n` +\n            '`' +\n            strings.join('${...}') +\n            '`'\n        );\n      }\n    }\n\n    // We could set walker.currentNode to another node here to prevent a memory\n    // leak, but every time we prepare a template, we immediately render it\n    // and re-use the walker in new TemplateInstance._clone().\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'template prep',\n        template: this,\n        clonableTemplate: this.el,\n        parts: this.parts,\n        strings,\n      });\n  }\n\n  // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n  /** @nocollapse */\n  static createElement(html: TrustedHTML, _options?: RenderOptions) {\n    const el = d.createElement('template');\n    el.innerHTML = html as unknown as string;\n    return el;\n  }\n}\n\nexport interface Disconnectable {\n  _$parent?: Disconnectable;\n  _$disconnectableChildren?: Set<Disconnectable>;\n  // Rather than hold connection state on instances, Disconnectables recursively\n  // fetch the connection state from the RootPart they are connected in via\n  // getters up the Disconnectable tree via _$parent references. This pushes the\n  // cost of tracking the isConnected state to `AsyncDirectives`, and avoids\n  // needing to pass all Disconnectables (parts, template instances, and\n  // directives) their connection state each time it changes, which would be\n  // costly for trees that have no AsyncDirectives.\n  _$isConnected: boolean;\n}\n\nfunction resolveDirective(\n  part: ChildPart | AttributePart | ElementPart,\n  value: unknown,\n  parent: DirectiveParent = part,\n  attributeIndex?: number\n): unknown {\n  // Bail early if the value is explicitly noChange. Note, this means any\n  // nested directive is still attached and is not run.\n  if (value === noChange) {\n    return value;\n  }\n  let currentDirective =\n    attributeIndex !== undefined\n      ? (parent as AttributePart).__directives?.[attributeIndex]\n      : (parent as ChildPart | ElementPart | Directive).__directive;\n  const nextDirectiveConstructor = isPrimitive(value)\n    ? undefined\n    : // This property needs to remain unminified.\n      (value as DirectiveResult)['_$litDirective$'];\n  if (currentDirective?.constructor !== nextDirectiveConstructor) {\n    // This property needs to remain unminified.\n    currentDirective?.['_$notifyDirectiveConnectionChanged']?.(false);\n    if (nextDirectiveConstructor === undefined) {\n      currentDirective = undefined;\n    } else {\n      currentDirective = new nextDirectiveConstructor(part as PartInfo);\n      currentDirective._$initialize(part, parent, attributeIndex);\n    }\n    if (attributeIndex !== undefined) {\n      ((parent as AttributePart).__directives ??= [])[attributeIndex] =\n        currentDirective;\n    } else {\n      (parent as ChildPart | Directive).__directive = currentDirective;\n    }\n  }\n  if (currentDirective !== undefined) {\n    value = resolveDirective(\n      part,\n      currentDirective._$resolve(part, (value as DirectiveResult).values),\n      currentDirective,\n      attributeIndex\n    );\n  }\n  return value;\n}\n\nexport /* COPYBARA: type */ {TemplateInstance};\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance implements Disconnectable {\n  _$template: Template;\n  _$parts: Array<Part | undefined> = [];\n\n  /** @internal */\n  _$parent: ChildPart;\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  constructor(template: Template, parent: ChildPart) {\n    this._$template = template;\n    this._$parent = parent;\n  }\n\n  // Called by ChildPart parentNode getter\n  get parentNode() {\n    return this._$parent.parentNode;\n  }\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  // This method is separate from the constructor because we need to return a\n  // DocumentFragment and we don't want to hold onto it with an instance field.\n  _clone(options: RenderOptions | undefined) {\n    const {\n      el: {content},\n      parts: parts,\n    } = this._$template;\n    const fragment = (options?.creationScope ?? d).importNode(content, true);\n    walker.currentNode = fragment;\n\n    let node = walker.nextNode()!;\n    let nodeIndex = 0;\n    let partIndex = 0;\n    let templatePart = parts[0];\n\n    while (templatePart !== undefined) {\n      if (nodeIndex === templatePart.index) {\n        let part: Part | undefined;\n        if (templatePart.type === CHILD_PART) {\n          part = new ChildPart(\n            node as HTMLElement,\n            node.nextSibling,\n            this,\n            options\n          );\n        } else if (templatePart.type === ATTRIBUTE_PART) {\n          part = new templatePart.ctor(\n            node as HTMLElement,\n            templatePart.name,\n            templatePart.strings,\n            this,\n            options\n          );\n        } else if (templatePart.type === ELEMENT_PART) {\n          part = new ElementPart(node as HTMLElement, this, options);\n        }\n        this._$parts.push(part);\n        templatePart = parts[++partIndex];\n      }\n      if (nodeIndex !== templatePart?.index) {\n        node = walker.nextNode()!;\n        nodeIndex++;\n      }\n    }\n    // We need to set the currentNode away from the cloned tree so that we\n    // don't hold onto the tree even if the tree is detached and should be\n    // freed.\n    walker.currentNode = d;\n    return fragment;\n  }\n\n  _update(values: Array<unknown>) {\n    let i = 0;\n    for (const part of this._$parts) {\n      if (part !== undefined) {\n        debugLogEvent &&\n          debugLogEvent({\n            kind: 'set part',\n            part,\n            value: values[i],\n            valueIndex: i,\n            values,\n            templateInstance: this,\n          });\n        if ((part as AttributePart).strings !== undefined) {\n          (part as AttributePart)._$setValue(values, part as AttributePart, i);\n          // The number of values the part consumes is part.strings.length - 1\n          // since values are in between template spans. We increment i by 1\n          // later in the loop, so increment it by part.strings.length - 2 here\n          i += (part as AttributePart).strings!.length - 2;\n        } else {\n          part._$setValue(values[i]);\n        }\n      }\n      i++;\n    }\n  }\n}\n\n/*\n * Parts\n */\ntype AttributeTemplatePart = {\n  readonly type: typeof ATTRIBUTE_PART;\n  readonly index: number;\n  readonly name: string;\n  readonly ctor: typeof AttributePart;\n  readonly strings: ReadonlyArray<string>;\n};\ntype ChildTemplatePart = {\n  readonly type: typeof CHILD_PART;\n  readonly index: number;\n};\ntype ElementTemplatePart = {\n  readonly type: typeof ELEMENT_PART;\n  readonly index: number;\n};\ntype CommentTemplatePart = {\n  readonly type: typeof COMMENT_PART;\n  readonly index: number;\n};\n\n/**\n * A TemplatePart represents a dynamic part in a template, before the template\n * is instantiated. When a template is instantiated Parts are created from\n * TemplateParts.\n */\ntype TemplatePart =\n  | ChildTemplatePart\n  | AttributeTemplatePart\n  | ElementTemplatePart\n  | CommentTemplatePart;\n\nexport type Part =\n  | ChildPart\n  | AttributePart\n  | PropertyPart\n  | BooleanAttributePart\n  | ElementPart\n  | EventPart;\n\nexport /* COPYBARA: type */ {ChildPart};\nclass ChildPart implements Disconnectable {\n  readonly type = CHILD_PART;\n  readonly options: RenderOptions | undefined;\n  _$committedValue: unknown = nothing;\n  /** @internal */\n  __directive?: Directive;\n  /** @internal */\n  _$startNode: ChildNode;\n  /** @internal */\n  _$endNode: ChildNode | null;\n  private _textSanitizer: ValueSanitizer | undefined;\n  /** @internal */\n  _$parent: Disconnectable | undefined;\n  /**\n   * Connection state for RootParts only (i.e. ChildPart without _$parent\n   * returned from top-level `render`). This field is unused otherwise. The\n   * intention would be clearer if we made `RootPart` a subclass of `ChildPart`\n   * with this field (and a different _$isConnected getter), but the subclass\n   * caused a perf regression, possibly due to making call sites polymorphic.\n   * @internal\n   */\n  __isConnected: boolean;\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    // ChildParts that are not at the root should always be created with a\n    // parent; only RootChildNode's won't, so they return the local isConnected\n    // state\n    return this._$parent?._$isConnected ?? this.__isConnected;\n  }\n\n  // The following fields will be patched onto ChildParts when required by\n  // AsyncDirective\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n  /** @internal */\n  _$notifyConnectionChanged?(\n    isConnected: boolean,\n    removeFromParent?: boolean,\n    from?: number\n  ): void;\n  /** @internal */\n  _$reparentDisconnectables?(parent: Disconnectable): void;\n\n  constructor(\n    startNode: ChildNode,\n    endNode: ChildNode | null,\n    parent: TemplateInstance | ChildPart | undefined,\n    options: RenderOptions | undefined\n  ) {\n    this._$startNode = startNode;\n    this._$endNode = endNode;\n    this._$parent = parent;\n    this.options = options;\n    // Note __isConnected is only ever accessed on RootParts (i.e. when there is\n    // no _$parent); the value on a non-root-part is \"don't care\", but checking\n    // for parent would be more code\n    this.__isConnected = options?.isConnected ?? true;\n    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      // Explicitly initialize for consistent class shape.\n      this._textSanitizer = undefined;\n    }\n  }\n\n  /**\n   * The parent node into which the part renders its content.\n   *\n   * A ChildPart's content consists of a range of adjacent child nodes of\n   * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and\n   * `.endNode`).\n   *\n   * - If both `.startNode` and `.endNode` are non-null, then the part's content\n   * consists of all siblings between `.startNode` and `.endNode`, exclusively.\n   *\n   * - If `.startNode` is non-null but `.endNode` is null, then the part's\n   * content consists of all siblings following `.startNode`, up to and\n   * including the last child of `.parentNode`. If `.endNode` is non-null, then\n   * `.startNode` will always be non-null.\n   *\n   * - If both `.endNode` and `.startNode` are null, then the part's content\n   * consists of all child nodes of `.parentNode`.\n   */\n  get parentNode(): Node {\n    let parentNode: Node = wrap(this._$startNode).parentNode!;\n    const parent = this._$parent;\n    if (\n      parent !== undefined &&\n      parentNode?.nodeType === 11 /* Node.DOCUMENT_FRAGMENT */\n    ) {\n      // If the parentNode is a DocumentFragment, it may be because the DOM is\n      // still in the cloned fragment during initial render; if so, get the real\n      // parentNode the part will be committed into by asking the parent.\n      parentNode = (parent as ChildPart | TemplateInstance).parentNode;\n    }\n    return parentNode;\n  }\n\n  /**\n   * The part's leading marker node, if any. See `.parentNode` for more\n   * information.\n   */\n  get startNode(): Node | null {\n    return this._$startNode;\n  }\n\n  /**\n   * The part's trailing marker node, if any. See `.parentNode` for more\n   * information.\n   */\n  get endNode(): Node | null {\n    return this._$endNode;\n  }\n\n  _$setValue(value: unknown, directiveParent: DirectiveParent = this): void {\n    if (DEV_MODE && this.parentNode === null) {\n      throw new Error(\n        `This \\`ChildPart\\` has no \\`parentNode\\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \\`innerHTML\\` or \\`textContent\\` can do this.`\n      );\n    }\n    value = resolveDirective(this, value, directiveParent);\n    if (isPrimitive(value)) {\n      // Non-rendering child values. It's important that these do not render\n      // empty text nodes to avoid issues with preventing default <slot>\n      // fallback content.\n      if (value === nothing || value == null || value === '') {\n        if (this._$committedValue !== nothing) {\n          debugLogEvent &&\n            debugLogEvent({\n              kind: 'commit nothing to child',\n              start: this._$startNode,\n              end: this._$endNode,\n              parent: this._$parent,\n              options: this.options,\n            });\n          this._$clear();\n        }\n        this._$committedValue = nothing;\n      } else if (value !== this._$committedValue && value !== noChange) {\n        this._commitText(value);\n      }\n      // This property needs to remain unminified.\n    } else if ((value as TemplateResult)['_$litType$'] !== undefined) {\n      this._commitTemplateResult(value as TemplateResult);\n    } else if ((value as Node).nodeType !== undefined) {\n      if (DEV_MODE && this.options?.host === value) {\n        this._commitText(\n          `[probable mistake: rendered a template's host in itself ` +\n            `(commonly caused by writing \\${this} in a template]`\n        );\n        console.warn(\n          `Attempted to render the template host`,\n          value,\n          `inside itself. This is almost always a mistake, and in dev mode `,\n          `we render some warning text. In production however, we'll `,\n          `render it, which will usually result in an error, and sometimes `,\n          `in the element disappearing from the DOM.`\n        );\n        return;\n      }\n      this._commitNode(value as Node);\n    } else if (isIterable(value)) {\n      this._commitIterable(value);\n    } else {\n      // Fallback, will render the string representation\n      this._commitText(value);\n    }\n  }\n\n  private _insert<T extends Node>(node: T) {\n    return wrap(wrap(this._$startNode).parentNode!).insertBefore(\n      node,\n      this._$endNode\n    );\n  }\n\n  private _commitNode(value: Node): void {\n    if (this._$committedValue !== value) {\n      this._$clear();\n      if (\n        ENABLE_EXTRA_SECURITY_HOOKS &&\n        sanitizerFactoryInternal !== noopSanitizer\n      ) {\n        const parentNodeName = this._$startNode.parentNode?.nodeName;\n        if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {\n          let message = 'Forbidden';\n          if (DEV_MODE) {\n            if (parentNodeName === 'STYLE') {\n              message =\n                `Lit does not support binding inside style nodes. ` +\n                `This is a security risk, as style injection attacks can ` +\n                `exfiltrate data and spoof UIs. ` +\n                `Consider instead using css\\`...\\` literals ` +\n                `to compose styles, and do dynamic styling with ` +\n                `css custom properties, ::parts, <slot>s, ` +\n                `and by mutating the DOM rather than stylesheets.`;\n            } else {\n              message =\n                `Lit does not support binding inside script nodes. ` +\n                `This is a security risk, as it could allow arbitrary ` +\n                `code execution.`;\n            }\n          }\n          throw new Error(message);\n        }\n      }\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'commit node',\n          start: this._$startNode,\n          parent: this._$parent,\n          value: value,\n          options: this.options,\n        });\n      this._$committedValue = this._insert(value);\n    }\n  }\n\n  private _commitText(value: unknown): void {\n    // If the committed value is a primitive it means we called _commitText on\n    // the previous render, and we know that this._$startNode.nextSibling is a\n    // Text node. We can now just replace the text content (.data) of the node.\n    if (\n      this._$committedValue !== nothing &&\n      isPrimitive(this._$committedValue)\n    ) {\n      const node = wrap(this._$startNode).nextSibling as Text;\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        if (this._textSanitizer === undefined) {\n          this._textSanitizer = createSanitizer(node, 'data', 'property');\n        }\n        value = this._textSanitizer(value);\n      }\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'commit text',\n          node,\n          value,\n          options: this.options,\n        });\n      (node as Text).data = value as string;\n    } else {\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        const textNode = d.createTextNode('');\n        this._commitNode(textNode);\n        // When setting text content, for security purposes it matters a lot\n        // what the parent is. For example, <style> and <script> need to be\n        // handled with care, while <span> does not. So first we need to put a\n        // text node into the document, then we can sanitize its content.\n        if (this._textSanitizer === undefined) {\n          this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n        }\n        value = this._textSanitizer(value);\n        debugLogEvent &&\n          debugLogEvent({\n            kind: 'commit text',\n            node: textNode,\n            value,\n            options: this.options,\n          });\n        textNode.data = value as string;\n      } else {\n        this._commitNode(d.createTextNode(value as string));\n        debugLogEvent &&\n          debugLogEvent({\n            kind: 'commit text',\n            node: wrap(this._$startNode).nextSibling as Text,\n            value,\n            options: this.options,\n          });\n      }\n    }\n    this._$committedValue = value;\n  }\n\n  private _commitTemplateResult(\n    result: TemplateResult | CompiledTemplateResult\n  ): void {\n    // This property needs to remain unminified.\n    const {values, ['_$litType$']: type} = result;\n    // If $litType$ is a number, result is a plain TemplateResult and we get\n    // the template from the template cache. If not, result is a\n    // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need\n    // to create the <template> element the first time we see it.\n    const template: Template | CompiledTemplate =\n      typeof type === 'number'\n        ? this._$getTemplate(result as UncompiledTemplateResult)\n        : (type.el === undefined &&\n            (type.el = Template.createElement(\n              trustFromTemplateString(type.h, type.h[0]),\n              this.options\n            )),\n          type);\n\n    if ((this._$committedValue as TemplateInstance)?._$template === template) {\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'template updating',\n          template,\n          instance: this._$committedValue as TemplateInstance,\n          parts: (this._$committedValue as TemplateInstance)._$parts,\n          options: this.options,\n          values,\n        });\n      (this._$committedValue as TemplateInstance)._update(values);\n    } else {\n      const instance = new TemplateInstance(template as Template, this);\n      const fragment = instance._clone(this.options);\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'template instantiated',\n          template,\n          instance,\n          parts: instance._$parts,\n          options: this.options,\n          fragment,\n          values,\n        });\n      instance._update(values);\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'template instantiated and updated',\n          template,\n          instance,\n          parts: instance._$parts,\n          options: this.options,\n          fragment,\n          values,\n        });\n      this._commitNode(fragment);\n      this._$committedValue = instance;\n    }\n  }\n\n  // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n  /** @internal */\n  _$getTemplate(result: UncompiledTemplateResult) {\n    const strings = result.strings;\n    let template = templateCache.get(strings);\n    if (template === undefined) {\n      if (goog.DEBUG) {\n        const key = strings.join('\\0');\n        template = templateStringContentsToTemplates.get(key);\n        if (template === undefined) {\n          template = new Template(result);\n          templateStringContentsToTemplates.set(key, template);\n        }\n        templateCache.set(strings, template);\n      } else {\n        templateCache.set(result.strings, (template = new Template(result)));\n      }\n    }\n\n    return template;\n  }\n\n  private _commitIterable(value: Iterable<unknown>): void {\n    // For an Iterable, we create a new InstancePart per item, then set its\n    // value to the item. This is a little bit of overhead for every item in\n    // an Iterable, but it lets us recurse easily and efficiently update Arrays\n    // of TemplateResults that will be commonly returned from expressions like:\n    // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n    // If value is an array, then the previous render was of an\n    // iterable and value will contain the ChildParts from the previous\n    // render. If value is not an array, clear this part and make a new\n    // array for ChildParts.\n    if (!isArray(this._$committedValue)) {\n      this._$committedValue = [];\n      this._$clear();\n    }\n\n    // Lets us keep track of how many items we stamped so we can clear leftover\n    // items from a previous render\n    const itemParts = this._$committedValue as ChildPart[];\n    let partIndex = 0;\n    let itemPart: ChildPart | undefined;\n\n    for (const item of value) {\n      if (partIndex === itemParts.length) {\n        // If no existing part, create a new one\n        // TODO (justinfagnani): test perf impact of always creating two parts\n        // instead of sharing parts between nodes\n        // https://github.com/lit/lit/issues/1266\n        itemParts.push(\n          (itemPart = new ChildPart(\n            this._insert(createMarker()),\n            this._insert(createMarker()),\n            this,\n            this.options\n          ))\n        );\n      } else {\n        // Reuse an existing part\n        itemPart = itemParts[partIndex];\n      }\n      itemPart._$setValue(item);\n      partIndex++;\n    }\n\n    if (partIndex < itemParts.length) {\n      // itemParts always have end nodes\n      this._$clear(\n        itemPart && wrap(itemPart._$endNode!).nextSibling,\n        partIndex\n      );\n      // Truncate the parts array so _value reflects the current state\n      itemParts.length = partIndex;\n    }\n  }\n\n  /**\n   * Removes the nodes contained within this Part from the DOM.\n   *\n   * @param start Start node to clear from, for clearing a subset of the part's\n   *     DOM (used when truncating iterables)\n   * @param from  When `start` is specified, the index within the iterable from\n   *     which ChildParts are being removed, used for disconnecting directives in\n   *     those Parts.\n   *\n   * @internal\n   */\n  _$clear(\n    start: ChildNode | null = wrap(this._$startNode).nextSibling,\n    from?: number\n  ) {\n    this._$notifyConnectionChanged?.(false, true, from);\n    while (start && start !== this._$endNode) {\n      const n = wrap(start!).nextSibling;\n      (wrap(start!) as Element).remove();\n      start = n;\n    }\n  }\n  /**\n   * Implementation of RootPart's `isConnected`. Note that this method\n   * should only be called on `RootPart`s (the `ChildPart` returned from a\n   * top-level `render()` call). It has no effect on non-root ChildParts.\n   * @param isConnected Whether to set\n   * @internal\n   */\n  setConnected(isConnected: boolean) {\n    if (this._$parent === undefined) {\n      this.__isConnected = isConnected;\n      this._$notifyConnectionChanged?.(isConnected);\n    } else if (DEV_MODE) {\n      throw new Error(\n        'part.setConnected() may only be called on a ' +\n          'RootPart returned from render().'\n      );\n    }\n  }\n}\n\n/**\n * A top-level `ChildPart` returned from `render` that manages the connected\n * state of `AsyncDirective`s created throughout the tree below it.\n */\nexport interface RootPart extends ChildPart {\n  /**\n   * Sets the connection state for `AsyncDirective`s contained within this root\n   * ChildPart.\n   *\n   * lit-html does not automatically monitor the connectedness of DOM rendered;\n   * as such, it is the responsibility of the caller to `render` to ensure that\n   * `part.setConnected(false)` is called before the part object is potentially\n   * discarded, to ensure that `AsyncDirective`s have a chance to dispose of\n   * any resources being held. If a `RootPart` that was previously\n   * disconnected is subsequently re-connected (and its `AsyncDirective`s should\n   * re-connect), `setConnected(true)` should be called.\n   *\n   * @param isConnected Whether directives within this tree should be connected\n   * or not\n   */\n  setConnected(isConnected: boolean): void;\n}\n\nexport /* COPYBARA: type */ {AttributePart};\nclass AttributePart implements Disconnectable {\n  readonly type:\n    | typeof ATTRIBUTE_PART\n    | typeof PROPERTY_PART\n    | typeof BOOLEAN_ATTRIBUTE_PART\n    | typeof EVENT_PART = ATTRIBUTE_PART;\n  readonly element: HTMLElement;\n  readonly name: string;\n  readonly options: RenderOptions | undefined;\n\n  /**\n   * If this attribute part represents an interpolation, this contains the\n   * static strings of the interpolation. For single-value, complete bindings,\n   * this is undefined.\n   */\n  readonly strings?: ReadonlyArray<string>;\n  /** @internal */\n  _$committedValue: unknown | Array<unknown> = nothing;\n  /** @internal */\n  __directives?: Array<Directive | undefined>;\n  /** @internal */\n  _$parent: Disconnectable;\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  protected _sanitizer: ValueSanitizer | undefined;\n\n  get tagName() {\n    return this.element.tagName;\n  }\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  constructor(\n    element: HTMLElement,\n    name: string,\n    strings: ReadonlyArray<string>,\n    parent: Disconnectable,\n    options: RenderOptions | undefined\n  ) {\n    this.element = element;\n    this.name = name;\n    this._$parent = parent;\n    this.options = options;\n    if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {\n      this._$committedValue = new Array(strings.length - 1).fill(new String());\n      this.strings = strings;\n    } else {\n      this._$committedValue = nothing;\n    }\n    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      this._sanitizer = undefined;\n    }\n  }\n\n  /**\n   * Sets the value of this part by resolving the value from possibly multiple\n   * values and static strings and committing it to the DOM.\n   * If this part is single-valued, `this._strings` will be undefined, and the\n   * method will be called with a single value argument. If this part is\n   * multi-value, `this._strings` will be defined, and the method is called\n   * with the value array of the part's owning TemplateInstance, and an offset\n   * into the value array from which the values should be read.\n   * This method is overloaded this way to eliminate short-lived array slices\n   * of the template instance values, and allow a fast-path for single-valued\n   * parts.\n   *\n   * @param value The part value, or an array of values for multi-valued parts\n   * @param valueIndex the index to start reading values from. `undefined` for\n   *   single-valued parts\n   * @param noCommit causes the part to not commit its value to the DOM. Used\n   *   in hydration to prime attribute parts with their first-rendered value,\n   *   but not set the attribute, and in SSR to no-op the DOM operation and\n   *   capture the value for serialization.\n   *\n   * @internal\n   */\n  _$setValue(\n    value: unknown | Array<unknown>,\n    directiveParent: DirectiveParent = this,\n    valueIndex?: number,\n    noCommit?: boolean\n  ) {\n    const strings = this.strings;\n\n    // Whether any of the values has changed, for dirty-checking\n    let change = false;\n\n    if (strings === undefined) {\n      // Single-value binding case\n      value = resolveDirective(this, value, directiveParent, 0);\n      change =\n        !isPrimitive(value) ||\n        (value !== this._$committedValue && value !== noChange);\n      if (change) {\n        this._$committedValue = value;\n      }\n    } else {\n      // Interpolation case\n      const values = value as Array<unknown>;\n      value = strings[0];\n\n      let i, v;\n      for (i = 0; i < strings.length - 1; i++) {\n        v = resolveDirective(this, values[valueIndex! + i], directiveParent, i);\n\n        if (v === noChange) {\n          // If the user-provided value is `noChange`, use the previous value\n          v = (this._$committedValue as Array<unknown>)[i];\n        }\n        change ||=\n          !isPrimitive(v) || v !== (this._$committedValue as Array<unknown>)[i];\n        if (v === nothing) {\n          value = nothing;\n        } else if (value !== nothing) {\n          value += (v ?? '') + strings[i + 1];\n        }\n        // We always record each value, even if one is `nothing`, for future\n        // change detection.\n        (this._$committedValue as Array<unknown>)[i] = v;\n      }\n    }\n    if (change && !noCommit) {\n      this._commitValue(value);\n    }\n  }\n\n  /** @internal */\n  _commitValue(value: unknown) {\n    if (value === nothing) {\n      (wrap(this.element) as Element).removeAttribute(this.name);\n    } else {\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        if (this._sanitizer === undefined) {\n          this._sanitizer = sanitizerFactoryInternal(\n            this.element,\n            this.name,\n            'attribute'\n          );\n        }\n        value = this._sanitizer(value ?? '');\n      }\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'commit attribute',\n          element: this.element,\n          name: this.name,\n          value,\n          options: this.options,\n        });\n      (wrap(this.element) as Element).setAttribute(\n        this.name,\n        (value ?? '') as string\n      );\n    }\n  }\n}\n\nexport /* COPYBARA: type */ {PropertyPart};\nclass PropertyPart extends AttributePart {\n  override readonly type = PROPERTY_PART;\n\n  /** @internal */\n  override _commitValue(value: unknown) {\n    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      if (this._sanitizer === undefined) {\n        this._sanitizer = sanitizerFactoryInternal(\n          this.element,\n          this.name,\n          'property'\n        );\n      }\n      value = this._sanitizer(value);\n    }\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit property',\n        element: this.element,\n        name: this.name,\n        value,\n        options: this.options,\n      });\n    // tslint:disable-next-line:no-any\n    (this.element as any)[this.name] = value === nothing ? undefined : value;\n  }\n}\n\nexport /* COPYBARA: type */ {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n  override readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n  /** @internal */\n  override _commitValue(value: unknown) {\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit boolean attribute',\n        element: this.element,\n        name: this.name,\n        value: !!(value && value !== nothing),\n        options: this.options,\n      });\n    (wrap(this.element) as Element).toggleAttribute(\n      this.name,\n      !!value && value !== nothing\n    );\n  }\n}\n\ntype EventListenerWithOptions = EventListenerOrEventListenerObject &\n  Partial<AddEventListenerOptions>;\n\n/**\n * An AttributePart that manages an event listener via add/removeEventListener.\n *\n * This part works by adding itself as the event listener on an element, then\n * delegating to the value passed to it. This reduces the number of calls to\n * add/removeEventListener if the listener changes frequently, such as when an\n * inline function is used as a listener.\n *\n * Because event options are passed when adding listeners, we must take case\n * to add and remove the part as a listener when the event options change.\n */\nexport /* COPYBARA: type */ {EventPart};\nclass EventPart extends AttributePart {\n  override readonly type = EVENT_PART;\n\n  constructor(\n    element: HTMLElement,\n    name: string,\n    strings: ReadonlyArray<string>,\n    parent: Disconnectable,\n    options: RenderOptions | undefined\n  ) {\n    super(element, name, strings, parent, options);\n\n    if (DEV_MODE && this.strings !== undefined) {\n      throw new Error(\n        `A \\`<${element.localName}>\\` has a \\`@${name}=...\\` listener with ` +\n          'invalid content. Event listeners in templates must have exactly ' +\n          'one expression and no surrounding text.'\n      );\n    }\n  }\n\n  // EventPart does not use the base _$setValue/_resolveValue implementation\n  // since the dirty checking is more complex\n  /** @internal */\n  override _$setValue(\n    newListener: unknown,\n    directiveParent: DirectiveParent = this\n  ) {\n    newListener =\n      resolveDirective(this, newListener, directiveParent, 0) ?? nothing;\n    if (newListener === noChange) {\n      return;\n    }\n    const oldListener = this._$committedValue;\n\n    // If the new value is nothing or any options change we have to remove the\n    // part as a listener.\n    const shouldRemoveListener =\n      (newListener === nothing && oldListener !== nothing) ||\n      (newListener as EventListenerWithOptions).capture !==\n        (oldListener as EventListenerWithOptions).capture ||\n      (newListener as EventListenerWithOptions).once !==\n        (oldListener as EventListenerWithOptions).once ||\n      (newListener as EventListenerWithOptions).passive !==\n        (oldListener as EventListenerWithOptions).passive;\n\n    // If the new value is not nothing and we removed the listener, we have\n    // to add the part as a listener.\n    const shouldAddListener =\n      newListener !== nothing &&\n      (oldListener === nothing || shouldRemoveListener);\n\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit event listener',\n        element: this.element,\n        name: this.name,\n        value: newListener,\n        options: this.options,\n        removeListener: shouldRemoveListener,\n        addListener: shouldAddListener,\n        oldListener,\n      });\n    if (shouldRemoveListener) {\n      this.element.removeEventListener(\n        this.name,\n        this,\n        oldListener as EventListenerWithOptions\n      );\n    }\n    if (shouldAddListener) {\n      this.element.addEventListener(\n        this.name,\n        this,\n        newListener as EventListenerWithOptions\n      );\n    }\n    this._$committedValue = newListener;\n  }\n\n  handleEvent(event: Event) {\n    if (typeof this._$committedValue === 'function') {\n      this._$committedValue.call(this.options?.host ?? this.element, event);\n    } else {\n      (this._$committedValue as EventListenerObject).handleEvent(event);\n    }\n  }\n}\n\nexport /* COPYBARA: type */ {ElementPart};\nclass ElementPart implements Disconnectable {\n  readonly type = ELEMENT_PART;\n\n  /** @internal */\n  __directive?: Directive;\n\n  // This is to ensure that every Part has a _$committedValue\n  _$committedValue: undefined;\n\n  /** @internal */\n  _$parent!: Disconnectable;\n\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  options: RenderOptions | undefined;\n\n  constructor(\n    public element: Element,\n    parent: Disconnectable,\n    options: RenderOptions | undefined\n  ) {\n    this._$parent = parent;\n    this.options = options;\n  }\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  _$setValue(value: unknown): void {\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit to element binding',\n        element: this.element,\n        value,\n        options: this.options,\n      });\n    resolveDirective(this, value);\n  }\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-element, which re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LH = {\n  // Used in lit-ssr\n  _boundAttributeSuffix: boundAttributeSuffix,\n  _marker: marker,\n  _markerMatch: markerMatch,\n  _HTML_RESULT: HTML_RESULT,\n  _getTemplateHtml: getTemplateHtml,\n  // Used in tests and private-ssr-support\n  _TemplateInstance: TemplateInstance,\n  _isIterable: isIterable,\n  _resolveDirective: resolveDirective,\n  _ChildPart: ChildPart,\n  _AttributePart: AttributePart,\n  _BooleanAttributePart: BooleanAttributePart,\n  _EventPart: EventPart,\n  _PropertyPart: PropertyPart,\n  _ElementPart: ElementPart,\n};\n\nif (goog.FEATURESET_YEAR < 2020) {\n  // Apply polyfills if available\n  const polyfillSupport = DEV_MODE ? globalThis.litHtmlPolyfillSupportDevMode :\n                                     globalThis.litHtmlPolyfillSupport;\n  polyfillSupport?.(Template, ChildPart);\n}\n\nconst markVersions = () => {\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n(global.litHtmlVersions ??= []).push('3.2.1');\nif (DEV_MODE && global.litHtmlVersions.length > 1) {\n  Promise.resolve().then(() => {\n    issueWarning!(\n      'multiple-versions',\n      `Multiple versions of Lit loaded. Loading multiple versions ` +\n        `is not recommended.`\n    );\n  });\n}\n};\n\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n *\n * This example renders the text \"Hello, Zoe!\" inside a paragraph tag, appending\n * it to the container `document.body`.\n *\n * ```js\n * import {html, render} from 'lit';\n *\n * const name = \"Zoe\";\n * render(html`<p>Hello, ${name}!</p>`, document.body);\n * ```\n *\n * @param value Any [renderable\n *   value](https://lit.dev/docs/templates/expressions/#child-expressions),\n *   typically a {@linkcode TemplateResult} created by evaluating a template tag\n *   like {@linkcode html} or {@linkcode svg}.\n * @param container A DOM container to render to. The first render will append\n *   the rendered value to the container: container as HTMLElement|DocumentFragment, and subsequent renders will\n *   efficiently update the rendered value if the same result type was\n *   previously rendered there.\n * @param options See {@linkcode RenderOptions} for options documentation.\n * @see\n * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}\n */\nexport const render = {valueOf() {\nmarkVersions();\nconst render = (\n  value: unknown,\n  container: Element | DocumentFragment,\n  options?: RenderOptions\n): RootPart => {\n  if (DEV_MODE && container == null) {\n    // Give a clearer error message than\n    //     Uncaught TypeError: Cannot read properties of null (reading\n    //     '_$litPart$')\n    // which reads like an internal Lit error.\n    throw new TypeError(`The container to render into may not be ${container}`);\n  }\n  const renderId = DEV_MODE ? debugLogRenderId++ : 0;\n  const partOwnerNode = options?.renderBefore ?? container;\n  // This property needs to remain unminified.\n  // tslint:disable-next-line:no-any\n  let part: ChildPart = (partOwnerNode as any)['_$litPart$'];\n  debugLogEvent &&\n    debugLogEvent({\n      kind: 'begin render',\n      id: renderId,\n      value,\n      container: container as HTMLElement|DocumentFragment,\n      options,\n      part,\n    });\n  if (part === undefined) {\n    const endNode = options?.renderBefore ?? null;\n    // This property needs to remain unminified.\n    // tslint:disable-next-line:no-any\n    (partOwnerNode as any)['_$litPart$'] = part = new ChildPart(\n      container.insertBefore(createMarker(), endNode),\n      endNode,\n      undefined,\n      options ?? {}\n    );\n  }\n  part._$setValue(value);\n  debugLogEvent &&\n    debugLogEvent({\n      kind: 'end render',\n      id: renderId,\n      value,\n      container: container as HTMLElement|DocumentFragment,\n      options,\n      part,\n    });\n  return part as RootPart;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n  render.setSanitizer = setSanitizer;\n  render.createSanitizer = createSanitizer;\n  if (DEV_MODE) {\n    render._testOnlyClearSanitizerFactoryDoNotCallOrElse =\n      _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n  }\n}\nreturn render;\n}}.valueOf();\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The main LitElement module, which defines the {@linkcode LitElement} base\n * class and related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import {@linkcode LitElement} and {@linkcode html} from this module to\n * create a component:\n *\n *  ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n *   // Declare observed properties\n *   static get properties() {\n *     return {\n *       adjective: {}\n *     }\n *   }\n *\n *   constructor() {\n *     this.adjective = 'awesome';\n *   }\n *\n *   // Define the element's template\n *   render() {\n *     return html`<p>your ${adjective} template here</p>`;\n *   }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html\n * templating. The `ReactiveElement` class is provided for users that want to\n * build their own custom element base classes that don't use lit-html.\n *\n * (COPYBARA: packageDocumentation)\n */\n\nimport './polyfill-support';\nimport {objectProperty} from 'google3/third_party/javascript/closure/reflect/reflect';\nimport {adoptStyles, supportsAdoptingStyleSheets} from '@lit/reactive-element/css-tag.js';\nimport {shadowPiercingWalk} from 'google3/javascript/polymer/testing/shadow_piercer';\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, RootPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\nimport {LitUnstable} from 'lit-html';\nimport {ReactiveUnstable} from '@lit/reactive-element';\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Unstable {\n  /**\n   * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n   * we will emit 'lit-debug' events to window, with live details about the update and render\n   * lifecycle. These can be useful for writing debug tooling and visualizations.\n   *\n   * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n   * making certain operations that are normally very cheap (like a no-op render) much slower,\n   * because we must copy data and dispatch events.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  export namespace DebugLog {\n    export type Entry =\n      | LitUnstable.DebugLog.Entry\n      | ReactiveUnstable.DebugLog.Entry;\n  }\n}\n// COPYBARA: JSCompiler_renameProperty\n\nimport {DEV_MODE} from '@lit/reactive-element/dev-mode'; // COPYBARA: const\n// Allows minifiers to rename references to globalThis\nconst global = goog.global;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n  // Ensure warnings are issued only 1x, even if multiple versions of Lit\n  // are loaded.\n  global.litIssuedWarnings ??= new Set();\n\n  /**\n   * Issue a warning if we haven't already, based either on `code` or `warning`.\n   * Warnings are disabled automatically only by `warning`; disabling via `code`\n   * can be done by users.\n   */\n  issueWarning = (code: string, warning: string) => {\n    warning += ` See https://lit.dev/msg/${code} for more information.`;\n    if (\n      !global.litIssuedWarnings!.has(warning) &&\n      !global.litIssuedWarnings!.has(code)\n    ) {\n      console.warn(warning);\n      global.litIssuedWarnings!.add(warning);\n    }\n  };\n}\n\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the {@linkcode LitElement.properties properties} property or the\n * {@linkcode property} decorator.\n */\nexport class LitElement extends ReactiveElement {\n  // This property needs to remain unminified.\n  static ['_$litElement$'] = true;\n\n  /**\n   * @category rendering\n   */\n  readonly renderOptions: RenderOptions = {host: this};\n\n  private __childPart: RootPart | undefined = undefined;\n\n  /**\n   * @category rendering\n   */\n  protected override createRenderRoot() {\n    const renderRoot = super.createRenderRoot();\n    // When adoptedStyleSheets are shimmed, they are inserted into the\n    // shadowRoot by createRenderRoot. Adjust the renderBefore node so that\n    // any styles in Lit content render before adoptedStyleSheets. This is\n    // important so that adoptedStyleSheets have precedence over styles in\n    // the shadowRoot.\n    this.renderOptions.renderBefore ??= renderRoot!.firstChild as ChildNode;\n    return renderRoot;\n  }\n\n  /**\n   * Updates the element. This method reflects property values to attributes\n   * and calls `render` to render DOM via lit-html. Setting properties inside\n   * this method will *not* trigger another update.\n   * @param changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected override update(changedProperties: PropertyValues) {\n    // Setting properties in `render` should not trigger an update. Since\n    // updates are allowed after super.update, it's important to call `render`\n    // before that.\n    const value = this.render();\n    if (!this.hasUpdated) {\n      this.renderOptions.isConnected = this.isConnected;\n    }\n    super.update(changedProperties);\n    this.__childPart = render(value, this.renderRoot, this.renderOptions);\n  }\n\n  /**\n   * Invoked when the component is added to the document's DOM.\n   *\n   * In `connectedCallback()` you should setup tasks that should only occur when\n   * the element is connected to the document. The most common of these is\n   * adding event listeners to nodes external to the element, like a keydown\n   * event handler added to the window.\n   *\n   * ```ts\n   * connectedCallback() {\n   *   super.connectedCallback();\n   *   addEventListener('keydown', this._handleKeydown);\n   * }\n   * ```\n   *\n   * Typically, anything done in `connectedCallback()` should be undone when the\n   * element is disconnected, in `disconnectedCallback()`.\n   *\n   * @category lifecycle\n   */\n  override connectedCallback() {\n    super.connectedCallback();\n    this.__childPart?.setConnected(true);\n  }\n\n  /**\n   * Invoked when the component is removed from the document's DOM.\n   *\n   * This callback is the main signal to the element that it may no longer be\n   * used. `disconnectedCallback()` should ensure that nothing is holding a\n   * reference to the element (such as event listeners added to nodes external\n   * to the element), so that it is free to be garbage collected.\n   *\n   * ```ts\n   * disconnectedCallback() {\n   *   super.disconnectedCallback();\n   *   window.removeEventListener('keydown', this._handleKeydown);\n   * }\n   * ```\n   *\n   * An element may be re-connected after being disconnected.\n   *\n   * @category lifecycle\n   */\n  override disconnectedCallback() {\n    super.disconnectedCallback();\n    this.__childPart?.setConnected(false);\n  }\n\n  /**\n   * Invoked on each update to perform rendering tasks. This method may return\n   * any value renderable by lit-html's `ChildPart` - typically a\n   * `TemplateResult`. Setting properties inside this method will *not* trigger\n   * the element to update.\n   * @category rendering\n   */\n  protected render(): unknown {\n    return noChange;\n  }\n\n  /** @nocollapse */\n  static notifyOnHotReplace(tagname: string, classObj: typeof LitElement) {\n    if (goog.DEBUG) {\n      // There's lots of things that this doesn't handle, but probably the\n      // biggest is updates to the constructor. That means that changes to event\n      // handlers won't go through when they're defined as arrow function\n      // property initializers. We could potentially hack that together, via\n      // some really wild tricks, but I'm inclined not to. Periodically\n      // reloading the page while developing with HMR is a good habit for people\n      // to get into.\n      //\n      // One thing I'd like to support is live updating of CSS defined in a\n      // css file with lit_css_module.\n      const existingProps = new Set(Object.getOwnPropertyNames(this.prototype));\n      const newProps = new Set(Object.getOwnPropertyNames(classObj.prototype));\n      for (const prop of Object.getOwnPropertyNames(classObj.prototype)) {\n        Object.defineProperty(\n            this.prototype, prop,\n            Object.getOwnPropertyDescriptor(classObj.prototype, prop)!);\n      }\n      const nonconfigurablePropsToDelete = new Set<string>();\n      for (const existingProp of existingProps) {\n        if (!newProps.has(existingProp)) {\n          if (Object.getOwnPropertyDescriptor(this.prototype, existingProp)\n                  ?.configurable === false) {\n            nonconfigurablePropsToDelete.add(existingProp);\n            // No way to delete a non-configurable property off the prototype.\n            continue;\n          }\n          // tslint:disable-next-line:no-any Yep, this is hacky.\n          delete (this.prototype as any)[existingProp];\n        }\n      }\n\n      // This new class object has never been finalized before. Need to finalize\n      // so that instances can get any updated styles.\n      classObj.finalize();\n\n      for (const node of shadowPiercingWalk(document)) {\n        if (node instanceof HTMLElement &&\n            node.tagName.toLowerCase() === tagname.toLowerCase()) {\n          const myNode = node as LitElement;\n\n          for (const prop of nonconfigurablePropsToDelete) {\n            // So, prop is a non-configurable property on the prototype that\n            // we want to delete. We can't remove it on the prototype, but\n            // we can probably shadow it on the instance.\n            const directDescriptor =\n                Object.getOwnPropertyDescriptor(myNode, prop);\n            if (directDescriptor !== undefined) {\n              // The prototype field has been overwritten by a field on the\n              // instance, leave it alone.\n              continue;\n            }\n            // Patch myNode to behave as though it has no `prop` by defining an\n            // instance field named `prop` that is initially undefined, writable\n            // but not enumerable.\n            let val: unknown = undefined;\n            Object.defineProperty(myNode, prop, {\n              get() {\n                return val;\n              },\n              set(updated: unknown) {\n                val = updated;\n              },\n              enumerable: false,\n              configurable: true,\n            });\n          }\n          // Get updated styling. Need to test that this works in all the\n          // different browser configs, only tested on recent Chrome so far,\n          // where overriding adopted stylesheets seems to just work.\n          const styles = (myNode.constructor as typeof LitElement).elementStyles;\n          const renderRoot = myNode.renderRoot;\n          if (styles && renderRoot instanceof ShadowRoot) {\n            if (supportsAdoptingStyleSheets) {\n              adoptStyles(renderRoot, styles);\n            } else {\n              // Remove all existing shimmed styles from the node.\n              const nodes = Array.from(renderRoot.children);\n              for (const node of nodes) {\n                if (node.tagName.toLowerCase() === 'style') {\n                  renderRoot.removeChild(node);\n                }\n              }\n              // `myNode.renderOptions.renderBefore` needs to be updated\n              // because it refers to the first shimmed adopted style, which was\n              // just removed. So, keep track of the last child in `renderRoot`\n              // because the first new shimmed adopted style to be added by\n              // `adoptStyles` will be its next sibling once `adoptStyles` is\n              // finished.\n              const lastChild = renderRoot.lastChild;\n              adoptStyles(renderRoot, styles);\n              if (lastChild) {\n                myNode.renderOptions.renderBefore = lastChild.nextSibling;\n              } else {\n                delete myNode.renderOptions.renderBefore;\n              }\n            }\n            // Ask for a re-render.\n            myNode.requestUpdate();\n          }\n        }\n      }\n    }\n  }\n\n  /** @nocollapse */\n  static override finalize() {\n    oneTimeWork();\n    return super.finalize.call(this);\n  }\n}\n\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See @lit/reactive-element for more information.\n */\n(LitElement as unknown as Record<string, unknown>)[\n  objectProperty('finalized', LitElement)\n] = true;\n\n// Install hydration if available\n// commented out by copybara\n// global.litElementHydrateSupport?.({LitElement});\n\n// Apply polyfills if available\nif (goog.FEATURESET_YEAR < 2020) {\n  const polyfillSupport = DEV_MODE ?\n      global.litElementPolyfillSupportDevMode :\n      global.litElementPolyfillSupport;\n  polyfillSupport?.({LitElement});\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports  mangled in the\n * client side code, we export a _$LE object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-html, since this module re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LE = {\n  _$attributeToProperty: (\n    el: LitElement,\n    name: string,\n    value: string | null\n  ) => {\n    // eslint-disable-next-line\n    (el as any)._$attributeToProperty(name, value);\n  },\n  // eslint-disable-next-line\n  _$changedProperties: (el: LitElement) => (el as any)._$changedProperties,\n};\n\nlet oneTimeWork = () => {\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n(global.litElementVersions ??= []).push('4.1.1');\nif (DEV_MODE && global.litElementVersions.length > 1) {\n  Promise.resolve().then(() => {\n    issueWarning!(\n      'multiple-versions',\n      `Multiple versions of Lit loaded. Loading multiple versions ` +\n        `is not recommended.`\n    );\n  });\n}\noneTimeWork = () => {};\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Definition of NodeType.\n */\ngoog.module('goog.dom.NodeType');\ngoog.module.declareLegacyNamespace();\n\n/**\n * Constants for the nodeType attribute in the Node interface.\n *\n * These constants match those specified in the Node interface. These are\n * usually present on the Node object in recent browsers, but not in older\n * browsers (specifically, early IEs) and thus are given here.\n *\n * In some browsers (early IEs), these are not defined on the Node object,\n * so they are provided here.\n *\n * See http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247\n * @enum {number}\n */\nconst NodeType = {\n  ELEMENT: 1,\n  ATTRIBUTE: 2,\n  TEXT: 3,\n  CDATA_SECTION: 4,\n  ENTITY_REFERENCE: 5,\n  ENTITY: 6,\n  PROCESSING_INSTRUCTION: 7,\n  COMMENT: 8,\n  DOCUMENT: 9,\n  DOCUMENT_TYPE: 10,\n  DOCUMENT_FRAGMENT: 11,\n  NOTATION: 12\n};\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n\nexports = NodeType;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for manipulating arrays.\n */\n\n\ngoog.module('goog.array');\ngoog.module.declareLegacyNamespace();\n\nconst asserts = goog.require('goog.asserts');\n\n\n/**\n * @define {boolean} NATIVE_ARRAY_PROTOTYPES indicates whether the code should\n * rely on Array.prototype functions, if available.\n *\n * The Array.prototype functions can be defined by external libraries like\n * Prototype and setting this flag to false forces closure to use its own\n * goog.array implementation.\n *\n * If your javascript can be loaded by a third party site and you are wary about\n * relying on the prototype functions, specify\n * \"--define goog.NATIVE_ARRAY_PROTOTYPES=false\" to the JSCompiler.\n *\n * Setting goog.TRUSTED_SITE to false will automatically set\n * NATIVE_ARRAY_PROTOTYPES to false.\n */\ngoog.NATIVE_ARRAY_PROTOTYPES =\n    goog.define('goog.NATIVE_ARRAY_PROTOTYPES', goog.TRUSTED_SITE);\n\n\n/**\n * @define {boolean} If true, JSCompiler will use the native implementation of\n * array functions where appropriate (e.g., `Array#filter`) and remove the\n * unused pure JS implementation.\n */\nconst ASSUME_NATIVE_FUNCTIONS = goog.define(\n    'goog.array.ASSUME_NATIVE_FUNCTIONS', goog.FEATURESET_YEAR > 2012);\nexports.ASSUME_NATIVE_FUNCTIONS = ASSUME_NATIVE_FUNCTIONS;\n\n\n/**\n * Returns the last element in an array without removing it.\n * Same as {@link goog.array.last}.\n * @param {IArrayLike<T>|string} array The array.\n * @return {T} Last item in array.\n * @template T\n */\nfunction peek(array) {\n  return array[array.length - 1];\n}\nexports.peek = peek;\n\n\n/**\n * Returns the last element in an array without removing it.\n * Same as {@link goog.array.peek}.\n * @param {IArrayLike<T>|string} array The array.\n * @return {T} Last item in array.\n * @template T\n */\nexports.last = peek;\n\n// NOTE(arv): Since most of the array functions are generic it allows you to\n// pass an array-like object. Strings have a length and are considered array-\n// like. However, the 'in' operator does not work on strings so we cannot just\n// use the array path even if the browser supports indexing into strings. We\n// therefore end up splitting the string.\n\n\n/**\n * Returns the index of the first element of an array with a specified value, or\n * -1 if the element is not present in the array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-indexof}\n *\n * @param {IArrayLike<T>|string} arr The array to be searched.\n * @param {T} obj The object for which we are searching.\n * @param {number=} opt_fromIndex The index at which to start the search. If\n *     omitted the search starts at index 0.\n * @return {number} The index of the first matching array element.\n * @template T\n */\nconst indexOf = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.indexOf) ?\n    function(arr, obj, opt_fromIndex) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.indexOf.call(arr, obj, opt_fromIndex);\n    } :\n    function(arr, obj, opt_fromIndex) {\n      const fromIndex = opt_fromIndex == null ?\n          0 :\n          (opt_fromIndex < 0 ? Math.max(0, arr.length + opt_fromIndex) :\n                               opt_fromIndex);\n\n      if (typeof arr === 'string') {\n        // Array.prototype.indexOf uses === so only strings should be found.\n        if (typeof obj !== 'string' || obj.length != 1) {\n          return -1;\n        }\n        return arr.indexOf(obj, fromIndex);\n      }\n\n      for (let i = fromIndex; i < arr.length; i++) {\n        if (i in arr && arr[i] === obj) return i;\n      }\n      return -1;\n    };\nexports.indexOf = indexOf;\n\n\n/**\n * Returns the index of the last element of an array with a specified value, or\n * -1 if the element is not present in the array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-lastindexof}\n *\n * @param {!IArrayLike<T>|string} arr The array to be searched.\n * @param {T} obj The object for which we are searching.\n * @param {?number=} opt_fromIndex The index at which to start the search. If\n *     omitted the search starts at the end of the array.\n * @return {number} The index of the last matching array element.\n * @template T\n */\nconst lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.lastIndexOf) ?\n    function(arr, obj, opt_fromIndex) {\n      asserts.assert(arr.length != null);\n\n      // Firefox treats undefined and null as 0 in the fromIndex argument which\n      // leads it to always return -1\n      const fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;\n      return Array.prototype.lastIndexOf.call(arr, obj, fromIndex);\n    } :\n    function(arr, obj, opt_fromIndex) {\n      let fromIndex = opt_fromIndex == null ? arr.length - 1 : opt_fromIndex;\n\n      if (fromIndex < 0) {\n        fromIndex = Math.max(0, arr.length + fromIndex);\n      }\n\n      if (typeof arr === 'string') {\n        // Array.prototype.lastIndexOf uses === so only strings should be found.\n        if (typeof obj !== 'string' || obj.length != 1) {\n          return -1;\n        }\n        return arr.lastIndexOf(obj, fromIndex);\n      }\n\n      for (let i = fromIndex; i >= 0; i--) {\n        if (i in arr && arr[i] === obj) return i;\n      }\n      return -1;\n    };\nexports.lastIndexOf = lastIndexOf;\n\n\n/**\n * Calls a function for each element in an array. Skips holes in the array.\n * See {@link http://tinyurl.com/developer-mozilla-org-array-foreach}\n *\n * @param {IArrayLike<T>|string} arr Array or array like object over\n *     which to iterate.\n * @param {?function(this: S, T, number, ?): ?} f The function to call for every\n *     element. This function takes 3 arguments (the element, the index and the\n *     array). The return value is ignored.\n * @param {S=} opt_obj The object to be used as the value of 'this' within f.\n * @template T,S\n */\nconst forEach = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.forEach) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      Array.prototype.forEach.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2) {\n          f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr);\n        }\n      }\n    };\nexports.forEach = forEach;\n\n\n/**\n * Calls a function for each element in an array, starting from the last\n * element rather than the first.\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this: S, T, number, ?): ?} f The function to call for every\n *     element. This function\n *     takes 3 arguments (the element, the index and the array). The return\n *     value is ignored.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @template T,S\n */\nfunction forEachRight(arr, f, opt_obj) {\n  const l = arr.length;  // must be fixed during loop... see docs\n  const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n  for (let i = l - 1; i >= 0; --i) {\n    if (i in arr2) {\n      f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr);\n    }\n  }\n}\nexports.forEachRight = forEachRight;\n\n\n/**\n * Calls a function for each element in an array, and if the function returns\n * true adds the element to a new array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-filter}\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?):boolean} f The function to call for\n *     every element. This function\n *     takes 3 arguments (the element, the index and the array) and must\n *     return a Boolean. If the return value is true the element is added to the\n *     result array. If it is false the element is not included.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @return {!Array<T>} a new array in which only elements that passed the test\n *     are present.\n * @template T,S\n */\nconst filter = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.filter) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.filter.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const res = [];\n      let resLength = 0;\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2) {\n          const val = arr2[i];  // in case f mutates arr2\n          if (f.call(/** @type {?} */ (opt_obj), val, i, arr)) {\n            res[resLength++] = val;\n          }\n        }\n      }\n      return res;\n    };\nexports.filter = filter;\n\n\n/**\n * Calls a function for each element in an array and inserts the result into a\n * new array.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-map}\n *\n * @param {IArrayLike<VALUE>|string} arr Array or array like object\n *     over which to iterate.\n * @param {function(this:THIS, VALUE, number, ?): RESULT} f The function to call\n *     for every element. This function takes 3 arguments (the element,\n *     the index and the array) and should return something. The result will be\n *     inserted into a new array.\n * @param {THIS=} opt_obj The object to be used as the value of 'this' within f.\n * @return {!Array<RESULT>} a new array with the results from f.\n * @template THIS, VALUE, RESULT\n */\nconst map = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.map) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.map.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const res = new Array(l);\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2) {\n          res[i] = f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr);\n        }\n      }\n      return res;\n    };\nexports.map = map;\n\n\n/**\n * Passes every element of an array into a function and accumulates the result.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-reduce}\n * Note that this implementation differs from the native Array.prototype.reduce\n * in that the initial value is assumed to be defined (the MDN docs linked above\n * recommend not omitting this parameter, although it is technically optional).\n *\n * For example:\n * var a = [1, 2, 3, 4];\n * reduce(a, function(r, v, i, arr) {return r + v;}, 0);\n * returns 10\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {function(this:S, R, T, number, ?) : R} f The function to call for\n *     every element. This function\n *     takes 4 arguments (the function's previous result or the initial value,\n *     the value of the current array element, the current array index, and the\n *     array itself)\n *     function(previousValue, currentValue, index, array).\n * @param {?} val The initial value to pass into the function on the first call.\n * @param {S=} opt_obj  The object to be used as the value of 'this'\n *     within f.\n * @return {R} Result of evaluating f repeatedly across the values of the array.\n * @template T,S,R\n */\nconst reduce = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduce) ?\n    function(arr, f, val, opt_obj) {\n      asserts.assert(arr.length != null);\n      if (opt_obj) {\n        f = (goog.TRUSTED_SITE) ? f.bind(opt_obj) : goog.bind(f, opt_obj);\n      }\n      return Array.prototype.reduce.call(arr, f, val);\n    } :\n    function(arr, f, val, opt_obj) {\n      let rval = val;\n      forEach(arr, function(val, index) {\n        rval = f.call(/** @type {?} */ (opt_obj), rval, val, index, arr);\n      });\n      return rval;\n    };\nexports.reduce = reduce;\n\n\n/**\n * Passes every element of an array into a function and accumulates the result,\n * starting from the last element and working towards the first.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-reduceright}\n *\n * For example:\n * var a = ['a', 'b', 'c'];\n * reduceRight(a, function(r, v, i, arr) {return r + v;}, '');\n * returns 'cba'\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, R, T, number, ?) : R} f The function to call for\n *     every element. This function\n *     takes 4 arguments (the function's previous result or the initial value,\n *     the value of the current array element, the current array index, and the\n *     array itself)\n *     function(previousValue, currentValue, index, array).\n * @param {?} val The initial value to pass into the function on the first call.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @return {R} Object returned as a result of evaluating f repeatedly across the\n *     values of the array.\n * @template T,S,R\n */\nconst reduceRight = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduceRight) ?\n    function(arr, f, val, opt_obj) {\n      asserts.assert(arr.length != null);\n      asserts.assert(f != null);\n      if (opt_obj) {\n        f = (goog.TRUSTED_SITE) ? f.bind(opt_obj) : goog.bind(f, opt_obj);\n      }\n      return Array.prototype.reduceRight.call(arr, f, val);\n    } :\n    function(arr, f, val, opt_obj) {\n      let rval = val;\n      forEachRight(arr, function(val, index) {\n        rval = f.call(/** @type {?} */ (opt_obj), rval, val, index, arr);\n      });\n      return rval;\n    };\nexports.reduceRight = reduceRight;\n\n\n/**\n * Calls f for each element of an array. If any call returns true, some()\n * returns true (without checking the remaining elements). If all calls\n * return false, some() returns false.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-some}\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call for\n *     for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a boolean.\n * @param {S=} opt_obj  The object to be used as the value of 'this'\n *     within f.\n * @return {boolean} true if any element passes the test.\n * @template T,S\n */\nconst some = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.some) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.some.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2 && f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n          return true;\n        }\n      }\n      return false;\n    };\nexports.some = some;\n\n\n/**\n * Call f for each element of an array. If all calls return true, every()\n * returns true. If any call returns false, every() returns false and\n * does not continue to check the remaining elements.\n *\n * See {@link http://tinyurl.com/developer-mozilla-org-array-every}\n *\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call for\n *     for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a boolean.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within f.\n * @return {boolean} false if any element fails the test.\n * @template T,S\n */\nconst every = goog.NATIVE_ARRAY_PROTOTYPES &&\n        (ASSUME_NATIVE_FUNCTIONS || Array.prototype.every) ?\n    function(arr, f, opt_obj) {\n      asserts.assert(arr.length != null);\n\n      return Array.prototype.every.call(arr, f, opt_obj);\n    } :\n    function(arr, f, opt_obj) {\n      const l = arr.length;  // must be fixed during loop... see docs\n      const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n      for (let i = 0; i < l; i++) {\n        if (i in arr2 && !f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n          return false;\n        }\n      }\n      return true;\n    };\nexports.every = every;\n\n\n/**\n * Counts the array elements that fulfill the predicate, i.e. for which the\n * callback function returns true. Skips holes in the array.\n *\n * @param {!IArrayLike<T>|string} arr Array or array like object\n *     over which to iterate.\n * @param {function(this: S, T, number, ?): boolean} f The function to call for\n *     every element. Takes 3 arguments (the element, the index and the array).\n * @param {S=} opt_obj The object to be used as the value of 'this' within f.\n * @return {number} The number of the matching elements.\n * @template T,S\n */\nfunction count(arr, f, opt_obj) {\n  let count = 0;\n  forEach(arr, function(element, index, arr) {\n    if (f.call(/** @type {?} */ (opt_obj), element, index, arr)) {\n      ++count;\n    }\n  }, opt_obj);\n  return count;\n}\nexports.count = count;\n\n\n/**\n * Search an array for the first element that satisfies a given condition and\n * return that element.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {T|null} The first array element that passes the test, or null if no\n *     element is found.\n * @template T,S\n */\nfunction find(arr, f, opt_obj) {\n  const i = findIndex(arr, f, opt_obj);\n  return i < 0 ? null : typeof arr === 'string' ? arr.charAt(i) : arr[i];\n}\nexports.find = find;\n\n\n/**\n * Search an array for the first element that satisfies a given condition and\n * return its index.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call for\n *     every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {number} The index of the first array element that passes the test,\n *     or -1 if no element is found.\n * @template T,S\n */\nfunction findIndex(arr, f, opt_obj) {\n  const l = arr.length;  // must be fixed during loop... see docs\n  const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n  for (let i = 0; i < l; i++) {\n    if (i in arr2 && f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n      return i;\n    }\n  }\n  return -1;\n}\nexports.findIndex = findIndex;\n\n\n/**\n * Search an array (in reverse order) for the last element that satisfies a\n * given condition and return that element.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {T|null} The last array element that passes the test, or null if no\n *     element is found.\n * @template T,S\n */\nfunction findRight(arr, f, opt_obj) {\n  const i = findIndexRight(arr, f, opt_obj);\n  return i < 0 ? null : typeof arr === 'string' ? arr.charAt(i) : arr[i];\n}\nexports.findRight = findRight;\n\n\n/**\n * Search an array (in reverse order) for the last element that satisfies a\n * given condition and return its index.\n * @param {IArrayLike<T>|string} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {number} The index of the last array element that passes the test,\n *     or -1 if no element is found.\n * @template T,S\n */\nfunction findIndexRight(arr, f, opt_obj) {\n  const l = arr.length;  // must be fixed during loop... see docs\n  const arr2 = (typeof arr === 'string') ? arr.split('') : arr;\n  for (let i = l - 1; i >= 0; i--) {\n    if (i in arr2 && f.call(/** @type {?} */ (opt_obj), arr2[i], i, arr)) {\n      return i;\n    }\n  }\n  return -1;\n}\nexports.findIndexRight = findIndexRight;\n\n\n/**\n * Whether the array contains the given object.\n * @param {IArrayLike<?>|string} arr The array to test for the presence of the\n *     element.\n * @param {*} obj The object for which to test.\n * @return {boolean} true if obj is present.\n */\nfunction contains(arr, obj) {\n  return indexOf(arr, obj) >= 0;\n}\nexports.contains = contains;\n\n\n/**\n * Whether the array is empty.\n * @param {IArrayLike<?>|string} arr The array to test.\n * @return {boolean} true if empty.\n */\nfunction isEmpty(arr) {\n  return arr.length == 0;\n}\nexports.isEmpty = isEmpty;\n\n\n/**\n * Clears the array.\n * @param {IArrayLike<?>} arr Array or array like object to clear.\n */\nfunction clear(arr) {\n  // For non real arrays we don't have the magic length so we delete the\n  // indices.\n  if (!Array.isArray(arr)) {\n    for (let i = arr.length - 1; i >= 0; i--) {\n      delete arr[i];\n    }\n  }\n  arr.length = 0;\n}\nexports.clear = clear;\n\n\n/**\n * Pushes an item into an array, if it's not already in the array.\n * @param {Array<T>} arr Array into which to insert the item.\n * @param {T} obj Value to add.\n * @template T\n */\nfunction insert(arr, obj) {\n  if (!contains(arr, obj)) {\n    arr.push(obj);\n  }\n}\nexports.insert = insert;\n\n\n/**\n * Inserts an object at the given index of the array.\n * @param {IArrayLike<?>} arr The array to modify.\n * @param {*} obj The object to insert.\n * @param {number=} opt_i The index at which to insert the object. If omitted,\n *      treated as 0. A negative index is counted from the end of the array.\n */\nfunction insertAt(arr, obj, opt_i) {\n  splice(arr, opt_i, 0, obj);\n}\nexports.insertAt = insertAt;\n\n\n/**\n * Inserts at the given index of the array, all elements of another array.\n * @param {IArrayLike<?>} arr The array to modify.\n * @param {IArrayLike<?>} elementsToAdd The array of elements to add.\n * @param {number=} opt_i The index at which to insert the object. If omitted,\n *      treated as 0. A negative index is counted from the end of the array.\n */\nfunction insertArrayAt(arr, elementsToAdd, opt_i) {\n  goog.partial(splice, arr, opt_i, 0).apply(null, elementsToAdd);\n}\nexports.insertArrayAt = insertArrayAt;\n\n\n/**\n * Inserts an object into an array before a specified object.\n * @param {Array<T>} arr The array to modify.\n * @param {T} obj The object to insert.\n * @param {T=} opt_obj2 The object before which obj should be inserted. If obj2\n *     is omitted or not found, obj is inserted at the end of the array.\n * @template T\n */\nfunction insertBefore(arr, obj, opt_obj2) {\n  let i;\n  if (arguments.length == 2 || (i = indexOf(arr, opt_obj2)) < 0) {\n    arr.push(obj);\n  } else {\n    insertAt(arr, obj, i);\n  }\n}\nexports.insertBefore = insertBefore;\n\n\n/**\n * Removes the first occurrence of a particular value from an array.\n * @param {IArrayLike<T>} arr Array from which to remove\n *     value.\n * @param {T} obj Object to remove.\n * @return {boolean} True if an element was removed.\n * @template T\n */\nfunction remove(arr, obj) {\n  const i = indexOf(arr, obj);\n  let rv;\n  if ((rv = i >= 0)) {\n    removeAt(arr, i);\n  }\n  return rv;\n}\nexports.remove = remove;\n\n\n/**\n * Removes the last occurrence of a particular value from an array.\n * @param {!IArrayLike<T>} arr Array from which to remove value.\n * @param {T} obj Object to remove.\n * @return {boolean} True if an element was removed.\n * @template T\n */\nfunction removeLast(arr, obj) {\n  const i = lastIndexOf(arr, obj);\n  if (i >= 0) {\n    removeAt(arr, i);\n    return true;\n  }\n  return false;\n}\nexports.removeLast = removeLast;\n\n\n/**\n * Removes from an array the element at index i\n * @param {IArrayLike<?>} arr Array or array like object from which to\n *     remove value.\n * @param {number} i The index to remove.\n * @return {boolean} True if an element was removed.\n */\nfunction removeAt(arr, i) {\n  asserts.assert(arr.length != null);\n\n  // use generic form of splice\n  // splice returns the removed items and if successful the length of that\n  // will be 1\n  return Array.prototype.splice.call(arr, i, 1).length == 1;\n}\nexports.removeAt = removeAt;\n\n\n/**\n * Removes the first value that satisfies the given condition.\n * @param {IArrayLike<T>} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {boolean} True if an element was removed.\n * @template T,S\n */\nfunction removeIf(arr, f, opt_obj) {\n  const i = findIndex(arr, f, opt_obj);\n  if (i >= 0) {\n    removeAt(arr, i);\n    return true;\n  }\n  return false;\n}\nexports.removeIf = removeIf;\n\n\n/**\n * Removes all values that satisfy the given condition.\n * @param {IArrayLike<T>} arr Array or array\n *     like object over which to iterate.\n * @param {?function(this:S, T, number, ?) : boolean} f The function to call\n *     for every element. This function\n *     takes 3 arguments (the element, the index and the array) and should\n *     return a boolean.\n * @param {S=} opt_obj An optional \"this\" context for the function.\n * @return {number} The number of items removed\n * @template T,S\n */\nfunction removeAllIf(arr, f, opt_obj) {\n  let removedCount = 0;\n  forEachRight(arr, function(val, index) {\n    if (f.call(/** @type {?} */ (opt_obj), val, index, arr)) {\n      if (removeAt(arr, index)) {\n        removedCount++;\n      }\n    }\n  });\n  return removedCount;\n}\nexports.removeAllIf = removeAllIf;\n\n\n/**\n * Returns a new array that is the result of joining the arguments.  If arrays\n * are passed then their items are added, however, if non-arrays are passed they\n * will be added to the return array as is.\n *\n * Note that ArrayLike objects will be added as is, rather than having their\n * items added.\n *\n * concat([1, 2], [3, 4]) -> [1, 2, 3, 4]\n * concat(0, [1, 2]) -> [0, 1, 2]\n * concat([1, 2], null) -> [1, 2, null]\n *\n * @param {...*} var_args Items to concatenate.  Arrays will have each item\n *     added, while primitives and objects will be added as is.\n * @return {!Array<?>} The new resultant array.\n */\nfunction concat(var_args) {\n  return Array.prototype.concat.apply([], arguments);\n}\nexports.concat = concat;\n\n\n/**\n * Returns a new array that contains the contents of all the arrays passed.\n * @param {...!Array<T>} var_args\n * @return {!Array<T>}\n * @template T\n */\nfunction join(var_args) {\n  return Array.prototype.concat.apply([], arguments);\n}\nexports.join = join;\n\n\n/**\n * Converts an object to an array.\n * @param {IArrayLike<T>|string} object  The object to convert to an\n *     array.\n * @return {!Array<T>} The object converted into an array. If object has a\n *     length property, every property indexed with a non-negative number\n *     less than length will be included in the result. If object does not\n *     have a length property, an empty array will be returned.\n * @template T\n */\nfunction toArray(object) {\n  const length = object.length;\n\n  // If length is not a number the following is false. This case is kept for\n  // backwards compatibility since there are callers that pass objects that are\n  // not array like.\n  if (length > 0) {\n    const rv = new Array(length);\n    for (let i = 0; i < length; i++) {\n      rv[i] = object[i];\n    }\n    return rv;\n  }\n  return [];\n}\nexports.toArray = toArray;\n\n\n/**\n * Does a shallow copy of an array.\n * @param {IArrayLike<T>|string} arr  Array or array-like object to\n *     clone.\n * @return {!Array<T>} Clone of the input array.\n * @template T\n */\nconst clone = toArray;\nexports.clone = clone;\n\n\n/**\n * Extends an array with another array, element, or \"array like\" object.\n * This function operates 'in-place', it does not create a new Array.\n *\n * Example:\n * var a = [];\n * extend(a, [0, 1]);\n * a; // [0, 1]\n * extend(a, 2);\n * a; // [0, 1, 2]\n *\n * @param {Array<VALUE>} arr1  The array to modify.\n * @param {...(IArrayLike<VALUE>|VALUE)} var_args The elements or arrays of\n *     elements to add to arr1.\n * @template VALUE\n */\nfunction extend(arr1, var_args) {\n  for (let i = 1; i < arguments.length; i++) {\n    const arr2 = arguments[i];\n    if (goog.isArrayLike(arr2)) {\n      const len1 = arr1.length || 0;\n      const len2 = arr2.length || 0;\n      arr1.length = len1 + len2;\n      for (let j = 0; j < len2; j++) {\n        arr1[len1 + j] = arr2[j];\n      }\n    } else {\n      arr1.push(arr2);\n    }\n  }\n}\nexports.extend = extend;\n\n\n/**\n * Adds or removes elements from an array. This is a generic version of Array\n * splice. This means that it might work on other objects similar to arrays,\n * such as the arguments object.\n *\n * @param {IArrayLike<T>} arr The array to modify.\n * @param {number|undefined} index The index at which to start changing the\n *     array. If not defined, treated as 0.\n * @param {number} howMany How many elements to remove (0 means no removal. A\n *     value below 0 is treated as zero and so is any other non number. Numbers\n *     are floored).\n * @param {...T} var_args Optional, additional elements to insert into the\n *     array.\n * @return {!Array<T>} the removed elements.\n * @template T\n */\nfunction splice(arr, index, howMany, var_args) {\n  asserts.assert(arr.length != null);\n\n  return Array.prototype.splice.apply(arr, slice(arguments, 1));\n}\nexports.splice = splice;\n\n\n/**\n * Returns a new array from a segment of an array. This is a generic version of\n * Array slice. This means that it might work on other objects similar to\n * arrays, such as the arguments object.\n *\n * @param {IArrayLike<T>|string} arr The array from\n * which to copy a segment.\n * @param {number} start The index of the first element to copy.\n * @param {number=} opt_end The index after the last element to copy.\n * @return {!Array<T>} A new array containing the specified segment of the\n *     original array.\n * @template T\n */\nfunction slice(arr, start, opt_end) {\n  asserts.assert(arr.length != null);\n\n  // passing 1 arg to slice is not the same as passing 2 where the second is\n  // null or undefined (in that case the second argument is treated as 0).\n  // we could use slice on the arguments object and then use apply instead of\n  // testing the length\n  if (arguments.length <= 2) {\n    return Array.prototype.slice.call(arr, start);\n  } else {\n    return Array.prototype.slice.call(arr, start, opt_end);\n  }\n}\nexports.slice = slice;\n\n\n/**\n * Removes all duplicates from an array (retaining only the first\n * occurrence of each array element).  This function modifies the\n * array in place and doesn't change the order of the non-duplicate items.\n *\n * For objects, duplicates are identified as having the same unique ID as\n * defined by {@link goog.getUid}.\n *\n * Alternatively you can specify a custom hash function that returns a unique\n * value for each item in the array it should consider unique.\n *\n * Runtime: N,\n * Worstcase space: 2N (no dupes)\n *\n * @param {IArrayLike<T>} arr The array from which to remove\n *     duplicates.\n * @param {Array=} opt_rv An optional array in which to return the results,\n *     instead of performing the removal inplace.  If specified, the original\n *     array will remain unchanged.\n * @param {function(T):string=} opt_keyFn An optional function to use to\n *     apply to every item in the array. This function should return a unique\n *     value for each item in the array it should consider unique.\n * @template T\n */\nfunction removeDuplicates(arr, opt_rv, opt_keyFn) {\n  const returnArray = opt_rv || arr;\n  \n  if (goog.FEATURESET_YEAR >= 2018) {\n    const defaultKeyFn = (item) => item;\n    const keyFn = opt_keyFn || defaultKeyFn;\n\n    let cursorInsert = 0;\n    let cursorRead = 0;\n    const seen = new Set();\n\n    while (cursorRead < arr.length) {\n      const current = arr[cursorRead++];\n      const key = keyFn(current);\n      if (!seen.has(key)) {\n        seen.add(key);\n        returnArray[cursorInsert++] = current;\n      }\n    }\n    returnArray.length = cursorInsert;\n  } else {\n    const defaultKeyFn = function(item) {\n      // Prefix each type with a single character representing the type to\n      // prevent conflicting keys (e.g. true and 'true').\n      return goog.isObject(item) ? 'o' + goog.getUid(item) :\n                                  (typeof item).charAt(0) + item;\n    };\n    const keyFn = opt_keyFn || defaultKeyFn;\n\n    let cursorInsert = 0;\n    let cursorRead = 0;\n    const seen = {};\n\n    while (cursorRead < arr.length) {\n      const current = arr[cursorRead++];\n      const key = keyFn(current);\n      if (!Object.prototype.hasOwnProperty.call(seen, key)) {\n        seen[key] = true;\n        returnArray[cursorInsert++] = current;\n      }\n    }\n    returnArray.length = cursorInsert;\n  }\n}\nexports.removeDuplicates = removeDuplicates;\n\n\n/**\n * Searches the specified array for the specified target using the binary\n * search algorithm.  If no opt_compareFn is specified, elements are compared\n * using <code>defaultCompare</code>, which compares the elements\n * using the built in < and > operators.  This will produce the expected\n * behavior for homogeneous arrays of String(s) and Number(s). The array\n * specified <b>must</b> be sorted in ascending order (as defined by the\n * comparison function).  If the array is not sorted, results are undefined.\n * If the array contains multiple instances of the specified target value, the\n * left-most instance will be found.\n *\n * Runtime: O(log n)\n *\n * @param {IArrayLike<VALUE>} arr The array to be searched.\n * @param {TARGET} target The sought value.\n * @param {function(TARGET, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is ordered. Should take 2 arguments to\n *     compare, the target value and an element from your array, and return a\n *     negative number, zero, or a positive number depending on whether the\n *     first argument is less than, equal to, or greater than the second.\n * @return {number} Lowest index of the target value if found, otherwise\n *     (-(insertion point) - 1). The insertion point is where the value should\n *     be inserted into arr to preserve the sorted property.  Return value >= 0\n *     iff target is found.\n * @template TARGET, VALUE\n */\nfunction binarySearch(arr, target, opt_compareFn) {\n  return binarySearch_(\n      arr, opt_compareFn || defaultCompare, false /* isEvaluator */, target);\n}\nexports.binarySearch = binarySearch;\n\n\n/**\n * Selects an index in the specified array using the binary search algorithm.\n * The evaluator receives an element and determines whether the desired index\n * is before, at, or after it.  The evaluator must be consistent (formally,\n * map(map(arr, evaluator, opt_obj), Math.sign)\n * must be monotonically non-increasing).\n *\n * Runtime: O(log n)\n *\n * @param {IArrayLike<VALUE>} arr The array to be searched.\n * @param {function(this:THIS, VALUE, number, ?): number} evaluator\n *     Evaluator function that receives 3 arguments (the element, the index and\n *     the array). Should return a negative number, zero, or a positive number\n *     depending on whether the desired index is before, at, or after the\n *     element passed to it.\n * @param {THIS=} opt_obj The object to be used as the value of 'this'\n *     within evaluator.\n * @return {number} Index of the leftmost element matched by the evaluator, if\n *     such exists; otherwise (-(insertion point) - 1). The insertion point is\n *     the index of the first element for which the evaluator returns negative,\n *     or arr.length if no such element exists. The return value is non-negative\n *     iff a match is found.\n * @template THIS, VALUE\n */\nfunction binarySelect(arr, evaluator, opt_obj) {\n  return binarySearch_(\n      arr, evaluator, true /* isEvaluator */, undefined /* opt_target */,\n      opt_obj);\n}\nexports.binarySelect = binarySelect;\n\n\n/**\n * Implementation of a binary search algorithm which knows how to use both\n * comparison functions and evaluators. If an evaluator is provided, will call\n * the evaluator with the given optional data object, conforming to the\n * interface defined in binarySelect. Otherwise, if a comparison function is\n * provided, will call the comparison function against the given data object.\n *\n * This implementation purposefully does not use goog.bind or goog.partial for\n * performance reasons.\n *\n * Runtime: O(log n)\n *\n * @param {IArrayLike<?>} arr The array to be searched.\n * @param {function(?, ?, ?): number | function(?, ?): number} compareFn\n *     Either an evaluator or a comparison function, as defined by binarySearch\n *     and binarySelect above.\n * @param {boolean} isEvaluator Whether the function is an evaluator or a\n *     comparison function.\n * @param {?=} opt_target If the function is a comparison function, then\n *     this is the target to binary search for.\n * @param {Object=} opt_selfObj If the function is an evaluator, this is an\n *     optional this object for the evaluator.\n * @return {number} Lowest index of the target value if found, otherwise\n *     (-(insertion point) - 1). The insertion point is where the value should\n *     be inserted into arr to preserve the sorted property.  Return value >= 0\n *     iff target is found.\n * @private\n */\nfunction binarySearch_(arr, compareFn, isEvaluator, opt_target, opt_selfObj) {\n  let left = 0;            // inclusive\n  let right = arr.length;  // exclusive\n  let found;\n  while (left < right) {\n    const middle = left + ((right - left) >>> 1);\n    let compareResult;\n    if (isEvaluator) {\n      compareResult = compareFn.call(opt_selfObj, arr[middle], middle, arr);\n    } else {\n      // NOTE(dimvar): To avoid this cast, we'd have to use function overloading\n      // for the type of binarySearch_, which the type system can't express yet.\n      compareResult = /** @type {function(?, ?): number} */ (compareFn)(\n          opt_target, arr[middle]);\n    }\n    if (compareResult > 0) {\n      left = middle + 1;\n    } else {\n      right = middle;\n      // We are looking for the lowest index so we can't return immediately.\n      found = !compareResult;\n    }\n  }\n  // left is the index if found, or the insertion point otherwise.\n  // Avoiding bitwise not operator, as that causes a loss in precision for array\n  // indexes outside the bounds of a 32-bit signed integer.  Array indexes have\n  // a maximum value of 2^32-2 https://tc39.es/ecma262/#array-index\n  return found ? left : -left - 1;\n}\n\n\n/**\n * Sorts the specified array into ascending order.  If no opt_compareFn is\n * specified, elements are compared using\n * <code>defaultCompare</code>, which compares the elements using\n * the built in < and > operators.  This will produce the expected behavior\n * for homogeneous arrays of String(s) and Number(s), unlike the native sort,\n * but will give unpredictable results for heterogeneous lists of strings and\n * numbers with different numbers of digits.\n *\n * This sort is not guaranteed to be stable.\n *\n * Runtime: Same as `Array.prototype.sort`\n *\n * @param {Array<T>} arr The array to be sorted.\n * @param {?function(T,T):number=} opt_compareFn Optional comparison\n *     function by which the\n *     array is to be ordered. Should take 2 arguments to compare, and return a\n *     negative number, zero, or a positive number depending on whether the\n *     first argument is less than, equal to, or greater than the second.\n * @template T\n */\nfunction sort(arr, opt_compareFn) {\n  // TODO(arv): Update type annotation since null is not accepted.\n  arr.sort(opt_compareFn || defaultCompare);\n}\nexports.sort = sort;\n\n\n/**\n * Sorts the specified array into ascending order in a stable way.  If no\n * opt_compareFn is specified, elements are compared using\n * <code>defaultCompare</code>, which compares the elements using\n * the built in < and > operators.  This will produce the expected behavior\n * for homogeneous arrays of String(s) and Number(s).\n *\n * Runtime: Same as `Array.prototype.sort`, plus an additional\n * O(n) overhead of copying the array twice.\n *\n * @param {Array<T>} arr The array to be sorted.\n * @param {?function(T, T): number=} opt_compareFn Optional comparison function\n *     by which the array is to be ordered. Should take 2 arguments to compare,\n *     and return a negative number, zero, or a positive number depending on\n *     whether the first argument is less than, equal to, or greater than the\n *     second.\n * @template T\n */\nfunction stableSort(arr, opt_compareFn) {\n  const compArr = new Array(arr.length);\n  for (let i = 0; i < arr.length; i++) {\n    compArr[i] = {index: i, value: arr[i]};\n  }\n  const valueCompareFn = opt_compareFn || defaultCompare;\n  function stableCompareFn(obj1, obj2) {\n    return valueCompareFn(obj1.value, obj2.value) || obj1.index - obj2.index;\n  }\n  sort(compArr, stableCompareFn);\n  for (let i = 0; i < arr.length; i++) {\n    arr[i] = compArr[i].value;\n  }\n}\nexports.stableSort = stableSort;\n\n\n/**\n * Sort the specified array into ascending order based on item keys\n * returned by the specified key function.\n * If no opt_compareFn is specified, the keys are compared in ascending order\n * using <code>defaultCompare</code>.\n *\n * Runtime: O(S(f(n)), where S is runtime of <code>sort</code>\n * and f(n) is runtime of the key function.\n *\n * @param {Array<T>} arr The array to be sorted.\n * @param {function(T): K} keyFn Function taking array element and returning\n *     a key used for sorting this element.\n * @param {?function(K, K): number=} opt_compareFn Optional comparison function\n *     by which the keys are to be ordered. Should take 2 arguments to compare,\n *     and return a negative number, zero, or a positive number depending on\n *     whether the first argument is less than, equal to, or greater than the\n *     second.\n * @template T,K\n */\nfunction sortByKey(arr, keyFn, opt_compareFn) {\n  const keyCompareFn = opt_compareFn || defaultCompare;\n  sort(arr, function(a, b) {\n    return keyCompareFn(keyFn(a), keyFn(b));\n  });\n}\nexports.sortByKey = sortByKey;\n\n\n/**\n * Sorts an array of objects by the specified object key and compare\n * function. If no compare function is provided, the key values are\n * compared in ascending order using <code>defaultCompare</code>.\n * This won't work for keys that get renamed by the compiler. So use\n * {'foo': 1, 'bar': 2} rather than {foo: 1, bar: 2}.\n * @param {Array<Object>} arr An array of objects to sort.\n * @param {string} key The object key to sort by.\n * @param {Function=} opt_compareFn The function to use to compare key\n *     values.\n */\nfunction sortObjectsByKey(arr, key, opt_compareFn) {\n  sortByKey(arr, function(obj) {\n    return obj[key];\n  }, opt_compareFn);\n}\nexports.sortObjectsByKey = sortObjectsByKey;\n\n\n/**\n * Tells if the array is sorted.\n * @param {!IArrayLike<T>} arr The array.\n * @param {?function(T,T):number=} opt_compareFn Function to compare the\n *     array elements.\n *     Should take 2 arguments to compare, and return a negative number, zero,\n *     or a positive number depending on whether the first argument is less\n *     than, equal to, or greater than the second.\n * @param {boolean=} opt_strict If true no equal elements are allowed.\n * @return {boolean} Whether the array is sorted.\n * @template T\n */\nfunction isSorted(arr, opt_compareFn, opt_strict) {\n  const compare = opt_compareFn || defaultCompare;\n  for (let i = 1; i < arr.length; i++) {\n    const compareResult = compare(arr[i - 1], arr[i]);\n    if (compareResult > 0 || compareResult == 0 && opt_strict) {\n      return false;\n    }\n  }\n  return true;\n}\nexports.isSorted = isSorted;\n\n\n/**\n * Compares two arrays for equality. Two arrays are considered equal if they\n * have the same length and their corresponding elements are equal according to\n * the comparison function.\n *\n * @param {IArrayLike<A>} arr1 The first array to compare.\n * @param {IArrayLike<B>} arr2 The second array to compare.\n * @param {?function(A,B):boolean=} opt_equalsFn Optional comparison function.\n *     Should take 2 arguments to compare, and return true if the arguments\n *     are equal. Defaults to {@link goog.array.defaultCompareEquality} which\n *     compares the elements using the built-in '===' operator.\n * @return {boolean} Whether the two arrays are equal.\n * @template A\n * @template B\n */\nfunction equals(arr1, arr2, opt_equalsFn) {\n  if (!goog.isArrayLike(arr1) || !goog.isArrayLike(arr2) ||\n      arr1.length != arr2.length) {\n    return false;\n  }\n  const l = arr1.length;\n  const equalsFn = opt_equalsFn || defaultCompareEquality;\n  for (let i = 0; i < l; i++) {\n    if (!equalsFn(arr1[i], arr2[i])) {\n      return false;\n    }\n  }\n  return true;\n}\nexports.equals = equals;\n\n\n/**\n * 3-way array compare function.\n * @param {!IArrayLike<VALUE>} arr1 The first array to\n *     compare.\n * @param {!IArrayLike<VALUE>} arr2 The second array to\n *     compare.\n * @param {function(VALUE, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is to be ordered. Should take 2 arguments to\n *     compare, and return a negative number, zero, or a positive number\n *     depending on whether the first argument is less than, equal to, or\n *     greater than the second.\n * @return {number} Negative number, zero, or a positive number depending on\n *     whether the first argument is less than, equal to, or greater than the\n *     second.\n * @template VALUE\n */\nfunction compare3(arr1, arr2, opt_compareFn) {\n  const compare = opt_compareFn || defaultCompare;\n  const l = Math.min(arr1.length, arr2.length);\n  for (let i = 0; i < l; i++) {\n    const result = compare(arr1[i], arr2[i]);\n    if (result != 0) {\n      return result;\n    }\n  }\n  return defaultCompare(arr1.length, arr2.length);\n}\nexports.compare3 = compare3;\n\n\n/**\n * Compares its two arguments for order, using the built in < and >\n * operators.\n * @param {VALUE} a The first object to be compared.\n * @param {VALUE} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n *     argument is less than, equal to, or greater than the second,\n *     respectively.\n * @template VALUE\n */\nfunction defaultCompare(a, b) {\n  return a > b ? 1 : a < b ? -1 : 0;\n}\nexports.defaultCompare = defaultCompare;\n\n\n/**\n * Compares its two arguments for inverse order, using the built in < and >\n * operators.\n * @param {VALUE} a The first object to be compared.\n * @param {VALUE} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n *     argument is greater than, equal to, or less than the second,\n *     respectively.\n * @template VALUE\n */\nfunction inverseDefaultCompare(a, b) {\n  return -defaultCompare(a, b);\n}\nexports.inverseDefaultCompare = inverseDefaultCompare;\n\n\n/**\n * Compares its two arguments for equality, using the built in === operator.\n * @param {*} a The first object to compare.\n * @param {*} b The second object to compare.\n * @return {boolean} True if the two arguments are equal, false otherwise.\n */\nfunction defaultCompareEquality(a, b) {\n  return a === b;\n}\nexports.defaultCompareEquality = defaultCompareEquality;\n\n\n/**\n * Inserts a value into a sorted array. The array is not modified if the\n * value is already present.\n * @param {IArrayLike<VALUE>} array The array to modify.\n * @param {VALUE} value The object to insert.\n * @param {function(VALUE, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is ordered. Should take 2 arguments to\n *     compare, and return a negative number, zero, or a positive number\n *     depending on whether the first argument is less than, equal to, or\n *     greater than the second.\n * @return {boolean} True if an element was inserted.\n * @template VALUE\n */\nfunction binaryInsert(array, value, opt_compareFn) {\n  const index = binarySearch(array, value, opt_compareFn);\n  if (index < 0) {\n    insertAt(array, value, -(index + 1));\n    return true;\n  }\n  return false;\n}\nexports.binaryInsert = binaryInsert;\n\n\n/**\n * Removes a value from a sorted array.\n * @param {!IArrayLike<VALUE>} array The array to modify.\n * @param {VALUE} value The object to remove.\n * @param {function(VALUE, VALUE): number=} opt_compareFn Optional comparison\n *     function by which the array is ordered. Should take 2 arguments to\n *     compare, and return a negative number, zero, or a positive number\n *     depending on whether the first argument is less than, equal to, or\n *     greater than the second.\n * @return {boolean} True if an element was removed.\n * @template VALUE\n */\nfunction binaryRemove(array, value, opt_compareFn) {\n  const index = binarySearch(array, value, opt_compareFn);\n  return (index >= 0) ? removeAt(array, index) : false;\n}\nexports.binaryRemove = binaryRemove;\n\n\n/**\n * Splits an array into disjoint buckets according to a splitting function.\n * @param {IArrayLike<T>} array The array.\n * @param {function(this:S, T, number, !IArrayLike<T>):?} sorter Function to\n *     call for every element.  This takes 3 arguments (the element, the index\n *     and the array) and must return a valid object key (a string, number,\n *     etc), or undefined, if that object should not be placed in a bucket.\n * @param {S=} opt_obj The object to be used as the value of 'this' within\n *     sorter.\n * @return {!Object<!Array<T>>} An object, with keys being all of the unique\n *     return values of sorter, and values being arrays containing the items for\n *     which the splitter returned that key.\n * @template T,S\n */\nfunction bucket(array, sorter, opt_obj) {\n  const buckets = {};\n\n  for (let i = 0; i < array.length; i++) {\n    const value = array[i];\n    const key = sorter.call(/** @type {?} */ (opt_obj), value, i, array);\n    if (key !== undefined) {\n      // Push the value to the right bucket, creating it if necessary.\n      const bucket = buckets[key] || (buckets[key] = []);\n      bucket.push(value);\n    }\n  }\n\n  return buckets;\n}\nexports.bucket = bucket;\n\n\n// TODO: b/385200988 - Remove @tsType tag below after clutz is fixed.\n/**\n * Splits an array into disjoint buckets according to a splitting function.\n * @param {!IArrayLike<V>} array The array.\n * @param {function(V, number, !IArrayLike<V>):(K|undefined)} sorter Function to\n *     call for every element.  This takes 3 arguments (the element, the index,\n *     and the array) and must return a value to use as a key, or undefined, if\n *     that object should not be placed in a bucket.\n * @return {!Map<K, !Array<V>>} A map, with keys being all of the unique\n *     return values of sorter, and values being arrays containing the items for\n *     which the splitter returned that key.\n * @template K,V\n * @tsType <K, V>(\n *   array: ArrayLike<V>,\n *   sorter: (value: V, index: number, array: ArrayLike<V>) => K | undefined,\n * ): Map<K, V[]>\n */\nfunction bucketToMap(array, sorter) {\n  const /** !Map<K, !Array<V>> */ buckets = new Map();\n\n  for (let i = 0; i < array.length; i++) {\n    const value = array[i];\n    const key = sorter(value, i, array);\n    if (key !== undefined) {\n      // Push the value to the right bucket, creating it if necessary.\n      let bucket = buckets.get(key);\n      if (!bucket) {\n        bucket = [];\n        buckets.set(key, bucket);\n      }\n      bucket.push(value);\n    }\n  }\n\n  return buckets;\n}\nexports.bucketToMap = bucketToMap;\n\n\n/**\n * Creates a new object built from the provided array and the key-generation\n * function.\n * @param {IArrayLike<T>} arr Array or array like object over\n *     which to iterate whose elements will be the values in the new object.\n * @param {?function(this:S, T, number, ?) : string} keyFunc The function to\n *     call for every element. This function takes 3 arguments (the element, the\n *     index and the array) and should return a string that will be used as the\n *     key for the element in the new object. If the function returns the same\n *     key for more than one element, the value for that key is\n *     implementation-defined.\n * @param {S=} opt_obj The object to be used as the value of 'this'\n *     within keyFunc.\n * @return {!Object<T>} The new object.\n * @template T,S\n */\nfunction toObject(arr, keyFunc, opt_obj) {\n  const ret = {};\n  forEach(arr, function(element, index) {\n    ret[keyFunc.call(/** @type {?} */ (opt_obj), element, index, arr)] =\n        element;\n  });\n  return ret;\n}\nexports.toObject = toObject;\n\n\n/**\n * Creates a new ES6 Map built from the provided array and the key-generation\n * function.\n * @param {!IArrayLike<V>} arr Array or array like object over which to iterate\n *     whose elements will be the values in the new object.\n * @param {?function(V, number, ?) : K} keyFunc The function to call for every\n *     element. This function takes 3 arguments (the element, the index, and the\n *     array) and should return a value that will be used as the key for the\n *     element in the new object. If the function returns the same key for more\n *     than one element, the value for that key is implementation-defined.\n * @return {!Map<K, V>} The new map.\n * @template K,V\n */\nfunction toMap(arr, keyFunc) {\n  const /** !Map<K, V> */ map = new Map();\n\n  for (let i = 0; i < arr.length; i++) {\n    const element = arr[i];\n    map.set(keyFunc(element, i, arr), element);\n  }\n\n  return map;\n}\nexports.toMap = toMap;\n\n\n/**\n * Creates a range of numbers in an arithmetic progression.\n *\n * Range takes 1, 2, or 3 arguments:\n * <pre>\n * range(5) is the same as range(0, 5, 1) and produces [0, 1, 2, 3, 4]\n * range(2, 5) is the same as range(2, 5, 1) and produces [2, 3, 4]\n * range(-2, -5, -1) produces [-2, -3, -4]\n * range(-2, -5, 1) produces [], since stepping by 1 wouldn't ever reach -5.\n * </pre>\n *\n * @param {number} startOrEnd The starting value of the range if an end argument\n *     is provided. Otherwise, the start value is 0, and this is the end value.\n * @param {number=} opt_end The optional end value of the range.\n * @param {number=} opt_step The step size between range values. Defaults to 1\n *     if opt_step is undefined or 0.\n * @return {!Array<number>} An array of numbers for the requested range. May be\n *     an empty array if adding the step would not converge toward the end\n *     value.\n */\nfunction range(startOrEnd, opt_end, opt_step) {\n  const array = [];\n  let start = 0;\n  let end = startOrEnd;\n  const step = opt_step || 1;\n  if (opt_end !== undefined) {\n    start = startOrEnd;\n    end = opt_end;\n  }\n\n  if (step * (end - start) < 0) {\n    // Sign mismatch: start + step will never reach the end value.\n    return [];\n  }\n\n  if (step > 0) {\n    for (let i = start; i < end; i += step) {\n      array.push(i);\n    }\n  } else {\n    for (let i = start; i > end; i += step) {\n      array.push(i);\n    }\n  }\n  return array;\n}\nexports.range = range;\n\n\n/**\n * Returns an array consisting of the given value repeated N times.\n *\n * @param {VALUE} value The value to repeat.\n * @param {number} n The repeat count.\n * @return {!Array<VALUE>} An array with the repeated value.\n * @template VALUE\n */\nfunction repeat(value, n) {\n  const array = [];\n  for (let i = 0; i < n; i++) {\n    array[i] = value;\n  }\n  return array;\n}\nexports.repeat = repeat;\n\n\n/**\n * Returns an array consisting of every argument with all arrays\n * expanded in-place recursively.\n *\n * @param {...*} var_args The values to flatten.\n * @return {!Array<?>} An array containing the flattened values.\n */\nfunction flatten(var_args) {\n  const CHUNK_SIZE = 8192;\n\n  const result = [];\n  for (let i = 0; i < arguments.length; i++) {\n    const element = arguments[i];\n    if (Array.isArray(element)) {\n      for (let c = 0; c < element.length; c += CHUNK_SIZE) {\n        const chunk = slice(element, c, c + CHUNK_SIZE);\n        const recurseResult = flatten.apply(null, chunk);\n        for (let r = 0; r < recurseResult.length; r++) {\n          result.push(recurseResult[r]);\n        }\n      }\n    } else {\n      result.push(element);\n    }\n  }\n  return result;\n}\nexports.flatten = flatten;\n\n\n/**\n * Rotates an array in-place. After calling this method, the element at\n * index i will be the element previously at index (i - n) %\n * array.length, for all values of i between 0 and array.length - 1,\n * inclusive.\n *\n * For example, suppose list comprises [t, a, n, k, s]. After invoking\n * rotate(array, 1) (or rotate(array, -4)), array will comprise [s, t, a, n, k].\n *\n * @param {!Array<T>} array The array to rotate.\n * @param {number} n The amount to rotate.\n * @return {!Array<T>} The array.\n * @template T\n */\nfunction rotate(array, n) {\n  asserts.assert(array.length != null);\n\n  if (array.length) {\n    n %= array.length;\n    if (n > 0) {\n      Array.prototype.unshift.apply(array, array.splice(-n, n));\n    } else if (n < 0) {\n      Array.prototype.push.apply(array, array.splice(0, -n));\n    }\n  }\n  return array;\n}\nexports.rotate = rotate;\n\n\n/**\n * Moves one item of an array to a new position keeping the order of the rest\n * of the items. Example use case: keeping a list of JavaScript objects\n * synchronized with the corresponding list of DOM elements after one of the\n * elements has been dragged to a new position.\n * @param {!IArrayLike<?>} arr The array to modify.\n * @param {number} fromIndex Index of the item to move between 0 and\n *     `arr.length - 1`.\n * @param {number} toIndex Target index between 0 and `arr.length - 1`.\n */\nfunction moveItem(arr, fromIndex, toIndex) {\n  asserts.assert(fromIndex >= 0 && fromIndex < arr.length);\n  asserts.assert(toIndex >= 0 && toIndex < arr.length);\n  // Remove 1 item at fromIndex.\n  const removedItems = Array.prototype.splice.call(arr, fromIndex, 1);\n  // Insert the removed item at toIndex.\n  Array.prototype.splice.call(arr, toIndex, 0, removedItems[0]);\n  // We don't use goog.array.insertAt and goog.array.removeAt, because they're\n  // significantly slower than splice.\n}\nexports.moveItem = moveItem;\n\n\n/**\n * Creates a new array for which the element at position i is an array of the\n * ith element of the provided arrays.  The returned array will only be as long\n * as the shortest array provided; additional values are ignored.  For example,\n * the result of zipping [1, 2] and [3, 4, 5] is [[1,3], [2, 4]].\n *\n * This is similar to the zip() function in Python.  See {@link\n * http://docs.python.org/library/functions.html#zip}\n *\n * @param {...!IArrayLike<?>} var_args Arrays to be combined.\n * @return {!Array<!Array<?>>} A new array of arrays created from\n *     provided arrays.\n */\nfunction zip(var_args) {\n  if (!arguments.length) {\n    return [];\n  }\n  const result = [];\n  let minLen = arguments[0].length;\n  for (let i = 1; i < arguments.length; i++) {\n    if (arguments[i].length < minLen) {\n      minLen = arguments[i].length;\n    }\n  }\n  for (let i = 0; i < minLen; i++) {\n    const value = [];\n    for (let j = 0; j < arguments.length; j++) {\n      value.push(arguments[j][i]);\n    }\n    result.push(value);\n  }\n  return result;\n}\nexports.zip = zip;\n\n\n/**\n * Shuffles the values in the specified array using the Fisher-Yates in-place\n * shuffle (also known as the Knuth Shuffle). By default, calls Math.random()\n * and so resets the state of that random number generator. Similarly, may reset\n * the state of any other specified random number generator.\n *\n * Runtime: O(n)\n *\n * @param {!Array<?>} arr The array to be shuffled.\n * @param {function():number=} opt_randFn Optional random function to use for\n *     shuffling.\n *     Takes no arguments, and returns a random number on the interval [0, 1).\n *     Defaults to Math.random() using JavaScript's built-in Math library.\n */\nfunction shuffle(arr, opt_randFn) {\n  const randFn = opt_randFn || Math.random;\n\n  for (let i = arr.length - 1; i > 0; i--) {\n    // Choose a random array index in [0, i] (inclusive with i).\n    const j = Math.floor(randFn() * (i + 1));\n\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n  }\n}\nexports.shuffle = shuffle;\n\n\n/**\n * Returns a new array of elements from arr, based on the indexes of elements\n * provided by index_arr. For example, the result of index copying\n * ['a', 'b', 'c'] with index_arr [1,0,0,2] is ['b', 'a', 'a', 'c'].\n *\n * @param {!IArrayLike<T>} arr The array to get a indexed copy from.\n * @param {!IArrayLike<number>} index_arr An array of indexes to get from arr.\n * @return {!Array<T>} A new array of elements from arr in index_arr order.\n * @template T\n */\nfunction copyByIndex(arr, index_arr) {\n  const result = [];\n  forEach(index_arr, function(index) {\n    result.push(arr[index]);\n  });\n  return result;\n}\nexports.copyByIndex = copyByIndex;\n\n\n/**\n * Maps each element of the input array into zero or more elements of the output\n * array.\n *\n * @param {!IArrayLike<VALUE>|string} arr Array or array like object\n *     over which to iterate.\n * @param {function(this:THIS, VALUE, number, ?): !Array<RESULT>} f The function\n *     to call for every element. This function takes 3 arguments (the element,\n *     the index and the array) and should return an array. The result will be\n *     used to extend a new array.\n * @param {THIS=} opt_obj The object to be used as the value of 'this' within f.\n * @return {!Array<RESULT>} a new array with the concatenation of all arrays\n *     returned from f.\n * @template THIS, VALUE, RESULT\n */\nfunction concatMap(arr, f, opt_obj) {\n  return concat.apply([], map(arr, f, opt_obj));\n}\nexports.concatMap = concatMap;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for manipulating objects/maps/hashes.\n */\ngoog.module('goog.object');\ngoog.module.declareLegacyNamespace();\n\n/**\n * Calls a function for each element in an object/map/hash.\n * @param {?Object<K,V>} obj The object over which to iterate.\n * @param {function(this:T,V,?,?Object<K,V>):?} f The function to call for every\n *     element. This function takes 3 arguments (the value, the key and the\n *     object) and the return value is ignored.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {void}\n * @template T,K,V\n */\nfunction forEach(obj, f, opt_obj) {\n  for (const key in obj) {\n    f.call(/** @type {?} */ (opt_obj), obj[key], key, obj);\n  }\n}\n\n/**\n * Calls a function for each element in an object/map/hash. If that call returns\n * true, adds the element to a new object.\n * @param {?Object<K,V>} obj The object over which to iterate.\n * @param {function(this:T,V,?,?Object<K,V>):boolean} f The function to call for\n *     every element. This function takes 3 arguments (the value, the key and\n *     the object) and should return a boolean. If the return value is true the\n *     element is added to the result object. If it is false the element is not\n *     included.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {!Object<K,V>} a new object in which only elements that passed the\n *     test are present.\n * @template T,K,V\n */\nfunction filter(obj, f, opt_obj) {\n  const res = {};\n  for (const key in obj) {\n    if (f.call(/** @type {?} */ (opt_obj), obj[key], key, obj)) {\n      res[key] = obj[key];\n    }\n  }\n  return res;\n}\n\n/**\n * For every element in an object/map/hash calls a function and inserts the\n * result into a new object.\n * @param {?Object<K,V>} obj The object over which to iterate.\n * @param {function(this:T,V,?,?Object<K,V>):R} f The function to call for every\n *     element. This function takes 3 arguments (the value, the key and the\n *     object) and should return something. The result will be inserted into a\n *     new object.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {!Object<K,R>} a new object with the results from f.\n * @template T,K,V,R\n */\nfunction map(obj, f, opt_obj) {\n  const res = {};\n  for (const key in obj) {\n    res[key] = f.call(/** @type {?} */ (opt_obj), obj[key], key, obj);\n  }\n  return res;\n}\n\n/**\n * Calls a function for each element in an object/map/hash. If any\n * call returns true, returns true (without checking the rest). If\n * all calls return false, returns false.\n * @param {?Object<K,V>} obj The object to check.\n * @param {function(this:T,V,?,?Object<K,V>):boolean} f The function to call for\n *     every element. This function takes 3 arguments (the value, the key and\n *     the object) and should return a boolean.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {boolean} true if any element passes the test.\n * @template T,K,V\n */\nfunction some(obj, f, opt_obj) {\n  for (const key in obj) {\n    if (f.call(/** @type {?} */ (opt_obj), obj[key], key, obj)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Calls a function for each element in an object/map/hash. If\n * all calls return true, returns true. If any call returns false, returns\n * false at this point and does not continue to check the remaining elements.\n * @param {?Object<K,V>} obj The object to check.\n * @param {?function(this:T,V,?,?Object<K,V>):boolean} f The function to call\n *     for every element. This function takes 3 arguments (the value, the key\n *     and the object) and should return a boolean.\n * @param {T=} opt_obj This is used as the 'this' object within f.\n * @return {boolean} false if any element fails the test.\n * @template T,K,V\n */\nfunction every(obj, f, opt_obj) {\n  for (const key in obj) {\n    if (!f.call(/** @type {?} */ (opt_obj), obj[key], key, obj)) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Returns the number of key-value pairs in the object map.\n * @param {?Object} obj The object for which to get the number of key-value\n *     pairs.\n * @return {number} The number of key-value pairs in the object map.\n */\nfunction getCount(obj) {\n  let rv = 0;\n  for (const key in obj) {\n    rv++;\n  }\n  return rv;\n}\n\n/**\n * Returns one key from the object map, if any exists.\n * For map literals the returned key will be the first one in most of the\n * browsers (a know exception is Konqueror).\n * @param {?Object} obj The object to pick a key from.\n * @return {string|undefined} The key or undefined if the object is empty.\n */\nfunction getAnyKey(obj) {\n  for (const key in obj) {\n    return key;\n  }\n}\n\n/**\n * Returns one value from the object map, if any exists.\n * For map literals the returned value will be the first one in most of the\n * browsers (a know exception is Konqueror).\n * @param {?Object<K,V>} obj The object to pick a value from.\n * @return {V|undefined} The value or undefined if the object is empty.\n * @template K,V\n */\nfunction getAnyValue(obj) {\n  for (const key in obj) {\n    return obj[key];\n  }\n}\n\n/**\n * Whether the object/hash/map contains the given object as a value.\n * An alias for containsValue(obj, val).\n * @param {?Object<K,V>} obj The object in which to look for val.\n * @param {V} val The object for which to check.\n * @return {boolean} true if val is present.\n * @template K,V\n */\nfunction contains(obj, val) {\n  return containsValue(obj, val);\n}\n\n/**\n * Returns the values of the object/map/hash.\n * @param {?Object<K,V>} obj The object from which to get the values.\n * @return {!Array<V>} The values in the object/map/hash.\n * @template K,V\n */\nfunction getValues(obj) {\n  const res = [];\n  let i = 0;\n  for (const key in obj) {\n    res[i++] = obj[key];\n  }\n  return res;\n}\n\n/**\n * Returns the keys of the object/map/hash.\n * @param {?Object} obj The object from which to get the keys.\n * @return {!Array<string>} Array of property keys.\n */\nfunction getKeys(obj) {\n  const res = [];\n  let i = 0;\n  for (const key in obj) {\n    res[i++] = key;\n  }\n  return res;\n}\n\n/**\n * Get a value from an object multiple levels deep.  This is useful for\n * pulling values from deeply nested objects, such as JSON responses.\n * Example usage: getValueByKeys(jsonObj, 'foo', 'entries', 3)\n * @param {?Object} obj An object to get the value from. Can be array-like.\n * @param {...(string|number|!IArrayLike<number|string>)} var_args A number of\n *     keys (as strings, or numbers, for array-like objects). Can also be\n *     specified as a single array of keys.\n * @return {*} The resulting value. If, at any point, the value for a key in the\n *     current object is null or undefined, returns undefined.\n */\nfunction getValueByKeys(obj, var_args) {\n  const isArrayLike = goog.isArrayLike(var_args);\n  const keys = isArrayLike ?\n      /** @type {!IArrayLike<number|string>} */ (var_args) :\n      arguments;\n\n  // Start with the 2nd parameter for the variable parameters syntax.\n  for (let i = isArrayLike ? 0 : 1; i < keys.length; i++) {\n    if (obj == null) return undefined;\n    obj = obj[keys[i]];\n  }\n\n  return obj;\n}\n\n/**\n * Whether the object/map/hash contains the given key.\n * @param {?Object} obj The object in which to look for key.\n * @param {?} key The key for which to check.\n * @return {boolean} true If the map contains the key.\n */\nfunction containsKey(obj, key) {\n  return obj !== null && key in obj;\n}\n\n/**\n * Whether the object/map/hash contains the given value. This is O(n).\n * @param {?Object<K,V>} obj The object in which to look for val.\n * @param {V} val The value for which to check.\n * @return {boolean} true If the map contains the value.\n * @template K,V\n */\nfunction containsValue(obj, val) {\n  for (const key in obj) {\n    if (obj[key] == val) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Searches an object for an element that satisfies the given condition and\n * returns its key.\n * @param {?Object<K,V>} obj The object to search in.\n * @param {function(this:T,V,string,?Object<K,V>):boolean} f The function to\n *     call for every element. Takes 3 arguments (the value, the key and the\n *     object) and should return a boolean.\n * @param {T=} thisObj An optional \"this\" context for the function.\n * @return {string|undefined} The key of an element for which the function\n *     returns true or undefined if no such element is found.\n * @template T,K,V\n */\nfunction findKey(obj, f, thisObj = undefined) {\n  for (const key in obj) {\n    if (f.call(/** @type {?} */ (thisObj), obj[key], key, obj)) {\n      return key;\n    }\n  }\n  return undefined;\n}\n\n/**\n * Searches an object for an element that satisfies the given condition and\n * returns its value.\n * @param {?Object<K,V>} obj The object to search in.\n * @param {function(this:T,V,string,?Object<K,V>):boolean} f The function to\n *     call for every element. Takes 3 arguments (the value, the key and the\n *     object) and should return a boolean.\n * @param {T=} thisObj An optional \"this\" context for the function.\n * @return {V} The value of an element for which the function returns true or\n *     undefined if no such element is found.\n * @template T,K,V\n */\nfunction findValue(obj, f, thisObj = undefined) {\n  const key = findKey(obj, f, thisObj);\n  return key && obj[key];\n}\n\n/**\n * Whether the object/map/hash is empty.\n * @param {?Object} obj The object to test.\n * @return {boolean} true if obj is empty.\n */\nfunction isEmpty(obj) {\n  for (const key in obj) {\n    return false;\n  }\n  return true;\n}\n\n/**\n * Removes all key value pairs from the object/map/hash.\n * @param {?Object} obj The object to clear.\n * @return {void}\n */\nfunction clear(obj) {\n  for (const i in obj) {\n    delete obj[i];\n  }\n}\n\n/**\n * Removes a key-value pair based on the key.\n * @param {?Object} obj The object from which to remove the key.\n * @param {?} key The key to remove.\n * @return {boolean} Whether an element was removed.\n */\nfunction remove(obj, key) {\n  let rv;\n  if (rv = key in /** @type {!Object} */ (obj)) {\n    delete obj[key];\n  }\n  return rv;\n}\n\n/**\n * Adds a key-value pair to the object. Throws an exception if the key is\n * already in use. Use set if you want to change an existing pair.\n * @param {?Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {V} val The value to add.\n * @return {void}\n * @template K,V\n */\nfunction add(obj, key, val) {\n  if (obj !== null && key in obj) {\n    throw new Error(`The object already contains the key \"${key}\"`);\n  }\n  set(obj, key, val);\n}\n\n/**\n * Returns the value for the given key.\n * @param {?Object<K,V>} obj The object from which to get the value.\n * @param {string} key The key for which to get the value.\n * @param {R=} val The value to return if no item is found for the given key\n *     (default is undefined).\n * @return {V|R|undefined} The value for the given key.\n * @template K,V,R\n */\nfunction get(obj, key, val = undefined) {\n  if (obj !== null && key in obj) {\n    return obj[key];\n  }\n  return val;\n}\n\n/**\n * Adds a key-value pair to the object/map/hash.\n * @param {?Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {V} value The value to add.\n * @template K,V\n * @return {void}\n */\nfunction set(obj, key, value) {\n  obj[key] = value;\n}\n\n/**\n * Adds a key-value pair to the object/map/hash if it doesn't exist yet.\n * @param {?Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {V} value The value to add if the key wasn't present.\n * @return {V} The value of the entry at the end of the function.\n * @template K,V\n */\nfunction setIfUndefined(obj, key, value) {\n  return key in /** @type {!Object} */ (obj) ? obj[key] : (obj[key] = value);\n}\n\n/**\n * Sets a key and value to an object if the key is not set. The value will be\n * the return value of the given function. If the key already exists, the\n * object will not be changed and the function will not be called (the function\n * will be lazily evaluated -- only called if necessary).\n * This function is particularly useful when used with an `Object` which is\n * acting as a cache.\n * @param {?Object<K,V>} obj The object to which to add the key-value pair.\n * @param {string} key The key to add.\n * @param {function():V} f The value to add if the key wasn't present.\n * @return {V} The value of the entry at the end of the function.\n * @template K,V\n */\nfunction setWithReturnValueIfNotSet(obj, key, f) {\n  if (key in obj) {\n    return obj[key];\n  }\n\n  const val = f();\n  obj[key] = val;\n  return val;\n}\n\n/**\n * Compares two objects for equality using === on the values.\n * @param {!Object<K,V>} a\n * @param {!Object<K,V>} b\n * @return {boolean}\n * @template K,V\n */\nfunction equals(a, b) {\n  for (const k in a) {\n    if (!(k in b) || a[k] !== b[k]) {\n      return false;\n    }\n  }\n  for (const k in b) {\n    if (!(k in a)) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Returns a shallow clone of the object.\n * @param {?Object<K,V>} obj Object to clone.\n * @return {!Object<K,V>} Clone of the input object.\n * @template K,V\n */\nfunction clone(obj) {\n  const res = {};\n  for (const key in obj) {\n    res[key] = obj[key];\n  }\n  return res;\n}\n\n/**\n * Clones a value. The input may be an Object, Array, or basic type. Objects and\n * arrays will be cloned recursively.\n * WARNINGS:\n * <code>unsafeClone</code> does not detect reference loops. Objects\n * that refer to themselves will cause infinite recursion.\n * <code>unsafeClone</code> is unaware of unique identifiers, and\n * copies UIDs created by <code>getUid</code> into cloned results.\n * @param {T} obj The value to clone.\n * @return {T} A clone of the input value.\n * @template T\n */\nfunction unsafeClone(obj) {\n  if (!obj || typeof obj !== 'object') return obj;\n  if (typeof obj.clone === 'function') return obj.clone();\n  if (typeof Map !== 'undefined' && obj instanceof Map) {\n    return new Map(obj);\n  } else if (typeof Set !== 'undefined' && obj instanceof Set) {\n    return new Set(obj);\n  } else if (obj instanceof Date) {\n    return new Date(obj.getTime());\n  }\n  const clone = Array.isArray(obj) ? [] :\n      typeof ArrayBuffer === 'function' &&\n          typeof ArrayBuffer.isView === 'function' && ArrayBuffer.isView(obj) &&\n          !(obj instanceof DataView) ?\n                                     new obj.constructor(obj.length) :\n                                     {};\n  for (const key in obj) {\n    clone[key] = unsafeClone(obj[key]);\n  }\n  return clone;\n}\n\n/**\n * Returns a new object in which all the keys and values are interchanged\n * (keys become values and values become keys). If multiple keys map to the\n * same value, the chosen transposed value is implementation-dependent.\n * @param {?Object} obj The object to transpose.\n * @return {!Object} The transposed object.\n */\nfunction transpose(obj) {\n  const transposed = {};\n  for (const key in obj) {\n    transposed[obj[key]] = key;\n  }\n  return transposed;\n}\n\n/**\n * The names of the fields that are defined on Object.prototype.\n * @type {!Array<string>}\n */\nconst PROTOTYPE_FIELDS = [\n  'constructor',\n  'hasOwnProperty',\n  'isPrototypeOf',\n  'propertyIsEnumerable',\n  'toLocaleString',\n  'toString',\n  'valueOf',\n];\n\n/**\n * Extends an object with another object.\n * This operates 'in-place'; it does not create a new Object.\n * Example:\n * var o = {};\n * extend(o, {a: 0, b: 1});\n * o; // {a: 0, b: 1}\n * extend(o, {b: 2, c: 3});\n * o; // {a: 0, b: 2, c: 3}\n * @param {?Object} target The object to modify. Existing properties will be\n *     overwritten if they are also present in one of the objects in `var_args`.\n * @param {...(?Object|undefined)} var_args The objects from which values\n *     will be copied.\n * @return {void}\n * @deprecated Prefer Object.assign\n */\nfunction extend(target, var_args) {\n  let key;\n  let source;\n  for (let i = 1; i < arguments.length; i++) {\n    source = arguments[i];\n    for (key in source) {\n      target[key] = source[key];\n    }\n\n    // For IE the for-in-loop does not contain any properties that are not\n    // enumerable on the prototype object (for example isPrototypeOf from\n    // Object.prototype) and it will also not include 'replace' on objects that\n    // extend String and change 'replace' (not that it is common for anyone to\n    // extend anything except Object).\n\n    for (let j = 0; j < PROTOTYPE_FIELDS.length; j++) {\n      key = PROTOTYPE_FIELDS[j];\n      if (Object.prototype.hasOwnProperty.call(source, key)) {\n        target[key] = source[key];\n      }\n    }\n  }\n}\n\n/**\n * Creates a new object built from the key-value pairs provided as arguments.\n * @param {...*} var_args If only one argument is provided and it is an array\n *     then this is used as the arguments, otherwise even arguments are used as\n *     the property names and odd arguments are used as the property values.\n * @return {!Object} The new object.\n * @throws {!Error} If there are uneven number of arguments or there is only one\n *     non array argument.\n */\nfunction create(var_args) {\n  const argLength = arguments.length;\n  if (argLength == 1 && Array.isArray(arguments[0])) {\n    return create.apply(null, arguments[0]);\n  }\n\n  if (argLength % 2) {\n    throw new Error('Uneven number of arguments');\n  }\n\n  const rv = {};\n  for (let i = 0; i < argLength; i += 2) {\n    rv[arguments[i]] = arguments[i + 1];\n  }\n  return rv;\n}\n\n/**\n * Creates a new object where the property names come from the arguments but\n * the value is always set to true\n * @param {...*} var_args If only one argument is provided and it is an array\n *     then this is used as the arguments, otherwise the arguments are used as\n *     the property names.\n * @return {!Object} The new object.\n */\nfunction createSet(var_args) {\n  const argLength = arguments.length;\n  if (argLength == 1 && Array.isArray(arguments[0])) {\n    return createSet.apply(null, arguments[0]);\n  }\n\n  const rv = {};\n  for (let i = 0; i < argLength; i++) {\n    rv[arguments[i]] = true;\n  }\n  return rv;\n}\n\n/**\n * Creates an immutable view of the underlying object, if the browser\n * supports immutable objects.\n * In default mode, writes to this view will fail silently. In strict mode,\n * they will throw an error.\n * @param {!Object<K,V>} obj An object.\n * @return {!Object<K,V>} An immutable view of that object, or the original\n *     object if this browser does not support immutables.\n * @template K,V\n */\nfunction createImmutableView(obj) {\n  let result = obj;\n  if (Object.isFrozen && !Object.isFrozen(obj)) {\n    result = Object.create(obj);\n    Object.freeze(result);\n  }\n  return result;\n}\n\n/**\n * @param {!Object} obj An object.\n * @return {boolean} Whether this is an immutable view of the object.\n */\nfunction isImmutableView(obj) {\n  return !!Object.isFrozen && Object.isFrozen(obj);\n}\n\n/**\n * Get all properties names on a given Object regardless of enumerability.\n * <p> If the browser does not support `Object.getOwnPropertyNames` nor\n * `Object.getPrototypeOf` then this is equivalent to using\n * `getKeys`\n * @param {?Object} obj The object to get the properties of.\n * @param {boolean=} includeObjectPrototype Whether properties defined on\n *     `Object.prototype` should be included in the result.\n * @param {boolean=} includeFunctionPrototype Whether properties defined on\n *     `Function.prototype` should be included in the result.\n * @return {!Array<string>}\n * @public\n */\nfunction getAllPropertyNames(\n    obj, includeObjectPrototype = undefined,\n    includeFunctionPrototype = undefined) {\n  if (!obj) {\n    return [];\n  }\n\n  // Naively use a for..in loop to get the property names if the browser doesn't\n  // support any other APIs for getting it.\n  if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) {\n    return getKeys(obj);\n  }\n\n  const visitedSet = {};\n\n  // Traverse the prototype chain and add all properties to the visited set.\n  let proto = obj;\n  while (proto && (proto !== Object.prototype || !!includeObjectPrototype) &&\n         (proto !== Function.prototype || !!includeFunctionPrototype)) {\n    const names = Object.getOwnPropertyNames(proto);\n    for (let i = 0; i < names.length; i++) {\n      visitedSet[names[i]] = true;\n    }\n    proto = Object.getPrototypeOf(proto);\n  }\n\n  return getKeys(visitedSet);\n}\n\n/**\n * Given a ES5 or ES6 class reference, return its super class / super\n * constructor.\n * This should be used in rare cases where you need to walk up the inheritance\n * tree (this is generally a bad idea). But this work with ES5 and ES6 classes,\n * unlike relying on the superClass_ property.\n * Note: To start walking up the hierarchy from an instance call this with its\n * `constructor` property; e.g. `getSuperClass(instance.constructor)`.\n * @param {function(new: ?)} constructor\n * @return {?Object}\n */\nfunction getSuperClass(constructor) {\n  const proto = Object.getPrototypeOf(constructor.prototype);\n  return proto && proto.constructor;\n}\n\nexports = {\n  add,\n  clear,\n  clone,\n  contains,\n  containsKey,\n  containsValue,\n  create,\n  createImmutableView,\n  createSet,\n  equals,\n  every,\n  extend,\n  filter,\n  findKey,\n  findValue,\n  forEach,\n  get,\n  getAllPropertyNames,\n  getAnyKey,\n  getAnyValue,\n  getCount,\n  getKeys,\n  getSuperClass,\n  getValueByKeys,\n  getValues,\n  isEmpty,\n  isImmutableView,\n  map,\n  remove,\n  set,\n  setIfUndefined,\n  setWithReturnValueIfNotSet,\n  some,\n  transpose,\n  unsafeClone,\n};\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {unwrapUrlOrSanitize, Url} from '../../builders/url_builders';\n\n/**\n * windowOpen calls {@link Window.open} on the given {@link Window}, given a\n * target {@link Url}.\n */\nexport function windowOpen(\n  win: Window,\n  url: Url,\n  target?: string,\n  features?: string,\n): Window | null {\n  const sanitizedUrl = unwrapUrlOrSanitize(url);\n  if (sanitizedUrl !== undefined) {\n    return win.open(sanitizedUrl, target, features);\n  }\n  return null;\n}\n\n/**\n * Returns CSP nonce, if set for any script tag.\n */\nexport function getScriptNonce(doc?: Document): string {\n  return getNonceFor('script', doc);\n}\n\n/**\n * Returns CSP nonce, if set for any style tag.\n */\nexport function getStyleNonce(doc?: Document): string {\n  return getNonceFor('style', doc);\n}\n\nfunction getNonceFor(\n  elementName: 'script' | 'style',\n  doc: Document = document,\n): string {\n  // document.querySelector can be undefined in non-browser environments.\n  const el = doc.querySelector?.<HTMLScriptElement | HTMLStyleElement>(\n    `${elementName}[nonce]`,\n  );\n\n  if (el == null) {\n    return '';\n  }\n\n  // Try to get the nonce from the IDL property first, because browsers that\n  // implement additional nonce protection features (currently only Chrome) to\n  // prevent nonce stealing via CSS do not expose the nonce via attributes.\n  // See https://github.com/whatwg/html/issues/2369\n  return el['nonce'] || el.getAttribute('nonce') || '';\n}\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n  TrustedResourceUrl,\n  unwrapResourceUrl,\n} from '../../internals/resource_url_impl';\nimport {SafeScript, unwrapScript} from '../../internals/script_impl';\nimport {getScriptNonce} from '../globals/window';\n\n/** Propagates CSP nonce to dynamically created scripts. */\nfunction setNonceForScriptElement(script: HTMLScriptElement) {\n  const nonce = getScriptNonce(script.ownerDocument);\n  if (nonce) {\n    script.setAttribute('nonce', nonce);\n  }\n}\n\n/** Sets textContent from the given SafeScript. */\nexport function setScriptTextContent(\n  script: HTMLScriptElement,\n  v: SafeScript,\n  options?: {omitNonce?: boolean},\n): void {\n  script.textContent = unwrapScript(v) as string;\n  if (options?.omitNonce) return;\n  setNonceForScriptElement(script);\n}\n\n/** Sets the Src attribute using a TrustedResourceUrl */\nexport function setScriptSrc(\n  script: HTMLScriptElement,\n  v: TrustedResourceUrl,\n  options?: {omitNonce?: boolean},\n): void {\n  script.src = unwrapResourceUrl(v) as string;\n  if (options?.omitNonce) return;\n  setNonceForScriptElement(script);\n}\n","// DO NOT OPENSOURCE\ngoog.module('goog.flags');\ngoog.module.declareLegacyNamespace();\n\nconst toggles = goog.require('google3.third_party.javascript.closure.flags.flags$2etoggles');\n\n// NOTE: STAGING defaults to true unless overridden by command-line flag.\n/** @type {boolean} */\nconst STAGING = goog.readFlagInternalDoNotUseOrElse(1, goog.FLAGS_STAGING_DEFAULT);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bUSE_USER_AGENT_CLIENT_HINTS\\b\n */\nexports.USE_USER_AGENT_CLIENT_HINTS = toggles.TOGGLE_GoogFlags__use_toggles ? toggles.TOGGLE_GoogFlags__use_user_agent_client_hints__enable :\n    goog.readFlagInternalDoNotUseOrElse(610401301, false);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bASYNC_THROW_ON_UNICODE_TO_BYTE\\b\n */\nexports.ASYNC_THROW_ON_UNICODE_TO_BYTE = toggles.TOGGLE_GoogFlags__use_toggles ? toggles.TOGGLE_GoogFlags__async_throw_on_unicode_to_byte__enable :\n    goog.readFlagInternalDoNotUseOrElse(899588437, false);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bCLIENT_ONLY_WIZ_QUEUE_EFFECT_AND_ON_INIT_INITIAL_RUNS\\b\n */\nexports.CLIENT_ONLY_WIZ_QUEUE_EFFECT_AND_ON_INIT_INITIAL_RUNS = toggles.TOGGLE_GoogFlags__use_toggles ? toggles.TOGGLE_GoogFlags__override_disable_toggles || !toggles.TOGGLE_GoogFlags__client_only_wiz_queue_effect_and_on_init_initial_runs__disable :\n    goog.readFlagInternalDoNotUseOrElse(772657768, true);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bCLIENT_ONLY_WIZ_CONTEXT_PER_COMPONENT\\b\n */\nexports.CLIENT_ONLY_WIZ_CONTEXT_PER_COMPONENT = toggles.TOGGLE_GoogFlags__use_toggles ? goog.DEBUG || toggles.TOGGLE_GoogFlags__client_only_wiz_context_per_component__enable :\n    goog.readFlagInternalDoNotUseOrElse(513659523, goog.DEBUG);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bCLIENT_ONLY_WIZ_LAZY_TSX\\b\n */\nexports.CLIENT_ONLY_WIZ_LAZY_TSX = toggles.TOGGLE_GoogFlags__use_toggles ? toggles.TOGGLE_GoogFlags__override_disable_toggles || !toggles.TOGGLE_GoogFlags__client_only_wiz_lazy_tsx__disable :\n    goog.readFlagInternalDoNotUseOrElse(568333945, true);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bFIXED_NOOPENER_BEHAVIOR\\b\n */\nexports.FIXED_NOOPENER_BEHAVIOR = toggles.TOGGLE_GoogFlags__use_toggles ? toggles.TOGGLE_GoogFlags__fixed_noopener_behavior__enable :\n    goog.readFlagInternalDoNotUseOrElse(1331761403, false);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bWIZ_ENABLE_NATIVE_PROMISE\\b\n */\nexports.WIZ_ENABLE_NATIVE_PROMISE = toggles.TOGGLE_GoogFlags__use_toggles ? goog.DEBUG || toggles.TOGGLE_GoogFlags__wiz_enable_native_promise__enable :\n    goog.readFlagInternalDoNotUseOrElse(651175828, goog.DEBUG);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bJSPB_DISALLOW_MESSAGE_TOJSON\\b\n */\nexports.JSPB_DISALLOW_MESSAGE_TOJSON = toggles.TOGGLE_GoogFlags__use_toggles ? goog.DEBUG || toggles.TOGGLE_GoogFlags__jspb_disallow_message_tojson__enable :\n    goog.readFlagInternalDoNotUseOrElse(722764542, goog.DEBUG);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bJSPB_USE_CONSTANT_DEFAULT_PIVOT\\b\n */\nexports.JSPB_USE_CONSTANT_DEFAULT_PIVOT = toggles.TOGGLE_GoogFlags__use_toggles ? goog.DEBUG || toggles.TOGGLE_GoogFlags__jspb_use_constant_default_pivot__enable :\n    goog.readFlagInternalDoNotUseOrElse(748402145, goog.DEBUG);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bJSPB_SERIALIZE_WITH_DYNAMIC_PIVOT_SELECTOR\\b\n */\nexports.JSPB_SERIALIZE_WITH_DYNAMIC_PIVOT_SELECTOR = toggles.TOGGLE_GoogFlags__use_toggles ? goog.DEBUG || toggles.TOGGLE_GoogFlags__jspb_serialize_with_dynamic_pivot_selector__enable :\n    goog.readFlagInternalDoNotUseOrElse(748402146, goog.DEBUG);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bJSPB_THROW_IN_ARRAY_CONSTRUCTOR_IF_ARRAY_IS_ALREADY_CONSTRUCTED\\b\n */\nexports.JSPB_THROW_IN_ARRAY_CONSTRUCTOR_IF_ARRAY_IS_ALREADY_CONSTRUCTED = toggles.TOGGLE_GoogFlags__use_toggles ? toggles.TOGGLE_GoogFlags__override_disable_toggles || !toggles.TOGGLE_GoogFlags__jspb_throw_in_array_constructor_if_array_is_already_constructed__disable :\n    goog.readFlagInternalDoNotUseOrElse(748402147, true);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bJSPB_DESERIALIZE_BINARY_INT64S_AS_GBIGINT\\b\n */\nexports.JSPB_DESERIALIZE_BINARY_INT64S_AS_GBIGINT = toggles.TOGGLE_GoogFlags__use_toggles ? goog.FLAGS_STAGING_DEFAULT && (toggles.TOGGLE_GoogFlags__override_disable_toggles || !toggles.TOGGLE_GoogFlags__jspb_deserialize_binary_int64s_as_gbigint__disable) :\n    goog.readFlagInternalDoNotUseOrElse(824648567, STAGING);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bJSPB_WRITE_BACK_BIGINT\\b\n */\nexports.JSPB_WRITE_BACK_BIGINT = toggles.TOGGLE_GoogFlags__use_toggles ? goog.DEBUG || toggles.TOGGLE_GoogFlags__jspb_write_back_bigint__enable :\n    goog.readFlagInternalDoNotUseOrElse(824656860, goog.DEBUG);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bOPTIMIZE_GET_EI_FROM_VED\\b\n */\nexports.OPTIMIZE_GET_EI_FROM_VED = toggles.TOGGLE_GoogFlags__use_toggles ? toggles.TOGGLE_GoogFlags__optimize_get_ei_from_ved__enable :\n    goog.readFlagInternalDoNotUseOrElse(333098724, false);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bTESTONLY_DISABLED_FLAG\\b\n */\nexports.TESTONLY_DISABLED_FLAG = toggles.TOGGLE_GoogFlags__use_toggles ? toggles.TOGGLE_GoogFlags__testonly_disabled_flag__enable :\n    goog.readFlagInternalDoNotUseOrElse(2147483644, false);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bTESTONLY_DEBUG_FLAG\\b\n */\nexports.TESTONLY_DEBUG_FLAG = toggles.TOGGLE_GoogFlags__use_toggles ? goog.DEBUG || toggles.TOGGLE_GoogFlags__testonly_debug_flag__enable :\n    goog.readFlagInternalDoNotUseOrElse(2147483645, goog.DEBUG);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bTESTONLY_STAGING_FLAG\\b\n */\nexports.TESTONLY_STAGING_FLAG = toggles.TOGGLE_GoogFlags__use_toggles ? goog.FLAGS_STAGING_DEFAULT && (toggles.TOGGLE_GoogFlags__override_disable_toggles || !toggles.TOGGLE_GoogFlags__testonly_staging_flag__disable) :\n    goog.readFlagInternalDoNotUseOrElse(2147483646, STAGING);\n/**\n * @const {boolean}\n * @see google3/third_party/javascript/closure/flags/flags.proto?q=symbol:\\bTESTONLY_STABLE_FLAG\\b\n */\nexports.TESTONLY_STABLE_FLAG = toggles.TOGGLE_GoogFlags__use_toggles ? toggles.TOGGLE_GoogFlags__override_disable_toggles || !toggles.TOGGLE_GoogFlags__testonly_stable_flag__disable :\n    goog.readFlagInternalDoNotUseOrElse(2147483647, true);\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities used by goog.labs.userAgent tools. These functions\n * should not be used outside of goog.labs.userAgent.*.\n *\n */\n\ngoog.module('goog.labs.userAgent.util');\ngoog.module.declareLegacyNamespace();\n\nconst {caseInsensitiveContains, contains} = goog.require('goog.string.internal');\nconst {useClientHints} = goog.require('goog.labs.userAgent');\n\n/**\n * @const {boolean} If true, use navigator.userAgentData without check.\n * TODO(b/335248598): FEATURESET_YEAR >= 2025 if it supports mobile and all the\n * brands we need.  See https://caniuse.com/mdn-api_navigator_useragentdata.\n */\nconst ASSUME_CLIENT_HINTS_SUPPORT = false;\n\n/**\n * Gets the native userAgent string from navigator if it exists.\n * If navigator or navigator.userAgent string is missing, returns an empty\n * string.\n * @return {string}\n */\nfunction getNativeUserAgentString() {\n  const navigator = getNavigator();\n  if (navigator) {\n    const userAgent = navigator.userAgent;\n    if (userAgent) {\n      return userAgent;\n    }\n  }\n  return '';\n}\n\n/**\n * Gets the native userAgentData object from navigator if it exists.\n * If navigator.userAgentData object is missing returns null.\n * @return {?NavigatorUAData}\n */\nfunction getNativeUserAgentData() {\n  const navigator = getNavigator();\n  // TODO(b/195343593): Use navigator?.userAgent ?? null once it's supported.\n  if (navigator) {\n    return navigator.userAgentData || null;\n  }\n  return null;\n}\n\n/**\n * Getter for the native navigator.\n * @return {!Navigator}\n */\nfunction getNavigator() {\n  return goog.global.navigator;\n}\n\n/**\n * A possible override for applications which wish to not check\n * navigator.userAgent but use a specified value for detection instead.\n * @type {?string}\n */\nlet userAgentInternal = null;\n\n/**\n * A possible override for applications which wish to not check\n * navigator.userAgentData but use a specified value for detection instead.\n * @type {?NavigatorUAData}\n */\nlet userAgentDataInternal = getNativeUserAgentData();\n\n/**\n * Override the user agent string with the given value.\n * This should only be used for testing within the goog.labs.userAgent\n * namespace.\n * Pass `null` to use the native browser object instead.\n * @param {?string=} userAgent The userAgent override.\n * @return {void}\n */\nfunction setUserAgent(userAgent = undefined) {\n  userAgentInternal =\n      typeof userAgent === 'string' ? userAgent : getNativeUserAgentString();\n}\n\n/** @return {string} The user agent string. */\nfunction getUserAgent() {\n  return userAgentInternal == null ? getNativeUserAgentString() :\n                                     userAgentInternal;\n}\n\n/**\n * Override the user agent data object with the given value.\n * This should only be used for testing within the goog.labs.userAgent\n * namespace.\n * Pass `null` to specify the absence of userAgentData. Note that this behavior\n * is different from setUserAgent.\n * @param {?NavigatorUAData} userAgentData The userAgentData override.\n */\nfunction setUserAgentData(userAgentData) {\n  userAgentDataInternal = userAgentData;\n}\n\n/**\n * If the user agent data object was overridden using setUserAgentData,\n * reset it so that it uses the native browser object instead, if it exists.\n */\nfunction resetUserAgentData() {\n  userAgentDataInternal = getNativeUserAgentData();\n}\n\n/** @return {?NavigatorUAData} Navigator.userAgentData if exist */\nfunction getUserAgentData() {\n  return userAgentDataInternal;\n}\n\n/**\n * Checks if any string in userAgentData.brands matches str.\n * Returns false if userAgentData is not supported.\n * @param {string} str\n * @return {boolean} Whether any brand string from userAgentData contains the\n *     given string.\n */\nfunction matchUserAgentDataBrand(str) {\n  if (!useClientHints()) return false;\n  const data = getUserAgentData();\n  if (!data) return false;\n  // This must be written as a loop instead of helpers like Array.some to\n  // avoid side-effects. This way, user agent detection can be\n  // dead-code-eliminated. Note that a `for..of` loop will also prevent the\n  // optimization, so it must not be used either.\n  for (let i = 0; i < data.brands.length; i++) {\n    const {brand} = data.brands[i];\n    if (brand && contains(brand, str)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * @param {string} str\n * @return {boolean} Whether the user agent contains the given string.\n */\nfunction matchUserAgent(str) {\n  const userAgent = getUserAgent();\n  return contains(userAgent, str);\n}\n\n/**\n * @param {string} str\n * @return {boolean} Whether the user agent contains the given string, ignoring\n *     case.\n */\nfunction matchUserAgentIgnoreCase(str) {\n  const userAgent = getUserAgent();\n  return caseInsensitiveContains(userAgent, str);\n}\n\n/**\n * Parses the user agent into tuples for each section.\n * @param {string} userAgent\n * @return {!Array<!Array<string>>} Tuples of key, version, and the contents of\n *     the parenthetical.\n */\nfunction extractVersionTuples(userAgent) {\n  // Matches each section of a user agent string.\n  // Example UA:\n  // Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us)\n  // AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405\n  // This has three version tuples: Mozilla, AppleWebKit, and Mobile.\n\n  const versionRegExp = new RegExp(\n      // Key. Note that a key may have a space.\n      // (i.e. 'Mobile Safari' in 'Mobile Safari/5.0')\n      '([A-Z][\\\\w ]+)' +\n\n          '/' +                // slash\n          '([^\\\\s]+)' +        // version (i.e. '5.0b')\n          '\\\\s*' +             // whitespace\n          '(?:\\\\((.*?)\\\\))?',  // parenthetical info. parentheses not matched.\n      'g');\n\n  const data = [];\n  let match;\n\n  // Iterate and collect the version tuples.  Each iteration will be the\n  // next regex match.\n  while (match = versionRegExp.exec(userAgent)) {\n    data.push([\n      match[1],  // key\n      match[2],  // value\n      // || undefined as this is not undefined in IE7 and IE8\n      match[3] || undefined  // info\n    ]);\n  }\n\n  return data;\n}\n\nexports = {\n  ASSUME_CLIENT_HINTS_SUPPORT,\n  extractVersionTuples,\n  getNativeUserAgentString,\n  getUserAgent,\n  getUserAgentData,\n  matchUserAgent,\n  matchUserAgentDataBrand,\n  matchUserAgentIgnoreCase,\n  resetUserAgentData,\n  setUserAgent,\n  setUserAgentData,\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Rendering engine detection.\n * @see <a href=\"http://www.useragentstring.com/\">User agent strings</a>\n * For information on the browser brand (such as Safari versus Chrome), see\n * goog.userAgent.product.\n */\n\ngoog.provide('goog.userAgent');\n\ngoog.require('goog.labs.userAgent.browser');\ngoog.require('goog.labs.userAgent.engine');\ngoog.require('goog.labs.userAgent.platform');\ngoog.require('goog.labs.userAgent.util');\ngoog.require('goog.reflect');\ngoog.require('goog.string.internal');\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is IE.\n */\ngoog.userAgent.ASSUME_IE = goog.define('goog.userAgent.ASSUME_IE', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is EDGE,\n * referring to EdgeHTML based Edge.\n */\ngoog.userAgent.ASSUME_EDGE = goog.define('goog.userAgent.ASSUME_EDGE', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is GECKO.\n */\ngoog.userAgent.ASSUME_GECKO = goog.define('goog.userAgent.ASSUME_GECKO', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is WEBKIT.\n */\ngoog.userAgent.ASSUME_WEBKIT =\n    goog.define('goog.userAgent.ASSUME_WEBKIT', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is a\n *     mobile device running WebKit e.g. iPhone or Android.\n */\ngoog.userAgent.ASSUME_MOBILE_WEBKIT =\n    goog.define('goog.userAgent.ASSUME_MOBILE_WEBKIT', false);\n\n\n/**\n * @define {boolean} Whether we know at compile-time that the browser is OPERA,\n * referring to Presto-based Opera.\n */\ngoog.userAgent.ASSUME_OPERA = goog.define('goog.userAgent.ASSUME_OPERA', false);\n\n\n/**\n * @define {boolean} Whether the\n *     `goog.userAgent.isVersionOrHigher`\n *     function will return true for any version.\n */\ngoog.userAgent.ASSUME_ANY_VERSION =\n    goog.define('goog.userAgent.ASSUME_ANY_VERSION', false);\n\n\n/**\n * Whether we know the browser engine at compile-time.\n * @type {boolean}\n * @private\n */\ngoog.userAgent.BROWSER_KNOWN_ = goog.userAgent.ASSUME_IE ||\n    goog.userAgent.ASSUME_EDGE || goog.userAgent.ASSUME_GECKO ||\n    goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.ASSUME_WEBKIT ||\n    goog.userAgent.ASSUME_OPERA;\n\n\n/**\n * Returns the userAgent string for the current browser.\n *\n * @return {string} The userAgent string.\n */\ngoog.userAgent.getUserAgentString = function() {\n  'use strict';\n  return goog.labs.userAgent.util.getUserAgent();\n};\n\n\n/**\n * @return {?Navigator} The native navigator object.\n */\ngoog.userAgent.getNavigatorTyped = function() {\n  'use strict';\n  // Need a local navigator reference instead of using the global one,\n  // to avoid the rare case where they reference different objects.\n  // (in a WorkerPool, for example).\n  return goog.global['navigator'] || null;\n};\n\n\n/**\n * TODO(nnaze): Change type to \"Navigator\" and update compilation targets.\n * @return {?Object} The native navigator object.\n */\ngoog.userAgent.getNavigator = function() {\n  'use strict';\n  return goog.userAgent.getNavigatorTyped();\n};\n\n\n/**\n * Whether the user agent is Presto-based Opera.\n * @type {boolean}\n */\ngoog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_OPERA :\n    goog.labs.userAgent.browser.isOpera();\n\n\n/**\n * Whether the user agent is Internet Explorer.\n * @type {boolean}\n */\ngoog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_IE :\n    goog.labs.userAgent.browser.isIE();\n\n\n/**\n * Whether the user agent is Microsoft Edge (EdgeHTML based).\n * @type {boolean}\n */\ngoog.userAgent.EDGE = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_EDGE :\n    goog.labs.userAgent.engine.isEdge();\n\n\n/**\n * Whether the user agent is MS Internet Explorer or MS Edge (EdgeHTML based).\n * @type {boolean}\n */\ngoog.userAgent.EDGE_OR_IE = goog.userAgent.EDGE || goog.userAgent.IE;\n\n\n/**\n * Whether the user agent is Gecko. Gecko is the rendering engine used by\n * Mozilla, Firefox, and others.\n * @type {boolean}\n */\ngoog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_GECKO :\n    goog.labs.userAgent.engine.isGecko();\n\n\n/**\n * Whether the user agent is WebKit. WebKit is the rendering engine that\n * Safari, Edge Chromium, Opera Chromium, Android and others use.\n * @type {boolean}\n */\ngoog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ ?\n    goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT :\n    goog.labs.userAgent.engine.isWebKit();\n\n\n/**\n * Whether the user agent is running on a mobile device.\n *\n * This is a separate function so that the logic can be tested.\n *\n * TODO(nnaze): Investigate swapping in goog.labs.userAgent.device.isMobile().\n *\n * @return {boolean} Whether the user agent is running on a mobile device.\n * @private\n */\ngoog.userAgent.isMobile_ = function() {\n  'use strict';\n  return goog.userAgent.WEBKIT &&\n      goog.labs.userAgent.util.matchUserAgent('Mobile');\n};\n\n\n/**\n * Whether the user agent is running on a mobile device.\n *\n * TODO(nnaze): Consider deprecating MOBILE when labs.userAgent\n *   is promoted as the gecko/webkit logic is likely inaccurate.\n *\n * @type {boolean}\n */\ngoog.userAgent.MOBILE =\n    goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.isMobile_();\n\n\n/**\n * Used while transitioning code to use WEBKIT instead.\n * @type {boolean}\n * @deprecated Use {@link goog.userAgent.product.SAFARI} instead.\n * TODO(nicksantos): Delete this from goog.userAgent.\n */\ngoog.userAgent.SAFARI = goog.userAgent.WEBKIT;\n\n\n/**\n * @return {string} the platform (operating system) the user agent is running\n *     on. Default to empty string because navigator.platform may not be defined\n *     (on Rhino, for example).\n * @private\n */\ngoog.userAgent.determinePlatform_ = function() {\n  'use strict';\n  const navigator = goog.userAgent.getNavigatorTyped();\n  return navigator && navigator.platform || '';\n};\n\n\n/**\n * The platform (operating system) the user agent is running on. Default to\n * empty string because navigator.platform may not be defined (on Rhino, for\n * example).\n * @type {string}\n */\ngoog.userAgent.PLATFORM = goog.userAgent.determinePlatform_();\n\n\n/**\n * @define {boolean} Whether the user agent is running on a Macintosh operating\n *     system.\n */\ngoog.userAgent.ASSUME_MAC = goog.define('goog.userAgent.ASSUME_MAC', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on a Windows operating\n *     system.\n */\ngoog.userAgent.ASSUME_WINDOWS =\n    goog.define('goog.userAgent.ASSUME_WINDOWS', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on a Linux operating\n *     system.\n */\ngoog.userAgent.ASSUME_LINUX = goog.define('goog.userAgent.ASSUME_LINUX', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on Android.\n */\ngoog.userAgent.ASSUME_ANDROID =\n    goog.define('goog.userAgent.ASSUME_ANDROID', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on an iPhone.\n */\ngoog.userAgent.ASSUME_IPHONE =\n    goog.define('goog.userAgent.ASSUME_IPHONE', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on an iPad.\n */\ngoog.userAgent.ASSUME_IPAD = goog.define('goog.userAgent.ASSUME_IPAD', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on an iPod.\n */\ngoog.userAgent.ASSUME_IPOD = goog.define('goog.userAgent.ASSUME_IPOD', false);\n\n\n/**\n * @define {boolean} Whether the user agent is running on KaiOS.\n */\ngoog.userAgent.ASSUME_KAIOS = goog.define('goog.userAgent.ASSUME_KAIOS', false);\n\n\n/**\n * @type {boolean}\n * @private\n */\ngoog.userAgent.PLATFORM_KNOWN_ = goog.userAgent.ASSUME_MAC ||\n    goog.userAgent.ASSUME_WINDOWS || goog.userAgent.ASSUME_LINUX ||\n    goog.userAgent.ASSUME_ANDROID || goog.userAgent.ASSUME_IPHONE ||\n    goog.userAgent.ASSUME_IPAD || goog.userAgent.ASSUME_IPOD;\n\n\n/**\n * Whether the user agent is running on a Macintosh operating system.\n * @type {boolean}\n */\ngoog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_MAC :\n    goog.labs.userAgent.platform.isMacintosh();\n\n\n/**\n * Whether the user agent is running on a Windows operating system.\n * @type {boolean}\n */\ngoog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_WINDOWS :\n    goog.labs.userAgent.platform.isWindows();\n\n\n/**\n * Whether the user agent is Linux per the legacy behavior of\n * goog.userAgent.LINUX, which considered ChromeOS to also be\n * Linux.\n * @return {boolean}\n * @private\n */\ngoog.userAgent.isLegacyLinux_ = function() {\n  'use strict';\n  return goog.labs.userAgent.platform.isLinux() ||\n      goog.labs.userAgent.platform.isChromeOS();\n};\n\n\n/**\n * Whether the user agent is running on a Linux operating system.\n *\n * Note that goog.userAgent.LINUX considers ChromeOS to be Linux,\n * while goog.labs.userAgent.platform considers ChromeOS and\n * Linux to be different OSes.\n *\n * @type {boolean}\n */\ngoog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_LINUX :\n    goog.userAgent.isLegacyLinux_();\n\n\n/**\n * Whether the user agent is running on Android.\n * @type {boolean}\n */\ngoog.userAgent.ANDROID = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_ANDROID :\n    goog.labs.userAgent.platform.isAndroid();\n\n\n/**\n * Whether the user agent is running on an iPhone.\n * @type {boolean}\n */\ngoog.userAgent.IPHONE = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_IPHONE :\n    goog.labs.userAgent.platform.isIphone();\n\n\n/**\n * Whether the user agent is running on an iPad.\n * @type {boolean}\n */\ngoog.userAgent.IPAD = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_IPAD :\n    goog.labs.userAgent.platform.isIpad();\n\n\n/**\n * Whether the user agent is running on an iPod.\n * @type {boolean}\n */\ngoog.userAgent.IPOD = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_IPOD :\n    goog.labs.userAgent.platform.isIpod();\n\n\n/**\n * Whether the user agent is running on iOS.\n * @type {boolean}\n */\ngoog.userAgent.IOS = goog.userAgent.PLATFORM_KNOWN_ ?\n    (goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD ||\n     goog.userAgent.ASSUME_IPOD) :\n    goog.labs.userAgent.platform.isIos();\n\n/**\n * Whether the user agent is running on KaiOS.\n * @type {boolean}\n */\ngoog.userAgent.KAIOS = goog.userAgent.PLATFORM_KNOWN_ ?\n    goog.userAgent.ASSUME_KAIOS :\n    goog.labs.userAgent.platform.isKaiOS();\n\n\n/**\n * @return {string} The string that describes the version number of the user\n *     agent.\n * @private\n */\ngoog.userAgent.determineVersion_ = function() {\n  'use strict';\n  // All browsers have different ways to detect the version and they all have\n  // different naming schemes.\n  // version is a string rather than a number because it may contain 'b', 'a',\n  // and so on.\n  let version = '';\n  const arr = goog.userAgent.getVersionRegexResult_();\n  if (arr) {\n    version = arr ? arr[1] : '';\n  }\n\n  if (goog.userAgent.IE) {\n    // IE9 can be in document mode 9 but be reporting an inconsistent user agent\n    // version.  If it is identifying as a version lower than 9 we take the\n    // documentMode as the version instead.  IE8 has similar behavior.\n    // It is recommended to set the X-UA-Compatible header to ensure that IE9\n    // uses documentMode 9.\n    const docMode = goog.userAgent.getDocumentMode_();\n    if (docMode != null && docMode > parseFloat(version)) {\n      return String(docMode);\n    }\n  }\n\n  return version;\n};\n\n\n/**\n * @return {?IArrayLike<string>|undefined} The version regex matches from\n *     parsing the user\n *     agent string. These regex statements must be executed inline so they can\n *     be compiled out by the closure compiler with the rest of the useragent\n *     detection logic when ASSUME_* is specified.\n * @private\n */\ngoog.userAgent.getVersionRegexResult_ = function() {\n  'use strict';\n  const userAgent = goog.userAgent.getUserAgentString();\n  if (goog.userAgent.GECKO) {\n    return /rv\\:([^\\);]+)(\\)|;)/.exec(userAgent);\n  }\n  if (goog.userAgent.EDGE) {\n    return /Edge\\/([\\d\\.]+)/.exec(userAgent);\n  }\n  if (goog.userAgent.IE) {\n    return /\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)/.exec(userAgent);\n  }\n  if (goog.userAgent.WEBKIT) {\n    // WebKit/125.4\n    return /WebKit\\/(\\S+)/.exec(userAgent);\n  }\n  if (goog.userAgent.OPERA) {\n    // If none of the above browsers were detected but the browser is Opera, the\n    // only string that is of interest is 'Version/<number>'.\n    return /(?:Version)[ \\/]?(\\S+)/.exec(userAgent);\n  }\n  return undefined;\n};\n\n\n/**\n * @return {number|undefined} Returns the document mode (for testing).\n * @private\n */\ngoog.userAgent.getDocumentMode_ = function() {\n  'use strict';\n  // NOTE(pupius): goog.userAgent may be used in context where there is no DOM.\n  const doc = goog.global['document'];\n  return doc ? doc['documentMode'] : undefined;\n};\n\n\n/**\n * The version of the user agent. This is a string because it might contain\n * 'b' (as in beta) as well as multiple dots.\n * @type {string}\n */\ngoog.userAgent.VERSION = goog.userAgent.determineVersion_();\n\n\n/**\n * Compares two version numbers.\n *\n * @param {string} v1 Version of first item.\n * @param {string} v2 Version of second item.\n *\n * @return {number}  1 if first argument is higher\n *                   0 if arguments are equal\n *                  -1 if second argument is higher.\n * @deprecated Use goog.string.compareVersions.\n */\ngoog.userAgent.compare = function(v1, v2) {\n  'use strict';\n  return goog.string.internal.compareVersions(v1, v2);\n};\n\n\n/**\n * Cache for {@link goog.userAgent.isVersionOrHigher}.\n * Calls to compareVersions are surprisingly expensive and, as a browser's\n * version number is unlikely to change during a session, we cache the results.\n * @const\n * @private\n */\ngoog.userAgent.isVersionOrHigherCache_ = {};\n\n\n/**\n * Whether the user agent version is higher or the same as the given version.\n * NOTE: When checking the version numbers for Firefox and Safari, be sure to\n * use the engine's version, not the browser's version number.  For example,\n * Firefox 3.0 corresponds to Gecko 1.9 and Safari 3.0 to Webkit 522.11.\n * Opera and Internet Explorer versions match the product release number.<br>\n * @see <a href=\"http://en.wikipedia.org/wiki/Safari_version_history\">\n *     Webkit</a>\n * @see <a href=\"http://en.wikipedia.org/wiki/Gecko_engine\">Gecko</a>\n *\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the user agent version is higher or the same as\n *     the given version.\n */\ngoog.userAgent.isVersionOrHigher = function(version) {\n  'use strict';\n  return goog.userAgent.ASSUME_ANY_VERSION ||\n      goog.reflect.cache(\n          goog.userAgent.isVersionOrHigherCache_, version, function() {\n            'use strict';\n            return goog.string.internal.compareVersions(\n                       goog.userAgent.VERSION, version) >= 0;\n          });\n};\n\n\n/**\n * Whether the IE effective document mode is higher or the same as the given\n * document mode version.\n * NOTE: Only for IE, return false for another browser.\n *\n * @param {number} documentMode The document mode version to check.\n * @return {boolean} Whether the IE effective document mode is higher or the\n *     same as the given version.\n */\ngoog.userAgent.isDocumentModeOrHigher = function(documentMode) {\n  'use strict';\n  return Number(goog.userAgent.DOCUMENT_MODE) >= documentMode;\n};\n\n\n/**\n * For IE version < 7, documentMode is undefined, so attempt to use the\n * CSS1Compat property to see if we are in standards mode. If we are in\n * standards mode, treat the browser version as the document mode. Otherwise,\n * IE is emulating version 5.\n *\n * NOTE(2019/05/31): Support for IE < 7 is long gone, so this is now simplified.\n * It returns document.documentMode for IE and undefined for everything else.\n *\n * @type {number|undefined}\n * @const\n */\ngoog.userAgent.DOCUMENT_MODE = (function() {\n  'use strict';\n  const doc = goog.global['document'];\n  if (!doc || !goog.userAgent.IE) return undefined;\n  // This must be an IE user agent.\n  const documentMode = goog.userAgent.getDocumentMode_();\n  if (documentMode) return documentMode;\n  // The user agent version string begins with the major version.\n  // Parse the major version and truncate anything following.\n  const ieVersion = parseInt(goog.userAgent.VERSION, 10);\n  return ieVersion || undefined;\n})();\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview String functions called from Closure packages that couldn't\n * depend on each other. Outside Closure, use goog.string function which\n * delegate to these.\n */\n\n\ngoog.module('goog.string.internal');\n\ngoog.module.declareLegacyNamespace();\n\n/**\n * Fast prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix A string to look for at the start of `str`.\n * @return {boolean} True if `str` begins with `prefix`.\n * @see goog.string.startsWith\n */\nfunction startsWith(str, prefix) {\n  return str.lastIndexOf(prefix, 0) == 0;\n}\n\n/**\n * Fast suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix`.\n * @see goog.string.endsWith\n */\nfunction endsWith(str, suffix) {\n  const l = str.length - suffix.length;\n  return l >= 0 && str.indexOf(suffix, l) == l;\n}\n\n/**\n * Case-insensitive prefix-checker.\n * @param {string} str The string to check.\n * @param {string} prefix  A string to look for at the end of `str`.\n * @return {boolean} True if `str` begins with `prefix` (ignoring\n *     case).\n * @see goog.string.caseInsensitiveStartsWith\n */\nfunction caseInsensitiveStartsWith(str, prefix) {\n  return (caseInsensitiveCompare(prefix, str.slice(0, prefix.length)) == 0);\n}\n\n/**\n * Case-insensitive suffix-checker.\n * @param {string} str The string to check.\n * @param {string} suffix A string to look for at the end of `str`.\n * @return {boolean} True if `str` ends with `suffix` (ignoring\n *     case).\n * @see goog.string.caseInsensitiveEndsWith\n */\nfunction caseInsensitiveEndsWith(str, suffix) {\n  return (\n      caseInsensitiveCompare(suffix, str.slice(str.length - suffix.length)) ==\n      0);\n}\n\n/**\n * Case-insensitive equality checker.\n * @param {string} str1 First string to check.\n * @param {string} str2 Second string to check.\n * @return {boolean} True if `str1` and `str2` are the same string,\n *     ignoring case.\n * @see goog.string.caseInsensitiveEquals\n */\nfunction caseInsensitiveEquals(str1, str2) {\n  return str1.toLowerCase() == str2.toLowerCase();\n}\n\n/**\n * Checks if a string is empty or contains only whitespaces.\n * @param {string} str The string to check.\n * @return {boolean} Whether `str` is empty or whitespace only.\n * @see goog.string.isEmptyOrWhitespace\n */\nfunction isEmptyOrWhitespace(str) {\n  // testing length == 0 first is actually slower in all browsers (about the\n  // same in Opera).\n  // Since IE doesn't include non-breaking-space (0xa0) in their \\s character\n  // class (as required by section 7.2 of the ECMAScript spec), we explicitly\n  // include it in the regexp to enforce consistent cross-browser behavior.\n  return /^[\\s\\xa0]*$/.test(str);\n}\n\n/**\n * Trims white spaces to the left and right of a string.\n * @param {string} str The string to trim.\n * @return {string} A trimmed copy of `str`.\n */\nconst trim = (goog.TRUSTED_SITE &&\n              (goog.FEATURESET_YEAR >= 2018 || String.prototype.trim)) ?\n    function(str) {\n      return str.trim();\n    } :\n    function(str) {\n      // Since IE doesn't include non-breaking-space (0xa0) in their \\s\n      // character class (as required by section 7.2 of the ECMAScript spec),\n      // we explicitly include it in the regexp to enforce consistent\n      // cross-browser behavior.\n      // NOTE: We don't use String#replace because it might have side effects\n      // causing this function to not compile to 0 bytes.\n      return /^[\\s\\xa0]*([\\s\\S]*?)[\\s\\xa0]*$/.exec(str)[1];\n    };\n\n/**\n * A string comparator that ignores case.\n * -1 = str1 less than str2\n *  0 = str1 equals str2\n *  1 = str1 greater than str2\n *\n * @param {string} str1 The string to compare.\n * @param {string} str2 The string to compare `str1` to.\n * @return {number} The comparator result, as described above.\n * @see goog.string.caseInsensitiveCompare\n */\nfunction caseInsensitiveCompare(str1, str2) {\n  const test1 = String(str1).toLowerCase();\n  const test2 = String(str2).toLowerCase();\n\n  if (test1 < test2) {\n    return -1;\n  } else if (test1 == test2) {\n    return 0;\n  } else {\n    return 1;\n  }\n}\n\n/**\n * Converts \\n to <br>s or <br />s.\n * @param {string} str The string in which to convert newlines.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} A copy of `str` with converted newlines.\n * @see goog.string.newLineToBr\n */\nfunction newLineToBr(str, opt_xml) {\n  return str.replace(/(\\r\\n|\\r|\\n)/g, opt_xml ? '<br />' : '<br>');\n}\n\n/**\n * Escapes double quote '\"' and single quote '\\'' characters in addition to\n * '&', '<', and '>' so that a string can be included in an HTML tag attribute\n * value within double or single quotes.\n * @param {string} str string to be escaped.\n * @param {boolean=} opt_isLikelyToContainHtmlChars\n * @return {string} An escaped copy of `str`.\n * @see goog.string.htmlEscape\n */\nfunction htmlEscape(str, opt_isLikelyToContainHtmlChars) {\n  if (opt_isLikelyToContainHtmlChars) {\n    str = str.replace(AMP_RE, '&amp;')\n              .replace(LT_RE, '&lt;')\n              .replace(GT_RE, '&gt;')\n              .replace(QUOT_RE, '&quot;')\n              .replace(SINGLE_QUOTE_RE, '&#39;')\n              .replace(NULL_RE, '&#0;');\n    return str;\n\n  } else {\n    // quick test helps in the case when there are no chars to replace, in\n    // worst case this makes barely a difference to the time taken\n    if (!ALL_RE.test(str)) return str;\n\n    // str.indexOf is faster than regex.test in this case\n    if (str.indexOf('&') != -1) {\n      str = str.replace(AMP_RE, '&amp;');\n    }\n    if (str.indexOf('<') != -1) {\n      str = str.replace(LT_RE, '&lt;');\n    }\n    if (str.indexOf('>') != -1) {\n      str = str.replace(GT_RE, '&gt;');\n    }\n    if (str.indexOf('\"') != -1) {\n      str = str.replace(QUOT_RE, '&quot;');\n    }\n    if (str.indexOf('\\'') != -1) {\n      str = str.replace(SINGLE_QUOTE_RE, '&#39;');\n    }\n    if (str.indexOf('\\x00') != -1) {\n      str = str.replace(NULL_RE, '&#0;');\n    }\n    return str;\n  }\n}\n\n/**\n * Regular expression that matches an ampersand, for use in escaping.\n * @const {!RegExp}\n */\nconst AMP_RE = /&/g;\n\n/**\n * Regular expression that matches a less than sign, for use in escaping.\n * @const {!RegExp}\n */\nconst LT_RE = /</g;\n\n/**\n * Regular expression that matches a greater than sign, for use in escaping.\n * @const {!RegExp}\n */\nconst GT_RE = />/g;\n\n/**\n * Regular expression that matches a double quote, for use in escaping.\n * @const {!RegExp}\n */\nconst QUOT_RE = /\"/g;\n\n/**\n * Regular expression that matches a single quote, for use in escaping.\n * @const {!RegExp}\n */\nconst SINGLE_QUOTE_RE = /'/g;\n\n/**\n * Regular expression that matches null character, for use in escaping.\n * @const {!RegExp}\n */\nconst NULL_RE = /\\x00/g;\n\n/**\n * Regular expression that matches any character that needs to be escaped.\n * @const {!RegExp}\n */\nconst ALL_RE = /[\\x00&<>\"']/;\n\n/**\n * Do escaping of whitespace to preserve spatial formatting. We use character\n * entity #160 to make it safer for xml.\n * @param {string} str The string in which to escape whitespace.\n * @param {boolean=} opt_xml Whether to use XML compatible tags.\n * @return {string} An escaped copy of `str`.\n * @see goog.string.whitespaceEscape\n */\nfunction whitespaceEscape(str, opt_xml) {\n  // This doesn't use goog.string.preserveSpaces for backwards compatibility.\n  return newLineToBr(str.replace(/  /g, ' &#160;'), opt_xml);\n}\n\n/**\n * Determines whether a string contains a substring.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n * @see goog.string.contains\n */\nfunction contains(str, subString) {\n  return str.indexOf(subString) != -1;\n}\n\n/**\n * Determines whether a string contains a substring, ignoring case.\n * @param {string} str The string to search.\n * @param {string} subString The substring to search for.\n * @return {boolean} Whether `str` contains `subString`.\n * @see goog.string.caseInsensitiveContains\n */\nfunction caseInsensitiveContains(str, subString) {\n  return contains(str.toLowerCase(), subString.toLowerCase());\n}\n\n/**\n * Compares two version numbers.\n *\n * @param {string|number} version1 Version of first item.\n * @param {string|number} version2 Version of second item.\n *\n * @return {number}  1 if `version1` is higher.\n *                   0 if arguments are equal.\n *                  -1 if `version2` is higher.\n * @see goog.string.compareVersions\n */\nfunction compareVersions(version1, version2) {\n  let order = 0;\n  // Trim leading and trailing whitespace and split the versions into\n  // subversions.\n  const v1Subs = trim(String(version1)).split('.');\n  const v2Subs = trim(String(version2)).split('.');\n  const subCount = Math.max(v1Subs.length, v2Subs.length);\n\n  // Iterate over the subversions, as long as they appear to be equivalent.\n  for (let subIdx = 0; order == 0 && subIdx < subCount; subIdx++) {\n    let v1Sub = v1Subs[subIdx] || '';\n    let v2Sub = v2Subs[subIdx] || '';\n\n    do {\n      // Split the subversions into pairs of numbers and qualifiers (like 'b').\n      // Two different RegExp objects are use to make it clear the code\n      // is side-effect free\n      const v1Comp = /(\\d*)(\\D*)(.*)/.exec(v1Sub) || ['', '', '', ''];\n      const v2Comp = /(\\d*)(\\D*)(.*)/.exec(v2Sub) || ['', '', '', ''];\n      // Break if there are no more matches.\n      if (v1Comp[0].length == 0 && v2Comp[0].length == 0) {\n        break;\n      }\n\n      // Parse the numeric part of the subversion. A missing number is\n      // equivalent to 0.\n      const v1CompNum = v1Comp[1].length == 0 ? 0 : parseInt(v1Comp[1], 10);\n      const v2CompNum = v2Comp[1].length == 0 ? 0 : parseInt(v2Comp[1], 10);\n\n      // Compare the subversion components. The number has the highest\n      // precedence. Next, if the numbers are equal, a subversion without any\n      // qualifier is always higher than a subversion with any qualifier. Next,\n      // the qualifiers are compared as strings.\n      order = compareElements(v1CompNum, v2CompNum) ||\n          compareElements(v1Comp[2].length == 0, v2Comp[2].length == 0) ||\n          compareElements(v1Comp[2], v2Comp[2]);\n      // Stop as soon as an inequality is discovered.\n\n      v1Sub = v1Comp[3];\n      v2Sub = v2Comp[3];\n    } while (order == 0);\n  }\n\n  return order;\n}\n\n/**\n * Compares elements of a version number.\n *\n * @param {string|number|boolean} left An element from a version number.\n * @param {string|number|boolean} right An element from a version number.\n *\n * @return {number}  1 if `left` is higher.\n *                   0 if arguments are equal.\n *                  -1 if `right` is higher.\n */\nfunction compareElements(left, right) {\n  if (left < right) {\n    return -1;\n  } else if (left > right) {\n    return 1;\n  }\n  return 0;\n}\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n\nexports = {\n  caseInsensitiveCompare,\n  caseInsensitiveContains,\n  caseInsensitiveEndsWith,\n  caseInsensitiveEquals,\n  caseInsensitiveStartsWith,\n  compareVersions,\n  contains,\n  endsWith,\n  htmlEscape,\n  isEmptyOrWhitespace,\n  newLineToBr,\n  startsWith,\n  trim,\n  whitespaceEscape,\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Closure user agent detection.\n * @see http://en.wikipedia.org/wiki/User_agent\n * For more information on browser brand, platform, or device see the other\n * sub-namespaces in goog.labs.userAgent (browser, platform, and device).\n */\n\ngoog.module('goog.labs.userAgent.engine');\ngoog.module.declareLegacyNamespace();\n\nconst googArray = goog.require('goog.array');\nconst googString = goog.require('goog.string.internal');\nconst util = goog.require('goog.labs.userAgent.util');\n\n/**\n * @return {boolean} Whether the rendering engine is Presto.\n */\nfunction isPresto() {\n  return util.matchUserAgent('Presto');\n}\n\n/**\n * @return {boolean} Whether the rendering engine is Trident.\n */\nfunction isTrident() {\n  // IE only started including the Trident token in IE8.\n  return util.matchUserAgent('Trident') || util.matchUserAgent('MSIE');\n}\n\n/**\n * @return {boolean} Whether the rendering engine is EdgeHTML.\n */\nfunction isEdge() {\n  return util.matchUserAgent('Edge');\n}\n\n/**\n * @return {boolean} Whether the rendering engine is WebKit. This will return\n * true for Chrome, Blink-based Opera (15+), Edge Chromium and Safari.\n */\nfunction isWebKit() {\n  return util.matchUserAgentIgnoreCase('WebKit') && !isEdge();\n}\n\n/**\n * @return {boolean} Whether the rendering engine is Gecko.\n */\nfunction isGecko() {\n  return util.matchUserAgent('Gecko') && !isWebKit() && !isTrident() &&\n      !isEdge();\n}\n\n/**\n * @return {string} The rendering engine's version or empty string if version\n *     can't be determined.\n */\nfunction getVersion() {\n  const userAgentString = util.getUserAgent();\n  if (userAgentString) {\n    const tuples = util.extractVersionTuples(userAgentString);\n\n    const engineTuple = getEngineTuple(tuples);\n    if (engineTuple) {\n      // In Gecko, the version string is either in the browser info or the\n      // Firefox version.  See Gecko user agent string reference:\n      // http://goo.gl/mULqa\n      if (engineTuple[0] == 'Gecko') {\n        return getVersionForKey(tuples, 'Firefox');\n      }\n\n      return engineTuple[1];\n    }\n\n    // MSIE has only one version identifier, and the Trident version is\n    // specified in the parenthetical. IE Edge is covered in the engine tuple\n    // detection.\n    const browserTuple = tuples[0];\n    let info;\n    if (browserTuple && (info = browserTuple[2])) {\n      const match = /Trident\\/([^\\s;]+)/.exec(info);\n      if (match) {\n        return match[1];\n      }\n    }\n  }\n  return '';\n}\n\n/**\n * @param {!Array<!Array<string>>} tuples Extracted version tuples.\n * @return {!Array<string>|undefined} The engine tuple or undefined if not\n *     found.\n */\nfunction getEngineTuple(tuples) {\n  if (!isEdge()) {\n    return tuples[1];\n  }\n  for (let i = 0; i < tuples.length; i++) {\n    const tuple = tuples[i];\n    if (tuple[0] == 'Edge') {\n      return tuple;\n    }\n  }\n}\n\n/**\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the rendering engine version is higher or the same\n *     as the given version.\n */\nfunction isVersionOrHigher(version) {\n  return googString.compareVersions(getVersion(), version) >= 0;\n}\n\n/**\n * @param {!Array<!Array<string>>} tuples Version tuples.\n * @param {string} key The key to look for.\n * @return {string} The version string of the given key, if present.\n *     Otherwise, the empty string.\n */\nfunction getVersionForKey(tuples, key) {\n  // TODO(nnaze): Move to util if useful elsewhere.\n\n  const pair = googArray.find(tuples, function(pair) {\n    return key == pair[0];\n  });\n\n  return pair && pair[1] || '';\n}\n\nexports = {\n  getVersion,\n  isEdge,\n  isGecko,\n  isPresto,\n  isTrident,\n  isVersionOrHigher,\n  isWebKit,\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities for manipulating the browser's Document Object Model\n * Inspiration taken *heavily* from mochikit (http://mochikit.com/).\n *\n * You can use {@link goog.dom.DomHelper} to create new dom helpers that refer\n * to a different document object.  This is useful if you are working with\n * frames or multiple windows.\n *\n * @suppress {strictMissingProperties}\n */\n\n\n// TODO(arv): Rename/refactor getTextContent and getRawTextContent. The problem\n// is that getTextContent should mimic the DOM3 textContent. We should add a\n// getInnerText (or getText) which tries to return the visible text, innerText.\n\n\ngoog.provide('goog.dom');\n\ngoog.require('goog.array');\ngoog.require('goog.asserts');\ngoog.require('goog.asserts.dom');\ngoog.require('goog.dom.NodeType');\ngoog.require('goog.dom.TagName');\ngoog.require('goog.math.Coordinate');\ngoog.require('goog.math.Size');\ngoog.require('goog.object');\ngoog.require('goog.string');\ngoog.require('goog.string.Const');\ngoog.require('goog.userAgent');\ngoog.require('safevalues');\ngoog.require('safevalues.dom');\ngoog.require('safevalues.restricted.reviewed');\n\n\n/**\n * @define {boolean} Whether we know at compile time that the browser is in\n * quirks mode.\n */\ngoog.dom.ASSUME_QUIRKS_MODE = goog.define('goog.dom.ASSUME_QUIRKS_MODE', false);\n\n\n/**\n * @define {boolean} Whether we know at compile time that the browser is in\n * standards compliance mode.\n */\ngoog.dom.ASSUME_STANDARDS_MODE =\n    goog.define('goog.dom.ASSUME_STANDARDS_MODE', false);\n\n\n/**\n * Whether we know the compatibility mode at compile time.\n * @type {boolean}\n * @private\n */\ngoog.dom.COMPAT_MODE_KNOWN_ =\n    goog.dom.ASSUME_QUIRKS_MODE || goog.dom.ASSUME_STANDARDS_MODE;\n\n\n/**\n * Gets the DomHelper object for the document where the element resides.\n * @param {(Node|Window)=} opt_element If present, gets the DomHelper for this\n *     element.\n * @return {!goog.dom.DomHelper} The DomHelper.\n */\ngoog.dom.getDomHelper = function(opt_element) {\n  'use strict';\n  return opt_element ?\n      new goog.dom.DomHelper(goog.dom.getOwnerDocument(opt_element)) :\n      (goog.dom.defaultDomHelper_ ||\n       (goog.dom.defaultDomHelper_ = new goog.dom.DomHelper()));\n};\n\n\n/**\n * Cached default DOM helper.\n * @type {!goog.dom.DomHelper|undefined}\n * @private\n */\ngoog.dom.defaultDomHelper_;\n\n\n/**\n * Gets the document object being used by the dom library.\n * @return {!Document} Document object.\n */\ngoog.dom.getDocument = function() {\n  'use strict';\n  return document;\n};\n\n\n/**\n * Gets an element from the current document by element id.\n *\n * If an Element is passed in, it is returned.\n *\n * @param {string|Element} element Element ID or a DOM node.\n * @return {Element} The element with the given ID, or the node passed in.\n */\ngoog.dom.getElement = function(element) {\n  'use strict';\n  return goog.dom.getElementHelper_(document, element);\n};\n\n\n/**\n * Gets an HTML element from the current document by element id.\n *\n * @param {string} id\n * @return {?HTMLElement} The element with the given ID or null if no such\n *     element exists.\n */\ngoog.dom.getHTMLElement = function(id) {\n  'use strict'\n  const element = goog.dom.getElement(id);\n  if (!element) {\n    return null;\n  }\n  return goog.asserts.dom.assertIsHtmlElement(element);\n};\n\n\n/**\n * Gets an element by id from the given document (if present).\n * If an element is given, it is returned.\n * @param {!Document} doc\n * @param {string|Element} element Element ID or a DOM node.\n * @return {Element} The resulting element.\n * @private\n */\ngoog.dom.getElementHelper_ = function(doc, element) {\n  'use strict';\n  return typeof element === 'string' ? doc.getElementById(element) : element;\n};\n\n\n/**\n * Gets an element by id, asserting that the element is found.\n *\n * This is used when an element is expected to exist, and should fail with\n * an assertion error if it does not (if assertions are enabled).\n *\n * @param {string} id Element ID.\n * @return {!Element} The element with the given ID, if it exists.\n */\ngoog.dom.getRequiredElement = function(id) {\n  'use strict';\n  return goog.dom.getRequiredElementHelper_(document, id);\n};\n\n\n/**\n * Gets an HTML element by id, asserting that the element is found.\n *\n * This is used when an element is expected to exist, and should fail with\n * an assertion error if it does not (if assertions are enabled).\n *\n * @param {string} id Element ID.\n * @return {!HTMLElement} The element with the given ID, if it exists.\n */\ngoog.dom.getRequiredHTMLElement = function(id) {\n  'use strict'\n  return goog.asserts.dom.assertIsHtmlElement(\n      goog.dom.getRequiredElementHelper_(document, id));\n};\n\n\n/**\n * Helper function for getRequiredElementHelper functions, both static and\n * on DomHelper.  Asserts the element with the given id exists.\n * @param {!Document} doc\n * @param {string} id\n * @return {!Element} The element with the given ID, if it exists.\n * @private\n */\ngoog.dom.getRequiredElementHelper_ = function(doc, id) {\n  'use strict';\n  // To prevent users passing in Elements as is permitted in getElement().\n  goog.asserts.assertString(id);\n  const element = goog.dom.getElementHelper_(doc, id);\n  return goog.asserts.assert(element, 'No element found with id: ' + id);\n};\n\n\n/**\n * Alias for getElement.\n * @param {string|Element} element Element ID or a DOM node.\n * @return {Element} The element with the given ID, or the node passed in.\n * @deprecated Use {@link goog.dom.getElement} instead.\n */\ngoog.dom.$ = goog.dom.getElement;\n\n\n/**\n * Gets elements by tag name.\n * @param {!goog.dom.TagName<T>} tagName\n * @param {(!Document|!Element)=} opt_parent Parent element or document where to\n *     look for elements. Defaults to document.\n * @return {!NodeList<R>} List of elements. The members of the list are\n *     {!Element} if tagName is not a member of goog.dom.TagName or more\n *     specific types if it is (e.g. {!HTMLAnchorElement} for\n *     goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.getElementsByTagName = function(tagName, opt_parent) {\n  'use strict';\n  const parent = opt_parent || document;\n  return parent.getElementsByTagName(String(tagName));\n};\n\n\n/**\n * Looks up elements by both tag and class name, using browser native functions\n * (`querySelectorAll`, `getElementsByTagName` or\n * `getElementsByClassName`) where possible. This function\n * is a useful, if limited, way of collecting a list of DOM elements\n * with certain characteristics.  `querySelectorAll` offers a\n * more powerful and general solution which allows matching on CSS3\n * selector expressions.\n *\n * Note that tag names are case sensitive in the SVG namespace, and this\n * function converts opt_tag to uppercase for comparisons. For queries in the\n * SVG namespace you should use querySelector or querySelectorAll instead.\n * https://bugzilla.mozilla.org/show_bug.cgi?id=963870\n * https://bugs.webkit.org/show_bug.cgi?id=83438\n *\n * @see {https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll}\n *\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name.\n * @param {?string=} opt_class Optional class name.\n * @param {(Document|Element)=} opt_el Optional element to look in.\n * @return {!IArrayLike<R>} Array-like list of elements (only a length property\n *     and numerical indices are guaranteed to exist). The members of the array\n *     are {!Element} if opt_tag is not a member of goog.dom.TagName or more\n *     specific types if it is (e.g. {!HTMLAnchorElement} for\n *     goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.getElementsByTagNameAndClass = function(opt_tag, opt_class, opt_el) {\n  'use strict';\n  return goog.dom.getElementsByTagNameAndClass_(\n      document, opt_tag, opt_class, opt_el);\n};\n\n\n/**\n * Gets the first element matching the tag and the class.\n *\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name.\n * @param {?string=} opt_class Optional class name.\n * @param {(Document|Element)=} opt_el Optional element to look in.\n * @return {?R} Reference to a DOM node. The return type is {?Element} if\n *     tagName is a string or a more specific type if it is a member of\n *     goog.dom.TagName (e.g. {?HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.getElementByTagNameAndClass = function(opt_tag, opt_class, opt_el) {\n  'use strict';\n  return goog.dom.getElementByTagNameAndClass_(\n      document, opt_tag, opt_class, opt_el);\n};\n\n\n/**\n * Returns a static, array-like list of the elements with the provided\n * className.\n *\n * @param {string} className the name of the class to look for.\n * @param {(Document|Element)=} opt_el Optional element to look in.\n * @return {!IArrayLike<!Element>} The items found with the class name provided.\n */\ngoog.dom.getElementsByClass = function(className, opt_el) {\n  'use strict';\n  return (opt_el || document).querySelectorAll('.' + className);\n};\n\n\n/**\n * Returns the first element with the provided className.\n *\n * @param {string} className the name of the class to look for.\n * @param {Element|Document=} opt_el Optional element to look in.\n * @return {Element} The first item with the class name provided.\n */\ngoog.dom.getElementByClass = function(className, opt_el) {\n  'use strict';\n  const parent = opt_el || document;\n  let retVal = null;\n  if (parent.getElementsByClassName) {\n    retVal = parent.getElementsByClassName(className)[0];\n  } else {\n    retVal =\n        goog.dom.getElementByTagNameAndClass_(document, '*', className, opt_el);\n  }\n  return retVal || null;\n};\n\n\n/**\n * Returns the first element with the provided className and asserts that it is\n * an HTML element.\n *\n * @param {string} className the name of the class to look for.\n * @param {!Element|!Document=} opt_parent Optional element to look in.\n * @return {?HTMLElement} The first item with the class name provided.\n */\ngoog.dom.getHTMLElementByClass = function(className, opt_parent) {\n  'use strict'\n  const element = goog.dom.getElementByClass(className, opt_parent);\n  if (!element) {\n    return null;\n  }\n  return goog.asserts.dom.assertIsHtmlElement(element);\n};\n\n\n/**\n * Ensures an element with the given className exists, and then returns the\n * first element with the provided className.\n *\n * @param {string} className the name of the class to look for.\n * @param {!Element|!Document=} opt_root Optional element or document to look\n *     in.\n * @return {!Element} The first item with the class name provided.\n * @throws {goog.asserts.AssertionError} Thrown if no element is found.\n */\ngoog.dom.getRequiredElementByClass = function(className, opt_root) {\n  'use strict';\n  const retValue = goog.dom.getElementByClass(className, opt_root);\n  return goog.asserts.assert(\n      retValue, 'No element found with className: ' + className);\n};\n\n\n/**\n * Ensures an element with the given className exists, and then returns the\n * first element with the provided className after asserting that it is an\n * HTML element.\n *\n * @param {string} className the name of the class to look for.\n * @param {!Element|!Document=} opt_parent Optional element or document to look\n *     in.\n * @return {!HTMLElement} The first item with the class name provided.\n */\ngoog.dom.getRequiredHTMLElementByClass = function(className, opt_parent) {\n  'use strict'\n  const retValue = goog.dom.getElementByClass(className, opt_parent);\n  goog.asserts.assert(\n      retValue, 'No HTMLElement found with className: ' + className);\n  return goog.asserts.dom.assertIsHtmlElement(retValue);\n};\n\n\n/**\n * Helper for `getElementsByTagNameAndClass`.\n * @param {!Document} doc The document to get the elements in.\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name.\n * @param {?string=} opt_class Optional class name.\n * @param {(Document|Element)=} opt_el Optional element to look in.\n * @return {!IArrayLike<R>} Array-like list of elements (only a length property\n *     and numerical indices are guaranteed to exist). The members of the array\n *     are {!Element} if opt_tag is not a member of goog.dom.TagName or more\n *     specific types if it is (e.g. {!HTMLAnchorElement} for\n *     goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n * @private\n */\ngoog.dom.getElementsByTagNameAndClass_ = function(\n    doc, opt_tag, opt_class, opt_el) {\n  'use strict';\n  const parent = opt_el || doc;\n  const tagName =\n      (opt_tag && opt_tag != '*') ? String(opt_tag).toUpperCase() : '';\n\n  if (tagName || opt_class) {\n    const query = tagName + (opt_class ? '.' + opt_class : '');\n    return parent.querySelectorAll(query);\n  }\n\n  return parent.getElementsByTagName('*');\n};\n\n\n/**\n * Helper for goog.dom.getElementByTagNameAndClass.\n *\n * @param {!Document} doc The document to get the elements in.\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name.\n * @param {?string=} opt_class Optional class name.\n * @param {(Document|Element)=} opt_el Optional element to look in.\n * @return {?R} Reference to a DOM node. The return type is {?Element} if\n *     tagName is a string or a more specific type if it is a member of\n *     goog.dom.TagName (e.g. {?HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n * @private\n */\ngoog.dom.getElementByTagNameAndClass_ = function(\n    doc, opt_tag, opt_class, opt_el) {\n  'use strict';\n  const parent = opt_el || doc;\n  const tag = (opt_tag && opt_tag != '*') ? String(opt_tag).toUpperCase() : '';\n  if (tag || opt_class) {\n    return parent.querySelector(tag + (opt_class ? '.' + opt_class : ''));\n  }\n  const elements =\n      goog.dom.getElementsByTagNameAndClass_(doc, opt_tag, opt_class, opt_el);\n  return elements[0] || null;\n};\n\n\n\n/**\n * Alias for `getElementsByTagNameAndClass`.\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name.\n * @param {?string=} opt_class Optional class name.\n * @param {Element=} opt_el Optional element to look in.\n * @return {!IArrayLike<R>} Array-like list of elements (only a length property\n *     and numerical indices are guaranteed to exist). The members of the array\n *     are {!Element} if opt_tag is not a member of goog.dom.TagName or more\n *     specific types if it is (e.g. {!HTMLAnchorElement} for\n *     goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n * @deprecated Use {@link goog.dom.getElementsByTagNameAndClass} instead.\n */\ngoog.dom.$$ = goog.dom.getElementsByTagNameAndClass;\n\n\n/**\n * Sets multiple properties, and sometimes attributes, on an element. Note that\n * properties are simply object properties on the element instance, while\n * attributes are visible in the DOM. Many properties map to attributes with the\n * same names, some with different names, and there are also unmappable cases.\n *\n * This method sets properties by default (which means that custom attributes\n * are not supported). These are the exeptions (some of which is legacy):\n * - \"style\": Even though this is an attribute name, it is translated to a\n *   property, \"style.cssText\". Note that this property sanitizes and formats\n *   its value, unlike the attribute.\n * - \"class\": This is an attribute name, it is translated to the \"className\"\n *   property.\n * - \"for\": This is an attribute name, it is translated to the \"htmlFor\"\n *   property.\n * - Entries in {@see goog.dom.DIRECT_ATTRIBUTE_MAP_} are set as attributes,\n *   this is probably due to browser quirks.\n * - \"aria-*\", \"data-*\": Always set as attributes, they have no property\n *   counterparts.\n *\n * @param {Element} element DOM node to set properties on.\n * @param {Object} properties Hash of property:value pairs.\n *     Property values can be strings or closure/html values (such as\n *     goog.html.SafeUrl).\n */\ngoog.dom.setProperties = function(element, properties) {\n  'use strict';\n  goog.object.forEach(properties, function(val, key) {\n    'use strict';\n    if (key == 'style') {\n      element.style.cssText = val;\n    } else if (key == 'class') {\n      element.className = val;\n    } else if (key == 'for') {\n      element.htmlFor = val;\n    } else if (goog.dom.DIRECT_ATTRIBUTE_MAP_.hasOwnProperty(key)) {\n      element.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[key], val);\n    } else if (\n        goog.string.startsWith(key, 'aria-') ||\n        goog.string.startsWith(key, 'data-')) {\n      element.setAttribute(key, val);\n    } else {\n      element[key] = val;\n    }\n  });\n};\n\n\n/**\n * Map of attributes that should be set using\n * element.setAttribute(key, val) instead of element[key] = val.  Used\n * by goog.dom.setProperties.\n *\n * @private {!Object<string, string>}\n * @const\n */\ngoog.dom.DIRECT_ATTRIBUTE_MAP_ = {\n  'cellpadding': 'cellPadding',\n  'cellspacing': 'cellSpacing',\n  'colspan': 'colSpan',\n  'frameborder': 'frameBorder',\n  'height': 'height',\n  'maxlength': 'maxLength',\n  'nonce': 'nonce',\n  'role': 'role',\n  'rowspan': 'rowSpan',\n  'type': 'type',\n  'usemap': 'useMap',\n  'valign': 'vAlign',\n  'width': 'width'\n};\n\n\n/**\n * Gets the dimensions of the viewport.\n *\n * Gecko Standards mode:\n * docEl.clientWidth  Width of viewport excluding scrollbar.\n * win.innerWidth     Width of viewport including scrollbar.\n * body.clientWidth   Width of body element.\n *\n * docEl.clientHeight Height of viewport excluding scrollbar.\n * win.innerHeight    Height of viewport including scrollbar.\n * body.clientHeight  Height of document.\n *\n * Gecko Backwards compatible mode:\n * docEl.clientWidth  Width of viewport excluding scrollbar.\n * win.innerWidth     Width of viewport including scrollbar.\n * body.clientWidth   Width of viewport excluding scrollbar.\n *\n * docEl.clientHeight Height of document.\n * win.innerHeight    Height of viewport including scrollbar.\n * body.clientHeight  Height of viewport excluding scrollbar.\n *\n * IE6/7 Standards mode:\n * docEl.clientWidth  Width of viewport excluding scrollbar.\n * win.innerWidth     Undefined.\n * body.clientWidth   Width of body element.\n *\n * docEl.clientHeight Height of viewport excluding scrollbar.\n * win.innerHeight    Undefined.\n * body.clientHeight  Height of document element.\n *\n * IE5 + IE6/7 Backwards compatible mode:\n * docEl.clientWidth  0.\n * win.innerWidth     Undefined.\n * body.clientWidth   Width of viewport excluding scrollbar.\n *\n * docEl.clientHeight 0.\n * win.innerHeight    Undefined.\n * body.clientHeight  Height of viewport excluding scrollbar.\n *\n * Opera 9 Standards and backwards compatible mode:\n * docEl.clientWidth  Width of viewport excluding scrollbar.\n * win.innerWidth     Width of viewport including scrollbar.\n * body.clientWidth   Width of viewport excluding scrollbar.\n *\n * docEl.clientHeight Height of document.\n * win.innerHeight    Height of viewport including scrollbar.\n * body.clientHeight  Height of viewport excluding scrollbar.\n *\n * WebKit:\n * Safari 2\n * docEl.clientHeight Same as scrollHeight.\n * docEl.clientWidth  Same as innerWidth.\n * win.innerWidth     Width of viewport excluding scrollbar.\n * win.innerHeight    Height of the viewport including scrollbar.\n * frame.innerHeight  Height of the viewport excluding scrollbar.\n *\n * Safari 3 (tested in 522)\n *\n * docEl.clientWidth  Width of viewport excluding scrollbar.\n * docEl.clientHeight Height of viewport excluding scrollbar in strict mode.\n * body.clientHeight  Height of viewport excluding scrollbar in quirks mode.\n *\n * @param {Window=} opt_window Optional window element to test.\n * @return {!goog.math.Size} Object with values 'width' and 'height'.\n */\ngoog.dom.getViewportSize = function(opt_window) {\n  'use strict';\n  // TODO(arv): This should not take an argument\n  return goog.dom.getViewportSize_(opt_window || window);\n};\n\n\n/**\n * Helper for `getViewportSize`.\n * @param {Window} win The window to get the view port size for.\n * @return {!goog.math.Size} Object with values 'width' and 'height'.\n * @private\n */\ngoog.dom.getViewportSize_ = function(win) {\n  'use strict';\n  const doc = win.document;\n  const el = goog.dom.isCss1CompatMode_(doc) ? doc.documentElement : doc.body;\n  return new goog.math.Size(el.clientWidth, el.clientHeight);\n};\n\n\n/**\n * Calculates the height of the document.\n *\n * @return {number} The height of the current document.\n */\ngoog.dom.getDocumentHeight = function() {\n  'use strict';\n  return goog.dom.getDocumentHeight_(window);\n};\n\n/**\n * Calculates the height of the document of the given window.\n *\n * @param {!Window} win The window whose document height to retrieve.\n * @return {number} The height of the document of the given window.\n */\ngoog.dom.getDocumentHeightForWindow = function(win) {\n  'use strict';\n  return goog.dom.getDocumentHeight_(win);\n};\n\n/**\n * Calculates the height of the document of the given window.\n *\n * Function code copied from the opensocial gadget api:\n *   gadgets.window.adjustHeight(opt_height)\n *\n * @private\n * @param {!Window} win The window whose document height to retrieve.\n * @return {number} The height of the document of the given window.\n */\ngoog.dom.getDocumentHeight_ = function(win) {\n  'use strict';\n  // NOTE(eae): This method will return the window size rather than the document\n  // size in webkit quirks mode.\n  const doc = win.document;\n  let height = 0;\n\n  if (doc) {\n    // Calculating inner content height is hard and different between\n    // browsers rendering in Strict vs. Quirks mode.  We use a combination of\n    // three properties within document.body and document.documentElement:\n    // - scrollHeight\n    // - offsetHeight\n    // - clientHeight\n    // These values differ significantly between browsers and rendering modes.\n    // But there are patterns.  It just takes a lot of time and persistence\n    // to figure out.\n\n    const body = doc.body;\n    const docEl = /** @type {!HTMLElement} */ (doc.documentElement);\n    if (!(docEl && body)) {\n      return 0;\n    }\n\n    // Get the height of the viewport\n    const vh = goog.dom.getViewportSize_(win).height;\n    if (goog.dom.isCss1CompatMode_(doc) && docEl.scrollHeight) {\n      // In Strict mode:\n      // The inner content height is contained in either:\n      //    document.documentElement.scrollHeight\n      //    document.documentElement.offsetHeight\n      // Based on studying the values output by different browsers,\n      // use the value that's NOT equal to the viewport height found above.\n      height =\n          docEl.scrollHeight != vh ? docEl.scrollHeight : docEl.offsetHeight;\n    } else {\n      // In Quirks mode:\n      // documentElement.clientHeight is equal to documentElement.offsetHeight\n      // except in IE.  In most browsers, document.documentElement can be used\n      // to calculate the inner content height.\n      // However, in other browsers (e.g. IE), document.body must be used\n      // instead.  How do we know which one to use?\n      // If document.documentElement.clientHeight does NOT equal\n      // document.documentElement.offsetHeight, then use document.body.\n      let sh = docEl.scrollHeight;\n      let oh = docEl.offsetHeight;\n      if (docEl.clientHeight != oh) {\n        sh = body.scrollHeight;\n        oh = body.offsetHeight;\n      }\n\n      // Detect whether the inner content height is bigger or smaller\n      // than the bounding box (viewport).  If bigger, take the larger\n      // value.  If smaller, take the smaller value.\n      if (sh > vh) {\n        // Content is larger\n        height = sh > oh ? sh : oh;\n      } else {\n        // Content is smaller\n        height = sh < oh ? sh : oh;\n      }\n    }\n  }\n\n  return height;\n};\n\n\n/**\n * Gets the page scroll distance as a coordinate object.\n *\n * @param {Window=} opt_window Optional window element to test.\n * @return {!goog.math.Coordinate} Object with values 'x' and 'y'.\n * @deprecated Use {@link goog.dom.getDocumentScroll} instead.\n */\ngoog.dom.getPageScroll = function(opt_window) {\n  'use strict';\n  const win = opt_window || goog.global || window;\n  return goog.dom.getDomHelper(win.document).getDocumentScroll();\n};\n\n\n/**\n * Gets the document scroll distance as a coordinate object.\n *\n * @return {!goog.math.Coordinate} Object with values 'x' and 'y'.\n */\ngoog.dom.getDocumentScroll = function() {\n  'use strict';\n  return goog.dom.getDocumentScroll_(document);\n};\n\n\n/**\n * Helper for `getDocumentScroll`.\n *\n * @param {!Document} doc The document to get the scroll for.\n * @return {!goog.math.Coordinate} Object with values 'x' and 'y'.\n * @private\n */\ngoog.dom.getDocumentScroll_ = function(doc) {\n  'use strict';\n  const el = goog.dom.getDocumentScrollElement_(doc);\n  const win = goog.dom.getWindow_(doc);\n  return new goog.math.Coordinate(\n      win?.pageXOffset || el.scrollLeft, win?.pageYOffset || el.scrollTop);\n};\n\n\n/**\n * Gets the document scroll element.\n * @return {!Element} Scrolling element.\n */\ngoog.dom.getDocumentScrollElement = function() {\n  'use strict';\n  return goog.dom.getDocumentScrollElement_(document);\n};\n\n\n/**\n * Helper for `getDocumentScrollElement`.\n * @param {!Document} doc The document to get the scroll element for.\n * @return {!Element} Scrolling element.\n * @private\n */\ngoog.dom.getDocumentScrollElement_ = function(doc) {\n  'use strict';\n  // Old WebKit needs body.scrollLeft in both quirks mode and strict mode. We\n  // also default to the documentElement if the document does not have a body\n  // (e.g. a SVG document).\n  // Uses http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement to\n  // avoid trying to guess about browser behavior from the UA string.\n  if (doc.scrollingElement) {\n    return doc.scrollingElement;\n  }\n  if (!goog.userAgent.WEBKIT && goog.dom.isCss1CompatMode_(doc)) {\n    return doc.documentElement;\n  }\n  return doc.body || doc.documentElement;\n};\n\n\n/**\n * Gets the window object associated with the given document.\n *\n * @param {Document=} opt_doc  Document object to get window for.\n * @return {!Window} The window associated with the given document.\n */\ngoog.dom.getWindow = function(opt_doc) {\n  'use strict';\n  // TODO(arv): This should not take an argument.\n  return opt_doc ? goog.dom.getWindow_(opt_doc) : window;\n};\n\n\n/**\n * Helper for `getWindow`.\n *\n * @param {!Document} doc  Document object to get window for.\n * @return {!Window} The window associated with the given document.\n * @private\n */\ngoog.dom.getWindow_ = function(doc) {\n  'use strict';\n  return /** @type {!Window} */ (doc.defaultView);\n};\n\n\n/**\n * Returns a dom node with a set of attributes.  This function accepts varargs\n * for subsequent nodes to be added.  Subsequent nodes will be added to the\n * first node as childNodes.\n *\n * So:\n * <code>createDom(goog.dom.TagName.DIV, null, createDom(goog.dom.TagName.P),\n * createDom(goog.dom.TagName.P));</code> would return a div with two child\n * paragraphs\n *\n * This function uses {@link goog.dom.setProperties} to set attributes: the\n * `opt_attributes` parameter follows the same rules.\n *\n * @param {string|!goog.dom.TagName<T>} tagName Tag to create.\n * @param {?Object|?Array<string>|string=} opt_attributes If object, then a map\n *     of name-value pairs for attributes. If a string, then this is the\n *     className of the new element. If an array, the elements will be joined\n *     together as the className of the new element.\n * @param {...(Object|string|Array|NodeList|null|undefined)} var_args Further\n *     DOM nodes or strings for text nodes. If one of the var_args is an array\n *     or NodeList, its elements will be added as childNodes instead.\n * @return {R} Reference to a DOM node. The return type is {!Element} if tagName\n *     is a string or a more specific type if it is a member of\n *     goog.dom.TagName (e.g. {!HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.createDom = function(tagName, opt_attributes, var_args) {\n  'use strict';\n  return goog.dom.createDom_(document, arguments);\n};\n\n\n/**\n * Helper for `createDom`.\n * @param {!Document} doc The document to create the DOM in.\n * @param {!Arguments} args Argument object passed from the callers. See\n *     `goog.dom.createDom` for details.\n * @return {!Element} Reference to a DOM node.\n * @private\n */\ngoog.dom.createDom_ = function(doc, args) {\n  'use strict';\n  const tagName = String(args[0]);\n  const attributes = args[1];\n\n  const element = goog.dom.createElement_(doc, tagName);\n\n  if (attributes) {\n    if (typeof attributes === 'string') {\n      element.className = attributes;\n    } else if (Array.isArray(attributes)) {\n      element.className = attributes.join(' ');\n    } else {\n      goog.dom.setProperties(element, attributes);\n    }\n  }\n\n  if (args.length > 2) {\n    goog.dom.append_(doc, element, args, 2);\n  }\n\n  return element;\n};\n\n\n/**\n * Appends a node with text or other nodes.\n * @param {!Document} doc The document to create new nodes in.\n * @param {!Node} parent The node to append nodes to.\n * @param {!Arguments} args The values to add. See `goog.dom.append`.\n * @param {number} startIndex The index of the array to start from.\n * @private\n */\ngoog.dom.append_ = function(doc, parent, args, startIndex) {\n  'use strict';\n  function childHandler(child) {\n    // TODO(pupius): More coercion, ala MochiKit?\n    if (child) {\n      parent.appendChild(\n          typeof child === 'string' ? doc.createTextNode(child) : child);\n    }\n  }\n\n  for (let i = startIndex; i < args.length; i++) {\n    const arg = args[i];\n    // TODO(attila): Fix isArrayLike to return false for a text node.\n    if (goog.isArrayLike(arg) && !goog.dom.isNodeLike(arg)) {\n      // If the argument is a node list, not a real array, use a clone,\n      // because forEach can't be used to mutate a NodeList.\n      goog.array.forEach(\n          goog.dom.isNodeList(arg) ? goog.array.toArray(arg) : arg,\n          childHandler);\n    } else {\n      childHandler(arg);\n    }\n  }\n};\n\n\n/**\n * Alias for `createDom`.\n * @param {string|!goog.dom.TagName<T>} tagName Tag to create.\n * @param {?Object|?Array<string>|string=} opt_attributes If object, then a map\n *     of name-value pairs for attributes. If a string, then this is the\n *     className of the new element. If an array, the elements will be joined\n *     together as the className of the new element.\n * @param {...(Object|string|Array|NodeList|null|undefined)} var_args Further\n *     DOM nodes or strings for text nodes. If one of the var_args is an array,\n *     its children will be added as childNodes instead.\n * @return {R} Reference to a DOM node. The return type is {!Element} if tagName\n *     is a string or a more specific type if it is a member of\n *     goog.dom.TagName (e.g. {!HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n * @deprecated Use {@link goog.dom.createDom} instead.\n */\ngoog.dom.$dom = goog.dom.createDom;\n\n\n/**\n * Creates a new element.\n * @param {string|!goog.dom.TagName<T>} name Tag to create.\n * @return {R} The new element. The return type is {!Element} if name is\n *     a string or a more specific type if it is a member of goog.dom.TagName\n *     (e.g. {!HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.createElement = function(name) {\n  'use strict';\n  return goog.dom.createElement_(document, name);\n};\n\n\n/**\n * Creates a new element.\n * @param {!Document} doc The document to create the element in.\n * @param {string|!goog.dom.TagName<T>} name Tag to create.\n * @return {R} The new element. The return type is {!Element} if name is\n *     a string or a more specific type if it is a member of goog.dom.TagName\n *     (e.g. {!HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n * @private\n */\ngoog.dom.createElement_ = function(doc, name) {\n  'use strict';\n  name = String(name);\n  if (doc.contentType === 'application/xhtml+xml') name = name.toLowerCase();\n  return doc.createElement(name);\n};\n\n\n/**\n * Creates a new text node.\n * @param {number|string} content Content.\n * @return {!Text} The new text node.\n */\ngoog.dom.createTextNode = function(content) {\n  'use strict';\n  return document.createTextNode(String(content));\n};\n\n\n/**\n * Create a table.\n * @param {number} rows The number of rows in the table.  Must be >= 1.\n * @param {number} columns The number of columns in the table.  Must be >= 1.\n * @param {boolean=} opt_fillWithNbsp If true, fills table entries with\n *     `goog.string.Unicode.NBSP` characters.\n * @return {!Element} The created table.\n */\ngoog.dom.createTable = function(rows, columns, opt_fillWithNbsp) {\n  'use strict';\n  // TODO(mlourenco): Return HTMLTableElement, also in prototype function.\n  // Callers need to be updated to e.g. not assign numbers to table.cellSpacing.\n  return goog.dom.createTable_(document, rows, columns, !!opt_fillWithNbsp);\n};\n\n\n/**\n * Create a table.\n * @param {!Document} doc Document object to use to create the table.\n * @param {number} rows The number of rows in the table.  Must be >= 1.\n * @param {number} columns The number of columns in the table.  Must be >= 1.\n * @param {boolean} fillWithNbsp If true, fills table entries with\n *     `goog.string.Unicode.NBSP` characters.\n * @return {!HTMLTableElement} The created table.\n * @private\n */\ngoog.dom.createTable_ = function(doc, rows, columns, fillWithNbsp) {\n  'use strict';\n  const table = goog.dom.createElement_(doc, goog.dom.TagName.TABLE);\n  const tbody =\n      table.appendChild(goog.dom.createElement_(doc, goog.dom.TagName.TBODY));\n  for (let i = 0; i < rows; i++) {\n    const tr = goog.dom.createElement_(doc, goog.dom.TagName.TR);\n    for (let j = 0; j < columns; j++) {\n      const td = goog.dom.createElement_(doc, goog.dom.TagName.TD);\n      // IE <= 9 will create a text node if we set text content to the empty\n      // string, so we avoid doing it unless necessary. This ensures that the\n      // same DOM tree is returned on all browsers.\n      if (fillWithNbsp) {\n        goog.dom.setTextContent(td, goog.string.Unicode.NBSP);\n      }\n      tr.appendChild(td);\n    }\n    tbody.appendChild(tr);\n  }\n  return table;\n};\n\n\n\n/**\n * Creates a new Node from constant strings of HTML markup.\n * @param {...!goog.string.Const} var_args The HTML strings to concatenate then\n *     convert into a node.\n * @return {!Node}\n */\ngoog.dom.constHtmlToNode = function(var_args) {\n  'use strict';\n  const stringArray =\n      Array.prototype.map.call(arguments, goog.string.Const.unwrap);\n  let safeHtml =\n      safevalues.restricted.reviewed.htmlSafeByReview(stringArray.join(''), {\n        justification: 'Constant HTML string, that gets turned into a ' +\n            'Node later, so it will be automatically balanced.'\n      });\n  return goog.dom.safeHtmlToNode(safeHtml);\n};\n\n\n/**\n * Converts HTML markup into a node. This is a safe version of\n * `goog.dom.htmlToDocumentFragment` which is now deleted.\n * @param {!safevalues.SafeHtml} html The HTML markup to convert.\n * @return {!Node} The resulting node.\n */\ngoog.dom.safeHtmlToNode = function(html) {\n  'use strict';\n  return goog.dom.safeHtmlToNode_(document, html);\n};\n\n\n/**\n * Helper for `safeHtmlToNode`.\n * @param {!Document} doc The document.\n * @param {!safevalues.SafeHtml} html The HTML markup to convert.\n * @return {!Node} The resulting node.\n * @private\n */\ngoog.dom.safeHtmlToNode_ = function(doc, html) {\n  'use strict';\n  const tempDiv = goog.dom.createElement_(doc, goog.dom.TagName.DIV);\n  safevalues.dom.setElementInnerHtml(tempDiv, html);\n  return goog.dom.childrenToNode_(doc, tempDiv);\n};\n\n\n/**\n * Helper for `safeHtmlToNode_`.\n * @param {!Document} doc The document.\n * @param {!Node} tempDiv The input node.\n * @return {!Node} The resulting node.\n * @private\n */\ngoog.dom.childrenToNode_ = function(doc, tempDiv) {\n  'use strict';\n  if (tempDiv.childNodes.length == 1) {\n    return tempDiv.removeChild(goog.asserts.assert(tempDiv.firstChild));\n  } else {\n    const fragment = doc.createDocumentFragment();\n    while (tempDiv.firstChild) {\n      fragment.appendChild(tempDiv.firstChild);\n    }\n    return fragment;\n  }\n};\n\n\n/**\n * Returns true if the browser is in \"CSS1-compatible\" (standards-compliant)\n * mode, false otherwise.\n * @return {boolean} True if in CSS1-compatible mode.\n */\ngoog.dom.isCss1CompatMode = function() {\n  'use strict';\n  return goog.dom.isCss1CompatMode_(document);\n};\n\n\n/**\n * Returns true if the browser is in \"CSS1-compatible\" (standards-compliant)\n * mode, false otherwise.\n * @param {!Document} doc The document to check.\n * @return {boolean} True if in CSS1-compatible mode.\n * @private\n */\ngoog.dom.isCss1CompatMode_ = function(doc) {\n  'use strict';\n  if (goog.dom.COMPAT_MODE_KNOWN_) {\n    return goog.dom.ASSUME_STANDARDS_MODE;\n  }\n\n  return doc.compatMode == 'CSS1Compat';\n};\n\n\n/**\n * Determines if the given node can contain children, intended to be used for\n * HTML generation.\n *\n * IE natively supports node.canHaveChildren but has inconsistent behavior.\n * Prior to IE8 the base tag allows children and in IE9 all nodes return true\n * for canHaveChildren.\n *\n * In practice all non-IE browsers allow you to add children to any node, but\n * the behavior is inconsistent:\n *\n * <pre>\n *   var a = goog.dom.createElement(goog.dom.TagName.BR);\n *   a.appendChild(document.createTextNode('foo'));\n *   a.appendChild(document.createTextNode('bar'));\n *   console.log(a.childNodes.length);  // 2\n *   console.log(a.innerHTML);  // Chrome: \"\", IE9: \"foobar\", FF3.5: \"foobar\"\n * </pre>\n *\n * For more information, see:\n * http://dev.w3.org/html5/markup/syntax.html#syntax-elements\n *\n * TODO(pupius): Rename shouldAllowChildren() ?\n *\n * @param {Node} node The node to check.\n * @return {boolean} Whether the node can contain children.\n */\ngoog.dom.canHaveChildren = function(node) {\n  'use strict';\n  if (node.nodeType != goog.dom.NodeType.ELEMENT) {\n    return false;\n  }\n  switch (/** @type {!Element} */ (node).tagName) {\n    case String(goog.dom.TagName.APPLET):\n    case String(goog.dom.TagName.AREA):\n    case String(goog.dom.TagName.BASE):\n    case String(goog.dom.TagName.BR):\n    case String(goog.dom.TagName.COL):\n    case String(goog.dom.TagName.COMMAND):\n    case String(goog.dom.TagName.EMBED):\n    case String(goog.dom.TagName.FRAME):\n    case String(goog.dom.TagName.HR):\n    case String(goog.dom.TagName.IMG):\n    case String(goog.dom.TagName.INPUT):\n    case String(goog.dom.TagName.IFRAME):\n    case String(goog.dom.TagName.ISINDEX):\n    case String(goog.dom.TagName.KEYGEN):\n    case String(goog.dom.TagName.LINK):\n    case String(goog.dom.TagName.NOFRAMES):\n    case String(goog.dom.TagName.NOSCRIPT):\n    case String(goog.dom.TagName.META):\n    case String(goog.dom.TagName.OBJECT):\n    case String(goog.dom.TagName.PARAM):\n    case String(goog.dom.TagName.SCRIPT):\n    case String(goog.dom.TagName.SOURCE):\n    case String(goog.dom.TagName.STYLE):\n    case String(goog.dom.TagName.TRACK):\n    case String(goog.dom.TagName.WBR):\n      return false;\n  }\n  return true;\n};\n\n\n/**\n * Appends a child to a node.\n * @param {Node} parent Parent.\n * @param {Node} child Child.\n */\ngoog.dom.appendChild = function(parent, child) {\n  'use strict';\n  goog.asserts.assert(\n      parent != null && child != null,\n      'goog.dom.appendChild expects non-null arguments');\n  parent.appendChild(child);\n};\n\n\n/**\n * Appends a node with text or other nodes.\n * @param {!Node} parent The node to append nodes to.\n * @param {...goog.dom.Appendable} var_args The things to append to the node.\n *     If this is a Node it is appended as is.\n *     If this is a string then a text node is appended.\n *     If this is an array like object then fields 0 to length - 1 are appended.\n */\ngoog.dom.append = function(parent, var_args) {\n  'use strict';\n  goog.dom.append_(goog.dom.getOwnerDocument(parent), parent, arguments, 1);\n};\n\n\n/**\n * Removes all the child nodes on a DOM node.\n * @param {Node} node Node to remove children from.\n * @return {void}\n */\ngoog.dom.removeChildren = function(node) {\n  'use strict';\n  // Note: Iterations over live collections can be slow, this is the fastest\n  // we could find. The double parenthesis are used to prevent JsCompiler and\n  // strict warnings.\n  let child;\n  while ((child = node.firstChild)) {\n    node.removeChild(child);\n  }\n};\n\n\n/**\n * Inserts a new node before an existing reference node (i.e. as the previous\n * sibling). If the reference node has no parent, then does nothing.\n * @param {Node} newNode Node to insert.\n * @param {Node} refNode Reference node to insert before.\n */\ngoog.dom.insertSiblingBefore = function(newNode, refNode) {\n  'use strict';\n  goog.asserts.assert(\n      newNode != null && refNode != null,\n      'goog.dom.insertSiblingBefore expects non-null arguments');\n  if (refNode.parentNode) {\n    refNode.parentNode.insertBefore(newNode, refNode);\n  }\n};\n\n\n/**\n * Inserts a new node after an existing reference node (i.e. as the next\n * sibling). If the reference node has no parent, then does nothing.\n * @param {Node} newNode Node to insert.\n * @param {Node} refNode Reference node to insert after.\n * @return {void}\n */\ngoog.dom.insertSiblingAfter = function(newNode, refNode) {\n  'use strict';\n  goog.asserts.assert(\n      newNode != null && refNode != null,\n      'goog.dom.insertSiblingAfter expects non-null arguments');\n  if (refNode.parentNode) {\n    refNode.parentNode.insertBefore(newNode, refNode.nextSibling);\n  }\n};\n\n\n/**\n * Insert a child at a given index. If index is larger than the number of child\n * nodes that the parent currently has, the node is inserted as the last child\n * node.\n * @param {Element} parent The element into which to insert the child.\n * @param {Node} child The element to insert.\n * @param {number} index The index at which to insert the new child node. Must\n *     not be negative.\n * @return {void}\n */\ngoog.dom.insertChildAt = function(parent, child, index) {\n  'use strict';\n  // Note that if the second argument is null, insertBefore\n  // will append the child at the end of the list of children.\n  goog.asserts.assert(\n      parent != null, 'goog.dom.insertChildAt expects a non-null parent');\n  parent.insertBefore(\n      /** @type {!Node} */ (child), parent.childNodes[index] || null);\n};\n\n\n/**\n * Removes a node from its parent.\n * @param {Node} node The node to remove.\n * @return {Node} The node removed if removed; else, null.\n */\ngoog.dom.removeNode = function(node) {\n  'use strict';\n  return node && node.parentNode ? node.parentNode.removeChild(node) : null;\n};\n\n\n/**\n * Replaces a node in the DOM tree. Will do nothing if `oldNode` has no\n * parent.\n * @param {Node} newNode Node to insert.\n * @param {Node} oldNode Node to replace.\n */\ngoog.dom.replaceNode = function(newNode, oldNode) {\n  'use strict';\n  goog.asserts.assert(\n      newNode != null && oldNode != null,\n      'goog.dom.replaceNode expects non-null arguments');\n  const parent = oldNode.parentNode;\n  if (parent) {\n    parent.replaceChild(newNode, oldNode);\n  }\n};\n\n\n/**\n * Replaces child nodes of `target` with child nodes of `source`. This is\n * roughly equivalent to `target.innerHTML = source.innerHTML` which is not\n * compatible with Trusted Types.\n * @param {?Node} target Node to clean and replace its children.\n * @param {?Node} source Node to get the children from. The nodes will be cloned\n *     so they will stay in source.\n */\ngoog.dom.copyContents = function(target, source) {\n  'use strict';\n  goog.asserts.assert(\n      target != null && source != null,\n      'goog.dom.copyContents expects non-null arguments');\n  const childNodes = source.cloneNode(/* deep= */ true).childNodes;\n  goog.dom.removeChildren(target);\n  while (childNodes.length) {\n    target.appendChild(childNodes[0]);\n  }\n};\n\n\n/**\n * Flattens an element. That is, removes it and replace it with its children.\n * Does nothing if the element is not in the document.\n * @param {Element} element The element to flatten.\n * @return {Element|undefined} The original element, detached from the document\n *     tree, sans children; or undefined, if the element was not in the document\n *     to begin with.\n */\ngoog.dom.flattenElement = function(element) {\n  'use strict';\n  let child;\n  const parent = element.parentNode;\n  if (parent && parent.nodeType != goog.dom.NodeType.DOCUMENT_FRAGMENT) {\n    // Use IE DOM method (supported by Opera too) if available\n    if (element.removeNode) {\n      return /** @type {Element} */ (element.removeNode(false));\n    } else {\n      // Move all children of the original node up one level.\n      while ((child = element.firstChild)) {\n        parent.insertBefore(child, element);\n      }\n\n      // Detach the original element.\n      return /** @type {Element} */ (goog.dom.removeNode(element));\n    }\n  }\n};\n\n\n/**\n * Returns an array containing just the element children of the given element.\n * @param {Element} element The element whose element children we want.\n * @return {!(Array<!Element>|NodeList<!Element>)} An array or array-like list\n *     of just the element children of the given element.\n */\ngoog.dom.getChildren = function(element) {\n  'use strict';\n  // We check if the children attribute is supported for child elements\n  // since IE8 misuses the attribute by also including comments.\n  if ((goog.FEATURESET_YEAR > 2018) || (element.children != undefined)) {\n    return element.children;\n  }\n  // Fall back to manually filtering the element's child nodes.\n  return Array.prototype.filter.call(element.childNodes, function(node) {\n    return node.nodeType == goog.dom.NodeType.ELEMENT;\n  });\n};\n\n\n/**\n * Returns the first child node that is an element.\n * @param {Node} node The node to get the first child element of.\n * @return {Element} The first child node of `node` that is an element.\n */\ngoog.dom.getFirstElementChild = function(node) {\n  'use strict';\n  if (node.firstElementChild !== undefined) {\n    return /** @type {!Element} */ (node).firstElementChild;\n  }\n  return goog.dom.getNextElementNode_(node.firstChild, true);\n};\n\n\n/**\n * Returns the last child node that is an element.\n * @param {Node} node The node to get the last child element of.\n * @return {Element} The last child node of `node` that is an element.\n */\ngoog.dom.getLastElementChild = function(node) {\n  'use strict';\n  if (node.lastElementChild !== undefined) {\n    return /** @type {!Element} */ (node).lastElementChild;\n  }\n  return goog.dom.getNextElementNode_(node.lastChild, false);\n};\n\n\n/**\n * Returns the first next sibling that is an element.\n * @param {Node} node The node to get the next sibling element of.\n * @return {Element} The next sibling of `node` that is an element.\n */\ngoog.dom.getNextElementSibling = function(node) {\n  'use strict';\n  if (goog.FEATURESET_YEAR > 2018 || node.nextElementSibling !== undefined) {\n    return /** @type {!Element} */ (node).nextElementSibling;\n  }\n  return goog.dom.getNextElementNode_(node.nextSibling, true);\n};\n\n\n/**\n * Returns the first previous sibling that is an element.\n * @param {Node} node The node to get the previous sibling element of.\n * @return {Element} The first previous sibling of `node` that is\n *     an element.\n */\ngoog.dom.getPreviousElementSibling = function(node) {\n  'use strict';\n  if (node.previousElementSibling !== undefined) {\n    return /** @type {!Element} */ (node).previousElementSibling;\n  }\n  return goog.dom.getNextElementNode_(node.previousSibling, false);\n};\n\n\n/**\n * Returns the first node that is an element in the specified direction,\n * starting with `node`.\n * @param {Node} node The node to get the next element from.\n * @param {boolean} forward Whether to look forwards or backwards.\n * @return {Element} The first element.\n * @private\n */\ngoog.dom.getNextElementNode_ = function(node, forward) {\n  'use strict';\n  while (node && node.nodeType != goog.dom.NodeType.ELEMENT) {\n    node = forward ? node.nextSibling : node.previousSibling;\n  }\n\n  return /** @type {Element} */ (node);\n};\n\n\n/**\n * Returns the next node in source order from the given node.\n * @param {Node} node The node.\n * @return {Node} The next node in the DOM tree, or null if this was the last\n *     node.\n */\ngoog.dom.getNextNode = function(node) {\n  'use strict';\n  if (!node) {\n    return null;\n  }\n\n  if (node.firstChild) {\n    return node.firstChild;\n  }\n\n  while (node && !node.nextSibling) {\n    node = node.parentNode;\n  }\n\n  return node ? node.nextSibling : null;\n};\n\n\n/**\n * Returns the previous node in source order from the given node.\n * @param {Node} node The node.\n * @return {Node} The previous node in the DOM tree, or null if this was the\n *     first node.\n */\ngoog.dom.getPreviousNode = function(node) {\n  'use strict';\n  if (!node) {\n    return null;\n  }\n\n  if (!node.previousSibling) {\n    return node.parentNode;\n  }\n\n  node = node.previousSibling;\n  while (node && node.lastChild) {\n    node = node.lastChild;\n  }\n\n  return node;\n};\n\n\n/**\n * Whether the object looks like a DOM node.\n * @param {?} obj The object being tested for node likeness.\n * @return {boolean} Whether the object looks like a DOM node.\n */\ngoog.dom.isNodeLike = function(obj) {\n  'use strict';\n  return goog.isObject(obj) && obj.nodeType > 0;\n};\n\n\n/**\n * Whether the object looks like an Element.\n * @param {?} obj The object being tested for Element likeness.\n * @return {boolean} Whether the object looks like an Element.\n */\ngoog.dom.isElement = function(obj) {\n  'use strict';\n  return goog.isObject(obj) && obj.nodeType == goog.dom.NodeType.ELEMENT;\n};\n\n\n/**\n * Returns true if the specified value is a Window object. This includes the\n * global window for HTML pages, and iframe windows.\n * @param {?} obj Variable to test.\n * @return {boolean} Whether the variable is a window.\n */\ngoog.dom.isWindow = function(obj) {\n  'use strict';\n  return goog.isObject(obj) && obj['window'] == obj;\n};\n\n\n/**\n * Returns an element's parent, if it's an Element.\n * @param {Element} element The DOM element.\n * @return {Element} The parent, or null if not an Element.\n */\ngoog.dom.getParentElement = function(element) {\n  'use strict';\n  return element.parentElement || null;\n};\n\n\n/**\n * Whether a node contains another node.\n * @param {?Node|undefined} parent The node that should contain the other node.\n * @param {?Node|undefined} descendant The node to test presence of.\n * @return {boolean} Whether the parent node contains the descendant node.\n */\ngoog.dom.contains = function(parent, descendant) {\n  'use strict';\n  if (!parent || !descendant) {\n    return false;\n  }\n\n  if (goog.FEATURESET_YEAR > 2018) {\n    return parent == descendant || parent.contains(descendant);\n  }\n\n  // We use browser specific methods for this if available since it is faster\n  // that way.\n\n  // IE DOM\n  if (parent.contains && descendant.nodeType == goog.dom.NodeType.ELEMENT) {\n    return parent == descendant || parent.contains(descendant);\n  }\n\n  // W3C DOM Level 3\n  if (typeof parent.compareDocumentPosition != 'undefined') {\n    return parent == descendant ||\n        Boolean(parent.compareDocumentPosition(descendant) & 16);\n  }\n\n  // W3C DOM Level 1\n  while (descendant && parent != descendant) {\n    descendant = descendant.parentNode;\n  }\n  return descendant == parent;\n};\n\n\n/**\n * Compares the document order of two nodes, returning 0 if they are the same\n * node, a negative number if node1 is before node2, and a positive number if\n * node2 is before node1.  Note that we compare the order the tags appear in the\n * document so in the tree <b><i>text</i></b> the B node is considered to be\n * before the I node.\n *\n * @param {Node} node1 The first node to compare.\n * @param {Node} node2 The second node to compare.\n * @return {number} 0 if the nodes are the same node, a negative number if node1\n *     is before node2, and a positive number if node2 is before node1.\n */\ngoog.dom.compareNodeOrder = function(node1, node2) {\n  'use strict';\n  // Fall out quickly for equality.\n  if (node1 == node2) {\n    return 0;\n  }\n\n  // Use compareDocumentPosition where available\n  if (node1.compareDocumentPosition) {\n    // 4 is the bitmask for FOLLOWS.\n    return node1.compareDocumentPosition(node2) & 2 ? 1 : -1;\n  }\n\n  // Process in IE using sourceIndex - we check to see if the first node has\n  // a source index or if its parent has one.\n  if ('sourceIndex' in node1 ||\n      (node1.parentNode && 'sourceIndex' in node1.parentNode)) {\n    const isElement1 = node1.nodeType == goog.dom.NodeType.ELEMENT;\n    const isElement2 = node2.nodeType == goog.dom.NodeType.ELEMENT;\n\n    if (isElement1 && isElement2) {\n      return node1.sourceIndex - node2.sourceIndex;\n    } else {\n      const parent1 = node1.parentNode;\n      const parent2 = node2.parentNode;\n\n      if (parent1 == parent2) {\n        return goog.dom.compareSiblingOrder_(node1, node2);\n      }\n\n      if (!isElement1 && goog.dom.contains(parent1, node2)) {\n        return -1 * goog.dom.compareParentsDescendantNodeIe_(node1, node2);\n      }\n\n\n      if (!isElement2 && goog.dom.contains(parent2, node1)) {\n        return goog.dom.compareParentsDescendantNodeIe_(node2, node1);\n      }\n\n      return (isElement1 ? node1.sourceIndex : parent1.sourceIndex) -\n          (isElement2 ? node2.sourceIndex : parent2.sourceIndex);\n    }\n  }\n\n  // For Safari, we compare ranges.\n  const doc = goog.dom.getOwnerDocument(node1);\n\n  let range1;\n  let range2;\n  range1 = doc.createRange();\n  range1.selectNode(node1);\n  range1.collapse(true);\n\n  range2 = doc.createRange();\n  range2.selectNode(node2);\n  range2.collapse(true);\n\n  return range1.compareBoundaryPoints(\n      goog.global['Range'].START_TO_END, range2);\n};\n\n\n/**\n * Utility function to compare the position of two nodes, when\n * `textNode`'s parent is an ancestor of `node`.  If this entry\n * condition is not met, this function will attempt to reference a null object.\n * @param {!Node} textNode The textNode to compare.\n * @param {Node} node The node to compare.\n * @return {number} -1 if node is before textNode, +1 otherwise.\n * @private\n */\ngoog.dom.compareParentsDescendantNodeIe_ = function(textNode, node) {\n  'use strict';\n  const parent = textNode.parentNode;\n  if (parent == node) {\n    // If textNode is a child of node, then node comes first.\n    return -1;\n  }\n  let sibling = node;\n  while (sibling.parentNode != parent) {\n    sibling = sibling.parentNode;\n  }\n  return goog.dom.compareSiblingOrder_(sibling, textNode);\n};\n\n\n/**\n * Utility function to compare the position of two nodes known to be non-equal\n * siblings.\n * @param {Node} node1 The first node to compare.\n * @param {!Node} node2 The second node to compare.\n * @return {number} -1 if node1 is before node2, +1 otherwise.\n * @private\n */\ngoog.dom.compareSiblingOrder_ = function(node1, node2) {\n  'use strict';\n  let s = node2;\n  while ((s = s.previousSibling)) {\n    if (s == node1) {\n      // We just found node1 before node2.\n      return -1;\n    }\n  }\n\n  // Since we didn't find it, node1 must be after node2.\n  return 1;\n};\n\n\n/**\n * Find the deepest common ancestor of the given nodes.\n * @param {...Node} var_args The nodes to find a common ancestor of.\n * @return {Node} The common ancestor of the nodes, or null if there is none.\n *     null will only be returned if two or more of the nodes are from different\n *     documents.\n */\ngoog.dom.findCommonAncestor = function(var_args) {\n  'use strict';\n  let i;\n  const count = arguments.length;\n  if (!count) {\n    return null;\n  } else if (count == 1) {\n    return arguments[0];\n  }\n\n  const paths = [];\n  let minLength = Infinity;\n  for (i = 0; i < count; i++) {\n    // Compute the list of ancestors.\n    const ancestors = [];\n    let node = arguments[i];\n    while (node) {\n      ancestors.unshift(node);\n      node = node.parentNode;\n    }\n\n    // Save the list for comparison.\n    paths.push(ancestors);\n    minLength = Math.min(minLength, ancestors.length);\n  }\n  let output = null;\n  for (i = 0; i < minLength; i++) {\n    const first = paths[0][i];\n    for (let j = 1; j < count; j++) {\n      if (first != paths[j][i]) {\n        return output;\n      }\n    }\n    output = first;\n  }\n  return output;\n};\n\n\n/**\n * Returns whether node is in a document or detached. Throws an error if node\n * itself is a document. This specifically handles two cases beyond naive use of\n * builtins: (1) it works correctly in IE, and (2) it works for elements from\n * different documents/iframes. If neither of these considerations are relevant\n * then a simple `document.contains(node)` may be used instead.\n * @param {!Node} node\n * @return {boolean}\n */\ngoog.dom.isInDocument = function(node) {\n  'use strict';\n  return (node.ownerDocument.compareDocumentPosition(node) & 16) == 16;\n};\n\n\n/**\n * Returns the owner document for a node.\n * @param {Node|Window} node The node to get the document for.\n * @return {!Document} The document owning the node.\n */\ngoog.dom.getOwnerDocument = function(node) {\n  'use strict';\n  // TODO(nnaze): Update param signature to be non-nullable.\n  goog.asserts.assert(node, 'Node cannot be null or undefined.');\n  return /** @type {!Document} */ (\n      node.nodeType == goog.dom.NodeType.DOCUMENT ?\n          node :\n          node.ownerDocument || node.document);\n};\n\n\n/**\n * Cross-browser function for getting the document element of a frame or iframe.\n * @param {Element} frame Frame element.\n * @return {!Document} The frame content document.\n */\ngoog.dom.getFrameContentDocument = function(frame) {\n  'use strict';\n  return frame.contentDocument ||\n      /** @type {!HTMLFrameElement} */ (frame).contentWindow.document;\n};\n\n\n/**\n * Cross-browser function for getting the window of a frame or iframe.\n * @param {Element} frame Frame element.\n * @return {Window} The window associated with the given frame, or null if none\n *     exists.\n */\ngoog.dom.getFrameContentWindow = function(frame) {\n  'use strict';\n  try {\n    return frame.contentWindow ||\n        (frame.contentDocument ? goog.dom.getWindow(frame.contentDocument) :\n                                 null);\n  } catch (e) {\n    // NOTE(jfedor): In IE8, checking the contentWindow or contentDocument\n    // properties will throw a \"Unspecified Error\" exception if the iframe is\n    // not inserted in the DOM. If we get this we can be sure that no window\n    // exists, so return null.\n  }\n  return null;\n};\n\n\n/**\n * Sets the text content of a node, with cross-browser support.\n * @param {Node} node The node to change the text content of.\n * @param {string|number} text The value that should replace the node's content.\n * @return {void}\n */\ngoog.dom.setTextContent = function(node, text) {\n  'use strict';\n  goog.asserts.assert(\n      node != null,\n      'goog.dom.setTextContent expects a non-null value for node');\n\n  if ('textContent' in node) {\n    node.textContent = text;\n  } else if (node.nodeType == goog.dom.NodeType.TEXT) {\n    /** @type {!Text} */ (node).data = String(text);\n  } else if (\n      node.firstChild && node.firstChild.nodeType == goog.dom.NodeType.TEXT) {\n    // If the first child is a text node we just change its data and remove the\n    // rest of the children.\n    while (node.lastChild != node.firstChild) {\n      node.removeChild(goog.asserts.assert(node.lastChild));\n    }\n    /** @type {!Text} */ (node.firstChild).data = String(text);\n  } else {\n    goog.dom.removeChildren(node);\n    const doc = goog.dom.getOwnerDocument(node);\n    node.appendChild(doc.createTextNode(String(text)));\n  }\n};\n\n\n/**\n * Gets the outerHTML of a node, which is like innerHTML, except that it\n * actually contains the HTML of the node itself.\n * @param {Element} element The element to get the HTML of.\n * @return {string} The outerHTML of the given element.\n */\ngoog.dom.getOuterHtml = function(element) {\n  'use strict';\n  goog.asserts.assert(\n      element !== null,\n      'goog.dom.getOuterHtml expects a non-null value for element');\n  // IE, Opera and WebKit all have outerHTML.\n  if ('outerHTML' in element) {\n    return element.outerHTML;\n  } else {\n    const doc = goog.dom.getOwnerDocument(element);\n    const div = goog.dom.createElement_(doc, goog.dom.TagName.DIV);\n    div.appendChild(element.cloneNode(true));\n    return div.innerHTML;\n  }\n};\n\n\n/**\n * Finds the first descendant node that matches the filter function, using depth\n * first search. This function offers the most general purpose way of finding a\n * matching element.\n *\n * Prefer using `querySelector` if the matching criteria can be expressed as a\n * CSS selector, or `goog.dom.findElement` if you would filter for `nodeType ==\n * Node.ELEMENT_NODE`.\n *\n * @param {Node} root The root of the tree to search.\n * @param {function(Node) : boolean} p The filter function.\n * @return {Node|undefined} The found node or undefined if none is found.\n */\ngoog.dom.findNode = function(root, p) {\n  'use strict';\n  const rv = [];\n  const found = goog.dom.findNodes_(root, p, rv, true);\n  return found ? rv[0] : undefined;\n};\n\n\n/**\n * Finds all the descendant nodes that match the filter function, using depth\n * first search. This function offers the most general-purpose way\n * of finding a set of matching elements.\n *\n * Prefer using `querySelectorAll` if the matching criteria can be expressed as\n * a CSS selector, or `goog.dom.findElements` if you would filter for\n * `nodeType == Node.ELEMENT_NODE`.\n *\n * @param {Node} root The root of the tree to search.\n * @param {function(Node) : boolean} p The filter function.\n * @return {!Array<!Node>} The found nodes or an empty array if none are found.\n */\ngoog.dom.findNodes = function(root, p) {\n  'use strict';\n  const rv = [];\n  goog.dom.findNodes_(root, p, rv, false);\n  return rv;\n};\n\n\n/**\n * Finds the first or all the descendant nodes that match the filter function,\n * using a depth first search.\n * @param {Node} root The root of the tree to search.\n * @param {function(Node) : boolean} p The filter function.\n * @param {!Array<!Node>} rv The found nodes are added to this array.\n * @param {boolean} findOne If true we exit after the first found node.\n * @return {boolean} Whether the search is complete or not. True in case findOne\n *     is true and the node is found. False otherwise.\n * @private\n */\ngoog.dom.findNodes_ = function(root, p, rv, findOne) {\n  'use strict';\n  if (root != null) {\n    let child = root.firstChild;\n    while (child) {\n      if (p(child)) {\n        rv.push(child);\n        if (findOne) {\n          return true;\n        }\n      }\n      if (goog.dom.findNodes_(child, p, rv, findOne)) {\n        return true;\n      }\n      child = child.nextSibling;\n    }\n  }\n  return false;\n};\n\n\n/**\n * Finds the first descendant element (excluding `root`) that matches the filter\n * function, using depth first search. Prefer using `querySelector` if the\n * matching criteria can be expressed as a CSS selector.\n *\n * @param {!Element | !Document} root\n * @param {function(!Element): boolean} pred Filter function.\n * @return {?Element} First matching element or null if there is none.\n */\ngoog.dom.findElement = function(root, pred) {\n  'use strict';\n  const stack = goog.dom.getChildrenReverse_(root);\n  while (stack.length > 0) {\n    const next = stack.pop();\n    if (pred(next)) return next;\n    for (let c = next.lastElementChild; c; c = c.previousElementSibling) {\n      stack.push(c);\n    }\n  }\n  return null;\n};\n\n\n/**\n * Finds all the descendant elements (excluding `root`) that match the filter\n * function, using depth first search. Prefer using `querySelectorAll` if the\n * matching criteria can be expressed as a CSS selector.\n *\n * @param {!Element | !Document} root\n * @param {function(!Element): boolean} pred Filter function.\n * @return {!Array<!Element>}\n */\ngoog.dom.findElements = function(root, pred) {\n  'use strict';\n  const result = [];\n  const stack = goog.dom.getChildrenReverse_(root);\n  while (stack.length > 0) {\n    const next = stack.pop();\n    if (pred(next)) result.push(next);\n    for (let c = next.lastElementChild; c; c = c.previousElementSibling) {\n      stack.push(c);\n    }\n  }\n  return result;\n};\n\n\n/**\n * @param {!Element | !Document} node\n * @return {!Array<!Element>} node's child elements in reverse order.\n * @private\n */\ngoog.dom.getChildrenReverse_ = function(node) {\n  'use strict';\n  // document.lastElementChild doesn't exist in IE9; fall back to\n  // documentElement.\n  if (node.nodeType == goog.dom.NodeType.DOCUMENT) {\n    return [node.documentElement];\n  } else {\n    const children = [];\n    for (let c = node.lastElementChild; c; c = c.previousElementSibling) {\n      children.push(c);\n    }\n    return children;\n  }\n};\n\n\n/**\n * Map of tags whose content to ignore when calculating text length.\n * @private {!Object<string, number>}\n * @const\n */\ngoog.dom.TAGS_TO_IGNORE_ = {\n  'SCRIPT': 1,\n  'STYLE': 1,\n  'HEAD': 1,\n  'IFRAME': 1,\n  'OBJECT': 1\n};\n\n\n/**\n * Map of tags which have predefined values with regard to whitespace.\n * @private {!Object<string, string>}\n * @const\n */\ngoog.dom.PREDEFINED_TAG_VALUES_ = {\n  'IMG': ' ',\n  'BR': '\\n'\n};\n\n\n/**\n * Returns true if the element has a tab index that allows it to receive\n * keyboard focus (tabIndex >= 0), false otherwise.  Note that some elements\n * natively support keyboard focus, even if they have no tab index.\n * @param {!Element} element Element to check.\n * @return {boolean} Whether the element has a tab index that allows keyboard\n *     focus.\n */\ngoog.dom.isFocusableTabIndex = function(element) {\n  'use strict';\n  return goog.dom.hasSpecifiedTabIndex_(element) &&\n      goog.dom.isTabIndexFocusable_(element);\n};\n\n\n/**\n * Enables or disables keyboard focus support on the element via its tab index.\n * Only elements for which {@link goog.dom.isFocusableTabIndex} returns true\n * (or elements that natively support keyboard focus, like form elements) can\n * receive keyboard focus.  See http://go/tabindex for more info.\n * @param {Element} element Element whose tab index is to be changed.\n * @param {boolean} enable Whether to set or remove a tab index on the element\n *     that supports keyboard focus.\n * @return {void}\n */\ngoog.dom.setFocusableTabIndex = function(element, enable) {\n  'use strict';\n  if (enable) {\n    element.tabIndex = 0;\n  } else {\n    // Set tabIndex to -1 first, then remove it. This is a workaround for\n    // Safari (confirmed in version 4 on Windows). When removing the attribute\n    // without setting it to -1 first, the element remains keyboard focusable\n    // despite not having a tabIndex attribute anymore.\n    element.tabIndex = -1;\n    element.removeAttribute('tabIndex');  // Must be camelCase!\n  }\n};\n\n\n/**\n * Returns true if the element can be focused, i.e. it has a tab index that\n * allows it to receive keyboard focus (tabIndex >= 0), or it is an element\n * that natively supports keyboard focus.\n * @param {!Element} element Element to check.\n * @return {boolean} Whether the element allows keyboard focus.\n */\ngoog.dom.isFocusable = function(element) {\n  'use strict';\n  let focusable;\n  // Some elements can have unspecified tab index and still receive focus.\n  if (goog.dom.nativelySupportsFocus_(element)) {\n    // Make sure the element is not disabled ...\n    focusable = !element.disabled &&\n        // ... and if a tab index is specified, it allows focus.\n        (!goog.dom.hasSpecifiedTabIndex_(element) ||\n         goog.dom.isTabIndexFocusable_(element));\n  } else {\n    focusable = goog.dom.isFocusableTabIndex(element);\n  }\n\n  return focusable;\n};\n\n\n/**\n * Returns true if the element has a specified tab index.\n * @param {!Element} element Element to check.\n * @return {boolean} Whether the element has a specified tab index.\n * @private\n */\ngoog.dom.hasSpecifiedTabIndex_ = function(element) {\n  'use strict';\n  return element.hasAttribute('tabindex');\n};\n\n\n/**\n * Returns true if the element's tab index allows the element to be focused.\n * @param {!Element} element Element to check.\n * @return {boolean} Whether the element's tab index allows focus.\n * @private\n */\ngoog.dom.isTabIndexFocusable_ = function(element) {\n  'use strict';\n  const index = /** @type {!HTMLElement} */ (element).tabIndex;\n  // NOTE: IE9 puts tabIndex in 16-bit int, e.g. -2 is 65534.\n  return typeof (index) === 'number' && index >= 0 && index < 32768;\n};\n\n\n/**\n * Returns true if the element is focusable even when tabIndex is not set.\n * @param {!Element} element Element to check.\n * @return {boolean} Whether the element natively supports focus.\n * @private\n */\ngoog.dom.nativelySupportsFocus_ = function(element) {\n  'use strict';\n  return (\n      element.tagName == goog.dom.TagName.A && element.hasAttribute('href') ||\n      element.tagName == goog.dom.TagName.INPUT ||\n      element.tagName == goog.dom.TagName.TEXTAREA ||\n      element.tagName == goog.dom.TagName.SELECT ||\n      element.tagName == goog.dom.TagName.BUTTON);\n};\n\n\n/**\n * Returns true if the element has a bounding rectangle that would be visible\n * (i.e. its width and height are greater than zero).\n * @param {!HTMLElement} element Element to check.\n * @return {boolean} Whether the element has a non-zero bounding rectangle.\n * @private\n */\ngoog.dom.hasNonZeroBoundingRect_ = function(element) {\n  'use strict';\n  let rect;\n  if (typeof element['getBoundingClientRect'] !== 'function') {\n    rect = {'height': element.offsetHeight, 'width': element.offsetWidth};\n  } else {\n    rect = element.getBoundingClientRect();\n  }\n  return rect != null && rect.height > 0 && rect.width > 0;\n};\n\n\n/**\n * Returns the text content of the current node, without markup and invisible\n * symbols. New lines are stripped and whitespace is collapsed,\n * such that each character would be visible.\n *\n * In browsers that support it, innerText is used.  Other browsers attempt to\n * simulate it via node traversal.  Line breaks are canonicalized in IE.\n *\n * @param {Node} node The node from which we are getting content.\n * @return {string} The text content.\n */\ngoog.dom.getTextContent = function(node) {\n  'use strict';\n  let textContent;\n  const buf = [];\n  goog.dom.getTextContent_(node, buf, true);\n  textContent = buf.join('');\n\n  // Strip &shy; entities. goog.format.insertWordBreaks inserts them in Opera.\n  textContent = textContent.replace(/ \\xAD /g, ' ').replace(/\\xAD/g, '');\n  // Strip &#8203; entities. goog.format.insertWordBreaks inserts them in IE8.\n  textContent = textContent.replace(/\\u200B/g, '');\n\n  textContent = textContent.replace(/ +/g, ' ');\n  if (textContent != ' ') {\n    textContent = textContent.replace(/^\\s*/, '');\n  }\n\n  return textContent;\n};\n\n\n/**\n * Returns the text content of the current node, without markup.\n *\n * Unlike `getTextContent` this method does not collapse whitespaces\n * or normalize lines breaks.\n *\n * @param {Node} node The node from which we are getting content.\n * @return {string} The raw text content.\n */\ngoog.dom.getRawTextContent = function(node) {\n  'use strict';\n  const buf = [];\n  goog.dom.getTextContent_(node, buf, false);\n\n  return buf.join('');\n};\n\n\n/**\n * Recursive support function for text content retrieval.\n *\n * @param {Node} node The node from which we are getting content.\n * @param {Array<string>} buf string buffer.\n * @param {boolean} normalizeWhitespace Whether to normalize whitespace.\n * @private\n */\ngoog.dom.getTextContent_ = function(node, buf, normalizeWhitespace) {\n  'use strict';\n  if (node.nodeName in goog.dom.TAGS_TO_IGNORE_) {\n    // ignore certain tags\n  } else if (node.nodeType == goog.dom.NodeType.TEXT) {\n    if (normalizeWhitespace) {\n      buf.push(String(node.nodeValue).replace(/(\\r\\n|\\r|\\n)/g, ''));\n    } else {\n      buf.push(node.nodeValue);\n    }\n  } else if (node.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {\n    buf.push(goog.dom.PREDEFINED_TAG_VALUES_[node.nodeName]);\n  } else {\n    let child = node.firstChild;\n    while (child) {\n      goog.dom.getTextContent_(child, buf, normalizeWhitespace);\n      child = child.nextSibling;\n    }\n  }\n};\n\n\n/**\n * Returns the text length of the text contained in a node, without markup. This\n * is equivalent to the selection length if the node was selected, or the number\n * of cursor movements to traverse the node. Images & BRs take one space.  New\n * lines are ignored.\n *\n * @param {Node} node The node whose text content length is being calculated.\n * @return {number} The length of `node`'s text content.\n */\ngoog.dom.getNodeTextLength = function(node) {\n  'use strict';\n  return goog.dom.getTextContent(node).length;\n};\n\n\n/**\n * Returns the text offset of a node relative to one of its ancestors. The text\n * length is the same as the length calculated by goog.dom.getNodeTextLength.\n *\n * @param {Node} node The node whose offset is being calculated.\n * @param {Node=} opt_offsetParent The node relative to which the offset will\n *     be calculated. Defaults to the node's owner document's body.\n * @return {number} The text offset.\n */\ngoog.dom.getNodeTextOffset = function(node, opt_offsetParent) {\n  'use strict';\n  const root = opt_offsetParent || goog.dom.getOwnerDocument(node).body;\n  const buf = [];\n  while (node && node != root) {\n    let cur = node;\n    while ((cur = cur.previousSibling)) {\n      buf.unshift(goog.dom.getTextContent(cur));\n    }\n    node = node.parentNode;\n  }\n  // Trim left to deal with FF cases when there might be line breaks and empty\n  // nodes at the front of the text\n  return goog.string.trimLeft(buf.join('')).replace(/ +/g, ' ').length;\n};\n\n\n/**\n * Returns the node at a given offset in a parent node.  If an object is\n * provided for the optional third parameter, the node and the remainder of the\n * offset will stored as properties of this object.\n * @param {Node} parent The parent node.\n * @param {number} offset The offset into the parent node.\n * @param {Object=} opt_result Object to be used to store the return value. The\n *     return value will be stored in the form {node: Node, remainder: number}\n *     if this object is provided.\n * @return {Node} The node at the given offset.\n */\ngoog.dom.getNodeAtOffset = function(parent, offset, opt_result) {\n  'use strict';\n  const stack = [parent];\n  let pos = 0;\n  let cur = null;\n  while (stack.length > 0 && pos < offset) {\n    cur = stack.pop();\n    if (cur.nodeName in goog.dom.TAGS_TO_IGNORE_) {\n      // ignore certain tags\n    } else if (cur.nodeType == goog.dom.NodeType.TEXT) {\n      const text =\n          cur.nodeValue.replace(/(\\r\\n|\\r|\\n)/g, '').replace(/ +/g, ' ');\n      pos += text.length;\n    } else if (cur.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {\n      pos += goog.dom.PREDEFINED_TAG_VALUES_[cur.nodeName].length;\n    } else {\n      for (let i = cur.childNodes.length - 1; i >= 0; i--) {\n        stack.push(cur.childNodes[i]);\n      }\n    }\n  }\n  if (goog.isObject(opt_result)) {\n    opt_result.remainder = cur ? cur.nodeValue.length + offset - pos - 1 : 0;\n    opt_result.node = cur;\n  }\n\n  return cur;\n};\n\n\n/**\n * Returns true if the object is a `NodeList`.  To qualify as a NodeList,\n * the object must have a numeric length property and an item function (which\n * has type 'string' on IE for some reason).\n * @param {Object} val Object to test.\n * @return {boolean} Whether the object is a NodeList.\n */\ngoog.dom.isNodeList = function(val) {\n  'use strict';\n\n  if (goog.FEATURESET_YEAR >= 2018) {\n    return !!val && typeof val.length == 'number' &&\n        typeof val.item == 'function';\n  }\n\n  // TODO(attila): Now the isNodeList is part of goog.dom we can use\n  // goog.userAgent to make this simpler.\n  // A NodeList must have a length property of type 'number' on all platforms.\n  if (val && typeof val.length == 'number') {\n    // A NodeList is an object everywhere except Safari, where it's a function.\n    if (goog.isObject(val)) {\n      // A NodeList must have an item function (on non-IE platforms) or an item\n      // property of type 'string' (on IE).\n      return typeof val.item == 'function' || typeof val.item == 'string';\n    } else if (typeof val === 'function') {\n      // On Safari, a NodeList is a function with an item property that is also\n      // a function.\n      return typeof val.item == 'function';\n    }\n  }\n\n  // Not a NodeList.\n  return false;\n};\n\n\n/**\n * Walks up the DOM hierarchy returning the first ancestor that has the passed\n * tag name and/or class name. If the passed element matches the specified\n * criteria, the element itself is returned.\n * @param {Node} element The DOM node to start with.\n * @param {?(goog.dom.TagName<T>|string)=} opt_tag The tag name to match (or\n *     null/undefined to match only based on class name).\n * @param {?string=} opt_class The class name to match (or null/undefined to\n *     match only based on tag name).\n * @param {number=} opt_maxSearchSteps Maximum number of levels to search up the\n *     dom.\n * @return {?R} The first ancestor that matches the passed criteria, or\n *     null if no match is found. The return type is {?Element} if opt_tag is\n *     not a member of goog.dom.TagName or a more specific type if it is (e.g.\n *     {?HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.getAncestorByTagNameAndClass = function(\n    element, opt_tag, opt_class, opt_maxSearchSteps) {\n  'use strict';\n  if (!opt_tag && !opt_class) {\n    return null;\n  }\n  const tagName = opt_tag ? String(opt_tag).toUpperCase() : null;\n  return /** @type {Element} */ (goog.dom.getAncestor(element, function(node) {\n    'use strict';\n    return (!tagName || node.nodeName == tagName) &&\n        (!opt_class ||\n         typeof node.className === 'string' &&\n             goog.array.contains(node.className.split(/\\s+/), opt_class));\n  }, true, opt_maxSearchSteps));\n};\n\n\n/**\n * Walks up the DOM hierarchy returning the first ancestor that has the passed\n * class name. If the passed element matches the specified criteria, the\n * element itself is returned.\n * @param {Node} element The DOM node to start with.\n * @param {string} className The class name to match.\n * @param {number=} opt_maxSearchSteps Maximum number of levels to search up the\n *     dom.\n * @return {Element} The first ancestor that matches the passed criteria, or\n *     null if none match.\n */\ngoog.dom.getAncestorByClass = function(element, className, opt_maxSearchSteps) {\n  'use strict';\n  return goog.dom.getAncestorByTagNameAndClass(\n      element, null, className, opt_maxSearchSteps);\n};\n\n\n/**\n * Walks up the DOM hierarchy returning the first ancestor that passes the\n * matcher function.\n * @param {Node} element The DOM node to start with.\n * @param {function(!Node) : boolean} matcher A function that returns true if\n *     the passed node matches the desired criteria.\n * @param {boolean=} opt_includeNode If true, the node itself is included in\n *     the search (the first call to the matcher will pass startElement as\n *     the node to test).\n * @param {number=} opt_maxSearchSteps Maximum number of levels to search up the\n *     dom.\n * @return {Node} DOM node that matched the matcher, or null if there was\n *     no match.\n */\ngoog.dom.getAncestor = function(\n    element, matcher, opt_includeNode, opt_maxSearchSteps) {\n  'use strict';\n  if (element && !opt_includeNode) {\n    element = element.parentNode;\n  }\n  let steps = 0;\n  while (element &&\n         (opt_maxSearchSteps == null || steps <= opt_maxSearchSteps)) {\n    goog.asserts.assert(element.name != 'parentNode');\n    if (matcher(element)) {\n      return element;\n    }\n    element = element.parentNode;\n    steps++;\n  }\n  // Reached the root of the DOM without a match\n  return null;\n};\n\n\n/**\n * Determines the active element in the given document.\n * @param {Document} doc The document to look in.\n * @return {Element} The active element.\n */\ngoog.dom.getActiveElement = function(doc) {\n  'use strict';\n  // While in an iframe, IE9 will throw \"Unspecified error\" when accessing\n  // activeElement.\n  try {\n    const activeElement = doc && doc.activeElement;\n    // While not in an iframe, IE9-11 sometimes gives null.\n    // While in an iframe, IE11 sometimes returns an empty object.\n    return activeElement && activeElement.nodeName ? activeElement : null;\n  } catch (e) {\n    return null;\n  }\n};\n\n\n/**\n * Gives the current devicePixelRatio.\n *\n * By default, this is the value of window.devicePixelRatio (which should be\n * preferred if present).\n *\n * If window.devicePixelRatio is not present, the ratio is calculated with\n * window.matchMedia, if present. Otherwise, gives 1.0.\n *\n * Some browsers (including Chrome) consider the browser zoom level in the pixel\n * ratio, so the value may change across multiple calls.\n *\n * @return {number} The number of actual pixels per virtual pixel.\n */\ngoog.dom.getPixelRatio = function() {\n  'use strict';\n  const win = goog.dom.getWindow();\n  if (win.devicePixelRatio !== undefined) {\n    return win.devicePixelRatio;\n  } else if (win.matchMedia) {\n    // Should be for IE10 and FF6-17 (this basically clamps to lower)\n    // Note that the order of these statements is important\n    return goog.dom.matchesPixelRatio_(3) || goog.dom.matchesPixelRatio_(2) ||\n        goog.dom.matchesPixelRatio_(1.5) || goog.dom.matchesPixelRatio_(1) ||\n        .75;\n  }\n  return 1;\n};\n\n\n/**\n * Calculates a mediaQuery to check if the current device supports the\n * given actual to virtual pixel ratio.\n * @param {number} pixelRatio The ratio of actual pixels to virtual pixels.\n * @return {number} pixelRatio if applicable, otherwise 0.\n * @private\n */\ngoog.dom.matchesPixelRatio_ = function(pixelRatio) {\n  'use strict';\n  const win = goog.dom.getWindow();\n  /**\n   * Due to the 1:96 fixed ratio of CSS in to CSS px, 1dppx is equivalent to\n   * 96dpi.\n   * @const {number}\n   */\n  const dpiPerDppx = 96;\n  const query =\n      // FF16-17\n      '(min-resolution: ' + pixelRatio + 'dppx),' +\n      // FF6-15\n      '(min--moz-device-pixel-ratio: ' + pixelRatio + '),' +\n      // IE10 (this works for the two browsers above too but I don't want to\n      // trust the 1:96 fixed ratio magic)\n      '(min-resolution: ' + (pixelRatio * dpiPerDppx) + 'dpi)';\n  return win.matchMedia(query).matches ? pixelRatio : 0;\n};\n\n\n/**\n * Gets '2d' context of a canvas. Shortcut for canvas.getContext('2d') with a\n * type information.\n * @param {!HTMLCanvasElement|!OffscreenCanvas} canvas\n * @return {!CanvasRenderingContext2D}\n */\ngoog.dom.getCanvasContext2D = function(canvas) {\n  'use strict';\n  return /** @type {!CanvasRenderingContext2D} */ (canvas.getContext('2d'));\n};\n\n\n\n/**\n * Create an instance of a DOM helper with a new document object.\n * @param {Document=} opt_document Document object to associate with this\n *     DOM helper.\n * @constructor\n */\ngoog.dom.DomHelper = function(opt_document) {\n  'use strict';\n  /**\n   * Reference to the document object to use\n   * @type {!Document}\n   * @private\n   */\n  this.document_ = opt_document || goog.global.document || document;\n};\n\n\n/**\n * Gets the dom helper object for the document where the element resides.\n * @param {Node=} opt_node If present, gets the DomHelper for this node.\n * @return {!goog.dom.DomHelper} The DomHelper.\n */\ngoog.dom.DomHelper.prototype.getDomHelper = goog.dom.getDomHelper;\n\n\n/**\n * Sets the document object.\n * @param {!Document} document Document object.\n */\ngoog.dom.DomHelper.prototype.setDocument = function(document) {\n  'use strict';\n  this.document_ = document;\n};\n\n\n/**\n * Gets the document object being used by the dom library.\n * @return {!Document} Document object.\n */\ngoog.dom.DomHelper.prototype.getDocument = function() {\n  'use strict';\n  return this.document_;\n};\n\n\n/**\n * Alias for `getElementById`. If a DOM node is passed in then we just\n * return that.\n * @param {string|Element} element Element ID or a DOM node.\n * @return {Element} The element with the given ID, or the node passed in.\n */\ngoog.dom.DomHelper.prototype.getElement = function(element) {\n  'use strict';\n  return goog.dom.getElementHelper_(this.document_, element);\n};\n\n\n/**\n * Gets an element by id, asserting that the element is found.\n *\n * This is used when an element is expected to exist, and should fail with\n * an assertion error if it does not (if assertions are enabled).\n *\n * @param {string} id Element ID.\n * @return {!Element} The element with the given ID, if it exists.\n */\ngoog.dom.DomHelper.prototype.getRequiredElement = function(id) {\n  'use strict';\n  return goog.dom.getRequiredElementHelper_(this.document_, id);\n};\n\n\n/**\n * Alias for `getElement`.\n * @param {string|Element} element Element ID or a DOM node.\n * @return {Element} The element with the given ID, or the node passed in.\n * @deprecated Use {@link goog.dom.DomHelper.prototype.getElement} instead.\n */\ngoog.dom.DomHelper.prototype.$ = goog.dom.DomHelper.prototype.getElement;\n\n\n/**\n * Gets elements by tag name.\n * @param {!goog.dom.TagName<T>} tagName\n * @param {(!Document|!Element)=} opt_parent Parent element or document where to\n *     look for elements. Defaults to document of this DomHelper.\n * @return {!NodeList<R>} List of elements. The members of the list are\n *     {!Element} if tagName is not a member of goog.dom.TagName or more\n *     specific types if it is (e.g. {!HTMLAnchorElement} for\n *     goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.DomHelper.prototype.getElementsByTagName = function(\n    tagName, opt_parent) {\n  'use strict';\n  const parent = opt_parent || this.document_;\n  return parent.getElementsByTagName(String(tagName));\n};\n\n\n/**\n * Looks up elements by both tag and class name, using browser native functions\n * (`querySelectorAll`, `getElementsByTagName` or\n * `getElementsByClassName`) where possible. The returned array is a live\n * NodeList or a static list depending on the code path taken.\n *\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name or * for all\n *     tags.\n * @param {?string=} opt_class Optional class name.\n * @param {(Document|Element)=} opt_el Optional element to look in.\n * @return {!IArrayLike<R>} Array-like list of elements (only a length property\n *     and numerical indices are guaranteed to exist). The members of the array\n *     are {!Element} if opt_tag is not a member of goog.dom.TagName or more\n *     specific types if it is (e.g. {!HTMLAnchorElement} for\n *     goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.DomHelper.prototype.getElementsByTagNameAndClass = function(\n    opt_tag, opt_class, opt_el) {\n  'use strict';\n  return goog.dom.getElementsByTagNameAndClass_(\n      this.document_, opt_tag, opt_class, opt_el);\n};\n\n\n/**\n * Gets the first element matching the tag and the class.\n *\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name.\n * @param {?string=} opt_class Optional class name.\n * @param {(Document|Element)=} opt_el Optional element to look in.\n * @return {?R} Reference to a DOM node. The return type is {?Element} if\n *     tagName is a string or a more specific type if it is a member of\n *     goog.dom.TagName (e.g. {?HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.DomHelper.prototype.getElementByTagNameAndClass = function(\n    opt_tag, opt_class, opt_el) {\n  'use strict';\n  return goog.dom.getElementByTagNameAndClass_(\n      this.document_, opt_tag, opt_class, opt_el);\n};\n\n\n/**\n * Returns an array of all the elements with the provided className.\n * @param {string} className the name of the class to look for.\n * @param {Element|Document=} opt_el Optional element to look in.\n * @return {!IArrayLike<!Element>} The items found with the class name provided.\n */\ngoog.dom.DomHelper.prototype.getElementsByClass = function(className, opt_el) {\n  'use strict';\n  const doc = opt_el || this.document_;\n  return goog.dom.getElementsByClass(className, doc);\n};\n\n\n/**\n * Returns the first element we find matching the provided class name.\n * @param {string} className the name of the class to look for.\n * @param {(Element|Document)=} opt_el Optional element to look in.\n * @return {Element} The first item found with the class name provided.\n */\ngoog.dom.DomHelper.prototype.getElementByClass = function(className, opt_el) {\n  'use strict';\n  const doc = opt_el || this.document_;\n  return goog.dom.getElementByClass(className, doc);\n};\n\n\n/**\n * Ensures an element with the given className exists, and then returns the\n * first element with the provided className.\n * @param {string} className the name of the class to look for.\n * @param {(!Element|!Document)=} opt_root Optional element or document to look\n *     in.\n * @return {!Element} The first item found with the class name provided.\n * @throws {goog.asserts.AssertionError} Thrown if no element is found.\n */\ngoog.dom.DomHelper.prototype.getRequiredElementByClass = function(\n    className, opt_root) {\n  'use strict';\n  const root = opt_root || this.document_;\n  return goog.dom.getRequiredElementByClass(className, root);\n};\n\n\n/**\n * Alias for `getElementsByTagNameAndClass`.\n * @deprecated Use DomHelper getElementsByTagNameAndClass.\n *\n * @param {(string|?goog.dom.TagName<T>)=} opt_tag Element tag name.\n * @param {?string=} opt_class Optional class name.\n * @param {Element=} opt_el Optional element to look in.\n * @return {!IArrayLike<R>} Array-like list of elements (only a length property\n *     and numerical indices are guaranteed to exist). The members of the array\n *     are {!Element} if opt_tag is a string or more specific types if it is\n *     a member of goog.dom.TagName (e.g. {!HTMLAnchorElement} for\n *     goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.DomHelper.prototype.$$ =\n    goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;\n\n\n/**\n * Sets a number of properties on a node.\n * @param {Element} element DOM node to set properties on.\n * @param {Object} properties Hash of property:value pairs.\n */\ngoog.dom.DomHelper.prototype.setProperties = goog.dom.setProperties;\n\n\n/**\n * Gets the dimensions of the viewport.\n * @param {Window=} opt_window Optional window element to test. Defaults to\n *     the window of the Dom Helper.\n * @return {!goog.math.Size} Object with values 'width' and 'height'.\n */\ngoog.dom.DomHelper.prototype.getViewportSize = function(opt_window) {\n  'use strict';\n  // TODO(arv): This should not take an argument. That breaks the rule of a\n  // a DomHelper representing a single frame/window/document.\n  return goog.dom.getViewportSize(opt_window || this.getWindow());\n};\n\n\n/**\n * Calculates the height of the document.\n *\n * @return {number} The height of the document.\n */\ngoog.dom.DomHelper.prototype.getDocumentHeight = function() {\n  'use strict';\n  return goog.dom.getDocumentHeight_(this.getWindow());\n};\n\n\n/**\n * Typedef for use with goog.dom.createDom and goog.dom.append.\n * @typedef {Object|string|Array|NodeList}\n */\ngoog.dom.Appendable;\n\n\n/**\n * Returns a dom node with a set of attributes.  This function accepts varargs\n * for subsequent nodes to be added.  Subsequent nodes will be added to the\n * first node as childNodes.\n *\n * So:\n * <code>createDom(goog.dom.TagName.DIV, null, createDom(goog.dom.TagName.P),\n * createDom(goog.dom.TagName.P));</code> would return a div with two child\n * paragraphs\n *\n * An easy way to move all child nodes of an existing element to a new parent\n * element is:\n * <code>createDom(goog.dom.TagName.DIV, null, oldElement.childNodes);</code>\n * which will remove all child nodes from the old element and add them as\n * child nodes of the new DIV.\n *\n * @param {string|!goog.dom.TagName<T>} tagName Tag to create.\n * @param {?Object|?Array<string>|string=} opt_attributes If object, then a map\n *     of name-value pairs for attributes. If a string, then this is the\n *     className of the new element. If an array, the elements will be joined\n *     together as the className of the new element.\n * @param {...(goog.dom.Appendable|undefined)} var_args Further DOM nodes or\n *     strings for text nodes. If one of the var_args is an array or\n *     NodeList, its elements will be added as childNodes instead.\n * @return {R} Reference to a DOM node. The return type is {!Element} if tagName\n *     is a string or a more specific type if it is a member of\n *     goog.dom.TagName (e.g. {!HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.DomHelper.prototype.createDom = function(\n    tagName, opt_attributes, var_args) {\n  'use strict';\n  return goog.dom.createDom_(this.document_, arguments);\n};\n\n\n/**\n * Alias for `createDom`.\n * @param {string|!goog.dom.TagName<T>} tagName Tag to create.\n * @param {?Object|?Array<string>|string=} opt_attributes If object, then a map\n *     of name-value pairs for attributes. If a string, then this is the\n *     className of the new element. If an array, the elements will be joined\n *     together as the className of the new element.\n * @param {...(goog.dom.Appendable|undefined)} var_args Further DOM nodes or\n *     strings for text nodes.  If one of the var_args is an array, its children\n *     will be added as childNodes instead.\n * @return {R} Reference to a DOM node. The return type is {!Element} if tagName\n *     is a string or a more specific type if it is a member of\n *     goog.dom.TagName (e.g. {!HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n * @deprecated Use {@link goog.dom.DomHelper.prototype.createDom} instead.\n */\ngoog.dom.DomHelper.prototype.$dom = goog.dom.DomHelper.prototype.createDom;\n\n\n/**\n * Creates a new element.\n * @param {string|!goog.dom.TagName<T>} name Tag to create.\n * @return {R} The new element. The return type is {!Element} if name is\n *     a string or a more specific type if it is a member of goog.dom.TagName\n *     (e.g. {!HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.DomHelper.prototype.createElement = function(name) {\n  'use strict';\n  return goog.dom.createElement_(this.document_, name);\n};\n\n\n/**\n * Creates a new text node.\n * @param {number|string} content Content.\n * @return {!Text} The new text node.\n */\ngoog.dom.DomHelper.prototype.createTextNode = function(content) {\n  'use strict';\n  return this.document_.createTextNode(String(content));\n};\n\n\n/**\n * Create a table.\n * @param {number} rows The number of rows in the table.  Must be >= 1.\n * @param {number} columns The number of columns in the table.  Must be >= 1.\n * @param {boolean=} opt_fillWithNbsp If true, fills table entries with\n *     `goog.string.Unicode.NBSP` characters.\n * @return {!HTMLElement} The created table.\n */\ngoog.dom.DomHelper.prototype.createTable = function(\n    rows, columns, opt_fillWithNbsp) {\n  'use strict';\n  return goog.dom.createTable_(\n      this.document_, rows, columns, !!opt_fillWithNbsp);\n};\n\n\n/**\n * Converts an HTML into a node or a document fragment. A single Node is used if\n * `html` only generates a single node. If `html` generates multiple\n * nodes then these are put inside a `DocumentFragment`. This is a safe\n * version of `goog.dom.DomHelper#htmlToDocumentFragment` which is now\n * deleted.\n * @param {!safevalues.SafeHtml} html The HTML markup to convert.\n * @return {!Node} The resulting node.\n */\ngoog.dom.DomHelper.prototype.safeHtmlToNode = function(html) {\n  'use strict';\n  return goog.dom.safeHtmlToNode_(this.document_, html);\n};\n\n\n/**\n * Returns true if the browser is in \"CSS1-compatible\" (standards-compliant)\n * mode, false otherwise.\n * @return {boolean} True if in CSS1-compatible mode.\n */\ngoog.dom.DomHelper.prototype.isCss1CompatMode = function() {\n  'use strict';\n  return goog.dom.isCss1CompatMode_(this.document_);\n};\n\n\n/**\n * Gets the window object associated with the document.\n * @return {!Window} The window associated with the given document.\n */\ngoog.dom.DomHelper.prototype.getWindow = function() {\n  'use strict';\n  return goog.dom.getWindow_(this.document_);\n};\n\n\n/**\n * Gets the document scroll element.\n * @return {!Element} Scrolling element.\n */\ngoog.dom.DomHelper.prototype.getDocumentScrollElement = function() {\n  'use strict';\n  return goog.dom.getDocumentScrollElement_(this.document_);\n};\n\n\n/**\n * Gets the document scroll distance as a coordinate object.\n * @return {!goog.math.Coordinate} Object with properties 'x' and 'y'.\n */\ngoog.dom.DomHelper.prototype.getDocumentScroll = function() {\n  'use strict';\n  return goog.dom.getDocumentScroll_(this.document_);\n};\n\n\n/**\n * Determines the active element in the given document.\n * @param {Document=} opt_doc The document to look in.\n * @return {Element} The active element.\n */\ngoog.dom.DomHelper.prototype.getActiveElement = function(opt_doc) {\n  'use strict';\n  return goog.dom.getActiveElement(opt_doc || this.document_);\n};\n\n\n/**\n * Appends a child to a node.\n * @param {Node} parent Parent.\n * @param {Node} child Child.\n */\ngoog.dom.DomHelper.prototype.appendChild = goog.dom.appendChild;\n\n\n/**\n * Appends a node with text or other nodes.\n * @param {!Node} parent The node to append nodes to.\n * @param {...goog.dom.Appendable} var_args The things to append to the node.\n *     If this is a Node it is appended as is.\n *     If this is a string then a text node is appended.\n *     If this is an array like object then fields 0 to length - 1 are appended.\n */\ngoog.dom.DomHelper.prototype.append = goog.dom.append;\n\n\n/**\n * Determines if the given node can contain children, intended to be used for\n * HTML generation.\n *\n * @param {Node} node The node to check.\n * @return {boolean} Whether the node can contain children.\n */\ngoog.dom.DomHelper.prototype.canHaveChildren = goog.dom.canHaveChildren;\n\n\n/**\n * Removes all the child nodes on a DOM node.\n * @param {Node} node Node to remove children from.\n */\ngoog.dom.DomHelper.prototype.removeChildren = goog.dom.removeChildren;\n\n\n/**\n * Inserts a new node before an existing reference node (i.e., as the previous\n * sibling). If the reference node has no parent, then does nothing.\n * @param {Node} newNode Node to insert.\n * @param {Node} refNode Reference node to insert before.\n */\ngoog.dom.DomHelper.prototype.insertSiblingBefore = goog.dom.insertSiblingBefore;\n\n\n/**\n * Inserts a new node after an existing reference node (i.e., as the next\n * sibling). If the reference node has no parent, then does nothing.\n * @param {Node} newNode Node to insert.\n * @param {Node} refNode Reference node to insert after.\n */\ngoog.dom.DomHelper.prototype.insertSiblingAfter = goog.dom.insertSiblingAfter;\n\n\n/**\n * Insert a child at a given index. If index is larger than the number of child\n * nodes that the parent currently has, the node is inserted as the last child\n * node.\n * @param {Element} parent The element into which to insert the child.\n * @param {Node} child The element to insert.\n * @param {number} index The index at which to insert the new child node. Must\n *     not be negative.\n */\ngoog.dom.DomHelper.prototype.insertChildAt = goog.dom.insertChildAt;\n\n\n/**\n * Removes a node from its parent.\n * @param {Node} node The node to remove.\n * @return {Node} The node removed if removed; else, null.\n */\ngoog.dom.DomHelper.prototype.removeNode = goog.dom.removeNode;\n\n\n/**\n * Replaces a node in the DOM tree. Will do nothing if `oldNode` has no\n * parent.\n * @param {Node} newNode Node to insert.\n * @param {Node} oldNode Node to replace.\n */\ngoog.dom.DomHelper.prototype.replaceNode = goog.dom.replaceNode;\n\n\n/**\n * Replaces child nodes of `target` with child nodes of `source`. This is\n * roughly equivalent to `target.innerHTML = source.innerHTML` which is not\n * compatible with Trusted Types.\n * @param {?Node} target Node to clean and replace its children.\n * @param {?Node} source Node to get the children from. The nodes will be cloned\n *     so they will stay in source.\n */\ngoog.dom.DomHelper.prototype.copyContents = goog.dom.copyContents;\n\n\n/**\n * Flattens an element. That is, removes it and replace it with its children.\n * @param {Element} element The element to flatten.\n * @return {Element|undefined} The original element, detached from the document\n *     tree, sans children, or undefined if the element was already not in the\n *     document.\n */\ngoog.dom.DomHelper.prototype.flattenElement = goog.dom.flattenElement;\n\n\n/**\n * Returns an array containing just the element children of the given element.\n * @param {Element} element The element whose element children we want.\n * @return {!(Array<!Element>|NodeList<!Element>)} An array or array-like list\n *     of just the element children of the given element.\n */\ngoog.dom.DomHelper.prototype.getChildren = goog.dom.getChildren;\n\n\n/**\n * Returns the first child node that is an element.\n * @param {Node} node The node to get the first child element of.\n * @return {Element} The first child node of `node` that is an element.\n */\ngoog.dom.DomHelper.prototype.getFirstElementChild =\n    goog.dom.getFirstElementChild;\n\n\n/**\n * Returns the last child node that is an element.\n * @param {Node} node The node to get the last child element of.\n * @return {Element} The last child node of `node` that is an element.\n */\ngoog.dom.DomHelper.prototype.getLastElementChild = goog.dom.getLastElementChild;\n\n\n/**\n * Returns the first next sibling that is an element.\n * @param {Node} node The node to get the next sibling element of.\n * @return {Element} The next sibling of `node` that is an element.\n */\ngoog.dom.DomHelper.prototype.getNextElementSibling =\n    goog.dom.getNextElementSibling;\n\n\n/**\n * Returns the first previous sibling that is an element.\n * @param {Node} node The node to get the previous sibling element of.\n * @return {Element} The first previous sibling of `node` that is\n *     an element.\n */\ngoog.dom.DomHelper.prototype.getPreviousElementSibling =\n    goog.dom.getPreviousElementSibling;\n\n\n/**\n * Returns the next node in source order from the given node.\n * @param {Node} node The node.\n * @return {Node} The next node in the DOM tree, or null if this was the last\n *     node.\n */\ngoog.dom.DomHelper.prototype.getNextNode = goog.dom.getNextNode;\n\n\n/**\n * Returns the previous node in source order from the given node.\n * @param {Node} node The node.\n * @return {Node} The previous node in the DOM tree, or null if this was the\n *     first node.\n */\ngoog.dom.DomHelper.prototype.getPreviousNode = goog.dom.getPreviousNode;\n\n\n/**\n * Whether the object looks like a DOM node.\n * @param {?} obj The object being tested for node likeness.\n * @return {boolean} Whether the object looks like a DOM node.\n */\ngoog.dom.DomHelper.prototype.isNodeLike = goog.dom.isNodeLike;\n\n\n/**\n * Whether the object looks like an Element.\n * @param {?} obj The object being tested for Element likeness.\n * @return {boolean} Whether the object looks like an Element.\n */\ngoog.dom.DomHelper.prototype.isElement = goog.dom.isElement;\n\n\n/**\n * Returns true if the specified value is a Window object. This includes the\n * global window for HTML pages, and iframe windows.\n * @param {?} obj Variable to test.\n * @return {boolean} Whether the variable is a window.\n */\ngoog.dom.DomHelper.prototype.isWindow = goog.dom.isWindow;\n\n\n/**\n * Returns an element's parent, if it's an Element.\n * @param {Element} element The DOM element.\n * @return {Element} The parent, or null if not an Element.\n */\ngoog.dom.DomHelper.prototype.getParentElement = goog.dom.getParentElement;\n\n\n/**\n * Whether a node contains another node.\n * @param {Node} parent The node that should contain the other node.\n * @param {Node} descendant The node to test presence of.\n * @return {boolean} Whether the parent node contains the descendant node.\n */\ngoog.dom.DomHelper.prototype.contains = goog.dom.contains;\n\n\n/**\n * Compares the document order of two nodes, returning 0 if they are the same\n * node, a negative number if node1 is before node2, and a positive number if\n * node2 is before node1.  Note that we compare the order the tags appear in the\n * document so in the tree <b><i>text</i></b> the B node is considered to be\n * before the I node.\n *\n * @param {Node} node1 The first node to compare.\n * @param {Node} node2 The second node to compare.\n * @return {number} 0 if the nodes are the same node, a negative number if node1\n *     is before node2, and a positive number if node2 is before node1.\n */\ngoog.dom.DomHelper.prototype.compareNodeOrder = goog.dom.compareNodeOrder;\n\n\n/**\n * Find the deepest common ancestor of the given nodes.\n * @param {...Node} var_args The nodes to find a common ancestor of.\n * @return {Node} The common ancestor of the nodes, or null if there is none.\n *     null will only be returned if two or more of the nodes are from different\n *     documents.\n */\ngoog.dom.DomHelper.prototype.findCommonAncestor = goog.dom.findCommonAncestor;\n\n\n/**\n * Returns the owner document for a node.\n * @param {Node} node The node to get the document for.\n * @return {!Document} The document owning the node.\n */\ngoog.dom.DomHelper.prototype.getOwnerDocument = goog.dom.getOwnerDocument;\n\n\n/**\n * Cross browser function for getting the document element of an iframe.\n * @param {Element} iframe Iframe element.\n * @return {!Document} The frame content document.\n */\ngoog.dom.DomHelper.prototype.getFrameContentDocument =\n    goog.dom.getFrameContentDocument;\n\n\n/**\n * Cross browser function for getting the window of a frame or iframe.\n * @param {Element} frame Frame element.\n * @return {Window} The window associated with the given frame.\n */\ngoog.dom.DomHelper.prototype.getFrameContentWindow =\n    goog.dom.getFrameContentWindow;\n\n\n/**\n * Sets the text content of a node, with cross-browser support.\n * @param {Node} node The node to change the text content of.\n * @param {string|number} text The value that should replace the node's content.\n */\ngoog.dom.DomHelper.prototype.setTextContent = goog.dom.setTextContent;\n\n\n/**\n * Gets the outerHTML of a node, which islike innerHTML, except that it\n * actually contains the HTML of the node itself.\n * @param {Element} element The element to get the HTML of.\n * @return {string} The outerHTML of the given element.\n */\ngoog.dom.DomHelper.prototype.getOuterHtml = goog.dom.getOuterHtml;\n\n\n/**\n * Finds the first descendant node that matches the filter function. This does\n * a depth first search.\n * @param {Node} root The root of the tree to search.\n * @param {function(Node) : boolean} p The filter function.\n * @return {Node|undefined} The found node or undefined if none is found.\n */\ngoog.dom.DomHelper.prototype.findNode = goog.dom.findNode;\n\n\n/**\n * Finds all the descendant nodes that matches the filter function. This does a\n * depth first search.\n * @param {Node} root The root of the tree to search.\n * @param {function(Node) : boolean} p The filter function.\n * @return {Array<Node>} The found nodes or an empty array if none are found.\n */\ngoog.dom.DomHelper.prototype.findNodes = goog.dom.findNodes;\n\n\n/**\n * Returns true if the element has a tab index that allows it to receive\n * keyboard focus (tabIndex >= 0), false otherwise.  Note that some elements\n * natively support keyboard focus, even if they have no tab index.\n * @param {!Element} element Element to check.\n * @return {boolean} Whether the element has a tab index that allows keyboard\n *     focus.\n */\ngoog.dom.DomHelper.prototype.isFocusableTabIndex = goog.dom.isFocusableTabIndex;\n\n\n/**\n * Enables or disables keyboard focus support on the element via its tab index.\n * Only elements for which {@link goog.dom.isFocusableTabIndex} returns true\n * (or elements that natively support keyboard focus, like form elements) can\n * receive keyboard focus.  See http://go/tabindex for more info.\n * @param {Element} element Element whose tab index is to be changed.\n * @param {boolean} enable Whether to set or remove a tab index on the element\n *     that supports keyboard focus.\n */\ngoog.dom.DomHelper.prototype.setFocusableTabIndex =\n    goog.dom.setFocusableTabIndex;\n\n\n/**\n * Returns true if the element can be focused, i.e. it has a tab index that\n * allows it to receive keyboard focus (tabIndex >= 0), or it is an element\n * that natively supports keyboard focus.\n * @param {!Element} element Element to check.\n * @return {boolean} Whether the element allows keyboard focus.\n */\ngoog.dom.DomHelper.prototype.isFocusable = goog.dom.isFocusable;\n\n\n/**\n * Returns the text contents of the current node, without markup. New lines are\n * stripped and whitespace is collapsed, such that each character would be\n * visible.\n *\n * In browsers that support it, innerText is used.  Other browsers attempt to\n * simulate it via node traversal.  Line breaks are canonicalized in IE.\n *\n * @param {Node} node The node from which we are getting content.\n * @return {string} The text content.\n */\ngoog.dom.DomHelper.prototype.getTextContent = goog.dom.getTextContent;\n\n\n/**\n * Returns the text length of the text contained in a node, without markup. This\n * is equivalent to the selection length if the node was selected, or the number\n * of cursor movements to traverse the node. Images & BRs take one space.  New\n * lines are ignored.\n *\n * @param {Node} node The node whose text content length is being calculated.\n * @return {number} The length of `node`'s text content.\n */\ngoog.dom.DomHelper.prototype.getNodeTextLength = goog.dom.getNodeTextLength;\n\n\n/**\n * Returns the text offset of a node relative to one of its ancestors. The text\n * length is the same as the length calculated by\n * `goog.dom.getNodeTextLength`.\n *\n * @param {Node} node The node whose offset is being calculated.\n * @param {Node=} opt_offsetParent Defaults to the node's owner document's body.\n * @return {number} The text offset.\n */\ngoog.dom.DomHelper.prototype.getNodeTextOffset = goog.dom.getNodeTextOffset;\n\n\n/**\n * Returns the node at a given offset in a parent node.  If an object is\n * provided for the optional third parameter, the node and the remainder of the\n * offset will stored as properties of this object.\n * @param {Node} parent The parent node.\n * @param {number} offset The offset into the parent node.\n * @param {Object=} opt_result Object to be used to store the return value. The\n *     return value will be stored in the form {node: Node, remainder: number}\n *     if this object is provided.\n * @return {Node} The node at the given offset.\n */\ngoog.dom.DomHelper.prototype.getNodeAtOffset = goog.dom.getNodeAtOffset;\n\n\n/**\n * Returns true if the object is a `NodeList`.  To qualify as a NodeList,\n * the object must have a numeric length property and an item function (which\n * has type 'string' on IE for some reason).\n * @param {Object} val Object to test.\n * @return {boolean} Whether the object is a NodeList.\n */\ngoog.dom.DomHelper.prototype.isNodeList = goog.dom.isNodeList;\n\n\n/**\n * Walks up the DOM hierarchy returning the first ancestor that has the passed\n * tag name and/or class name. If the passed element matches the specified\n * criteria, the element itself is returned.\n * @param {Node} element The DOM node to start with.\n * @param {?(goog.dom.TagName<T>|string)=} opt_tag The tag name to match (or\n *     null/undefined to match only based on class name).\n * @param {?string=} opt_class The class name to match (or null/undefined to\n *     match only based on tag name).\n * @param {number=} opt_maxSearchSteps Maximum number of levels to search up the\n *     dom.\n * @return {?R} The first ancestor that matches the passed criteria, or\n *     null if no match is found. The return type is {?Element} if opt_tag is\n *     not a member of goog.dom.TagName or a more specific type if it is (e.g.\n *     {?HTMLAnchorElement} for goog.dom.TagName.A).\n * @template T\n * @template R := cond(isUnknown(T), 'Element', T) =:\n */\ngoog.dom.DomHelper.prototype.getAncestorByTagNameAndClass =\n    goog.dom.getAncestorByTagNameAndClass;\n\n\n/**\n * Walks up the DOM hierarchy returning the first ancestor that has the passed\n * class name. If the passed element matches the specified criteria, the\n * element itself is returned.\n * @param {Node} element The DOM node to start with.\n * @param {string} class The class name to match.\n * @param {number=} opt_maxSearchSteps Maximum number of levels to search up the\n *     dom.\n * @return {Element} The first ancestor that matches the passed criteria, or\n *     null if none match.\n */\ngoog.dom.DomHelper.prototype.getAncestorByClass = goog.dom.getAncestorByClass;\n\n\n/**\n * Walks up the DOM hierarchy returning the first ancestor that passes the\n * matcher function.\n * @param {Node} element The DOM node to start with.\n * @param {function(Node) : boolean} matcher A function that returns true if the\n *     passed node matches the desired criteria.\n * @param {boolean=} opt_includeNode If true, the node itself is included in\n *     the search (the first call to the matcher will pass startElement as\n *     the node to test).\n * @param {number=} opt_maxSearchSteps Maximum number of levels to search up the\n *     dom.\n * @return {Node} DOM node that matched the matcher, or null if there was\n *     no match.\n */\ngoog.dom.DomHelper.prototype.getAncestor = goog.dom.getAncestor;\n\n\n/**\n * Gets '2d' context of a canvas. Shortcut for canvas.getContext('2d') with a\n * type information.\n * @param {!HTMLCanvasElement} canvas\n * @return {!CanvasRenderingContext2D}\n */\ngoog.dom.DomHelper.prototype.getCanvasContext2D = goog.dom.getCanvasContext2D;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides a function to throw an error without interrupting\n * the current execution context.\n */\n\ngoog.module('goog.async.throwException');\ngoog.module.declareLegacyNamespace();\n\n/**\n * Throw an item without interrupting the current execution context.  For\n * example, if processing a group of items in a loop, sometimes it is useful\n * to report an error while still allowing the rest of the batch to be\n * processed.\n * @param {*} exception\n */\nfunction throwException(exception) {\n  // Each throw needs to be in its own context.\n  goog.global.setTimeout(() => {\n    throw exception;\n  }, 0);\n}\nexports = throwException;\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n","/**\n * @fileoverview Platform definitions for bigint usage in google3.\n *\n * Direct access to the exported constants in this file are restricted to\n * web platform code.\n */\n\n/**\n * Indicates that all browsers or platforms used in the JS binary natively\n * support `BigInt`. This permits removing `BigInt` related fallback code from\n * binaries.\n *\n * Prefer setting go/browser_featureset_year. If infeasible, you can exclusively\n * set this define for code-size improvements. For more info, see\n * go/typescript-g3patterns#closure-compile-time-defines\n *\n * For library authors, it is discouraged to set this to true in debug or\n * testing as this assumption may prove false for some binaries.\n *\n * @define\n */\nconst ASSUME_NATIVE_BIGINT: boolean = goog.define(\n  'javascript.common.bigint.ASSUME_NATIVE_BIGINT',\n  goog.FEATURESET_YEAR >= 2021,\n);\n\n/**\n * Indicates that BigInt is natively supported on the current platform.\n *\n * If `ASSUME_NATIVE_BIGINT` is `true`, this is a compile-time `true `constant.\n * Otherwise this will either be `true` or `false` at runtime depending on the\n * platform availability of `BigInt`\n *\n * In general, code authors should not need to use this. If you are an\n * application and `ASSUME_NATIVE_BIGINT` is true, just use the `BigInt()`\n * constructor directly. Otherwise, use `JSBI.BigInt()`.\n *\n * Core libraries that need to support `BigInt` related fallback code may use\n * this.\n */\nexport const NATIVE_BIGINT_AVAILABLE: boolean =\n  ASSUME_NATIVE_BIGINT ||\n  (typeof goog.global.BigInt === 'function' &&\n    typeof goog.global.BigInt(0) === 'bigint');\n\n/**\n * In DEBUG builds, makes `gbigintForcedAsStringHalfTheTime` and\n * `isGbigintForcedAsStringHalfTheTime` represent `gbigint` values as `string`\n * _always_ on odd numbers instead of session-random.\n *\n * Set this if, for debug builds, you need to ensure consistent `gbigint` value\n * representation across multiple JS VMs (e.g., a web app with a worker thread).\n *\n * @define\n */\nexport const ODD_FORCED_STRING_IN_DEBUG: boolean = goog.define(\n  'javascript.common.bigint.ODD_FORCED_STRING_IN_DEBUG',\n  false,\n);\n","import {\n  StateGuard,\n  TypeGuard,\n  assert,\n  assertTruthy,\n  cast,\n  defineStateGuard,\n  defineTypeGuard,\n  fail,\n} from 'google3/javascript/common/asserts/asserts';\nimport {\n  isAnyOf,\n  isBigInt,\n  isBoolean,\n  isNumber,\n  isString,\n} from 'google3/javascript/common/asserts/guards';\nimport {DebugBoxedBigInt} from 'google3/third_party/javascript/jsbi/g3_wrapper/debug_boxed_bigint';\nimport type JSBI from 'jsbi';\n\nimport {NATIVE_BIGINT_AVAILABLE, ODD_FORCED_STRING_IN_DEBUG} from './platform';\n\n// tslint:disable:gbigint-usage The common bigint library needs to break these\n// rules.\n\n// Capture in a local alias to mitigate against the risk of users mutating the\n// global `goog.DEBUG` value.  If it changes half way through a session,\n// comparisons between `gbigint` values will start failing.\nconst forcedAsStringHalfTheTime: boolean = goog.DEBUG;\n\n/**\n * Converts the given value to a `gbigint`.\n *\n * Throws exceptions on invalid values! Even in production! This mirrors the\n * behavior of the `BigInt()` constructor.\n *\n * See go/bigint#creating-gbigint-values for examples of valid and invalid\n * values.\n *\n * In debug builds with native `BigInt` support, `gbigint` values will either be\n * a `bigint` or `string` reference split on even and odd values. For more info,\n * see go/bigint#debug-gbigint-representation\n * @nosideeffects\n */\nexport function toGbigint(\n  value: number | string | boolean | bigint | JSBI,\n): gbigint {\n  validateToGbigintValue(value);\n\n  if (NATIVE_BIGINT_AVAILABLE) {\n    if (forcedAsStringHalfTheTime) {\n      return gbigintForcedAsStringHalfTheTime(value);\n    }\n\n    // Note: Native bigint is available and we're not in debug so JSBI instances\n    // ARE bigint already so we can safely exclude the JSBI type.\n    return castToGbigint(BigInt(value as Exclude<typeof value, JSBI>));\n  }\n\n  if (isBoolean(value)) {\n    // Convert boolean values to 1 or 0.\n    value = value ? '1' : '0';\n  } else if (isString(value)) {\n    // Strings that are pure whitespace resolve to '0'.\n    value = value.trim() || '0';\n  } else {\n    value = String(value);\n  }\n  return castToGbigint(value);\n}\n\n/** TypeGuard for `gbigint`. See go/guards-and-assertions */\nexport const isGbigint: TypeGuard<gbigint> = defineTypeGuard(\n  (arg: unknown): arg is gbigint => {\n    if (NATIVE_BIGINT_AVAILABLE) {\n      if (forcedAsStringHalfTheTime) {\n        return isGbigintForcedAsStringHalfTheTime(arg);\n      }\n\n      return isBigInt(arg);\n    }\n\n    return isString(arg) && isValidGbigintDecimalString(arg);\n  },\n  'gbigint',\n);\n\n/**\n * Returns whether `Number(value)` losslessly converts to a `number`. Equivalent\n * to the check performed by `Number.isSafeInteger()`.\n *\n * Note: This is _not_ a check for a valid two's complement 52-bit integer.\n */\nexport const isSafeInt52: StateGuard<gbigint | bigint> = defineStateGuard(\n  (value: gbigint | bigint): boolean => {\n    if (NATIVE_BIGINT_AVAILABLE) {\n      assert(MIN_SAFE_INT52_BIGINT, isBigInt);\n      assert(MAX_SAFE_INT52_BIGINT, isBigInt);\n\n      const valueAsBigInt = forcedAsStringHalfTheTime\n        ? BigInt(value)\n        : cast(value, isBigInt);\n      return (\n        valueAsBigInt >= MIN_SAFE_INT52_BIGINT &&\n        valueAsBigInt <= MAX_SAFE_INT52_BIGINT\n      );\n    }\n\n    const valueAsString = cast(value, isString);\n    if (valueAsString[0] === '-') {\n      return isInRange(valueAsString, MIN_SAFE_INT52_STR);\n    }\n\n    return isInRange(valueAsString, MAX_SAFE_INT52_STR);\n  },\n  'isSafeInt52',\n);\n\nconst MIN_SAFE_INT52_STR = Number.MIN_SAFE_INTEGER.toString();\nconst MIN_SAFE_INT52_BIGINT = NATIVE_BIGINT_AVAILABLE\n  ? BigInt(Number.MIN_SAFE_INTEGER)\n  : undefined;\n\nconst MAX_SAFE_INT52_STR = Number.MAX_SAFE_INTEGER.toString();\nconst MAX_SAFE_INT52_BIGINT = NATIVE_BIGINT_AVAILABLE\n  ? BigInt(Number.MAX_SAFE_INTEGER)\n  : undefined;\n\n/** Returns whether `value` is in the `int64` range. */\nexport const isValidSignedInt64: StateGuard<gbigint | bigint> =\n  defineStateGuard((value: gbigint | bigint): boolean => {\n    if (NATIVE_BIGINT_AVAILABLE) {\n      assert(MIN_SIGNED_INT64_BIGINT, isBigInt);\n      assert(MAX_SIGNED_INT64_BIGINT, isBigInt);\n\n      const valueAsBigInt = forcedAsStringHalfTheTime\n        ? BigInt(value)\n        : cast(value, isBigInt);\n      return (\n        valueAsBigInt >= MIN_SIGNED_INT64_BIGINT &&\n        valueAsBigInt <= MAX_SIGNED_INT64_BIGINT\n      );\n    }\n\n    const valueAsString = cast(value, isString);\n    if (valueAsString[0] === '-') {\n      return isInRange(valueAsString, MIN_SIGNED_INT64_STR);\n    }\n\n    return isInRange(valueAsString, MAX_SIGNED_INT64_STR);\n  }, 'isValidSignedInt64');\n\nconst MIN_SIGNED_INT64_STR = '-9223372036854775808';\nconst MIN_SIGNED_INT64_BIGINT = NATIVE_BIGINT_AVAILABLE\n  ? BigInt(MIN_SIGNED_INT64_STR)\n  : undefined;\n\nconst MAX_SIGNED_INT64_STR = '9223372036854775807';\nconst MAX_SIGNED_INT64_BIGINT = NATIVE_BIGINT_AVAILABLE\n  ? BigInt(MAX_SIGNED_INT64_STR)\n  : undefined;\n\n/** Returns whether `value` is in the `uint64` range. */\nexport const isValidUnsignedInt64: StateGuard<gbigint | bigint> =\n  defineStateGuard((value: gbigint | bigint): boolean => {\n    if (NATIVE_BIGINT_AVAILABLE) {\n      assert(MIN_UNSIGNED_INT64_BIGINT, isBigInt);\n      assert(MAX_UNSIGNED_INT64_BIGINT, isBigInt);\n\n      const valueAsBigInt = forcedAsStringHalfTheTime\n        ? BigInt(value)\n        : cast(value, isBigInt);\n      return (\n        valueAsBigInt >= MIN_UNSIGNED_INT64_BIGINT &&\n        valueAsBigInt <= MAX_UNSIGNED_INT64_BIGINT\n      );\n    }\n\n    const valueAsString = cast(value, isString);\n    if (valueAsString[0] === '-') return false;\n\n    assert(MAX_UNSIGNED_INT64_STR, isString);\n    return isInRange(valueAsString, MAX_UNSIGNED_INT64_STR);\n  }, 'isValidUnsignedInt64');\n\nconst MIN_UNSIGNED_INT64_BIGINT = NATIVE_BIGINT_AVAILABLE\n  ? BigInt(0)\n  : undefined;\n\nconst MAX_UNSIGNED_INT64_STR = '18446744073709551615';\nconst MAX_UNSIGNED_INT64_BIGINT = NATIVE_BIGINT_AVAILABLE\n  ? BigInt(MAX_UNSIGNED_INT64_STR)\n  : undefined;\n\n/**\n * Safely converts a `gbigint` value to a `boolean`.\n *\n * This function is necessary because `Boolean('0') !== Boolean(0n)`.\n */\nexport function gbigintToBoolean(value: gbigint): boolean {\n  if (NATIVE_BIGINT_AVAILABLE) {\n    assert(ZERO_BIGINT, isBigInt);\n\n    const valueAsBigInt = forcedAsStringHalfTheTime\n      ? BigInt(value)\n      : cast(value, isBigInt);\n    return valueAsBigInt !== ZERO_BIGINT;\n  }\n\n  const valueAsString = cast(value, isString);\n  return valueAsString !== ZERO_STR;\n}\n\n/**\n * Compares two gbigint or bigint values numerically. Compatible with\n * `Array.sort`.\n */\nexport function compareBigInt(\n  a: gbigint | bigint,\n  b: gbigint | bigint,\n): number {\n  if (NATIVE_BIGINT_AVAILABLE) {\n    const aAsBigInt = forcedAsStringHalfTheTime ? BigInt(a) : cast(a, isBigInt);\n    const bAsBigInt = forcedAsStringHalfTheTime ? BigInt(b) : cast(b, isBigInt);\n    return aAsBigInt > bAsBigInt ? 1 : aAsBigInt === bAsBigInt ? 0 : -1;\n  }\n\n  const aAsString = cast(a, isString);\n  const bAsString = cast(b, isString);\n\n  // String.startsWith is prohibted by GWS conformance: go/gws-inline-js-conformance#string-methods\n  const aIsNegative = aAsString.length && aAsString[0] === '-';\n  const bIsNegative = bAsString.length && bAsString[0] === '-';\n\n  const aSign = aIsNegative ? -1 : 1;\n\n  // The sign of a and b are different.\n  if (aIsNegative !== bIsNegative) return aSign;\n\n  // With equal sign, a and b have different lengths.\n  if (aAsString.length !== bAsString.length) {\n    return aAsString.length > bAsString.length ? aSign : -aSign;\n  }\n\n  // With equal sign and same length.\n  return aSign * aAsString.localeCompare(bAsString);\n}\n\n/// Internal implementation details. Not part of the API.\n\n/** Ensures `value` is valid input for `toGbigint`. ALWAYS throws if invalid. */\nfunction validateToGbigintValue(\n  value: number | string | boolean | bigint | JSBI,\n) {\n  if (isString(value)) {\n    if (!isValidGbigintInputString(value)) {\n      throw new Error(\n        goog.DEBUG ? `Invalid string for toGbigint: ${value}` : String(value),\n      );\n    }\n  } else if (isNumber(value)) {\n    if (!isValidGbigintInputNumber(value)) {\n      throw new Error(\n        goog.DEBUG ? `Invalid number for toGbigint: ${value}` : String(value),\n      );\n    }\n  }\n}\n\n/**\n * Returns whether `value` is a valid string **input** for `toGbigint()`.\n *\n * Valid values: `'0', '-12', '900719925474099175178', '  42  ', '\\t'`, ''\n *\n * Invalid values: `'12.34', '-0', '0x1a7e', 'one', 'not a number'`\n */\nfunction isValidGbigintInputString(value: string): boolean {\n  return /^\\s*(?:-?[1-9]\\d*|0)?\\s*$/.test(value);\n}\n\n/**\n * Returns whether `value` is a valid number input for `toGbigint()`.\n *\n * Valid values: `0, -12, 9007199254740991`\n *\n * Invalid values: `9007199254740992, 12.34, NaN, Infinity`\n */\nfunction isValidGbigintInputNumber(value: number): boolean {\n  return Number.isSafeInteger(value);\n}\n\n/**\n * Returns whether `value` is a valid `gbigint` string value. Equivalent to the\n * set of all `bigint` values converted to string with `.toString()`.\n *\n * Valid values: `'0', '-12', '900719925474099175178'`\n *\n * Invalid values: `'12.34', '-0', '  42  ', '0x1a7e', 'one', 'not a number'`\n */\nfunction isValidGbigintDecimalString(value: string): boolean {\n  return /^(?:-?[1-9]\\d*|0)$/.test(value);\n}\n\n/**\n * Casts the given value to a `gbigint`.\n *\n * Note to Googlers reading through this code... DON'T REPLICATE THIS CAST! :)\n * Call `toGbigint()` instead to guarantee runtime consistency and input\n * validation.\n */\nfunction castToGbigint(value: string | bigint): gbigint {\n  return value as unknown as gbigint;\n}\n\nfunction isInRange(value: string, boundary: string): boolean {\n  // Fast comparisons.\n  if (value.length > boundary.length) return false;\n  if (value.length < boundary.length) return true;\n  if (value === boundary) return true;\n\n  // Compare two strings conforming to isValidGbigintDecimalString char by char.\n  // At this point, both `value` and `boundary` are the same length and, if\n  // negative, both start with `-`.\n  for (let i = 0; i < value.length; i++) {\n    const valueChar = value[i];\n    const boundaryChar = boundary[i];\n    // Numeric chars compare the same as numbers.\n    if (valueChar > boundaryChar) return false;\n    if (valueChar < boundaryChar) return true;\n  }\n  fail(`isInRange weird case. Value was: ${value}. Boundary was: ${boundary}.`);\n}\n\nconst ZERO_STR = '0';\nconst ZERO_BIGINT = NATIVE_BIGINT_AVAILABLE ? BigInt(0) : undefined;\n\n/**\n * In DEBUG builds with native `BigInt` support, forces `gbigint` to be a\n * `string` half the time and a `bigint` otherwise in a consistent manner.\n *\n * The main sharp edge of `gbigint` is that a `gbigint` instance is itself a\n * `string` or a `bigint` at runtime. This can cause problems if a `gbigint`\n * value's type is unioned with `string` or `bigint` or is checked with\n * something like `isString()`. For example, this could result in a behavior\n * issue that only occurs on older browsers in production.\n *\n * This DEBUG-only behavior aims at helping developers detect these unexpected\n * edge cases earlier.\n */\nfunction gbigintForcedAsStringHalfTheTime(\n  value: number | string | boolean | bigint | JSBI,\n): gbigint {\n  let valueAsBigInt: bigint;\n  // In development builds, JSBI references are instances of DebugBoxedBigInt.\n  // This indirection avoids a full dependency on the large OSS JSBI sources.\n  if (value instanceof DebugBoxedBigInt) {\n    valueAsBigInt = value.val;\n  } else if (isBigInt(value)) {\n    valueAsBigInt = value;\n  } else {\n    assert(value, isAnyOf(isString, isBoolean, isNumber));\n    valueAsBigInt = BigInt(value);\n  }\n  if (\n    valueAsBigInt % BigInt(2) ===\n    BigInt(getGBigIntUseStrInDebugToggleVal())\n  ) {\n    return castToGbigint(valueAsBigInt.toString());\n  }\n  return castToGbigint(valueAsBigInt);\n}\n\nfunction isGbigintForcedAsStringHalfTheTime(arg: unknown): boolean {\n  if (typeof arg === 'bigint') {\n    if (arg % BigInt(2) === BigInt(getGBigIntUseStrInDebugToggleVal())) {\n      console.error(\n        'isGbigint: got a `bigint` when we were expecting a `string`. Make sure to call `toGbigint()` when creating `gbigint` instances!',\n      );\n      return false;\n    }\n    return true;\n  }\n\n  if (isString(arg)) {\n    if (!isValidGbigintDecimalString(arg)) return false;\n\n    if (\n      Number(arg[arg.length - 1]) % 2 ===\n      getGBigIntUseStrInDebugToggleVal()\n    ) {\n      return true;\n    }\n    console.error(\n      'isGbigint: got a `string` when we were expecting a `bigint`. Make sure to call `toGbigint()` when creating `gbigint` instances!',\n    );\n    return false;\n  }\n\n  return false;\n}\n\n// NOTE: This is a function rather than a module-local variable to ensure the\n// compiler can dead-code-eliminate it when compiled.\nfunction getGBigIntUseStrInDebugToggleVal(): 0 | 1 {\n  assertTruthy(forcedAsStringHalfTheTime);\n  if (ODD_FORCED_STRING_IN_DEBUG) {\n    return 1;\n  }\n\n  // In an iframe-compatible manner, determines whether odd or even gbigint\n  // values should be strings.\n  return (() => {\n    const container = (\n      typeof Window === 'function' && globalThis.top instanceof Window\n        ? globalThis.top\n        : globalThis\n    ) as GlobalThisWithDebugModResultAsString;\n    if (container.gbigintUseStrInDebugToggleVal == null) {\n      // Define it as readonly to prevent it from being mutated. If this value\n      // changes half way through a session, comparisons will start failing.\n      Object.defineProperties(container, {\n        // The types on defineProperties confuse the linter.\n        // tslint:disable-next-line:no-implicit-dictionary-conversion\n        gbigintUseStrInDebugToggleVal: {\n          value: Math.round(Math.random()) as 0 | 1,\n        },\n      });\n    }\n    return container.gbigintUseStrInDebugToggleVal!;\n  })();\n}\n\n// Declared so that binaries compiled with `goog.DEBUG` don't collide this\n// renamed property with some other top-level var of the same renamed name.\ndeclare interface GlobalThisWithDebugModResultAsString extends GlobalThis {\n  gbigintUseStrInDebugToggleVal: 0 | 1 | undefined;\n}\n","/**\n * @fileoverview Internal symbols and utilities for hidden state keeping.\n *\n * DO NOT USE THIS OUTSIDE OF THIS PACKAGE.\n */\n\ngoog.module('jspb.internal_symbols');\n\nconst {objectProperty} = goog.require('goog.reflect');\n\n/** @define {boolean} */\nconst DISALLOW_NATIVE_SYMBOL =\n    goog.define('jspb.DISALLOW_NATIVE_SYMBOL_FOR_TESTING', false);\n\n/** @const {boolean} */\nconst HAS_NATIVE_SYMBOL = !DISALLOW_NATIVE_SYMBOL &&\n    (goog.FEATURESET_YEAR >= 2018 ||\n     // This particular condition is structured so that the jscompiler\n     // recognizes it as feature detection and won't load the Symbol\n     // polyfill due to this code.  The first check feature detects Symbol\n     // and the second ensures that the version of Symbol that exists is\n     // the native version.\n     typeof Symbol === 'function' && typeof Symbol() === 'symbol');\n\n/**\n * @param {string|undefined} name\n * @param {T} fallbackValue\n * @param {boolean=} useSymbolFor\n * @return {symbol|T}\n * @template T\n * @nosideeffects\n */\nfunction createSymbolInternal(name, fallbackValue, useSymbolFor = false) {\n  // Explicitly test support for native Symbol because Symbol is more performant\n  // than generic properties, but we don't want to fallback to the polyfill\n  // since that creates an enumerable property which isn't desirable.\n  const symbol = !DISALLOW_NATIVE_SYMBOL &&\n          (goog.FEATURESET_YEAR >= 2018 ||\n           // This particular condition is structured so that the jscompiler\n           // recognizes it as feature detection and won't load the Symbol\n           // polyfill due to this code.  The first check feature detects Symbol\n           // and the second ensures that the version of Symbol that exists is\n           // the native version.\n           (typeof Symbol === 'function' && typeof Symbol() === 'symbol')) ?\n      ((useSymbolFor && Symbol.for && name) ?\n           Symbol.for(name) :\n           (name != null ? Symbol(name) : Symbol())) :\n      fallbackValue;\n  return symbol;\n}\n\n/**\n * @param {string} name\n * @param {T} fallbackValue\n * @return {symbol|T}\n * @template T\n * @nosideeffects\n * @requireInlining\n */\nfunction createSymbol(name, fallbackValue) {\n  return createSymbolInternal(goog.DEBUG ? name : undefined, fallbackValue);\n}\n\n/**\n * @param {string} name\n * @param {T} fallbackValue\n * @return {symbol|T}\n * @template T\n * @nosideeffects\n * @requireInlining\n */\nfunction createSymbolFor(name, fallbackValue) {\n  return createSymbolInternal(name, fallbackValue, /* useSymbolFor= */ true);\n}\n\n// Note: this uses Symbol.for to minimize issues with multiple\n// copies of the JSPB runtime (see go/jspb-freeze-and-reload).\n/** @const {symbol|undefined} */\nconst ARRAY_STATE_SYMBOL = createSymbolFor('jas', undefined);\n\n/** @const {symbol|string} */\nconst DEFAULT_IMMUTABLE_INSTANCE_SYMBOL =\n    /** @pureOrBreakMyCode */ (createSymbol('defaultInstance', '0di'));\n\n/** @const {symbol|string} */\nconst DUPLICATED_EXTENSION_SYMBOL =\n    /** @pureOrBreakMyCode */ (\n        createSymbol('DUPLICATED_EXTENSION_SYMBOL', '2ex'));\n\n/** @const {symbol|string} */\nconst ONEOF_ARRAY_SYMBOL =\n    /** @pureOrBreakMyCode */ (createSymbol('oneofCases', '1oa'));\n\n/** @const {symbol|string} */\nconst RETURNED_64BIT_INT_VALUE_MISMATCH_SYMBOL =\n    /** @pureOrBreakMyCode */ (\n        createSymbol('RETURNED_64BIT_INT_VALUE_MISMATCH', '64im'));\n\n/** @const {symbol|string} */\nconst STRING_TYPE_DOWNGRADES_SYMBOL =\n    /** @pureOrBreakMyCode */ (createSymbol('STRING_TYPE_DOWNGRADES', '0dg'));\n\n/** @const {symbol|string} */\nconst CACHED_HASH_CODE_SYMBOL =\n    /** @pureOrBreakMyCode */ (createSymbol('internalJspbHashCode', 'ijhc'));\n\n/** @const {symbol} */\nconst COMPARISON_TYPE_INFO_SYMBOL =\n    /** @pureOrBreakMyCode */ (\n        createSymbol('internalComparisonTypeInfo', Symbol()));\n\n/** @const {symbol} */\nconst UNKNOWN_BINARY_FIELDS_SYMBOL =\n    /** @pureOrBreakMyCode */ (createSymbol('unknownBinaryFields', Symbol()));\n\n/** @const {symbol|string} */\nconst UNKNOWN_BINARY_THROTTLE_KEY =\n    createSymbol('unknownBinaryThrottleKey', '0ub');\n\n/** @const {symbol|string} */\nconst UNKNOWN_BINARY_FIELD_IN_JSPB_SERIALIZE_THROTTLE_KEY =\n    createSymbol('unknownBinaryThrottleKey', '0ubs');\n\n/** @const {symbol|string} */\nconst UNKNOWN_JSPB_FIELD_IN_BINARY_SERIALIZE_THROTTLE_KEY =\n    createSymbol('unknownBinarySerializeBinaryThrottleKey', '0ubsb');\n\n/**\n * @const {symbol}\n *\n * NOTE: this cannot use Symbol.for because we depend on the value being this\n * module's Message type.\n */\nconst CACHED_JSPB_MESSAGE_ON_TRANSFERRED_ARRAY_SYMBOL =\n    /** @pureOrBreakMyCode */ (\n        createSymbol('cachedJspbMessageOnTransferredArray', Symbol()));\n\n/** @const {symbol} */\nconst GET_CLONED_JSPB_ARRAY_ON_TRANSFERRED_ARRAY_SYMBOL =\n    /** @pureOrBreakMyCode */ (createSymbolFor('_jcca', Symbol()));\n\n/** @const {symbol|string} */\nconst ARRAY_SYMBOL_WARNING_KEY =\n    /** @pureOrBreakMyCode */ (createSymbol('arraySymbolWarningKey', 'aswk'));\n\n/** @const {symbol|string} */\nconst ALREADY_CONSTRUCTED_THROTTLE_KEY =\n    /** @pureOrBreakMyCode */ (\n        createSymbol('alreadyConstructedThrottleKey', '0actk'));\n\n/** @const {symbol|string} */\nconst U8_THROTTLE_KEY =\n    /** @pureOrBreakMyCode */ (createSymbol('uint8ArrayThrottleKey', '8utk'));\n\n/** @interface */\nclass WithMessagePrototypeMarker {\n  constructor() {\n    /** @const {?} */\n    this.messagePrototypeMarker;\n  }\n}\n\n/** @const {symbol|string} */\nconst MESSAGE_PROTOTYPE_MARKER = /** @pureOrBreakMyCode */ (createSymbolFor(\n    'm_m',\n    objectProperty(\n        'messagePrototypeMarker',\n        /** @type {!WithMessagePrototypeMarker} */ (undefined))));\n\n/** @const {symbol|string} */\nconst MULTIPLE_RUNTIMES_THROTTLE_KEY =\n    /** @pureOrBreakMyCode */ (\n        createSymbol('multipleRuntimesThrottleKey', 'mrtk'));\n\n/** @const {symbol|string} */\nconst VALID_PIVOT_SELECTOR = createSymbol('validPivotSelector', 'vps');\n\n/**\n * @const {symbol|undefined}\n * @tsType unique symbol\n */\nconst LAZILY_PARSE_LATE_LOADED_EXTENSIONS_SYMBOL =\n    createSymbol('lazilyParseLateLoadedExtensions', undefined);\n\nexports = {\n  ALREADY_CONSTRUCTED_THROTTLE_KEY,\n  MESSAGE_PROTOTYPE_MARKER,\n  ARRAY_STATE_SYMBOL,\n  ARRAY_SYMBOL_WARNING_KEY,\n  CACHED_HASH_CODE_SYMBOL,\n  CACHED_JSPB_MESSAGE_ON_TRANSFERRED_ARRAY_SYMBOL,\n  COMPARISON_TYPE_INFO_SYMBOL,\n  DEFAULT_IMMUTABLE_INSTANCE_SYMBOL,\n  DUPLICATED_EXTENSION_SYMBOL,\n  GET_CLONED_JSPB_ARRAY_ON_TRANSFERRED_ARRAY_SYMBOL,\n  HAS_NATIVE_SYMBOL,\n  LAZILY_PARSE_LATE_LOADED_EXTENSIONS_SYMBOL,\n  MULTIPLE_RUNTIMES_THROTTLE_KEY,\n  ONEOF_ARRAY_SYMBOL,\n  RETURNED_64BIT_INT_VALUE_MISMATCH_SYMBOL,\n  STRING_TYPE_DOWNGRADES_SYMBOL,\n  U8_THROTTLE_KEY,\n  UNKNOWN_BINARY_FIELDS_SYMBOL,\n  UNKNOWN_BINARY_THROTTLE_KEY,\n  UNKNOWN_JSPB_FIELD_IN_BINARY_SERIALIZE_THROTTLE_KEY,\n  UNKNOWN_BINARY_FIELD_IN_JSPB_SERIALIZE_THROTTLE_KEY,\n  VALID_PIVOT_SELECTOR,\n  WithMessagePrototypeMarker,\n};","/**\n * @fileoverview Internal accessors for hidden array state.\n *\n * DO NOT USE THIS OUTSIDE OF THIS PACKAGE.\n */\n\ngoog.module('jspb.internal_array_state');\n\nconst asserts = goog.require('goog.asserts');\nconst {ARRAY_STATE_SYMBOL, HAS_NATIVE_SYMBOL} = goog.require('jspb.internal_symbols');\nconst {getWriteBackGbigintValues} = goog.require('jspb.internal_options');\nconst {objectProperty} = goog.require('goog.reflect');\n\nconst /** number */ DEFAULT_ARRAY_STATE = 0;\n\n/** @enum {number} */\nconst ArrayStateFlags = {\n  /**\n   * If set, this value is a repeated field. Never set for map fields.\n   *\n   * If unset AND another array bit is set AND there was not a schema mismatch,\n   * then this is not a repeated field.\n   */\n  IS_REPEATED_FIELD: 1 << 0,\n\n  /**\n   * If set on a message array, repeated field array, or map (array), this value\n   * cannot be mutated and contains only immutable values.\n   *\n   * Apps JSPB attempts to make state as immutable as possible so that it may\n   * be shared safely across message instances:\n   *\n   * - A message array which is immutable may be shared by any number of\n   *   wrappers. A message array which is mutable and owned may be referenced by\n   *   exactly one wrapper. A message array which is not owned may be shared by\n   *   only one wrapper in addition to external references.\n   *\n   * - A map array or object which is immutable may be shared by any number of\n   *   parent messages. A map array or object which is mutable may be shared\n   *   by only one parent message (except via external references).\n   *\n   * - A repeated field array which is immutable may be shared by any number\n   *   of mutable or immutable parents. A marked mutable repeated field array\n   *   may be shared by any number of mutable parents. An unmarked repeated\n   *   field array may not be shared.\n   *\n   * If set with IS_API_FORMATTED, a repeated field array must be frozen.\n   */\n  IS_IMMUTABLE_ARRAY: 1 << 1,\n\n  /**\n   * If set on a repeated field array, this field has been coerced from wire\n   * types to API types and does not need to be coerced again (though any\n   * new values will).\n   *\n   * This is only set on repeated fields.\n   *\n   * This bit only ensures that values obtained _from the wire_ have been\n   * converted: it's possible for an external mutation from the user to have\n   * added invalid data to this array. As a result, we may clear this bit\n   * in certain circumstances to be totally sure we are protected against\n   * invalid values.\n   *\n   * If set with IS_IMMUTABLE_ARRAY, a repeated field array must be frozen.\n   */\n  IS_API_FORMATTED: 1 << 2,\n\n  /**\n   * If this array has not been externally mutated, this array is a repeated\n   * submessage field and contains only constructed mutable messages. An array\n   * is known to not have been externally mutated if parent message has\n   * MUTABLE_REFERENCES_ARE_OWNED and this array doesn't have UNFROZEN_SHARED.\n   *\n   * We maintain this bit for mutable repeated submessage access on mutable\n   * parents, where it avoids our having to perform a linear traversal on each\n   * access to ensure values have the appropriate mutabilities.\n   *\n   * Only meaningful if IS_REPEATED_FIELD and IS_API_FORMATTED and\n   * not IS_IMMUTABLE_ARRAY.\n   */\n  ONLY_MUTABLE_VALUES: 1 << 3,\n\n  /**\n   * Indicates a repeated field array that has been shared without being frozen.\n   *\n   * Specifically, this means DO_NOT_FREEZE__LEGACY_OPTION has been used on the\n   * array.\n   */\n  UNFROZEN_SHARED: 1 << 4,\n\n  /**\n   * For mutable message arrays, indicates that there can be no references to\n   * this array outside of the runtime. Only meaningful if not\n   * IS_IMMUTABLE_ARRAY.\n   *\n   * A natural consequence is that any un-accessed child message, map, or\n   * repeated fields are not referenced except by this array. Once fields are\n   * first accessed, see IS_IMMUTABLE_ARRAY for invariants concerning sharing of\n   * their references.\n   *\n   * If the value is immutable, this bit is irrelevant and may or may not be\n   * set. It further does _not_ indicate whether references to the array are\n   * shared by multiple messages.\n   *\n   * Note: This bit is only meaningfully set on message arrays. For (unwrapped)\n   * map and repeated field arrays, this bit conceptually always has the same\n   * value as the parent message. Various copying routines that are agnostic to\n   * what the array represents may propagate this bit to map/repeated arrays,\n   * but there's otherwise no guarantee that they are maintained on map/repeated\n   * arrays. Code working with map/repeated arrays should always read this bit\n   * from the parent message if needed.\n   */\n  MUTABLE_REFERENCES_ARE_OWNED: 1 << 5,\n\n  /**\n   * This indicates that the pivot and HAS_MESSAGE_ID bits have reliable values.\n   *\n   * Those bits are always accurate if they are non-zero. However, if they are\n   * zero, then that value is only accurate if this bit is also set.\n   */\n  CONSTRUCTED: 1 << 6,\n\n  /**\n   * Marks the message array as having a message_id object.\n   *\n   * This is used to calculate the array index offset. It is always consistent\n   * for CONSTRUCTED arrays.\n   */\n  HAS_MESSAGE_ID: 1 << 7,\n\n  /**\n   * Indicates that this array is frozen. An array may also be frozen if\n   * (IS_IMMUTABLE_ARRAY && IS_API_FORMATTED) without this bit.\n   *\n   * This bit may be set when we freeze arrays internally to avoid checking\n   * Object.isFrozen.\n   *\n   * We may do this for 'message' arrays that we would like to prevent being\n   * passed to a constructor since FROZEN_ARRAY will cause constructMessageArray\n   * to throw.\n   *\n   * We may also set this bit for repeated submessage fields when some of those\n   * submessages might be mutable. If all of the submessages in the array are\n   * known to be immutable, or it's an owned primitive repeated field, the\n   * IS_IMMUTABLE_ARRAY and IS_API_FORMATTED bits should be set instead of this\n   * one.\n   */\n  FROZEN_ARRAY: 1 << 8,\n\n  // IS_API_FORMATTED subtypes for 64-bit integer repeated fields.\n  //\n  // Note: The absence of any subtype indicates \"legacy\" formatted values that\n  // have been coerced to number|string. We can move freely between\n  // STRING_FORMATTED and GBIGINT_FORMATTED. Legacy formatting is permanently\n  // lost after conversion to GBIGINT_|STRING_FORMATTED since we cannot get the\n  // legacy value back.\n\n  /**\n   * Indicates that valid 64-bit integer values that have been coerced to\n   * string.\n   *\n   * Only meaningful for repeated [u]int64 fields. Should not be set otherwise.\n   */\n  STRING_FORMATTED: 1 << 9,\n\n  /**\n   * Indicates that valid 64-bit integer values that have been coerced to\n   * gbigint.\n   *\n   * Only meaningful for repeated [u]int64 fields. Should not be set otherwise.\n   */\n  GBIGINT_FORMATTED: 1 << 10,\n\n  /** Indicates whether a wrapper has been made for this message array. */\n  HAS_WRAPPER: 1 << 11,\n\n  /**\n   * This is set to true whenever a message or repeated field array contains a\n   * substructure that isn't immutable and cannot be upgraded in place to\n   * immutable.\n   *\n   * Namely, the mutable substructures that cannot be upgraded are:\n   * - Mutable wrapped submessages.\n   * - Repeated fields that are unfrozen shared or contain mutable wrapped\n   * submessages.\n   *\n   * This allows for a special case where we can construct a zero copy immutable\n   * message.\n   */\n  MUTABLE_SUBSTRUCTURES: 1 << 12,\n\n  /**\n   * This is set when we know that the value is semantically a map.\n   *\n   * Code should not assume that the non presence of this bit means that the\n   * array is not a map.\n   *\n   * As an example, this is used in `equals` so that equality tests know to\n   * ignore value ordering.\n   */\n  KNOWN_MAP_ARRAY: 1 << 13,\n};\n\nconst PIVOT_OFFSET = 14;\n// Some implementations (Rhino) may incorrectly implement Math.log2 and produce\n// a non-integer answer, which is in violation of the spec.\nasserts.assert(\n    Math.round(Math.log2(Math.max(...Object.values(ArrayStateFlags)))) ===\n    PIVOT_OFFSET - 1);\nconst PIVOT_BITS = 10;\nconst PIVOT_LIMIT = (1 << PIVOT_BITS);\nconst PIVOT_MASK = PIVOT_LIMIT - 1;\nconst /** number */ ALL_FLAGS = ArrayStateFlags.IS_REPEATED_FIELD |\n    ArrayStateFlags.IS_IMMUTABLE_ARRAY | ArrayStateFlags.IS_API_FORMATTED |\n    ArrayStateFlags.ONLY_MUTABLE_VALUES | ArrayStateFlags.UNFROZEN_SHARED |\n    ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED | ArrayStateFlags.CONSTRUCTED |\n    ArrayStateFlags.HAS_MESSAGE_ID | ArrayStateFlags.STRING_FORMATTED |\n    ArrayStateFlags.GBIGINT_FORMATTED | ArrayStateFlags.FROZEN_ARRAY |\n    ArrayStateFlags.HAS_WRAPPER | ArrayStateFlags.MUTABLE_SUBSTRUCTURES |\n    ArrayStateFlags.KNOWN_MAP_ARRAY | (PIVOT_MASK << PIVOT_OFFSET);\n\n/** @requireInlining */\nfunction assertValidFlags(/** number */ flags) {\n  asserts.assert((flags & ALL_FLAGS) === flags);\n}\n\nconst /** !ArrayStateHolder */ ZERO_ARRAY_STATE_PROPERTY = {\n  internalArrayState: {\n    value: 0,\n    configurable: true,\n    writable: true,\n    enumerable: false,\n  },\n};\n\nconst OBJECT_DEFINE_PROPERTIES = Object.defineProperties;\n\n/** @typedef {{internalArrayState: ?}} */\nlet ArrayStateHolder;\n\n/** @const {boolean} */\nconst USE_SYMBOL_ARRAY_STATE = HAS_NATIVE_SYMBOL;\n\nconst /** symbol|string */ ARRAY_STATE_PROPERTY = /** @pureOrBreakMyCode */ (\n    USE_SYMBOL_ARRAY_STATE ? asserts.assertExists(ARRAY_STATE_SYMBOL) :\n                             objectProperty(\n                                 'internalArrayState',\n                                 /** @type {!ArrayStateHolder} */ (undefined)));\n\n/** const {!ArrayState} */\nconst EMPTY_LIST_SENTINEL_STATE = ArrayStateFlags.IS_IMMUTABLE_ARRAY |\n    ArrayStateFlags.IS_REPEATED_FIELD | ArrayStateFlags.IS_API_FORMATTED;\n\n/**\n * Used to mark empty repeated fields.\n *\n * This value will be replaced by null when serializing to JSON.\n *\n * When reading a repeated field readers must check the return value against\n * this value and return and replace it with a new empty array if it is\n * present.\n *\n * The initializer 'launders' the value through `valueOf` which tricks the\n * compiler into thinking that this is side-effect free, even though\n * `Object.freeze` doesn't normally qualify.  This will allow this declaration\n * to get moved or DCE'd when necessary.\n *\n * @const {!Array<?>}\n */\nconst EMPTY_LIST_SENTINEL = /** @type{!Array<?>} */ ({\n  valueOf: () => {\n    // This is a valid immutable array, so if we mark it as such we can avoid\n    // copies.\n    // Similarly empty arrays are always API_FORMATTED, so we can pre-mark it to\n    // avoid checks elsewhere.\n    const array = [];\n    setArrayState(array, EMPTY_LIST_SENTINEL_STATE);\n    return Object.freeze(array);\n  }\n}.valueOf());\n\n/**\n * Returns the array state value\n * @param {!Array<?>|!ReadonlyArray<?>} arr\n * @return {!ArrayState}\n * @requireInlining\n * @nosideeffects\n */\nfunction getArrayStateInline(arr) {\n  return /** @type {?} */ (asserts.assertArray(\n             arr,\n             'state is only maintained on arrays.'))[ARRAY_STATE_PROPERTY] |\n      0;\n}\n\n/**\n * Returns the array state value\n * @param {!Array<?>|!ReadonlyArray<?>} arr\n * @return {!ArrayState}\n * @nosideeffects\n */\nfunction getArrayState(arr) {\n  return getArrayStateInline(arr);\n}\n\n/**\n * Adds a flag value into the given array's state value.\n *\n * @param {!Array<?>} arr\n * @param {!ArrayState} flags\n * @return {!ArrayState}\n */\nfunction addFlags(arr, flags) {\n  assertValidFlags(flags);\n  asserts.assertArray(arr, 'state is only maintained on arrays.');\n  if (!USE_SYMBOL_ARRAY_STATE && !(ARRAY_STATE_PROPERTY in arr)) {\n    OBJECT_DEFINE_PROPERTIES(arr, ZERO_ARRAY_STATE_PROPERTY);\n  }\n  return /** @type {?} */ (arr)[ARRAY_STATE_PROPERTY] |= flags;\n}\n\n/**\n * Sets the current array state\n * @param {!Array<?>} arr\n * @param {!ArrayState} flags\n * @return {!ArrayState} flags\n */\nfunction setArrayState(arr, flags) {\n  assertValidFlags(flags);\n  asserts.assertArray(arr, 'state is only maintained on arrays.');\n  if (!USE_SYMBOL_ARRAY_STATE && !(ARRAY_STATE_PROPERTY in arr)) {\n    OBJECT_DEFINE_PROPERTIES(arr, ZERO_ARRAY_STATE_PROPERTY);\n  }\n  /** @type {?} */ (arr)[ARRAY_STATE_PROPERTY] = flags;\n  return flags;\n}\n\n/**\n * Clears the array mask's given state value.\n *\n * @param {!Array<?>} arr\n * @param {!ArrayState} flags\n * @return {!ArrayState} the new state\n */\nfunction clearFlags(arr, flags) {\n  assertValidFlags(flags);\n  asserts.assert(ARRAY_STATE_PROPERTY in arr);\n  asserts.assertArray(arr, 'state is only maintained on arrays.');\n  return /** @type {?} */ (arr)[ARRAY_STATE_PROPERTY] &= ~flags;\n}\n\n/**\n * Returns whether or not at least one of the flag bit(s) is set on the given\n * array state.\n * @param {!ArrayState} stateValue The array's state value.\n * @param {!ArrayState} flag The flag bit(s) to check.\n * @return {boolean}\n * @requireInlining\n */\nfunction hasFlagBit(stateValue, flag) {\n  return !!(flag & stateValue);\n}\n\n/**\n * Sets the flag bit(s) on the given array state. If isEnabled, sets the flag\n * bit(s) to '1'. Otherwise, clears the flag bit(s) by setting it to '0'.\n * @param {!ArrayState} stateValue The array's state value.\n * @param {!ArrayState} flag The flag bit(s) to toggle.\n * @param {boolean} isEnabled Whether to enable or disable the flag bit(s).\n * @return {!ArrayState} The new state value.\n * @requireInlining\n */\nfunction setFlagBitTo(stateValue, flag, isEnabled) {\n  return isEnabled ? setFlagBit(stateValue, flag) :\n                     clearFlagBit(stateValue, flag);\n}\n\n/**\n * Sets the flag bit(s) on the given array state to 1.\n * @param {!ArrayState} stateValue The array's state value.\n * @param {!ArrayState} flag The flag bit(s) to set.\n * @return {!ArrayState} The new state value.\n * @requireInlining\n */\nfunction setFlagBit(stateValue, flag) {\n  return stateValue | flag;\n}\n\n/**\n * Clears the flag bit(s) on the given array state.\n * @param {!ArrayState} stateValue The array's state value.\n * @param {!ArrayState} flag The flag bit(s) to clear.\n * @return {!ArrayState} The new state value.\n * @requireInlining\n */\nfunction clearFlagBit(stateValue, flag) {\n  return stateValue & ~flag;\n}\n\nfunction checkMessageStateInvariants(\n    /** !Array */ array, /** !ArrayState */ arrayState,\n    /** boolean= */ allowUnconstructed = false) {\n  // Invariant checking for message states\n\n  // Messages always set CONSTRUCTED unless we are in binary serialization\n  // or deserialization, in which case we only partially 'construct' the message\n  // array to handle message_id and pivot state.\n  //\n  // But if HAS_WRAPPER is set, we must always be constructed.\n  if (!allowUnconstructed || arrayState & ArrayStateFlags.HAS_WRAPPER) {\n    asserts.assert(\n        arrayState & ArrayStateFlags.CONSTRUCTED,\n        'state for messages must be constructed');\n  }\n\n  asserts.assert(\n      (arrayState &\n       (ArrayStateFlags.IS_REPEATED_FIELD |\n        ArrayStateFlags.IS_API_FORMATTED)) === 0,\n      'state for messages should not contain repeated field state');\n\n  asserts.assert(\n      (arrayState & (ArrayStateFlags.KNOWN_MAP_ARRAY)) === 0,\n      'state for messages should not contain map field state');\n\n  // HAS_SPARSE_OBJECT, HAS_MESSAGE_ID, and the pivot are only consistently set\n  // for constructed messages.\n  if (arrayState & ArrayStateFlags.CONSTRUCTED) {\n    // Fields like pivot and arrayIndexOffset should be in\n    // sync with the array structure\n    const pivot = getPivot(arrayState);\n    const arrayIndexOffset = getArrayIndexOffset(arrayState);\n    const arrayLength = array.length;\n    asserts.assert(\n        pivot + arrayIndexOffset >= arrayLength - 1,\n        'pivot %s is pointing at an index earlier than the last index of the array, length: %s',\n        pivot, arrayLength);\n    if (arrayState & ArrayStateFlags.HAS_MESSAGE_ID) {\n      asserts.assert(\n          typeof array[0] === 'string',\n          'arrays with a message_id bit must have a string in the first position, got: %s',\n          array[0]);\n    }\n  }\n}\n\n/**\n * Returns the array state value for a constructed message\n *\n * This is identical to getArrayStateInline but adds some extra development time\n * checks.\n * @param {!Array<?>} arr\n * @param {boolean=} allowUnconstructed\n * @return {!ArrayState}\n * @requireInlining\n * @nosideeffects\n */\nfunction getMessageArrayStateInline(arr, allowUnconstructed) {\n  const state = getArrayStateInline(arr);\n  if (asserts.ENABLE_ASSERTS) {\n    checkMessageStateInvariants(arr, state, allowUnconstructed);\n  }\n  return state;\n}\n\n/**\n * @param {!Array<?>} arr\n * @return {!ArrayState}\n * @nosideeffects\n */\nfunction getMessageArrayState(arr) {\n  return getMessageArrayStateInline(arr);\n}\n\n/**\n * @param {!Array<?>} arr\n * @return {!ArrayState}\n * @requireInlining\n * @nosideeffects\n */\n// TODO: b/436254718 - remove this in favor of a getMessageArrayState that\n// does not assert.\nfunction getPossiblyUnconstructedMessageArrayStateInline(arr) {\n  return getMessageArrayStateInline(arr, /* allowUnconstructed= */ true);\n}\n\n/**\n * @param {!Array<?>} arr\n * @return {!ArrayState}\n * @nosideeffects\n */\n// TODO: b/436254718 - remove this in favor of a getMessageArrayState that\n// does not assert.\nfunction getPossiblyUnconstructedMessageArrayState(arr) {\n  return getPossiblyUnconstructedMessageArrayStateInline(arr);\n}\n\n/**\n * Returns the array state value of a repeated field.\n * @param {!Array<?>|!ReadonlyArray<?>} arr\n * @return {!ArrayState}\n * @requireInlining\n */\nfunction getRepeatedArrayState(arr) {\n  return arr === EMPTY_LIST_SENTINEL ? EMPTY_LIST_SENTINEL_STATE :\n                                       getArrayStateInline(arr);\n}\n\n/**\n * Array API formatting states for 64-bit integer fields.\n * @enum {number}\n */\nconst TypeSpecificApiFormat = {\n  LEGACY: 0,\n  STRING: ArrayStateFlags.STRING_FORMATTED,\n  GBIGINT: ArrayStateFlags.GBIGINT_FORMATTED,\n};\n\n/**\n * Returns the current TypeSpecificApiFormat of the provided array or undefined\n * if the array lacks IS_API_FORMATTED.\n * @param {!ArrayState} state\n * @return {!TypeSpecificApiFormat|undefined}\n */\nfunction getTypeSpecificApiFormat(state) {\n  if (hasFlagBit(state, ArrayStateFlags.IS_API_FORMATTED)) {\n    if (hasFlagBit(state, ArrayStateFlags.STRING_FORMATTED)) {\n      return TypeSpecificApiFormat.STRING;\n    } else if (hasFlagBit(state, ArrayStateFlags.GBIGINT_FORMATTED)) {\n      return TypeSpecificApiFormat.GBIGINT;\n    }\n    return TypeSpecificApiFormat.LEGACY;\n  }\n\n  return undefined;\n}\n\n/** @return {!TypeSpecificApiFormat} */\nfunction getDefaultTypeSpecificApiFormat() {\n  return getWriteBackGbigintValues() ? TypeSpecificApiFormat.GBIGINT :\n                                       TypeSpecificApiFormat.LEGACY;\n}\n\n/**\n * @param {!ArrayState} state\n * @return {!ArrayState}\n */\nfunction clearTypeSpecificFormattedFlagBits(state) {\n  state = clearFlagBit(state, ArrayStateFlags.STRING_FORMATTED);\n  state = clearFlagBit(state, ArrayStateFlags.GBIGINT_FORMATTED);\n\n  return state;\n}\n\n/**\n * Tests whether or not the given array has been tagged with\n * `markApiFormattedField`.\n *\n * @param {!Array<?>} arr\n * @return {boolean}\n */\nfunction isApiFormattedField(arr) {\n  const state = getArrayStateInline(arr);\n  return Boolean(state & ArrayStateFlags.IS_API_FORMATTED);\n}\n\n/**\n * Returns whether arr is an immutable array.\n * @param {!Array<?>} arr\n * @return {boolean}\n */\nfunction isImmutableArray(arr) {\n  const state = getArrayStateInline(arr);\n  return Boolean(state & ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n}\n\n/**\n * Marks arr as an immutable array.\n *\n * @param {!Array<T>} arr\n * @return {!Array<T>} arr\n * @template T\n */\nfunction markArrayImmutable(arr) {\n  addFlags(\n      arr,\n      ArrayStateFlags.IS_IMMUTABLE_ARRAY |\n          ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED);\n  return arr;\n}\n\n/**\n * Marks arr as a known map array.\n *\n * @param {!Array<T>} arr\n * @return {!Array<T>} arr\n * @template T\n */\nfunction markKnownMapArray(arr) {\n  addFlags(arr, ArrayStateFlags.KNOWN_MAP_ARRAY);\n  return arr;\n}\n\n/**\n * Marks arr as having owned references.\n *\n * @param {!Array<T>} arr\n * @return {!Array<T>}\n * @template T\n */\nfunction markMutableReferencesAreOwned(arr) {\n  addFlags(arr, ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED);\n  return arr;\n}\n\n\n\n/**\n * Marks arr as shared, unsetting the owned bit.\n *\n * @param {!Array<T>} arr\n * @return {!Array<T>} arr\n * @template T\n */\nfunction markShared(arr) {\n  clearFlags(arr, ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED);\n  return arr;\n}\n\n/**\n * Returns whether we know arr to only have owned references.\n *\n * @param {!ReadonlyArray<?>} arr\n * @return {boolean}\n */\nfunction areMutableReferencesOwned(arr) {\n  const state = getArrayStateInline(arr);\n  return Boolean(state & ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED);\n}\n\n/**\n * Marks arr as having been used to construct a message or map.\n *\n * @param {!Array<T>} arr\n * @return {!Array<T>} arr\n * @template T\n */\nfunction markConstructed(arr) {\n  addFlags(arr, ArrayStateFlags.CONSTRUCTED);\n  return arr;\n}\n\n\n/** @typedef {number} */\nlet ArrayState;\n\n\n/**\n * @param {!ArrayState} fromState\n * @param {boolean=} markImmutable\n * @return {!ArrayState}\n */\nfunction copyArrayBitsClone(fromState, markImmutable) {\n  // Preserve the following bits:\n  // - IS_REPEATED_FIELD: this makes certain comparisons easier.\n  // - HAS_MESSAGE_ID: This is important for pivot selection logic\n  // - CONSTRUCTED: this bit lets us know we can trust the pivot value.\n  // - PIVOT: Copy the pivot value if present\n  //\n  // We do not copy the following bits:\n  // - IS_API_FORMATTED: For some repeated fields we could maintain this bit but\n  //   there are subtleties with repeated messages that make this tricky. For\n  //   now we drop it.\n  //     - The same goes for many other repeated field bits.  There is an\n  //       opportunity to improve this in the future.\n  let flagsToAdd = ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED;\n  if (markImmutable) {\n    flagsToAdd |= ArrayStateFlags.IS_IMMUTABLE_ARRAY;\n  }\n  const flagsToKeep = ArrayStateFlags.IS_REPEATED_FIELD |\n      ArrayStateFlags.KNOWN_MAP_ARRAY | ArrayStateFlags.HAS_MESSAGE_ID |\n      ArrayStateFlags.CONSTRUCTED | (PIVOT_MASK << PIVOT_OFFSET);\n  return (fromState & flagsToKeep) | flagsToAdd;\n}\n\n// This value is higher than all field numbers but it is still small enough to\n// be a SMI\nconst /** number */ NO_PIVOT = 1 << 29;\n\n/** @return {number} */\nfunction setPivot(/** !ArrayState */ arrayState, /** number */ pivot) {\n  asserts.assertNumber(pivot);\n  asserts.assert(\n      pivot > 0 && pivot <= PIVOT_MASK || NO_PIVOT === pivot,\n      'pivot must be in the range [1, 1024) or NO_PIVOT got %s', pivot);\n  // clear old and set new\n  // by masking pivot with PIVOT_MASK we implicitly turn NO_PIVOT into zero.\n  return (arrayState & ~(PIVOT_MASK << PIVOT_OFFSET)) |\n      ((pivot & PIVOT_MASK) << PIVOT_OFFSET);\n}\n\n/**\n * Returns the pivot where a sparse object should be written.\n *\n *\n * @return {number} @requireInlining\n */\nfunction getPivot(/** !ArrayState */ arrayState) {\n  asserts.assert(arrayState & ArrayStateFlags.CONSTRUCTED);\n  return (arrayState >> PIVOT_OFFSET) & PIVOT_MASK || NO_PIVOT;\n}\n\n/** @return {number} @requireInlining */\nfunction getArrayIndexOffsetInline(/** !ArrayState */ arrayState) {\n  // If there is a message id it is 0 otherwise -1.\n  //\n  // NOTE: by making this a single expression we can keep this as an inlining\n  // candidate\n  asserts.assert(arrayState & ArrayStateFlags.CONSTRUCTED);\n  return arrayState & ArrayStateFlags.HAS_MESSAGE_ID ? 0 : -1;\n}\n\n/**\n * @return {number}\n * @nosideeffects\n */\nfunction getArrayIndexOffset(\n    /** !ArrayState */ arrayState) {\n  return getArrayIndexOffsetInline(arrayState);\n}\n\nif (goog.DEBUG) {\n  // Capture the previous version of this property if any, this will happen if\n  // there are multiple copies of this code loaded in the same window.\n  const prev = Object.getOwnPropertyDescriptor(\n      Array.prototype, objectProperty('jspbArrayState', Array.prototype));\n  // Add a debug property to aid developer usecases in the console.\n  Object.defineProperties(Array.prototype, {\n    jspbArrayState: {\n      /**\n       * @this {!Array<?>}\n       * @return {string}\n       */\n      get() {\n        const formatted = prettyPrintArrayState(this);\n        if (prev) {\n          // compose with prior version if any.\n          return prev.get.call(this) + '|' + formatted;\n        }\n        return formatted;\n      },\n      // Allow this property to be defined multiple times in case multiple\n      // binaries are loaded onto the same page with this code.\n      configurable: true,\n      enumerable: false,\n    },\n  });\n}\n\n/** @return {string} */\nfunction prettyPrintArrayState(/** !Array<?> */ array) {\n  const arrayState = getArrayState(array);\n  const bits = [];\n  function maybeAddFlag(/** !ArrayStateFlags */ bit, /** string */ s) {\n    if (bit & arrayState) {\n      bits.push(s);\n    }\n  }\n  maybeAddFlag(ArrayStateFlags.IS_REPEATED_FIELD, 'IS_REPEATED_FIELD');\n  maybeAddFlag(ArrayStateFlags.IS_IMMUTABLE_ARRAY, 'IS_IMMUTABLE_ARRAY');\n  maybeAddFlag(ArrayStateFlags.IS_API_FORMATTED, 'IS_API_FORMATTED');\n  maybeAddFlag(ArrayStateFlags.STRING_FORMATTED, 'STRING_FORMATTED');\n  maybeAddFlag(ArrayStateFlags.GBIGINT_FORMATTED, 'GBIGINT_FORMATTED');\n  maybeAddFlag(ArrayStateFlags.GBIGINT_FORMATTED, 'BINARY');\n  maybeAddFlag(ArrayStateFlags.ONLY_MUTABLE_VALUES, 'ONLY_MUTABLE_VALUES');\n  maybeAddFlag(ArrayStateFlags.UNFROZEN_SHARED, 'UNFROZEN_SHARED');\n  maybeAddFlag(\n      ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED,\n      'MUTABLE_REFERENCES_ARE_OWNED');\n  maybeAddFlag(ArrayStateFlags.CONSTRUCTED, 'CONSTRUCTED');\n  maybeAddFlag(ArrayStateFlags.HAS_MESSAGE_ID, 'HAS_MESSAGE_ID');\n  maybeAddFlag(ArrayStateFlags.FROZEN_ARRAY, 'FROZEN_ARRAY');\n  maybeAddFlag(ArrayStateFlags.HAS_WRAPPER, 'HAS_WRAPPER');\n  maybeAddFlag(ArrayStateFlags.MUTABLE_SUBSTRUCTURES, 'MUTABLE_SUBSTRUCTURES');\n  maybeAddFlag(ArrayStateFlags.KNOWN_MAP_ARRAY, 'KNOWN_MAP_ARRAY');\n  if (arrayState & ArrayStateFlags.CONSTRUCTED) {\n    const pivot = getPivot(arrayState);\n    if (pivot !== NO_PIVOT) {\n      bits.push(`pivot: ${pivot}`);\n    }\n  }\n  return bits.join(',');\n}\n\nexports = {\n  ArrayState,\n  ArrayStateFlags,\n  DEFAULT_ARRAY_STATE,\n  EMPTY_LIST_SENTINEL,\n  NO_PIVOT,\n  PIVOT_LIMIT,\n  TypeSpecificApiFormat,\n  addArrayStateFlags: addFlags,\n  areMutableReferencesOwned,\n  checkMessageStateInvariants,\n  clearFlagBit,\n  clearFlags,\n  clearTypeSpecificFormattedFlagBits,\n  copyArrayBitsClone,\n  getArrayIndexOffsetInline,\n  getArrayIndexOffset,\n  getArrayState,\n  getArrayStateInline,\n  getDefaultTypeSpecificApiFormat,\n  getMessageArrayState,\n  getMessageArrayStateInline,\n  getPivot,\n  getPossiblyUnconstructedMessageArrayState,\n  getPossiblyUnconstructedMessageArrayStateInline,\n  getRepeatedArrayState,\n  getTypeSpecificApiFormat,\n  hasFlagBit,\n  isApiFormattedField,\n  isImmutableArray,\n  markArrayImmutable,\n  markConstructed,\n  markKnownMapArray,\n  markMutableReferencesAreOwned,\n  markShared,\n  prettyPrintArrayState,\n  setArrayState,\n  setFlagBit,\n  setFlagBitTo,\n  setPivot,\n};\n","/**\n * @fileoverview Common low level runtime utilities.\n */\ngoog.module('jspb.internal');\n\nconst {ArrayState, ArrayStateFlags, addArrayStateFlags, getArrayIndexOffset, getArrayState, getMessageArrayState, hasFlagBit, setArrayState} = goog.require('jspb.internal_array_state');\nconst {ByteString} = goog.require('jspb.bytestring');\nconst {DETAILED_JSPB_ASSERTS} = goog.require('jspb.internal_options');\nconst {ENABLE_ASSERTS, assert, assertArray, assertExists, assertInstanceof, assertNumber, fail} = goog.require('goog.asserts');\nconst {HAS_NATIVE_SYMBOL, MESSAGE_PROTOTYPE_MARKER, WithMessagePrototypeMarker} = goog.require('jspb.internal_symbols');\nconst {dataAsU8, isU8} = goog.require('jspb.internal_bytes');\nconst {unsafeUnwrapByteString} = goog.require('jspb.unsafe_bytestring');\n\n/**\n * Inner interface of the structure of a Message.\n *\n * <p>This can contain whatever we need in order to move functionality into this\n * file and out of message.js.  Because of the `exports` in message.js all\n * functionality needs to be exposed as properties on `Message`, as such it will\n * be inherited by es6 subclasses due to static-side inheritance.  To avoid that\n * internal functionality should be moved here.\n *\n * @interface\n * @extends {WithMessagePrototypeMarker}\n */\nclass InternalMessage {\n  constructor() {\n    /**\n     * @private {!Array<*>}\n     */\n    this.internalArrayDoNotAccessOrElseMightBeUndefinedWhoKnows;\n\n    /**\n     * This flag indicates that the message is mutable but the array is\n     * immutable and we should copy it if we need to mutate.\n     *\n     * @private {!PrivateOptionToken|undefined}\n     */\n    this.copyOnWrite;\n\n    /**\n     * This flag indicates getters should always return `undefined` instead of\n     * `null`. We use this to preserve behavior of messages that are the result\n     * of copies when we take the copy-on-write path. Without copy-on-write,\n     * the copy routine always turns `null` into `undefined`.\n     *\n     * @private {!PrivateOptionToken|undefined}\n     */\n    this.noLegacyNull;\n  }\n\n  /** @return {boolean} */\n  isImmutable() {}\n\n  /** @return {!Array<?>} */\n  toJsonValue() {}\n\n  /** @return {string|undefined} */\n  getJsPbMessageId() {}\n\n  /** @return {?} */\n  getExtension(/** ? */ extensionFieldInfo) {}\n\n  /** @return {number} */\n  getExtensionCount(/** ? */ extensionFieldInfo) {}\n\n  /** @return {boolean} */\n  hasExtension(/** ? */ extensionFieldInfo) {}\n\n  /** @return {?} */\n  getReadonlyExtension(/** ? */ extensionFieldInfo) {}\n\n  /** @return {?} */\n  getExtensionAtIndex(/** ? */ extensionFieldInfo, /** number */ index) {}\n}\n\nconst /** boolean */ USE_SYMBOL_FOR_INTERNAL_ARRAY =\n    goog.DEBUG && HAS_NATIVE_SYMBOL && (Math.random() < 0.5);\n\nconst /** symbol|undefined */ INTERNAL_ARRAY_SYMBOL =\n    USE_SYMBOL_FOR_INTERNAL_ARRAY ? Symbol() : undefined;\n\n/**\n *\n * @param {!InternalMessage} msg The message to get the internal array from.\n * @return {!Array<*>} The internal array of the message.\n * @nosideeffects\n * @requireInlining\n */\nfunction getInternalArrayInline(msg) {\n  assert(isMessage(msg));\n  if (USE_SYMBOL_FOR_INTERNAL_ARRAY) {\n    return msg[assertExists(INTERNAL_ARRAY_SYMBOL)];\n  } else {\n    return msg.internalArrayDoNotAccessOrElseMightBeUndefinedWhoKnows;\n  }\n}\n\n/**\n *\n * @param {!InternalMessage} msg The message to get the internal array from.\n * @return {!Array<*>} The internal array of the message.\n * @nosideeffects\n */\nfunction getInternalArray(msg) {\n  return getInternalArrayInline(msg);\n}\n\n/**\n * Sets the internal array of the message.\n * @param {!InternalMessage} msg\n * @param {!Array<*>} array\n * @requireInlining\n */\nfunction setInternalArrayForNewMessage(msg, array) {\n  assert(isMessage(msg));\n  assertArray(array);\n  if (USE_SYMBOL_FOR_INTERNAL_ARRAY) {\n    msg[assertExists(INTERNAL_ARRAY_SYMBOL)] = array;\n  } else {\n    msg.internalArrayDoNotAccessOrElseMightBeUndefinedWhoKnows = array;\n  }\n}\n\n/**\n * Sets the internal array of the message and clears copyOnWrite.\n * @param {!InternalMessage} msg\n * @param {!Array<*>} array\n * @requireInlining\n */\nfunction setInternalArray(msg, array) {\n  addArrayStateFlags(array, ArrayStateFlags.HAS_WRAPPER);\n  setInternalArrayForNewMessage(msg, array);\n  setCopyOnWrite(msg, false);\n  setNoLegacyNull(msg, false);\n}\n\n/**\n * This exists only to define toMutable somewhere, so that internal_map can call\n * toMutable. Nothing actually references this interface. The use of toMutable\n * in internal_map is on a 'loose type', but if toMutable isn't defined anywhere\n * in the internal modules, the compiler thinks toMutable definitely doesn't\n * exist.\n *\n * We can't put toMutable in InternalMessage because in TS it would be treated\n * as public (even if marked protected), but Message wants to make toMutable\n * protected. TS would consider Message to not be assignable to InternalMessage\n * due to the visibility difference of toMutable.\n *\n * @interface\n */\nclass InternalImmutableMessage {\n  /** @return {*} */\n  toMutable() {}\n}\n\n/**\n * Inner interface of the structure of an ExtensionFieldInfo.\n *\n * @interface\n */\nclass InternalExtensionFieldInfo {\n  constructor() {\n    /** @const {number} */\n    this.fieldIndex;\n\n    /** @const {function(new: InternalMessage, ?Array=)|undefined} */\n    this.extendeeCtor;\n\n    /** @const {?function(new: InternalMessage, ?Array=)} */\n    this.ctor;\n\n    /** @const {number} */\n    this.isRepeated;\n  }\n}\n\n/** @type {?} */\nlet messageCtor;\n\nfunction setMessageCtorInDebug(/** !Function */ ctor) {\n  if (!goog.DEBUG) return;\n  messageCtor = ctor;\n}\n\n/** @const {boolean} */\nconst MESSAGE_PROTOTYPE_MARKER_IS_SYMBOL =\n    typeof MESSAGE_PROTOTYPE_MARKER === 'symbol';\n\n/** @const {!Object} */\nconst MESSAGE_PROTOTYPE_MARKER_VALUE = {};\n\n/**\n * Returns whether or not the object is a Message subtype.  This is intended to\n * be used for values found in the array/sparseObject of a jspb.Message.\n *\n * @param {!Object} v The value, callers should have already checked that it is\n *     non-null.\n * @return {boolean}\n * @tsType (v: Object): v is InternalMessage\n */\nfunction isMessage(v) {\n  const value = v[MESSAGE_PROTOTYPE_MARKER];\n  const result = value === MESSAGE_PROTOTYPE_MARKER_VALUE;\n  assert(!messageCtor || result === (v instanceof messageCtor));\n  if (MESSAGE_PROTOTYPE_MARKER_IS_SYMBOL && value && !result) {\n    if (goog.DEBUG) throw new Error('multiple jspb runtimes detected');\n  }\n  return result;\n}\n\n/**\n * Returns whether or not the value is a Message. Unlike isMessage, accepts all\n * inputs and doesn't throw on nullish values.\n *\n * @param {*} v\n * @return {boolean}\n * @tsType (v: unknown): v is InternalMessage\n */\nfunction isInternalMessage(v) {\n  return v != null && isMessage(/** @type {!Object} */ (v));\n}\n\n/** @const {!Object} */\nconst ANY_PROTOTYPE_MARKER_VALUE = {};\n\n/**\n * Returns whether or not the object is an Any.\n *\n * This is defined to break dep cycles with our generated code.\n *\n * @param {!Object} v The value, callers should have already checked that it is\n *     non-null.\n * @return {boolean}\n */\nfunction isAny(v) {\n  const fn = /** @type {{jspbInternalDoNotUseAnyMarker: !Function}} */ (v)\n                 .jspbInternalDoNotUseAnyMarker;\n  if (typeof fn === 'function') {\n    return fn() === ANY_PROTOTYPE_MARKER_VALUE;\n  }\n  return false;\n}\n\n\n/**\n * Inner interface of the structure of a Map.\n *\n * @interface\n */\nclass InternalMap {\n  constructor() {\n    /**\n     * @private\n     * @const {number}\n     */\n    this.arrayState;\n\n    /**\n     * @private\n     * @const {!Object}\n     */\n    this.mapPrototypeMarker;\n  }\n}\n\n/**\n * Interface used to define the serializeBinaryFnForAnyProto_ property used by\n * packAnyValueJspb.\n *\n * @interface\n */\nclass SerializeBinaryFnHolder {\n  constructor() {\n    /**\n     * If this is an Any proto, this can store the serializeBinary function to\n     * serialize the value to binary. See implementation of packAnyValueJspb.\n     *\n     * @type {(function(?):!Uint8Array)|undefined}\n     */\n    this.serializeBinaryFnForAnyProto_;\n  }\n}\n\n/** @const {!Object} */\nconst MAP_PROTOTYPE_MARKER_VALUE = {};\n\n/**\n * Returns whether or not the object is a JspbMap.\n *\n * Note that this is a property test instead of an `instanceof` check because\n * that is, curiously, about twice as fast.\n *\n * @param {!Object} v The value, callers should have already checked that it is\n *     non-null.\n * @return {boolean}\n * @suppress {visibility} access to map internals\n */\nfunction isMap(v) {\n  const result =\n      !!(v && (typeof v === 'object') &&\n         (/** @type {!InternalMap} */ (v).mapPrototypeMarker ===\n          MAP_PROTOTYPE_MARKER_VALUE));\n  assert(result === (v instanceof Map));\n  return result;\n}\n\n/**\n * Returns whether or not the object is an empty JSPB map.\n *\n * This method is designed to avoid pinning the polyfill for maps.\n *\n * @param {!Object} v The value\n * @return {boolean}\n */\nfunction isEmptyMap(v) {\n  return isMap(v) && assertInstanceof(v, Map).size === 0;\n}\n\n/**\n * Returns the index into `internalArray_` at which the proto field with tag\n * number fieldNumber will be located.\n * @return {number}\n */\nfunction indexFromFieldNumber(\n    /** number */ fieldNumber, /** number */ arrayIndexOffset) {\n  assertNumber(fieldNumber);\n  assert(fieldNumber > 0);\n  assert(arrayIndexOffset === 0 || arrayIndexOffset === -1);\n  return fieldNumber + arrayIndexOffset;\n}\n\n/**\n * Returns the index into the array at which the proto field with tag\n * number fieldNumber will be located.\n * @return {number}\n */\nfunction indexFromFieldNumberAndHasMessageId(\n    /** number */ fieldNumber, /** !HasMessageId|undefined */ hasMessageId) {\n  assert(hasMessageId === HAS_MESSAGE_ID || hasMessageId === NO_MESSAGE_ID);\n  return fieldNumber + (hasMessageId ? 0 : -1);\n}\n\n/**\n * Returns the tag number based on the index in msg.array.\n * @return {number}\n */\nfunction fieldNumberFromIndex(\n    /** number */ index, /** number */ arrayIndexOffset) {\n  assertNumber(index);\n  assert(index >= 0);\n  assert(arrayIndexOffset === 0 || arrayIndexOffset === -1);\n  return index - arrayIndexOffset;\n}\n\n/**\n * Returns true if the provided message immutable.\n *\n * A message is immutable if and only if its array is immutable and it is not\n * copy-on-write.\n * @param {!InternalMessage} msg Message to check.\n * @param {!ArrayState=} arrayState message array state\n * @return {boolean}\n * @package\n */\nfunction isImmutableMessage(msg, arrayState) {\n  // use least expensive path based on already-read data\n  if (arrayState === undefined) {\n    return !isCopyOnWrite(msg) &&\n        hasFlagBit(\n            getMessageArrayState(getInternalArray(msg)),\n            ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n  } else {\n    assert(arrayState === getMessageArrayState(getInternalArray(msg)));\n    return hasFlagBit(arrayState, ArrayStateFlags.IS_IMMUTABLE_ARRAY) &&\n        !isCopyOnWrite(msg);\n  }\n}\n\nclass PrivateOptionToken {}\n\n/** @const {!PrivateOptionToken} */\nconst PRIVATE_OPTION_TOKEN = /** @type {!PrivateOptionToken} */ ({});\n\n/**\n * @param {!InternalMessage} msg\n * @return {boolean}\n */\nfunction isCopyOnWrite(msg) {\n  const value = msg.copyOnWrite;\n  assert(\n      !value ||\n      hasFlagBit(\n          getMessageArrayState(getInternalArray(msg)),\n          ArrayStateFlags.IS_IMMUTABLE_ARRAY));\n  assert(value === undefined || value === PRIVATE_OPTION_TOKEN);\n  return value === PRIVATE_OPTION_TOKEN;\n}\n\n/**\n * @param {!InternalMessage} msg\n * @param {boolean} value\n */\nfunction setCopyOnWrite(msg, value) {\n  assert(\n      value ===\n      hasFlagBit(\n          getMessageArrayState(getInternalArray(msg)),\n          ArrayStateFlags.IS_IMMUTABLE_ARRAY));\n  msg.copyOnWrite = value ? PRIVATE_OPTION_TOKEN : undefined;\n}\n\n/**\n * @param {!InternalMessage} msg\n * @return {boolean}\n */\nfunction isNoLegacyNull(msg) {\n  const value = msg.noLegacyNull;\n  assert(value === undefined || value === PRIVATE_OPTION_TOKEN);\n  return value === PRIVATE_OPTION_TOKEN;\n}\n\n/**\n * @param {!InternalMessage} msg\n * @param {boolean} value\n */\nfunction setNoLegacyNull(msg, value) {\n  msg.noLegacyNull = value ? PRIVATE_OPTION_TOKEN : undefined;\n}\n\n/**\n * Returns true if the provided argument is an extension object.\n *\n * Prior to calling this you should check that the element is the last item of\n * the owning array and that the array is the internalArray_ of a message\n * instance.\n *\n * @param {*} o The object to classify as array or not.\n * @return {boolean} True if the provided object is an extension object.\n * @requireInlining\n */\nfunction isSparseObjectInline(o) {\n  // Normal fields are never plain objects, so we can be sure that if we find an\n  // object here, then it is the extension object.\n  return o != null && typeof o === 'object' &&\n      /** @type {!Object} */ (o).constructor === Object;\n}\n\n/**\n * Returns true if the provided argument is an extension object.\n *\n * Prior to calling this you should check that the element is the last item of\n * the owning array and that the array is the internalArray_ of a message\n * instance.\n *\n * @param {*} o The object to classify as array or not.\n * @return {boolean} True if the provided object is an extension object.\n */\nfunction isSparseObject(o) {\n  return isSparseObjectInline(o);\n}\n\n/**\n * Helper method to ensure that properties iterated with for-in loop come from\n * the object. If JS runs on a pages with other 3rd party code it's possible\n * that that code (e.g. prototype.js) patches native Object.prototype. Without\n * hasOwnProperty JSPB code might get broken by that. Most google code runs on\n * owned pages and it's very unlikely to get patched native prototype. So by\n * default this check always returns true. The check is only enabled when\n * goog.TRUSTED_SITE is set to false.\n *\n * @param {!Object} obj\n * @param {string} property\n * @return {boolean}\n */\nfunction hasOwnPropertyIfNotTrusted(obj, property) {\n  return goog.TRUSTED_SITE ||\n      // Per http://jsben.ch/RIBNc this is the fastest way to call and is, as of\n      // 2023 faster than Object.hasOwn.\n      Object.prototype.hasOwnProperty.call(obj, property);\n}\n\n\n/**\n * A marker for JSPB subclasses which have been explicitly exempted from runtime\n * enforcement. See javascript/apps/jspb/exemptions/unsupported_subclass.js and\n * its callers.\n * @const {symbol|undefined}\n * @public because it is accessed by the 'exemptions' subpackage.\n */\nconst EXEMPTED_SUBCLASS_MARKER = ENABLE_ASSERTS ?\n    Symbol(goog.DEBUG ? 'exempted jspb subclass' : undefined) :\n    undefined;\n\n/**\n * A marker added to all generated JSPB subclasses so the runtime can verify\n * expected subclasses.\n *  @const {symbol|undefined}\n */\nconst GENERATED_SUBCLASS_MARKER = ENABLE_ASSERTS ?\n    Symbol(goog.DEBUG ? 'generated by jspb' : undefined) :\n    undefined;\n\n\n/**\n * Coerce a 'bytes' field to a Uint8Array byte buffer.\n * Note that Uint8Array is not supported on IE versions before 10 nor on Opera\n * Mini. @see http://caniuse.com/Uint8Array\n * @param {string|!Uint8Array|!ByteString|null} value\n * @return {?Uint8Array} The field's coerced value.\n */\nfunction bytesAsU8(value) {\n  return dataAsU8(\n      /** @type {string|?Uint8Array} */ (maybeUnsafeUnwrapByteString(value)));\n}\n\n/** @return {!ByteString} lies */\nfunction invalidBytes(/** ? */ value) {\n  throw goog.DEBUG ?\n      new Error(\n          'cannot coerce ' + value +\n          ' to a ByteString, expected a uint8Array, a base64 encoded string or a ByteString') :\n      new Error();\n}\n/**\n * Wraps a 'bytes' field into a ByteString.\n * @param {string|!Uint8Array|!ByteString|null|undefined} value\n * @param {boolean} invalidIsMissing\n * @param {boolean} allowNullishValues\n * @return {!ByteString|null|undefined} The field's wrapped value.\n */\nfunction bytesAsByteString(value, invalidIsMissing, allowNullishValues) {\n  if (value == null) {\n    if (allowNullishValues) {\n      return value;\n    }\n    return invalidBytes(value);\n  }\n  if (typeof value === 'string') {\n    return ByteString.fromBase64(value);\n  }\n  if (value.constructor === ByteString) {\n    return /** @type {!ByteString} */ (value);\n  }\n  // Even though Uint8Array is not supported on the wire, this is still\n  // called by setters.\n  if (isU8(value)) {\n    return ByteString.fromUint8Array(/** @type {!Uint8Array} */ (value));\n  }\n  // If we get here then the value is invalid, so we either treat it as absent\n  // or fall through and throw.\n  return invalidIsMissing ? undefined : invalidBytes(value);\n}\n\n\n/**\n * @param {*} field\n * @return {*}\n */\nfunction maybeUnsafeUnwrapByteString(field) {\n  if (field instanceof ByteString) {\n    return unsafeUnwrapByteString(field);\n  }\n  return field;\n}\n\n/**\n * @param {!ReadonlyArray<number>|!Set<number>|undefined} repeatedFields\n * @param {number} fieldNumber\n * @return {boolean}\n */\nfunction isRepeatedFieldInSet(repeatedFields, fieldNumber) {\n  return !!repeatedFields &&\n      (Array.isArray(repeatedFields) ?\n           repeatedFields.includes(fieldNumber) :\n           /** @type {!Set<number>} */ (repeatedFields).has(fieldNumber));\n}\n\n/**\n * Checks whether the given value is an empty repeated field. It must be either\n * marked or in the given repeated field array.\n *\n * @param {?} value\n * @param {!ReadonlyArray<number>|!Set<number>|undefined} repeatedFields\n * @param {number} fieldNumber\n * @return {boolean}\n */\nfunction isEmptyRepeatedField(value, repeatedFields, fieldNumber) {\n  if (!Array.isArray(value) || value.length) {\n    return false;\n  }\n\n  // We could be marked with a repeated field bit.\n  const arrayState = getArrayState(value);\n  if (arrayState & ArrayStateFlags.IS_REPEATED_FIELD) {\n    return true;\n  }\n\n  // Or we could know this is a repeated field without having marked it.\n  if (!isRepeatedFieldInSet(repeatedFields, fieldNumber)) {\n    return false;\n  }\n\n  // Write back the bit so we don't have to check the array again.\n  setArrayState(value, arrayState | ArrayStateFlags.IS_REPEATED_FIELD);\n  return true;\n}\n\n/**\n * Throws an error if the given state indicates a frozen parent.\n * @param {!ArrayState} state The parent's array state, if any.\n * @suppress {visibility} access to message internals.\n */\nfunction checkNotImmutableState(state) {\n  if (state & ArrayStateFlags.IS_IMMUTABLE_ARRAY) {\n    if (goog.DEBUG) {\n      throw new Error('Cannot mutate an immutable Message');\n    } else {\n      throw new Error();\n    }\n  }\n}\n\n/**\n * @param {!InternalMessage} msg\n * @param {!ArrayState=} arrayState\n */\nfunction checkMutableMessage(msg, arrayState) {\n  if (isImmutableMessage(msg, arrayState)) {\n    if (goog.DEBUG) {\n      throw new Error('Cannot mutate an immutable Message');\n    } else {\n      throw new Error();\n    }\n  }\n}\n\n/**\n * Throws if `index` is out of range to read from `array`\n * @param {!ReadonlyArray<*>} array\n * @param {number} index\n */\nfunction checkRepeatedIndexInRangeForGet(array, index) {\n  if (typeof index !== 'number' || index < 0 || index >= array.length) {\n    if (goog.DEBUG) {\n      throw new Error(\n          `Index ${index} out of range for field of length ${array.length}.`);\n    } else {\n      throw new Error();\n    }\n  }\n}\n\n/**\n * Throws if `index` is out of range to write to `array`. Allowed to equal the\n * length, since writing would not create holes.\n * @param {!Array<*>} array\n * @param {number|undefined} index\n */\nfunction checkRepeatedIndexInRangeForSet(array, index) {\n  if (typeof index !== 'number' || index < 0 || index > array.length) {\n    if (goog.DEBUG) {\n      throw new Error(\n          `Index ${index} out of range for field of length ${array.length}.`);\n    } else {\n      throw new Error();\n    }\n  }\n}\n\n/** @const {boolean} Whether we support Symbol.hasInstance. */\nconst SUPPORTS_HAS_INSTANCE = goog.FEATURESET_YEAR >= 2018 ||\n    (typeof Symbol != 'undefined' && typeof Symbol.hasInstance != 'undefined');\n\n/**\n * @param {*} value\n * @return {!ObjectPropertyDescriptor}\n * @tsType (value: any): PropertyDescriptor\n */\n// NOTE: the JS externs call it ObjectPropertyDescriptor but the TS externs\n// call the type PropertyDescriptor.\nfunction invisiblePropValue(value) {\n  return {\n    value,\n    configurable: false,\n    writable: false,\n    enumerable: false,\n  };\n}\n\n/**\n * Prevents the given value from being passed to structuredClone interfaces.\n * @param {!Object} obj\n */\nfunction disallowPassingToStructuredClone(obj) {\n  if (goog.DEBUG) {\n    obj['preventPassingToStructuredClone'] = dontPassJspbTypeToStructuredClone;\n  }\n}\n\n/**\n * Set as a property of a JSPB object to prevent passing it over a structured\n * clone interface, which will break and cannot be made to work.\n *\n * If you need to use postMessage etc. with Apps JSPB, please call\n * `.toJsonValue` on the message then pass that value to a\n * message constructor on the other side.\n */\nfunction dontPassJspbTypeToStructuredClone() {}\n\n\n/**\n * An IteratorIterable that transforms the values of another iterable.\n *\n * <p>Like map IteratorIterables, this is lazy and one-shot.\n * @implements {IteratorIterable<B>}\n * @template A, B, THIS_ARG\n * @final\n */\nclass TransformingIteratorIterable {\n  /**\n   * @param {!IteratorIterable<A>} iterable the source iterable.\n   * @param {(function(this: THIS_ARG, A): B)} mapper\n   * @param {THIS_ARG} thisArg\n   */\n  constructor(iterable, mapper, thisArg) {\n    /** @private @const */\n    this.iterable = iterable;\n\n    /** @private @const {function(A): B} */\n    this.mapper = mapper;\n\n    /** @private @const {THIS_ARG} */\n    this.thisArg = thisArg;\n  }\n\n  /**\n   * @override\n   * @return {!IIterableResult<B>}\n   */\n  next() {\n    const r = this.iterable.next();\n    if (!r.done) {\n      r.value = this.mapper.call(this.thisArg, r.value);\n    }\n    return r;\n  }\n\n  /**\n   * @override\n   * @return {!Iterator<B>}\n   */\n  [Symbol.iterator]() {\n    return this;\n  }\n}\n\n\n/**\n * @param {!IteratorIterable<A>} iterable\n * @param {function(A): B} mapper\n * @param {THIS_ARG} thisArg\n * @return {!IteratorIterable<B>}\n * @template A, B, THIS_ARG\n */\nfunction newTransformingIteratorIterable(iterable, mapper, thisArg) {\n  return new TransformingIteratorIterable(iterable, mapper, thisArg);\n}\n\n/**\n * Type information required for performing accurate comparisons.\n *\n * This type encapsulates best-effort information about which fields are either\n * repeated or maps, to be used during comparisons.\n * @interface\n */\nclass ComparisonTypeInfo {\n  constructor() {\n    /** @type {!Set<number>|undefined} */\n    this.repeatedFields;\n\n    /** @type {!Set<number>|undefined} */\n    this.mapFields;\n  }\n\n  /**\n   * @return {!ComparisonTypeInfo|undefined}\n   */\n  getFieldComparisonTypeInfo(/** number */ fieldNumber) {}\n\n  /**\n   * @return {!Set<number>}\n   */\n  getRepeatedFields() {}\n\n  /**\n   * @return {!Set<number>}\n   */\n  getMapFields() {}\n}\n\n/**\n * Asserts state invariants on the given array.\n *\n * Note that it's safe to skip the frozenness check _only_ when calling from\n * ImmutableJS, when we know that the ImmutableJS accessors will freeze after\n * potentially caching a coerced array on this one.\n */\nfunction assertArrayInvariants(\n    /** !Array */ arr, /** boolean= */ skipFrozennessCheck) {\n  if (!goog.DEBUG) return;\n\n  // Assert that we're always marked as repeated\n  const state = getArrayState(assertArray(arr));\n\n  // If a repeated field array is marked with the frozen bit, or the immutable\n  // and api formatted bits, then assert that the array is actually frozen.\n  // array is always frozen.\n  if (!skipFrozennessCheck) {\n    const shouldBeFrozen = ((state & ArrayStateFlags.IS_IMMUTABLE_ARRAY) &&\n                            (state & ArrayStateFlags.IS_API_FORMATTED)) ||\n        (state & ArrayStateFlags.FROZEN_ARRAY);\n    assert(!shouldBeFrozen || Object.isFrozen(arr));\n  }\n\n  if (DETAILED_JSPB_ASSERTS && !(state & ArrayStateFlags.UNFROZEN_SHARED)) {\n    // Don't bother checking value mutabilities unless we might assert on them.\n    const onlyMutableValues = !!(state & ArrayStateFlags.ONLY_MUTABLE_VALUES);\n    const onlyImmutableValues =\n        !(state & ArrayStateFlags.MUTABLE_SUBSTRUCTURES);\n    if (onlyMutableValues || onlyImmutableValues) {\n      let hasMutableMessage, hasImmutableMessage, hasInlineArray;\n      for (const v of arr) {\n        if (Array.isArray(v)) {\n          hasInlineArray = true;\n        } else if (isInternalMessage(v)) {\n          if (isImmutableMessage(v)) {\n            hasImmutableMessage = true;\n          } else {\n            hasMutableMessage = true;\n          }\n        }\n      }\n\n      // If we had an inlined array, we can't say formatted.\n      if (hasInlineArray) {\n        assert(!(state & ArrayStateFlags.IS_API_FORMATTED));\n      }\n\n      // We cannot have a mutable message without MUTABLE_SUBSTRUCTURES.\n      if (onlyImmutableValues) {\n        assert(!hasMutableMessage);\n      }\n\n      // We cannot have an inlined immutable message with ONLY_MUTABLE_VALUES.\n      if (onlyMutableValues) {\n        assert(!hasInlineArray && !hasImmutableMessage);\n      }\n    }\n  }\n  assertRepeated64BitIntegerFieldApiFormattingInvariants(arr);\n}\n\n/**\n * Verifies that a string-formatted [u]int64 field contains only string\n * elements.\n *\n * @param {!Array<?>} arr\n */\nfunction assertStringFormattedInvariant(arr) {\n  if (!DETAILED_JSPB_ASSERTS) return;\n\n  const state = getArrayState(arr);\n\n  if (!hasFlagBit(state, ArrayStateFlags.STRING_FORMATTED)) {\n    return;\n  }\n\n  for (let i = 0; i < arr.length; i++) {\n    if (typeof arr[i] !== 'string') {\n      fail(`Unexpected element of type ${\n          typeof arr[i]} in string formatted repeated 64-bit int field`);\n    }\n  }\n}\n\n/**\n * Verifies that a 64-bit int repeated field has the correct API formatting\n * array state flags.\n *\n * - There is at most 1 type-specific flag (may be 0 if not already API\n * formatted or is the empty list sentinel)\n * - If string formatted, all elements are strings\n *\n * @param {!Array<?>} arr\n */\nfunction assertRepeated64BitIntegerFieldApiFormattingInvariants(arr) {\n  if (!ENABLE_ASSERTS) return;\n\n  const state = getArrayState(arr);\n  const isApiFormatted = state & ArrayStateFlags.IS_API_FORMATTED;\n\n  const typeFormattedSetCount =\n      (hasFlagBit(state, ArrayStateFlags.STRING_FORMATTED) ? 1 : 0) +\n      (hasFlagBit(state, ArrayStateFlags.GBIGINT_FORMATTED) ? 1 : 0);\n\n  assert(\n      (isApiFormatted && typeFormattedSetCount <= 1) ||\n          (!isApiFormatted && typeFormattedSetCount === 0),\n      `Expected at most 1 type-specific formatting bit, but got ${\n          typeFormattedSetCount} with state: ${state}`);\n\n  assertStringFormattedInvariant(arr);\n}\n\n/**\n * @nosideeffects\n * @return {?}\n */\nfunction makeToken() {\n  return Object.freeze({});\n}\n\n// Do not export these. Do not mark @private\n// The intent is just to be types that are not externally instantiable.\nclass InternalDoNotFreezeToken {}\n\n/** @typedef {!InternalDoNotFreezeToken} */\nlet DoNotFreezeToken;\n\n/** @type {!DoNotFreezeToken} */\nconst DO_NOT_FREEZE__LEGACY_OPTION = makeToken();\n\n/** @template T */\nclass OrUndefinedToken {}\n\n// type param is for closure type inference.\n/** @type {!OrUndefinedToken<undefined>} */\nconst OR_UNDEFINED = makeToken();\n\n/**\n * A private key to guard methods on DescriptorTypeReferenceImpl.\n * @const {!Object}\n */\nconst DESCRIPTOR_TYPE_REFERENCE_INTERNAL_ARG = {};\n\n/** @const {symbol|undefined} */\nconst DEBUG_EXTENSIONS = goog.DEBUG ? Symbol('debugExtensions') : undefined;\n\n/** @return {!Object<!Object<string, !InternalExtensionFieldInfo>>|undefined} */\nfunction getExtensionRegistryForDebugging(/** !Function */ parentCtor) {\n  return parentCtor[DEBUG_EXTENSIONS];\n}\n\n/**\n * Registers extensions for debugging;\n */\nfunction registerExtensionsForDebugging(\n    /** !Function */ ctor, /** ? */ extensions) {\n  ctor[DEBUG_EXTENSIONS] = extensions;\n}\n\n/** @return {boolean} */\nfunction startsWith(/** string */ str, /** string */ prefix) {\n  return str.indexOf(prefix) === 0;\n}\n\n/** @return {boolean} */\nfunction endsWith(/** string */ str, /** string */ suffix) {\n  return str.lastIndexOf(suffix) === Math.max(0, str.length - suffix.length);\n}\n\n/**\n * Iterates over all fields in a message array with a callback\n *\n * @param {!Array} internalArray to iterate the fields of.\n * @param {!ArrayState} messageArrayState array state.\n * @param {function (number, *)} callback to call on each fields.\n *     The arguments are the value and the field number.\n */\nfunction iterateFields(internalArray, messageArrayState, callback) {\n  // Our iteration is not correct unless we have a consistent HAS_MESSAGE_ID.\n  assert(messageArrayState & ArrayStateFlags.CONSTRUCTED);\n  const arrayIndexOffset = getArrayIndexOffset(messageArrayState);\n  const arrayLength = internalArray.length;\n  const hasSparseObject =\n      !!arrayLength && isSparseObjectInline(internalArray[arrayLength - 1]);\n  const end = arrayLength + (hasSparseObject ? -1 : 0);\n  assert(!!hasSparseObject === isSparseObject(internalArray[arrayLength - 1]));\n  for (let i = (messageArrayState & ArrayStateFlags.HAS_MESSAGE_ID) ? 1 : 0;\n       i < end; i++) {\n    const value = internalArray[i];\n    callback(fieldNumberFromIndex(i, arrayIndexOffset), value);\n  }\n\n  if (hasSparseObject) {\n    const sparseObject = internalArray[arrayLength - 1];\n    for (const k in sparseObject) {\n      if (!hasOwnPropertyIfNotTrusted(sparseObject, k) || isNaN(k)) {\n        continue;\n      }\n      callback(+k, sparseObject[k]);\n    }\n  }\n}\n\n/**\n * Opaque type that indicates that a message has a messageId field.\n * @abstract\n */\nclass HasMessageId {\n  constructor() {\n    throw new Error('not instantiable');\n  }\n}\n\nconst /** !HasMessageId */ HAS_MESSAGE_ID =\n    /** @type {!HasMessageId} */ (/** @type {?} */ ({}));\n\nconst /** !HasMessageId|undefined */ NO_MESSAGE_ID = undefined;\n\nfunction assertValidHasMessageIdOrUndefined(\n    /** !Array */ messageArray, /** !HasMessageId|undefined */ hasMessageId) {\n  if (!ENABLE_ASSERTS) return;\n  const arrayState = getArrayState(messageArray);\n  // The HAS_MESSAGE_ID bit is not consistent unless CONSTRUCTED is set.\n  assert(arrayState & ArrayStateFlags.CONSTRUCTED);\n  if (arrayState & ArrayStateFlags.HAS_MESSAGE_ID) {\n    assert(hasMessageId === HAS_MESSAGE_ID);\n  } else {\n    assert(hasMessageId === NO_MESSAGE_ID);\n  }\n}\n\n/** @return {!HasMessageId|undefined} */\nfunction getHasMessageId(/** number */ arrayState) {\n  assert(arrayState & ArrayStateFlags.CONSTRUCTED);\n  return arrayState & ArrayStateFlags.HAS_MESSAGE_ID ? HAS_MESSAGE_ID :\n                                                       NO_MESSAGE_ID;\n}\n\nexports = {\n  ANY_PROTOTYPE_MARKER_VALUE,\n  ComparisonTypeInfo,\n  DESCRIPTOR_TYPE_REFERENCE_INTERNAL_ARG,\n  DO_NOT_FREEZE__LEGACY_OPTION,\n  DoNotFreezeToken,\n  EXEMPTED_SUBCLASS_MARKER,\n  GENERATED_SUBCLASS_MARKER,\n  HAS_MESSAGE_ID,\n  HasMessageId,\n  InternalExtensionFieldInfo,\n  InternalImmutableMessage,\n  InternalMap,\n  InternalMessage,\n  MAP_PROTOTYPE_MARKER_VALUE,\n  MESSAGE_PROTOTYPE_MARKER_VALUE,\n  NO_MESSAGE_ID,\n  OR_UNDEFINED,\n  OrUndefinedToken,\n  SUPPORTS_HAS_INSTANCE,\n  SerializeBinaryFnHolder,\n  assertArrayInvariants,\n  assertRepeated64BitIntegerFieldApiFormattingInvariants,\n  assertValidHasMessageIdOrUndefined,\n  bytesAsByteString,\n  bytesAsU8,\n  checkMutableMessage,\n  checkNotImmutableState,\n  checkRepeatedIndexInRangeForGet,\n  checkRepeatedIndexInRangeForSet,\n  disallowPassingToStructuredClone,\n  endsWith,\n  fieldNumberFromIndex,\n  getExtensionRegistryForDebugging,\n  getHasMessageId,\n  hasOwnPropertyIfNotTrusted,\n  indexFromFieldNumber,\n  indexFromFieldNumberAndHasMessageId,\n  invisiblePropValue,\n  isAny,\n  isEmptyMap,\n  isEmptyRepeatedField,\n  isImmutableMessage,\n  isInternalMessage,\n  isMap,\n  isMessage,\n  isRepeatedFieldInSet,\n  isSparseObject,\n  isSparseObjectInline,\n  iterateFields,\n  maybeUnsafeUnwrapByteString,\n  newTransformingIteratorIterable,\n  registerExtensionsForDebugging,\n  setMessageCtorInDebug,\n  startsWith,\n  getInternalArray,\n  getInternalArrayInline,\n  setInternalArray,\n  setInternalArrayForNewMessage,\n  isCopyOnWrite,\n  setCopyOnWrite,\n  isNoLegacyNull,\n  setNoLegacyNull,\n};\n","/**\n * @fileoverview Exception types thrown by Apps JSPB.\n *\n * Apps JSPB throws exceptions in the following contexts:\n *\n * - Internal assertions, which are typically state consistency checks that\n *   should never be violated.\n *\n * - Ordinary state exceptions, which can happen in certain obviously invalid\n *   circumstances. These are not handled by this library.\n *\n * - Type errors in setters, which are an ordinary `throw` statement but have\n *   a severity label indicating them as warnings. This is mostly for historical\n *   reasons now.\n *\n * - Asynchronous warnings, which are asynchronously thrown errors with a\n *   severity label indicating them as not important for error reporting\n *   ('incident'). They are typically picked up by eye3 (or AfterAll failures)\n *   for a 'soft' reporting mechanism that does not interrupt program execution.\n *\n * We use asynchronous warnings extensively when we _want_ to make something\n * a failure but have some expectation that it could happen in production.\n *\n * Applications that cannot receive asynchronous warnings automatically through\n * global error handlers (e.g. because they are embedded in another page) can\n * use `registerErrorHandler` to register their own interceptor.\n *\n * See go/ws-jserror-severity-guidance for context on the usage of severity\n * labels for docs reporting.\n */\n\ngoog.module('jspb.exceptions');\n\nconst asyncThrow = goog.require('goog.async.throwException');\nconst errorcontext = goog.require('goog.debug.errorcontext');\n\n/**\n * Throttle key storage for global errors or situations where a message\n * constructor is not available.\n *\n * @private @type {!Object|undefined}\n */\nlet globalThrottles = goog.DEBUG ? {} : undefined;\n\n/**\n * The registered error handler to be called whenever JSPB will throw (or\n * async-throw) an error.\n * @private @type {(function(!Error):void)|undefined}\n */\nlet errorHandler;\n\n/**\n * Allows client teams to register a callback called whenever JSPB runtime would\n * throw or async-throw an error.\n * @param {function(!Error):void} handler\n */\nfunction registerErrorHandler(handler) {\n  if (errorHandler) {\n    throw new Error(goog.DEBUG ? 'errorHandler already set!' : '');\n  }\n  errorHandler = (warning) => {\n    goog.global.setTimeout(() => {\n      handler(warning);\n    }, 0);\n  };\n}\n\n/**\n * Allows client teams to register an **execution-interrupting** callback called\n * whenever JSPB runtime would throw or async-throw an error.\n *\n * @param {function(!Error):void} handler\n */\nfunction registerSynchronousErrorHandler(handler) {\n  if (errorHandler) {\n    throw new Error(goog.DEBUG ? 'errorHandler already set!' : '');\n  }\n  errorHandler = handler;\n}\n\n/**\n * Removes any registered error handler. Only for use in testing. JSPB clients\n * should call this via 'jspb.testing.errorhandler.removeErrorHandler()'.\n */\nfunction removeErrorHandler() {\n  if (!goog.DEBUG) throw new Error();\n  errorHandler = undefined;\n}\n\n/**\n * Runs the registered error handler (if any) on the given Error.\n * @param {!Error} err\n */\nfunction runErrorHandler(err) {\n  if (!errorHandler) return;\n  try {\n    errorHandler(err);\n  } catch (e) {\n    e.cause = err;\n    throw e;\n  }\n}\n\n/**\n * Asynchronously throw an error to flag production issues to users via systems\n * like eye3.\n *\n * @param {string=} msg\n */\nfunction asyncThrowWarning(msg) {\n  const warning = makeTypeWarning(msg);\n  if (!errorHandler) {\n    asyncThrow(warning);\n    return;\n  }\n  runErrorHandler(warning);\n}\n\n/**\n * Creates an error to be thrown from Apps JSPB type checking.\n * @return {!Error}\n */\nfunction makeTypeError(/** string= */ message) {\n  const error = new Error(message);\n  errorcontext.addErrorContext(error, 'severity', 'warning');\n  runErrorHandler(error);\n  return error;\n}\n\n/**\n * An asynchronously thrown error used to test the addition of type checks.\n * @return {!Error}\n */\nfunction makeTypeWarning(/** string= */ message) {\n  const error = goog.DEBUG ? new Error(message) : new Error();\n  errorcontext.addErrorContext(error, 'severity', 'incident');\n  return error;\n}\n\n/**\n * @param {?} msg\n * @param {symbol|string} throttleKey\n * @param {number} limit\n * @param {string=} error\n */\nfunction throttledAsyncThrowWarning(msg, throttleKey, limit, error) {\n  // Emit a warning at most limit times per type.\n  if (throttleKey == null) {\n    return;\n  }\n\n  let throttleHandle;\n  if (msg == null) {\n    throttleHandle = (globalThrottles ??= {});\n  } else {\n    throttleHandle = msg.constructor;\n  }\n\n  const count = throttleHandle[throttleKey] || 0;\n  if (count >= limit) {\n    return;\n  }\n\n  throttleHandle[throttleKey] = count + 1;\n  asyncThrowWarning(error);\n}\n\n/**\n * Test-only exports of functions in this module.\n * @const {{\n *   globalThrottles: ?,\n *   makeTypeWarning: typeof makeTypeWarning,\n *   removeErrorHandler: typeof removeErrorHandler,\n * }}\n */\nconst TESTONLY = {\n  globalThrottles,\n  makeTypeWarning,\n  removeErrorHandler,\n};\n\nexports = {\n  asyncThrowWarning,\n  makeTypeError,\n  registerErrorHandler,\n  registerSynchronousErrorHandler,\n  throttledAsyncThrowWarning,\n\n  TESTONLY,\n};","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides methods dealing with context on error objects.\n */\n\ngoog.module('goog.debug.errorcontext');\n\ngoog.module.declareLegacyNamespace();\n\n/**\n * Adds key-value context to the error.\n * @param {!Error} err The error to add context to.\n * @param {string} contextKey Key for the context to be added.\n * @param {string} contextValue Value for the context to be added.\n */\nfunction addErrorContext(err, contextKey, contextValue) {\n  if (!err[CONTEXT_KEY]) {\n    err[CONTEXT_KEY] = {};\n  }\n  err[CONTEXT_KEY][contextKey] = contextValue;\n}\n\n/**\n * @param {!Error} err The error to get context from.\n * @return {!Object<string, string>} The context of the provided error.\n */\nfunction getErrorContext(err) {\n  return err[CONTEXT_KEY] || {};\n}\n\n// TODO(aaronsn): convert this to a Symbol once goog.debug.ErrorReporter is\n// able to use ES6.\n/** @const {string} */\nconst CONTEXT_KEY = '__closure__error__context__984382';\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n\nexports = {\n  addErrorContext,\n  getErrorContext,\n};\n","/**\n * @fileoverview Pivot selectors for message serialization.\n * @package\n *\n * DO NOT USE THIS OUTSIDE OF THIS PACKAGE.\n */\n\ngoog.module('jspb.internal_pivot_selectors');\n\nconst {InternalMessage, fieldNumberFromIndex} = goog.require('jspb.internal');\nconst {TestSerializationFormat, getRandomizeSerializationFormat} = goog.require('jspb.internal_options');\nconst {VALID_PIVOT_SELECTOR} = goog.require('jspb.internal_symbols');\nconst {fail} = goog.require('goog.asserts');\n\nconst /** ? */ VALID_PIVOT_SELECTOR_VALUE = {};\n\n/**\n * We flip this bit in a test variant to exercise the memory cost pivot\n * selector.\n * @define {boolean}\n */\nconst TEST_ONLY_USE_MEMORY_COST_PIVOT_SELECTOR_BY_DEFAULT = goog.define(\n    'jspb.TEST_ONLY_USE_MEMORY_COST_PIVOT_SELECTOR_BY_DEFAULT', false);\n\n/**\n * @typedef {function(number, number, !Array, (!Object|undefined),\n * ((function(new: InternalMessage))|undefined)): number}\n */\nlet InternalPivotSelector;\n\nconst MIN_PIVOT = 1;\nconst MAX_PIVOT = 1024;\n\nconst /** symbol */ RANDOMIZED_PIVOT_CHOICE = Symbol();\nlet /** boolean|undefined */ withoutWrapperRandomizedPivotChoice;\n\n/**\n * Selects the existing pivot.\n * @return {number}\n */\nfunction defaultPivotSelector(\n    /** number */ currentPivot, /** number */ arrayIndexOffset,\n    /** !Array */ array,\n    /** !Object|undefined */ sparseObject,\n    /** (function(new: InternalMessage))|undefined */ maybeCtor) {\n  // Break unsupported parsers.\n  if (goog.DEBUG && !COMPILED) {\n    const format = getRandomizeSerializationFormat();\n    if (format === TestSerializationFormat.ALWAYS_SPARSE) {\n      return 1;\n    }\n    if (format === TestSerializationFormat.RANDOMIZED &&\n        (maybeCtor ?\n             (/** @type {?} */ (maybeCtor)[RANDOMIZED_PIVOT_CHOICE] ??=\n                  Math.random() < 0.5) :\n             withoutWrapperRandomizedPivotChoice ??= Math.random() < 0.5)) {\n      return 1;\n    }\n  }\n  if (TEST_ONLY_USE_MEMORY_COST_PIVOT_SELECTOR_BY_DEFAULT) {\n    return memoryCostPivotSelector(\n        currentPivot, arrayIndexOffset, array, sparseObject, maybeCtor);\n  }\n  return noChangePivotSelector(\n      currentPivot, arrayIndexOffset, array, sparseObject, maybeCtor);\n}\n\ndefaultPivotSelector[VALID_PIVOT_SELECTOR] = VALID_PIVOT_SELECTOR_VALUE;\n\n/**\n * Selects the existing pivot.\n * @return {number}\n */\nfunction noChangePivotSelector(\n    /** number */ currentPivot, /** number */ arrayIndexOffset,\n    /** !Array */ array,\n    /** !Object|undefined */ sparseObject,\n    /** (function(new: InternalMessage))|undefined */ maybeCtor) {\n  return currentPivot;\n}\n\n/**\n * Select a pivot to minimize the in-memory cost of the wire format in V8.\n * @return {number}\n */\nfunction memoryCostPivotSelector(\n    /** number */ currentPivot, /** number */ arrayIndexOffset,\n    /** !Array */ array,\n    /** !Object|undefined */ sparseObject,\n    /** (function(new: InternalMessage))|undefined */ maybeCtor) {\n  return costPivotSelector(\n      currentPivot, arrayIndexOffset, array, sparseObject, arrayMemoryCost,\n      objectMemoryCost);\n}\n\nmemoryCostPivotSelector[VALID_PIVOT_SELECTOR] = VALID_PIVOT_SELECTOR_VALUE;\n\n/**\n * Select a pivot to minimize the uncompressed wire cost of JSPB serialization.\n * @return {number}\n */\nfunction wireCostPivotSelector(\n    /** number */ currentPivot, /** number */ arrayIndexOffset,\n    /** !Array */ array,\n    /** !Object|undefined */ sparseObject,\n    /** (function(new: InternalMessage))|undefined */ maybeCtor) {\n  return costPivotSelector(\n      currentPivot, arrayIndexOffset, array, sparseObject, arrayWireCost,\n      objectWireCost);\n}\n\nwireCostPivotSelector[VALID_PIVOT_SELECTOR] = VALID_PIVOT_SELECTOR_VALUE;\n\n/**\n * Selects a pivot of one.\n * @return {number}\n */\nfunction objectOnlyPivotSelector(\n    /** number */ currentPivot, /** number */ arrayIndexOffset,\n    /** !Array */ array,\n    /** !Object|undefined */ sparseObject,\n    /** (function(new: InternalMessage))|undefined */ maybeCtor) {\n  return MIN_PIVOT;\n}\n\nobjectOnlyPivotSelector[VALID_PIVOT_SELECTOR] = VALID_PIVOT_SELECTOR_VALUE;\n\n/** @typedef {number} */\nlet MaxFieldNumberInObject;\n\n/** @typedef {number} */\nlet NumFieldsInObject;\n\n/** @typedef {number} */\nlet TotalObjectKeyBytes;\n\n/** @typedef {number} */\nlet NumEntriesInArray;\n\n/** @typedef {number} */\nlet SetFieldsInArray;\n\n/** @typedef {function(!NumEntriesInArray, !SetFieldsInArray): number } */\nlet ArrayCostFn;\n\n/**\n * @typedef {function(!NumFieldsInObject, !MaxFieldNumberInObject,\n * !TotalObjectKeyBytes): number }\n */\nlet ObjectCostFn;\n\n/**\n * Select a pivot to minimize the cost of the wire format, according to the\n * given cost functions.\n * @return {number}\n */\nfunction costPivotSelector(\n    /** number */ originalPivot, /** number */ arrayIndexOffset,\n    /** !Array */ array,\n    /** !Object|undefined */ sparseObject,\n    /** !ArrayCostFn */ arrayCostFn,\n    /** !ObjectCostFn */ objectCostFn) {\n  // Fast-track empty arrays.\n  if (!array.length && !sparseObject) return MIN_PIVOT;\n\n  // Derive initial parameters for our cost function by walking the initial\n  // state of the array and sparse object.\n  let initialMaxFieldNumberInObject = 0;\n  let initialFieldsInObject = 0;\n  let initialSetFieldsInArray = 0;\n  let initialArrayLength = 0;\n  let initialTotalObjectKeyBytes = 0;\n  for (let i = array.length - 1; i >= 0; i--) {\n    const value = array[i];\n    if (sparseObject && i === array.length - 1 && (value === sparseObject)) {\n      continue;\n    }\n    initialArrayLength++;\n    if (value != null) initialSetFieldsInArray++;\n  }\n  if (sparseObject) {\n    for (const k in sparseObject) {\n      const n = +k;\n      if (isNaN(n)) continue;\n      initialTotalObjectKeyBytes += keyBytes(n);\n      initialFieldsInObject++;\n      if (n > initialMaxFieldNumberInObject) initialMaxFieldNumberInObject = n;\n    }\n  }\n\n  // Initialize our min-cost pivot selection with the initial cost.\n  let minCostPivot = originalPivot;\n  let minCost = arrayCostFn(initialArrayLength, initialSetFieldsInArray) +\n      objectCostFn(initialFieldsInObject, initialMaxFieldNumberInObject,\n                   initialTotalObjectKeyBytes);\n\n  // Our first case is a pivot lower than the current one. To select one, we\n  // iterate over the array and each time we see a value, we consider the pivot\n  // being (n+1).\n  let setFieldsInArray = initialSetFieldsInArray;\n  let fieldsInObject = initialFieldsInObject;\n  let maxFieldNumberInObject = initialMaxFieldNumberInObject;\n  let totalObjectKeyBytes = initialTotalObjectKeyBytes;\n  for (let i = array.length - 1; i >= 0; i--) {\n    // Skip nulls and the sparse object.\n    const value = array[i];\n    if (value == null ||\n        (sparseObject && i === array.length - 1 && (value === sparseObject))) {\n      continue;\n    }\n\n    // Consider the pivot being (n+1).\n    const n = fieldNumberFromIndex(i, arrayIndexOffset);\n    const lastFieldNumberInArray = n;\n    const cost = arrayCostFn(lastFieldNumberInArray, setFieldsInArray) +\n        objectCostFn(fieldsInObject, maxFieldNumberInObject,\n                     totalObjectKeyBytes);\n    if (cost < minCost) {\n      minCostPivot = 1 + n;\n      minCost = cost;\n    }\n\n    // On our next iteration, this field will be in the object; so we need to\n    // increase its count and max field number.\n    fieldsInObject++;\n    setFieldsInArray--;\n    totalObjectKeyBytes += keyBytes(n);\n    maxFieldNumberInObject = Math.max(maxFieldNumberInObject, n);\n  }\n\n  // Our second case is the pivot being one. We write this after iterating\n  // the array so that we know how many fields were written.\n  const zeroPivotCost = arrayCostFn(0, 0) +\n      objectCostFn(fieldsInObject, maxFieldNumberInObject, totalObjectKeyBytes);\n  if (zeroPivotCost < minCost) {\n    minCostPivot = 1;\n    minCost = zeroPivotCost;\n  }\n\n  // And our third case is the pivot being greater than the current one. This\n  // only makes sense if we have an object. Note that by spec, numeric keys in\n  // objects iterate in order, which is important for this logic.\n  if (sparseObject) {\n    fieldsInObject = initialFieldsInObject;\n    maxFieldNumberInObject = initialMaxFieldNumberInObject;\n    totalObjectKeyBytes = initialTotalObjectKeyBytes;\n    setFieldsInArray = initialSetFieldsInArray;\n    for (const k in sparseObject) {\n      const n = +k;\n      if (isNaN(n)) continue;\n      // We never put fields above 1023 in the array.\n      if (n >= MAX_PIVOT) continue;\n      fieldsInObject--;\n      setFieldsInArray++;\n      totalObjectKeyBytes -= k.length;\n      const cost = arrayCostFn(n, setFieldsInArray) +\n          objectCostFn(fieldsInObject, maxFieldNumberInObject,\n                       totalObjectKeyBytes);\n      if (cost < minCost) {\n        minCostPivot = 1 + n;\n        minCost = cost;\n      }\n    }\n  }\n\n  return minCostPivot;\n}\n\n// LINT.IfChange(PivotSelector)\n/** @return {number} */\nfunction objectWireCost(\n    /** !NumFieldsInObject */ numFields,\n    /** !MaxFieldNumberInObject */ maxFieldNumber,\n    /** !TotalObjectKeyBytes */ totalObjectKeyBytes) {\n  const numCommas = numFields > 1 ? numFields - 1 : 0;\n  return totalObjectKeyBytes + numFields * 3 + numCommas;\n}\n\n/** @return {number} */\nfunction arrayWireCost(\n    /** !NumEntriesInArray */ numEntriesInArray,\n    /** !SetFieldsInArray */ setFieldsInArray) {\n  const numCommas = numEntriesInArray > 1 ? numEntriesInArray - 1 : 0;\n  const numNulls = (numEntriesInArray - setFieldsInArray);\n  return numCommas + numNulls * 4;\n}\n\n/** @return {number} */\nfunction objectMemoryCost(\n    /** !NumFieldsInObject */ numFields,\n    /** !MaxFieldNumberInObject */ maxFieldNumber,\n    /** !TotalObjectKeyBytes */ totalObjectKeyBytes) {\n  if (numFields == 0) return 0;\n\n  // There are two basic representations that could be applied to the sparse\n  // object keys in V8, a NumberDictionary and a FixedArray.\n  //\n  // V8 chooses representations based on some heuristics, which are implemented\n  // below.\n  const preferFastElementsSizeFactor = 3;\n  const numberDictionaryEntrySize = 3;\n  const fieldCountWithBuffer = numFields + (numFields / 2);\n  const minimumNumberDictionaryCapacity = 4;\n  const sizeThreshold = preferFastElementsSizeFactor *\n      numberDictionaryEntrySize *\n      Math.max(\n          roundUpToPowerOfTwo(fieldCountWithBuffer),\n          minimumNumberDictionaryCapacity);\n  return sizeThreshold <= maxFieldNumber ?\n      numberDictionaryMemoryCost(numFields) :\n      arrayMemoryCost(\n          maxFieldNumber,\n          // This is wrong but the implementation ignores the parameter.\n          /* setFieldsInArray= */ maxFieldNumber);\n}\n\n/** @return {number} */\nfunction numberDictionaryMemoryCost(/** number */ numFields) {\n  // NumberDictionary sizes up every 2 fields up to field number 6. These\n  // numbers are written below and linearly interpolated across the flat\n  // regions. The interpolation prevents some pathological behavior where we\n  // always write a second value into the object when we can.\n  //\n  // Everything above 10 fields is an upper bound.\n  if (numFields == 0) {\n    return 0;\n  } else if (numFields < 4) {\n    return 100 + (numFields - 1) * 16;\n  } else if (numFields < 6) {\n    return 148 + (numFields - 4) * 16;\n  } else if (numFields < 12) {\n    return 244 + (numFields - 6) * 16;\n  } else if (numFields < 22) {\n    return 436 + (numFields - 12) * 19;\n  } else if (numFields < 44) {\n    return 820 + (numFields - 22) * 17;\n  }\n  // Anything else which we have not measured should use a linear upper-bound.\n  // In practice this is unlikely to happen.\n  return 52 + 32 * numFields;\n}\n\n/** @return {number} */\nfunction arrayMemoryCost(\n    /** !NumEntriesInArray */ maxFieldNumber,\n    /** !SetFieldsInArray */ setFieldsInArray) {\n  // Note that this is actually the cost of an object backed by a FixedArray.\n  //\n  // The delta, however, is a constant factor so it doesn't matter for our\n  // purposes.\n  return 40 + 4 * maxFieldNumber;\n}\n\n/** @return {number} */\nfunction roundUpToPowerOfTwo(/** number */ value) {\n  // There is no unsigned left shift in JS.\n  return 1 << (32 - Math.clz32(value - 1));\n}\n\n/** @return {number} */\nfunction keyBytes(/** number */ value) {\n  if (value >= 100) {\n    if (value >= 10000) {\n      return Math.ceil(Math.log10(1 + value));\n    }\n    return value < 1000 ? 3 : 4;\n  } else {\n    return value < 10 ? 1 : 2;\n  }\n}\n\n// LINT.ThenChange(//depot/google3/java/com/google/apps/jspb/Serializer.java:PivotSelector)\n\n/** @type {boolean} */\nlet checkPivotSelectorInstances = true;\n\nfunction setCheckPivotSelectorInstances(/** boolean */ value) {\n  checkPivotSelectorInstances = value;\n}\n\n/**\n * @return {!InternalPivotSelector}\n */\nfunction assertValidPivotSelector(/** !Object */ obj) {\n  if (obj == null || obj === noChangePivotSelector) {\n    return noChangePivotSelector;\n  }\n  if (checkPivotSelectorInstances &&\n      (obj[VALID_PIVOT_SELECTOR] !== VALID_PIVOT_SELECTOR_VALUE)) {\n    // Don't throw when we have a bad parameter because recaptcha's botguard\n    // obfuscations sometimes pass one.\n    //\n    // TODO(varomodt): figure out which pass is unsound.\n    fail('Invalid pivot selector');\n    return noChangePivotSelector;\n  }\n  return /** @type {!InternalPivotSelector} */ (obj);\n}\n\n/**\n * Used to gate tests which depend on the exact wire format. That should be\n * handled by wire conformance.\n *\n * @return {boolean}\n */\nfunction hasNonstandardPivotSelector() {\n  return TEST_ONLY_USE_MEMORY_COST_PIVOT_SELECTOR_BY_DEFAULT;\n}\n\nexports = {\n  InternalPivotSelector,\n  assertValidPivotSelector,\n  defaultPivotSelector,\n  memoryCostPivotSelector,\n  noChangePivotSelector,\n  objectOnlyPivotSelector,\n  wireCostPivotSelector,\n\n  // Exported for testing.\n  arrayMemoryCost,\n  arrayWireCost,\n  costPivotSelector,\n  hasNonstandardPivotSelector,\n  keyBytes,\n  objectMemoryCost,\n  objectWireCost,\n  roundUpToPowerOfTwo,\n  setCheckPivotSelectorInstances,\n};\n","/** @fileoverview Internal utilities for working with unknown fields. */\ngoog.module('jspb.internal_unknown_fields');\n\nconst asyncThrow = goog.require('goog.async.throwException');\nconst {ByteString} = goog.require('jspb.bytestring');\nconst {HAS_NATIVE_SYMBOL, LAZILY_PARSE_LATE_LOADED_EXTENSIONS_SYMBOL, UNKNOWN_BINARY_FIELDS_SYMBOL, UNKNOWN_BINARY_FIELD_IN_JSPB_SERIALIZE_THROTTLE_KEY, UNKNOWN_BINARY_THROTTLE_KEY, UNKNOWN_JSPB_FIELD_IN_BINARY_SERIALIZE_THROTTLE_KEY} = goog.require('jspb.internal_symbols');\nconst {InternalMessage, getInternalArray, hasOwnPropertyIfNotTrusted, isMessage} = goog.require('jspb.internal');\nconst {assert, assertArray} = goog.require('goog.asserts');\nconst {slice} = goog.require('jspb.internal_operations');\nconst {throttledAsyncThrowWarning} = goog.require('jspb.exceptions');\n\n\n/** @return {!UnknownFields|undefined} */\nfunction getUnknownFields(/** !Array */ messageArray) {\n  const unknownBinaryFields = goog.weakUsage(UNKNOWN_BINARY_FIELDS_SYMBOL);\n  return unknownBinaryFields ? assertArray(messageArray)[unknownBinaryFields] :\n                               undefined;\n}\n\n/** @typedef {function(!Array, number, !Array<!ByteString>)} */\nlet UnrevivedFieldCallbackFn;\n\n/**\n * @implements {IObject<number, !Array<!ByteString>>}\n */\nclass UnknownFields {\n  constructor() {\n    /**\n     * @type {(function(!Array, (number|undefined), ?,\n     *     !UnrevivedFieldCallbackFn=): void)|undefined}\n     */\n    this.reviveUnknownFields;\n  }\n\n  forEachUnknownField(\n      /** function(!UnknownFields, number, !Array<!ByteString>) */ fn) {\n    for (const k in /** @type {?} */ (this)) {\n      // the isNaN skips the reviveUnknownFields property.\n      if (!hasOwnPropertyIfNotTrusted(this, k) || isNaN(k)) continue;\n      fn(this, +k, assertArray(/** @type {?} */ (this)[k]));\n    }\n  }\n\n  /**\n   * Copies this unknown field set.\n   * @return {!UnknownFields}\n   */\n  cloneUnknownFields() {\n    const otherFields = new UnknownFields();\n    this.forEachUnknownField((fieldSet, fieldNumber, entries) => {\n      otherFields[fieldNumber] = slice(entries);\n    });\n    otherFields.reviveUnknownFields = this.reviveUnknownFields;\n    return otherFields;\n  }\n}\n\n\n/** Adds a single unknown field. */\nfunction addUnknownField(\n    /** !Array */ messageArray, /** number */ fieldNumber,\n    /** !ByteString|undefined */ unknownField) {\n  assertArray(messageArray);\n  if (!unknownField) return;\n  const fields = messageArray[UNKNOWN_BINARY_FIELDS_SYMBOL] ??=\n      new UnknownFields();\n  (fields[fieldNumber] ??= []).push(unknownField);\n}\n\n/** Clears all the unknown fields from the array. */\nfunction clearUnknownFields(/** !Array */ messageArray) {\n  assertArray(messageArray);\n  const unknownBinaryFields = goog.weakUsage(UNKNOWN_BINARY_FIELDS_SYMBOL);\n  if (unknownBinaryFields && unknownBinaryFields in messageArray) {\n    delete messageArray[unknownBinaryFields];\n  }\n}\n\n/** Clears all the unknown fields from the array. */\nfunction clearUnknownField(/** !InternalMessage */ msg,\n                           /** number */ fieldNumber) {\n  assert(isMessage(msg));\n  const messageArray = getInternalArray(msg);\n  assertArray(messageArray);\n  const unknownBinaryFields = goog.weakUsage(UNKNOWN_BINARY_FIELDS_SYMBOL);\n  if (unknownBinaryFields && unknownBinaryFields in messageArray) {\n    const fields = messageArray[unknownBinaryFields];\n    if (fields) delete fields[fieldNumber];\n  }\n}\n\n/**\n * Copy unknown fields from one message to another. Assumes that the other\n * message does not already have unknown fields.\n */\nfunction copyUnknownFields(/** !Array */ to, /** !Array */ from) {\n  if (!goog.weakUsage(UNKNOWN_BINARY_FIELDS_SYMBOL)) return;\n  assertArray(to);\n  assertArray(from);\n  assert(to[UNKNOWN_BINARY_FIELDS_SYMBOL] === undefined);\n  const sourceFields = getUnknownFields(from);\n  if (sourceFields && sourceFields instanceof UnknownFields) {\n    to[UNKNOWN_BINARY_FIELDS_SYMBOL] = sourceFields.cloneUnknownFields();\n  }\n}\n\nconst LAZY_REVIVAL_OPTIONS = {\n  reviveIntoImmutable: true\n};\n\nfunction maybeReviveUnknownField(\n    /** !InternalMessage */ msg,\n    /** number */ fieldNumber,\n    /** (typeof LAZILY_PARSE_LATE_LOADED_EXTENSIONS_SYMBOL)|undefined */\n    lazyParse,\n    /** boolean= */ orClear = false) {\n  if (\n      // We don't need to retain this block if the lazy parsing or unknown\n      // fields symbols are not referenced in this program.\n      goog.weakUsage(LAZILY_PARSE_LATE_LOADED_EXTENSIONS_SYMBOL) &&\n      goog.weakUsage(UNKNOWN_BINARY_FIELDS_SYMBOL) &&\n      // We only revive fields if their extendee sets the lazy pasing bit.\n      lazyParse === LAZILY_PARSE_LATE_LOADED_EXTENSIONS_SYMBOL) {\n    const messageArray = getInternalArray(msg);\n    const unknownBinaryFields = messageArray[UNKNOWN_BINARY_FIELDS_SYMBOL];\n    if (!unknownBinaryFields) return;\n\n    // If we have a reviver function and we have not previously failed to revive\n    // this field, attempt to revive it.\n    const revive = unknownBinaryFields.reviveUnknownFields;\n    if (revive) {\n      try {\n        revive(messageArray, fieldNumber, LAZY_REVIVAL_OPTIONS);\n        return;\n      } catch (e) {\n        // In debug we throw the error to help with debugging but in production\n        // we simply continue with the field unset and set a bit to avoid\n        // attempting to parse again.\n        if (goog.DEBUG) {\n          throw new Error(`unknown binary extension ${fieldNumber}`);\n        }\n        asyncThrow(e);\n      }\n    }\n  }\n  if (orClear) clearUnknownField(msg, fieldNumber);\n}\n\nlet /** boolean|undefined */ shouldIgnoreUnknownFieldAccess;\n\n/**\n * @template T\n * @return {T}\n */\nfunction withoutReportingUnknownExtensionAccess(/** function(): T */ fn) {\n  try {\n    shouldIgnoreUnknownFieldAccess = true;\n    return fn();\n  } finally {\n    shouldIgnoreUnknownFieldAccess = undefined;\n  }\n}\n\nlet /** boolean|undefined */ shouldIgnoreDroppedUnknownAny;\n\n/**\n * @template T\n * @return {T}\n */\nfunction withoutReportingDroppedUnknownAny(/** function(): T */ fn) {\n  try {\n    shouldIgnoreDroppedUnknownAny = true;\n    return fn();\n  } finally {\n    shouldIgnoreDroppedUnknownAny = undefined;\n  }\n}\n\n/**\n * This method should be called on any extension field access to detect\n * dropped unknown binary extensions.\n */\nfunction recordUnknownFieldAccessOnArray(/** !Array */ messageArray,\n                                         /** number */ fieldNumber) {\n  assertArray(messageArray);\n  const unknownBinaryFieldsSymbol =\n      goog.weakUsage(UNKNOWN_BINARY_FIELDS_SYMBOL);\n  if (HAS_NATIVE_SYMBOL && !shouldIgnoreUnknownFieldAccess &&\n      unknownBinaryFieldsSymbol &&\n      messageArray[unknownBinaryFieldsSymbol]?.[fieldNumber] != null) {\n    // If you see a failure due to this log line, you are losing data because\n    // a binary field was unknown at parse time. This could be either an\n    // unknown field (e.g. a field that was added after this client was built)\n    // or possibly an extension which is unknown to this binary.\n    //\n    // In the case of an extension, see go/jspb-proto2-extensions for\n    // information on how to ensure it is loaded before the parse occurs.\n    //\n    // See go/jspb-unknown-fields for more context.\n    throttledAsyncThrowWarning(\n        undefined, UNKNOWN_BINARY_THROTTLE_KEY, 3, `0ub:${fieldNumber}`);\n  }\n}\n\n/**\n * Reports via async warning that a field was accessed when unknown binary data\n * was present for that field number.\n */\nfunction recordUnknownFieldAccess(/** !InternalMessage */ msg,\n                                  /** number */ fieldNumber) {\n  assert(isMessage(msg));\n  recordUnknownFieldAccessOnArray(getInternalArray(msg), fieldNumber);\n}\n\n/**\n * Reports via async warning that a field was dropped during binary\n * serialization.\n */\nfunction recordUnknownFieldDroppedInSerializeBinary(/** !Array */ messageArray,\n                                                    /** number */ fieldNumber) {\n  assertArray(messageArray);\n\n  // Drop out for low field numbers as they are not likely to be extensions\n  // so a warning would not be actionable.\n  if (fieldNumber < 500) return;\n\n  // If you see a failure due to this log line, you are losing data because\n  // a JSPB field was unknown at serialization time. This could be either an\n  // unknown field (e.g. a field that was added after this client was built)\n  // or possibly an extension which is unknown to this binary.\n  //\n  // In the case of an extension, see go/jspb-proto2-extensions for\n  // information on how to ensure it is loaded before the serialization\n  // occurs.\n  throttledAsyncThrowWarning(\n      undefined, UNKNOWN_JSPB_FIELD_IN_BINARY_SERIALIZE_THROTTLE_KEY, 3,\n      `0ubsb:${fieldNumber}`);\n}\n\n\n/**\n * Reports via async warning that an Any value was dropped during binary\n * serialization.\n */\nfunction recordJspbAnyDroppedInSerializeBinary(\n    /** !Array|!InternalMessage */ value) {\n  if (!shouldIgnoreDroppedUnknownAny) {\n    // If you see a failure due to this log line, you are losing data from an\n    // Any proto during binary serialization, see go/jspb-api-gotchas#any.\n    //\n    // We recommend passing the `serializeBinaryFn` parameter to `Any.packJspb`\n    // if the Any was packed client-side.\n    throttledAsyncThrowWarning(\n        undefined, UNKNOWN_JSPB_FIELD_IN_BINARY_SERIALIZE_THROTTLE_KEY, 3,\n        '0ubsb');\n  }\n}\n\n/**\n * Reports via async warning that a field was dropped during JSPB\n * serialization.\n */\nfunction recordUnknownFieldDroppedInSerialize(\n    /** !UnknownFields */ unknownFields,\n    /** number */ fieldNumber,\n    /** !Array<!ByteString> */ entries) {\n  // Drop out for low field numbers as they are not likely to be extensions\n  // so a warning would not be actionable.\n  if (fieldNumber < 100) return;\n\n  // If you see a failure due to this log line, you are losing data because\n  // a binary field was unknown at parse time. This could be either an\n  // unknown field (e.g. a field that was added after this client was built)\n  // or possibly an extension which is unknown to this binary.\n  //\n  // In the case of an extension, see go/jspb-proto2-extensions for\n  // information on how to ensure it is loaded before the parse occurs.\n  //\n  // See go/jspb-unknown-fields for more context.\n  throttledAsyncThrowWarning(\n      undefined, UNKNOWN_BINARY_FIELD_IN_JSPB_SERIALIZE_THROTTLE_KEY, 1,\n      `0ubs:${fieldNumber}`);\n}\n\nexports = {\n  UnknownFields,\n  addUnknownField,\n  clearUnknownField,\n  clearUnknownFields,\n  copyUnknownFields,\n  getUnknownFields,\n  maybeReviveUnknownField,\n  recordJspbAnyDroppedInSerializeBinary,\n  recordUnknownFieldAccess,\n  recordUnknownFieldDroppedInSerializeBinary,\n  recordUnknownFieldDroppedInSerialize,\n  withoutReportingDroppedUnknownAny,\n  withoutReportingUnknownExtensionAccess,\n};\n","/**\n * @fileoverview The implementation of the main jspb copying routines.\n * clone and toJsonValue.\n *\n * DO NOT USE THIS OUTSIDE OF THIS PACKAGE.\n */\ngoog.module('jspb.internal_copy');\n\nconst {ArrayStateFlags, DEFAULT_ARRAY_STATE, getArrayIndexOffset, getArrayState, getMessageArrayState} = goog.require('jspb.internal_array_state');\nconst {ByteString} = goog.require('jspb.bytestring');\nconst {DEFAULT_PIVOT_SELECTOR, PivotSelector} = goog.require('jspb.dynamic_pivot_selection');\nconst {ENABLE_ASSERTS, assert, assertArray, assertExists} = goog.require('goog.asserts');\nconst {HAS_NATIVE_SYMBOL, UNKNOWN_BINARY_FIELDS_SYMBOL} = goog.require('jspb.internal_symbols');\nconst {InternalMessage, assertArrayInvariants, fieldNumberFromIndex, getInternalArray, hasOwnPropertyIfNotTrusted, indexFromFieldNumber, isInternalMessage, isSparseObject} = goog.require('jspb.internal');\nconst {InternalPivotSelector, assertValidPivotSelector, noChangePivotSelector} = goog.require('jspb.internal_pivot_selectors');\nconst {JspbMap} = goog.require('jspb.internal_map');\nconst {SUPPORTS_STRUCTURED_CLONE} = goog.require('jspb.internal_bytes');\nconst {copyUnknownFields, recordUnknownFieldDroppedInSerialize} = goog.require('jspb.internal_unknown_fields');\nconst {isSafeInt52} = goog.require('google3.javascript.common.bigint.index');\nconst {logNewArray} = goog.require('jspb.internal_operations');\n\n\nconst NO_PIVOT = -1 >>> 0;  // 2^32-1\n\n/**\n * Helper for cloning an internal JsPb object.\n * @param {!Array<?>} array A JsPb object, eg, a field, to be cloned.\n * @param {number} arrayState The state of the array.\n * @param {(function(*, boolean): *)} convertLeaf a function to map onto\n *     all primitive values in this object.\n * @param {boolean=} isOwned Whether array is known not to be exposed to users.\n *     When this is provided, it's taken to imply we're in a clone operation.\n * @param {function(new: InternalMessage)=} maybeCtorInDebug The constructor\n *     of the message, if available, in debug mode.\n * @return {!Array<?>} A clone of the input object.\n */\nfunction cloneJspbArray(\n    array, arrayState, convertLeaf, isOwned, maybeCtorInDebug) {\n  const inClone = isOwned !== undefined;\n  isOwned = !!isOwned;\n\n  // Complain when we drop unknown fields.\n  const unknownBinaryFieldsSymbol =\n      goog.weakUsage(UNKNOWN_BINARY_FIELDS_SYMBOL);\n  let unknownBinaryFields;\n  if (!inClone && HAS_NATIVE_SYMBOL && unknownBinaryFieldsSymbol &&\n      (unknownBinaryFields = array[unknownBinaryFieldsSymbol])) {\n    unknownBinaryFields.forEachUnknownField(\n        recordUnknownFieldDroppedInSerialize);\n  }\n\n  // The array we are copying into.\n  const clonedArray = logNewArray([]);\n  let length = array.length;\n  let sparseObject;\n  // The array index at which to start writing values to a sparse object when\n  // iterating over the array.\n  let pivotIndex = NO_PIVOT;\n  let movableSparseObject = false;\n\n  // Compute an array index offset, which is defined if we are constructed.\n  const isConstructed = !!(arrayState & ArrayStateFlags.CONSTRUCTED);\n  const arrayIndexOffset =\n      isConstructed ? getArrayIndexOffset(arrayState) : undefined;\n\n  // There are 3 interesting cases\n  // 1. We have a constructed message array and are performing a clone\n  //    operation.\n  // 2. We have a constructed message array and are not performing a clone\n  //    operation.\n  // 3. We have an array that is either not a message or is not constructed.\n  //\n  // For case 1, we can trust the pivot and sparse object bits. But we don't\n  // want to shift anything around.  In theory we could move the sparse object\n  // if it made sense but in the interest of backwards compatibility we do not,\n  // plus APIs like `toImmutable` do not accept a pivot selector.\n  //\n  // For case 2, we perform pivot selection and move the sparse object as\n  // needed.\n  //\n  // For case 3, we cannot trust either the pivot or sparse object bits,\n  // and thus do not move anything.\n\n\n  // Locate a sparse object and derive the pivot if the array is not repeated.\n  if (!(arrayState & ArrayStateFlags.IS_REPEATED_FIELD)) {\n    sparseObject = length && array[length - 1];\n    if (isSparseObject(sparseObject)) {\n      length--;\n      pivotIndex = length;\n    } else {\n      sparseObject = undefined;\n      // Here we could read the pivot from the array state for constructed\n      // messages, but there is no need to do so as we know it is beyond any\n      // field index.\n    }\n\n    // We may be moving the pivot if we have a pivot selector, do not have a\n    // message ID and are not cloning. We could move the pivot on clones\n    // but there is no need to and doing so may incur some extra allocations.\n    if (isConstructed && !(arrayState & ArrayStateFlags.HAS_MESSAGE_ID) &&\n        !inClone) {\n      movableSparseObject = true;\n      const pivotSelector = /** @type {!InternalPivotSelector} */ (\n          /** @type {?} */ (currentPivotSelector ?? DEFAULT_PIVOT_SELECTOR));\n      pivotIndex = indexFromFieldNumber(\n          pivotSelector(\n              fieldNumberFromIndex(pivotIndex, assertExists(arrayIndexOffset)),\n              assertExists(arrayIndexOffset), array, sparseObject,\n              maybeCtorInDebug),\n          assertExists(arrayIndexOffset));\n    }\n  }\n\n  // Copy fields from the array into the cloned array or sparse object.\n  let newSparseObject = undefined;\n  for (let i = 0; i < length; i++) {\n    let item = array[i];\n    // This implicitly turns null into undefined which is a legacy behavior we\n    // need to maintain for _legacyNullable callers.\n    if (item == null || (item = convertLeaf(item, isOwned)) == null) {\n      continue;\n    }\n    if (isConstructed && i >= pivotIndex) {\n      // This should not be possible unless there is a pivot selector.\n      assertNontrivialPivotSelector();\n      const n = fieldNumberFromIndex(i, assertExists(arrayIndexOffset));\n      (newSparseObject ??= {})[n] = item;\n    } else {\n      clonedArray[i] = item;\n    }\n  }\n\n  // Copy fields from any existing sparse object into the array or object.\n  if (sparseObject) {\n    for (let key in sparseObject) {\n      if (!hasOwnPropertyIfNotTrusted(sparseObject, key)) {\n        continue;\n      }\n      let item = sparseObject[key];\n      // This implicitly turns null into undefined which is a legacy behavior we\n      // need to maintain for _legacyNullable callers.\n      if (item == null || (item = convertLeaf(item, isOwned)) == null) {\n        continue;\n      }\n      const n = +key;\n      let i;\n      if (isConstructed && !Number.isNaN(n) &&\n          (i = indexFromFieldNumber(n, assertExists(arrayIndexOffset))) <\n              pivotIndex) {\n        // This should not be possible unless there is a pivot selector.\n        assertNontrivialPivotSelector();\n        clonedArray[assertExists(i)] = item;\n      } else {\n        (newSparseObject ??= {})[key] = item;\n      }\n    }\n  }\n\n  // If we have a sparse object, we need to add it to the end of the array.\n  // In a cloneImmutable operation we maintain pivots but otherwise we can\n  // just place the sparse object at the end of the array.\n  if (newSparseObject) {\n    if (movableSparseObject) {\n      clonedArray.push(newSparseObject);\n    } else {\n      assert(pivotIndex < NO_PIVOT);\n      clonedArray[pivotIndex] = newSparseObject;\n    }\n  }\n\n  // If in a clone operation, attempt to copy unknown binary fields. By doing\n  // this at the end we assure that the array accesses in the above loop are\n  // monomorphic.\n  if (inClone) {\n    copyUnknownFields(clonedArray, array);\n  }\n  return clonedArray;\n}\n\n\n/** @return {!Array<?>} */\nfunction convertMapEntryToJsonFormat(/** !Array<?> */ entry) {\n  entry[0] = convertToJsonFormat(entry[0]);\n  entry[1] = convertToJsonFormat(entry[1]);\n  return entry;\n}\n\n/**\n * @param {?} v the value to copy if it's a Uint8Array.\n * @return {?}\n * @suppress {visibility} access to map internals\n */\nfunction convertToJsonFormat(v) {\n  assertExists(v);  // callers should have handled this.\n  switch (typeof v) {\n    case 'number':\n      return Number.isFinite(v) ? v : '' + v;\n    case 'bigint':\n      return /** @type{!Function}*/ (isSafeInt52)(v) ? Number(v) : '' + v;\n    case 'boolean':\n      // Coerce to 0 or 1\n      return v ? 1 : 0;\n    case 'object':\n      if (Array.isArray(v)) {\n        assertArrayInvariants(v);\n        const state = getArrayState(v);\n        // If this is an empty repeated field, don't copy it in any mode.\n        if (v.length === 0 && (state & ArrayStateFlags.IS_REPEATED_FIELD)) {\n          return undefined;\n        }\n        return cloneJspbArray(v, state, convertToJsonFormat);\n      }\n      if (isInternalMessage(v)) {\n        return toJsonValueInternal(/** @type {!InternalMessage} */ (v));\n      }\n      // TODO(b/205306125): We use instanceof below to support dead code\n      // elimination even though constructor comparisons would be preferable\n      // performance wise.\n      if (v instanceof ByteString) {\n        return v.asBase64();\n      }\n      if (v instanceof JspbMap) {\n        return v.toArrayOrUndefinedInternal(convertMapEntryToJsonFormat);\n      }\n      // TODO(b/396420284): remove.\n      assert(!(v instanceof Uint8Array));\n      // Arrays and sparse objects were handled by our caller, so this is really\n      // just an invalid value. Drop it.\n      return undefined;\n  }\n  return v;\n}\n\n/**\n * Returns a deep copy of the given object, converting inner fields to\n * JSON-compatible types.\n *\n * @param {!Array<?>} el element to clone.\n * @return {!Array<?>} A copy of this element\n */\nfunction cloneToJsonFormat(el) {\n  assertArray(el);\n  return cloneJspbArray(\n      el,\n      // We don't need to pass the array state here because we either don't\n      // expect any existing state from the source (e.g. cloneRaw) or we are not\n      // producing an array for a clone so the caller doesn't need it.\n      DEFAULT_ARRAY_STATE,\n      /* convertLeaf = */ convertToJsonFormat);\n}\n\n/**\n * Helper for cloning an external array.\n *\n * @const {function(!Array<?>): !Array<?>}\n */\nconst cloneRaw = SUPPORTS_STRUCTURED_CLONE ?\n    /** @type {function(!Array<?>): !Array<?>} */ (\n        /** @type{?}*/ (structuredClone)) :\n    /** @return {!Array<?>} */\n    (/** !Array<?> */ arr) => cloneToJsonFormat(arr);\n\n/**\n * Our current pivot selector.\n *\n * Stashed in a global and managed by `toRaw`.  This is simpler than\n * threading it through the recursive methods and it also makes it\n * easier for the compiler to trim it and related conditions when\n * the application isn't using pivot selectors.\n *\n * @private {!InternalPivotSelector|undefined}\n */\nlet currentPivotSelector;\n\n/**\n * @param {!InternalMessage} message\n * @param {!PivotSelector=} pivotSelector\n * @return {!Array<?>}\n */\nfunction toJsonValue(message, pivotSelector) {\n  assert(!currentPivotSelector);\n  if (pivotSelector) {\n    currentPivotSelector = assertValidPivotSelector(pivotSelector);\n    try {\n      return toJsonValueInternal(message);\n    } finally {\n      currentPivotSelector = undefined;\n    }\n  }\n  return toJsonValueInternal(message);\n}\n\n/**\n * Internal implementation of `toJSON` that can be devirtualized\n *\n * Generally, `serialize()` should be called instead, but this may be useful\n * when a JSON stringifiable value is required for compatibility with other\n * APIs.\n *\n * @param {!InternalMessage} message\n * @return {!Array<?>} The proto represented as an array.\n */\nfunction toJsonValueInternal(message) {\n  const internalArr = getInternalArray(message);\n  return cloneJspbArray(\n      internalArr, getMessageArrayState(internalArr),\n      /* convertLeaf = */ convertToJsonFormat,\n      /* isOwned= */ undefined,\n      /* ctor= */ goog.DEBUG ?\n          /** @type {function(new: InternalMessage)} */ (message.constructor) :\n          undefined);\n}\n\n/**\n * Check for branches that can only be reached if a pivot selector other than\n * noChangePivotSelector is in use.\n */\nfunction assertNontrivialPivotSelector() {\n  if (!ENABLE_ASSERTS) return;\n  const pivotSelector = currentPivotSelector ?? DEFAULT_PIVOT_SELECTOR;\n  assert(pivotSelector !== noChangePivotSelector);\n}\n\nexports = {\n  // A low level array copying routine for unconstructed arrays.\n  cloneRaw,\n  // A primitive copy routine exposed for clone/toMutable/toImmutable\n  cloneJspbArray,\n  // Also used by dump.\n  cloneToJsonFormat,\n  // The internal implementation of `toJsonValue` that can be devirtualized.\n  toJsonValue,\n};\n","/**\n * @fileoverview Utilities for enabling dynamic pivot selection.\n *\n * This file provides helpers for selecting a \"pivot\" for JSPB serializations.\n * In the go/jspb-wireformat, you can select which values are serialized into\n * the 'dense array' or 'sparse object' according to where the 'pivot' index\n * is (representing the first field number which would be represented in the\n * sparse object). For example, see the following serializations:\n *\n * - [1,null,2,3]\n *   + Here, the pivot is effectively `4`, or any greater number.\n * - [1,{\"2\":\"hi\"}]\n *   + Here, the pivot is `2`.\n * - [{\"1\":\"hi\"}]\n *   + Here, the pivot is `1` or `0`.\n *\n * This file provides two different strategies for selecting a pivot:\n *\n * - `MEMORY_COST_PIVOT_SELECTOR`: This strategy selects the pivot which\n *   minimizes the total memory cost of the serialization as a JS object, in V8.\n *   This will eventually be the default for server-side pivot selection.\n *\n * - `WIRE_COST_PIVOT_SELECTOR`: This strategy selects the pivot which\n *   minimizes the uncompressed wire length of the serialization. This may\n *   be useful when application performance is sensitive to serialization size\n *   (e.g. if you have a lot of serializations attached to the DOM), or in some\n *   special cases (such as huge oneofs).\n *\n * The default is to \"do nothing\", wherein we use the default pivot, which is\n * 500. In practice, this is actually quite close to the result of the\n * `MEMORY_COST_PIVOT_SELECTOR` and is preferable for most applications since it\n * avoids object copies.\n *\n * **NOTE**: These pivot selectors will be ignored on messages with a\n * `message_id` so as not to break the semantics of `equals`. Message IDs\n * **cannot be removed**: see go/jspb-options#message_id.\n */\n\ngoog.module('jspb.dynamic_pivot_selection');\n\nconst internalPivotSelectors = goog.require('jspb.internal_pivot_selectors');\n\n/**\n * This is an opaque type which represents a pivot selection strategy.\n *\n * See the file overview on dynamic_pivot_selection.js for more information.\n *\n * You cannot construct these directly, use the constants below.\n *\n * @abstract\n */\nclass PivotSelector {\n  constructor() {\n    throw (\n        goog.DEBUG ? new Error('Do not construct these yourself.') :\n                     new Error());\n  }\n}\n\n/**\n * A pivot selector which minimizes the memory cost of the serialization in V8.\n *\n * @const {!PivotSelector}\n */\nconst MEMORY_COST_PIVOT_SELECTOR =\n    /** @type {!PivotSelector} */ (\n        /** @type {?} */ (internalPivotSelectors.memoryCostPivotSelector));\n\n/**\n * A pivot selector which minimizes the uncompressed wire size of the\n * serialization.\n *\n * @const {!PivotSelector}\n */\nconst WIRE_COST_PIVOT_SELECTOR =\n    /** @type {!PivotSelector} */ (\n        /** @type {?} */ (internalPivotSelectors.wireCostPivotSelector));\n\n/**\n * A pivot selector which never moves the pivot, even in tests.\n *\n * @const {!PivotSelector}\n * @deprecated there is no good reason to use this. If you are asserting on\n *   proto content, see go/jspb-testing. If you are trying to use a proto as\n *   a key, consider a solution involving hash_code_reexport.js and\n *   Message.equals.\n */\nconst DETERMINISTIC_PIVOT_SELECTOR =\n    /** @type {!PivotSelector} */ (\n        /** @type {?} */ (internalPivotSelectors.noChangePivotSelector));\n\n/**\n * This returns the default pivot selector.\n *\n * @const {!PivotSelector}\n */\nconst DEFAULT_PIVOT_SELECTOR = /** @type {!PivotSelector} */ (\n    /** @type {?} */ (\n        goog.DEBUG ? internalPivotSelectors.defaultPivotSelector :\n                     internalPivotSelectors.noChangePivotSelector));\n\nexports = {\n  DETERMINISTIC_PIVOT_SELECTOR,\n  MEMORY_COST_PIVOT_SELECTOR,\n  PivotSelector,\n  WIRE_COST_PIVOT_SELECTOR,\n  DEFAULT_PIVOT_SELECTOR,\n};\n","/**\n * @fileoverview Internal message construction utils.\n *\n * DO NOT USE THIS OUTSIDE OF THIS PACKAGE.\n */\n\ngoog.module('jspb.internal_construct');\n\nconst {ALREADY_CONSTRUCTED_THROTTLE_KEY} = goog.require('jspb.internal_symbols');\nconst {ArrayState, ArrayStateFlags, PIVOT_LIMIT, checkMessageStateInvariants, getArrayIndexOffset, getArrayState, hasFlagBit, setArrayState, setPivot} = goog.require('jspb.internal_array_state');\nconst {ENABLE_ASSERTS, assert, assertArray} = goog.require('goog.asserts');\nconst {assertArrayInvariants, fieldNumberFromIndex, hasOwnPropertyIfNotTrusted, indexFromFieldNumber, isSparseObject} = goog.require('jspb.internal');\nconst {logNewArray} = goog.require('jspb.internal_operations');\nconst {shouldThrowInArrayConstructorIfArrayIsAlreadyConstructed, shouldTransferArrayInConstructor} = goog.require('jspb.internal_options');\nconst {throttledAsyncThrowWarning} = goog.require('jspb.exceptions');\nconst {transferArray} = goog.require('jspb.internal.transfer_array');\n\n\nconst ENCODED_MAP_META = /** @type {*} */ (/** @type {?} */ (true));\n\n/** @abstract */\nclass Opaque {}\n\n/**\n * A MessageMeta is an array describing the type information necessary to\n * construct a message.\n *\n * These arrays may have either two or three elements, which are:\n *\n * [\n *    suggested pivot (number, usually zero),\n *    message_id (string, usually undefined),\n *    is_map (boolean, true iff present)\n * ]\n *\n * Because we cannot express such a tuple in JS types, we expose only as an\n * opaque type and localize manipulations to this file.\n *\n * @typedef {typeof Opaque}\n */\nlet MessageMeta;\n\nlet /** !MessageMeta|undefined */ mapEntryMessageMeta;\n\nlet /** !MessageMeta|undefined */ noPivotNoMessageIdMessageMeta;\n\n/**\n * Parses the value from the beginning of binaryFieldsObject into a MessageMeta\n * value, returns `undefined` if not a valid raw message meta.\n *\n * See `GenerateClassBinaryFields` in\n * net/proto2/compiler/js/internal/generator.cc\n *\n * @return {!MessageMeta|undefined}\n */\nfunction tryParseMessageMeta(/** ? */ value) {\n  switch (typeof value) {\n    case 'boolean':\n      // All map entry message metadatas are [0, undefined, true] so we\n      // shouldn't bother making more than one array.\n      return (mapEntryMessageMeta ||= createMapEntryMessageMeta());\n    case 'number':\n      // Take its negation, bare pivots are encoded as non-positive numbers to\n      // avoid ambiguity with oneof field arrays which are always >=1\n      return value > 0 ?\n          undefined :\n          // 0 is incredibly common so cache the MessageMeta for it\n          // This also avoids the awkward `-0` values we would otherwise get.\n          value === 0 ?\n          (noPivotNoMessageIdMessageMeta ||= createMessageMeta(0)) :\n          createMessageMeta(-value);\n    case 'string':\n      // This is just a message_id\n      return createMessageMeta(0, value);\n    case 'object':\n      // This is a message meta, check that it is valid and cast.\n      assertArray(value);\n      assert(value.length === 2 || (value.length === 3 && value[2] === true));\n      assert(\n          value[0] == null || (typeof value[0] === 'number' && value[0] >= 0));\n      assert(value[1] == null || typeof value[1] === 'string');\n      return /** @type{!MessageMeta}*/ (/** @type{?} */ (value));\n    default:\n      return undefined;\n  }\n}\n\n/**\n * Creates a `MessageMeta` for map entry fields.\n *\n * @return {!MessageMeta}\n */\nfunction createMapEntryMessageMeta() {\n  return /** @type {!MessageMeta} */ (/** @type {?} */ ([0, undefined, true]));\n}\n\n/**\n * @return {!MessageMeta}\n */\nfunction createMessageMeta(\n    /** number|undefined */ suggestedPivot,\n    /** string|undefined= */ messageId) {\n  return /** @type{!MessageMeta}*/ (\n      /** @type{?} */ ([suggestedPivot, messageId]));\n}\n\n/** @return {!Array<?>} */\nfunction constructMessageArrayFromMetaForBinary(\n    /** ?Array<?>|undefined */ data, /** !MessageMeta */ metadata) {\n  assertArray(metadata);\n  const metaAsArray = /** @type{!Array<?>} */ (/** @type{?} */ (metadata));\n  const suggestedPivot = metaAsArray[0];\n  const messageId = metaAsArray[1];\n  return constructMessageArray(data, suggestedPivot, messageId);\n}\n\n/** @return {!Array<?>} */\nfunction constructMessageArrayForJsonConversion(\n    /** ?Array<?>|undefined */ data, /** string|undefined= */ messageId) {\n  return constructMessageArray(data, /*suggestedPivot=*/ 500, messageId);\n}\n\n/** @return {boolean} */\nfunction metaHasMessageId(/** !MessageMeta */ metadata) {\n  assertArray(metadata);\n  const metaAsArray = /** @type{!Array<?>} */ (/** @type{?} */ (metadata));\n  return !!(metaAsArray[1]);\n}\n\n/**\n * Computes an array index offset given a MessageMeta.\n *\n * @return {number}\n */\nfunction arrayIndexOffsetForMeta(/** !MessageMeta */ metadata) {\n  return metaHasMessageId(metadata) ? 0 : -1;\n}\n\n/** @return {!Array<?>} */\nfunction constructMessageArrayForMessageConstructor(\n    /** ?Array<?>|undefined */ data, /** number|undefined=*/ suggestedPivot,\n    /** string|undefined= */ messageId) {\n  return constructMessageArray(\n      data, suggestedPivot, messageId, ArrayStateFlags.HAS_WRAPPER);\n}\n\n/** @return {!Array<?>} @noinline */\nfunction constructMessageArray(\n    /** ?Array<?>|undefined */ data, /** number|undefined=*/ suggestedPivot,\n    /** string|undefined= */ messageId,\n    /** !ArrayState= */ arrayStateToAdd = 0) {\n  // In tests, assert that immutable api formatted values are always\n  // frozen. This allows us to surface state management problems early, before\n  // assertArrayReturnedSafely and friends would fail.\n  if (goog.DEBUG && ENABLE_ASSERTS && (data != null)) {\n    for (let i = 0; i < data.length; i++) {\n      const value = data[i];\n      if (Array.isArray(value)) {\n        assertArrayInvariants(value);\n      }\n    }\n  }\n\n  // Check array state invariants.\n  let arrayState;\n  if (data == null) {\n    // The only reference to this array is this message so we know there are\n    // no external mutable references.\n    arrayState = ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED;\n    if (messageId) {\n      data = logNewArray([messageId]);\n      arrayState |= ArrayStateFlags.HAS_MESSAGE_ID;\n    } else {\n      data = logNewArray([]);\n    }\n    if (suggestedPivot) {\n      arrayState = setPivot(arrayState, suggestedPivot);\n    }\n  } else {\n    if (!Array.isArray(data)) {\n      if (goog.DEBUG) {\n        throw new Error(\n            `data passed to JSPB constructors must be an Array, got '${\n                JSON.stringify(data)}' a ${goog.typeOf(data)}`);\n      } else {\n        throw new Error('narr');\n      }\n    }\n\n    arrayState = getArrayState(data);\n\n    // Throw an error if the array is already owned by another jspb proto\n    // instance.\n    // Repeated field arrays should never be passed to constructors.\n    if (shouldThrowInArrayConstructorIfArrayIsAlreadyConstructed() &&\n        hasFlagBit(arrayState, ArrayStateFlags.IS_REPEATED_FIELD)) {\n      if (goog.DEBUG) {\n        throw new Error(\n            'Array passed to JSPB constructor is a repeated field array that belongs to another proto instance.');\n      } else {\n        throw new Error('rfarr');\n      }\n    }\n\n    // Mutable arrays that have already been marked as constructed belong to\n    // another proto instance, so they cannot be safely used to construct\n    // another message.\n    if (isPossiblyMutablyShared(arrayState)) {\n      maybeThrowAlreadyConstructedError();\n    }\n\n    if (goog.DEBUG) {\n      // Only perform these mutability tests in debug, this is almost entirely\n      // a testonly issue.\n      if (Object.isFrozen(data) || !Object.isExtensible(data) ||\n          Object.isSealed(data)) {\n        throw new Error(`data passed to JSPB constructors must be mutable`);\n      }\n    }\n\n    // If `shouldTransferArrayInConstructor` is enabled, and the array is not\n    // owned by us, then transfer it in debug environments to prevent external\n    // mutations by users.\n    if (shouldTransferArrayInConstructor() &&\n        hasFlagBit(arrayStateToAdd, ArrayStateFlags.HAS_WRAPPER) &&\n        !hasFlagBit(arrayState, ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED) &&\n        !hasFlagBit(arrayState, ArrayStateFlags.IS_IMMUTABLE_ARRAY)) {\n      // Transfer array in debug environments to prevent external mutations by\n      // users.\n      data = transferArray(/** @type{!Array<?>} */ (data));\n    }\n\n    if (arrayState & ArrayStateFlags.FROZEN_ARRAY) {\n      // In DEBUG we would've thrown above.\n      throw new Error('farr');\n    }\n\n    // Fast-path for constructed messages.\n    if (arrayState & ArrayStateFlags.CONSTRUCTED) {\n      if ((arrayState | arrayStateToAdd) !== arrayState) {\n        setArrayState(data, arrayState |= arrayStateToAdd);\n      }\n\n      // Check state invariants.\n      if (ENABLE_ASSERTS) {\n        checkMessageStateInvariants(data, arrayState);\n      }\n\n      return data;\n    }\n\n    if (messageId) {\n      arrayState |= ArrayStateFlags.HAS_MESSAGE_ID;\n      if (messageId !== data[0]) {\n        // Validate message ids in messages constructed from data.\n        // Ensure that the data matches the Id unless explicitly disabled.\n        if (goog.DEBUG) {\n          throw new Error(`Expected message to have a message id: \"${\n              messageId}\" in the array, got: ${JSON.stringify(data[0])} a ${\n              goog.typeOf(data[0])}, are you parsing with the wrong proto?`);\n        } else {\n          throw new Error('mid');\n        }\n      }\n    }\n\n    arrayState = initPivotAndSparseObject(\n        data,\n        // Pretend to set CONSTRUCTED for assertions.\n        //\n        // We will do this below but avoid it here so there is exactly one\n        // assignment.\n        arrayState | ArrayStateFlags.CONSTRUCTED, suggestedPivot);\n  }\n\n  // At this point all message bits are consistent so we can set CONSTRUCTED.\n  arrayState |= ArrayStateFlags.CONSTRUCTED | arrayStateToAdd;\n\n  // Update our array state.\n  setArrayState(data, arrayState);\n\n  return data;\n}\n\n/** @noinline */\nfunction maybeThrowAlreadyConstructedError() {\n  if (shouldThrowInArrayConstructorIfArrayIsAlreadyConstructed()) {\n    if (goog.DEBUG) {\n      throw new Error(\n          'Array passed to JSPB constructor already belongs to another JSPB proto instance');\n    } else {\n      throw new Error('carr');\n    }\n  }\n  // Async-throw if !goog.DEBUG. If we were in debug mode but\n  // shouldThrowInArrayConstructorIfArrayIsAlreadyConstructed was false then\n  // it was explicitly disabled for testing.\n  if (!goog.DEBUG) {\n    throttledAsyncThrowWarning(\n        undefined, ALREADY_CONSTRUCTED_THROTTLE_KEY, 5, 'carr');\n  }\n}\n\n/**\n * Whether the array is owned by another jspb proto instance and unsafe\n * to be passed to the message constructor.\n *\n * @param {!ArrayState} arrayState\n * @return {boolean}\n */\nfunction isPossiblyMutablyShared(arrayState) {\n  // Any mutable instance with a wrapper is owned by another proto.\n  return hasFlagBit(arrayState, ArrayStateFlags.HAS_WRAPPER) &&\n      !hasFlagBit(arrayState, ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n}\n\n/**\n * If the array contains an sparse object in its last position, then the\n * object is kept in place and its position is used as the pivot.  If not,\n * decides the pivot of the message based on suggestedPivot without\n * materializing the extension object.  Returns the updated arrayState value\n *\n * @param {!Array} data The JsPb internal array.\n * @param {number} arrayState the array state for the message.\n * @param {number|undefined} suggestedPivot See description for\n *     Message.constructor.\n * @return {number}\n */\nfunction initPivotAndSparseObject(data, arrayState, suggestedPivot) {\n  // There are 3 variants that need to be dealt with which are the\n  // combination of whether there exists an sparse object (SO) and\n  // whether there is a suggested pivot (SP).\n  //\n  // SO,    ?    : pivot is the index of the SO\n  // no-SO, no-SP: pivot is MAX_INT\n  // no-SO, SP   : pivot is the max(lastindex + 1, SP)\n  const msgLength = data.length;\n  if (msgLength) {\n    const lastIndex = msgLength - 1;\n    const obj = data[lastIndex];\n    if (isSparseObject(obj)) {\n      const arrayIndexOffset = getArrayIndexOffset(arrayState);\n      const pivot = fieldNumberFromIndex(lastIndex, arrayIndexOffset);\n      if (pivot >= PIVOT_LIMIT) {\n        if (goog.DEBUG) {\n          throw new Error(\n              `Found a message with a sparse object at fieldNumber ${\n                  pivot} is >= the limit ${PIVOT_LIMIT}`);\n        } else {\n          throw new Error('pvtlmt');\n        }\n      }\n\n      // Move low extensions to the dense portion so we don't have to worry\n      // about them. This means that values in the sparse object 'overwrite'\n      // values in the array but that is consistent with server behavior.\n      //\n      // Note that we cannot assume that the sparse object keys are ordered\n      // because they might not have been in browsers before 2016.\n      //\n      // We don't bother removing the sparse object because serialization\n      // already implements that.\n      for (const k in obj) {\n        if (!hasOwnPropertyIfNotTrusted(obj, k)) continue;\n        const n = +k;\n        if (n < pivot) {\n          const i = indexFromFieldNumber(n, arrayIndexOffset);\n          assert(data[i] == null);\n          data[i] = obj[k];\n          delete obj[k];\n        } else if (goog.FEATURESET_YEAR >= 2018) {\n          break;\n        }\n      }\n\n      return setPivot(arrayState, pivot);\n    }\n  }\n  if (suggestedPivot) {\n    // If a sparse object is not present, set the pivot value as being\n    // after the last value in the array to avoid overwriting values, etc.\n    const arrayIndexOffset = getArrayIndexOffset(arrayState);\n    const pivot = Math.max(\n        suggestedPivot, fieldNumberFromIndex(msgLength, arrayIndexOffset));\n    if (pivot > PIVOT_LIMIT) {\n      if (goog.DEBUG) {\n        throw new Error(`a message was constructed with an array of length ${\n            msgLength} which is longer than ${\n            PIVOT_LIMIT}, are you using a supported serializer?`);\n      } else {\n        throw new Error('spvt');\n      }\n    }\n    // Otherwise store in the arrayState\n    return setPivot(arrayState, pivot);\n  } else {\n    // otherwise don't set a pivot, this is the same as explicitly setting\n    // NO_PIVOT\n    return arrayState;\n  }\n}\n\n/**\n * Returns whether the given MessageMeta corresponds to a map entry field.\n *\n * @return {boolean}\n */\nfunction isMapEntryMessageMeta(/** !MessageMeta */ messageMeta) {\n  return messageMeta === mapEntryMessageMeta;\n}\n\nexports = {\n  ENCODED_MAP_META,\n  MessageMeta,\n  arrayIndexOffsetForMeta,\n  constructMessageArrayForJsonConversion,\n  constructMessageArrayForMessageConstructor,\n  constructMessageArrayFromMetaForBinary,\n  isMapEntryMessageMeta,\n  metaHasMessageId,\n  tryParseMessageMeta,\n};\n","/**\n * @fileoverview Internal utilities for manipulating immutable messages.\n * @package\n *\n * DO NOT USE THIS OUTSIDE OF THIS PACKAGE.\n */\ngoog.module('jspb.internal_immutability');\n\nconst asserts = goog.require('goog.asserts');\nconst {ALLOW_COPY_ON_WRITE, DETAILED_JSPB_ASSERTS} = goog.require('jspb.internal_options');\nconst {ArrayState, ArrayStateFlags, addArrayStateFlags, copyArrayBitsClone, getArrayState, getMessageArrayState, getPossiblyUnconstructedMessageArrayState, getPossiblyUnconstructedMessageArrayStateInline, hasFlagBit, markArrayImmutable, setArrayState} = goog.require('jspb.internal_array_state');\nconst {ByteString} = goog.require('jspb.bytestring');\nconst {EXEMPTED_SUBCLASS_MARKER, InternalMessage, assertArrayInvariants, checkMutableMessage, getInternalArray, isCopyOnWrite, isImmutableMessage, isInternalMessage, iterateFields, setCopyOnWrite, setInternalArray, setInternalArrayForNewMessage, setNoLegacyNull} = goog.require('jspb.internal');\nconst {JspbMap, isImmutableMap} = goog.require('jspb.internal_map');\nconst {cloneJspbArray} = goog.require('jspb.internal_copy');\nconst {logOperation} = goog.require('jspb.internal_operations');\n\n\n/**\n * Returns whether an array with the given state is a candidate for in-place\n * markImmutable.\n *\n * @param {!ArrayState} state\n * @return {boolean}\n */\nfunction canMarkImmutableInPlaceIfParentIsOwned(state) {\n  // Callers shouldn't call us on already immutable arrays.\n  asserts.assert(!hasFlagBit(state, ArrayStateFlags.IS_IMMUTABLE_ARRAY));\n\n  // We never have a mutable sub-array with a wrapper inside a mutable parent\n  // with a wrapper because we always write back the wrapper.\n  asserts.assert(!hasFlagBit(state, ArrayStateFlags.HAS_WRAPPER));\n\n  // All message and map arrays that have no wrappers can be marked immutable\n  // in-place. Only repeated field arrays that have been unfrozen shared or\n  // contain mutable submessages can't be marked immutable.\n  return !hasFlagBit(state, ArrayStateFlags.MUTABLE_SUBSTRUCTURES) &&\n      !hasFlagBit(state, ArrayStateFlags.UNFROZEN_SHARED);\n}\n\n/**\n * @param {T} v\n * @param {boolean} parentIsOwned\n * @return {T}\n * @template T\n * @suppress {visibility} Access to map internals\n */\nfunction copyImmutableFieldValue(v, parentIsOwned) {\n  asserts.assertExists(v);\n  // boolean, number, string, bigint are all immutable, so we can just return\n  // them.\n  if (typeof v !== 'object') {\n    return v;\n  }\n  if (Array.isArray(v)) {\n    assertArrayInvariants(v);\n    const state = getArrayState(v);\n    // If this is an empty repeated field, don't copy it in any mode.\n    if (v.length === 0 && (state & ArrayStateFlags.IS_REPEATED_FIELD)) {\n      return undefined;\n    }\n    return getArrayForClone(v, state, parentIsOwned);\n  }\n\n  if (isInternalMessage(v)) {\n    return copyToImmutableMessageOrArray(/** @type {!InternalMessage} */ (v));\n  }\n  if (v instanceof JspbMap) {\n    const mapArrayState = v.arrayState;\n    if (mapArrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY) return v;\n    if (!v.size) return undefined;\n    const entries = markArrayImmutable(v.toArrayInternalUnsorted());\n    if (v.valueCtor) {\n      // Message maps are lazily constructed so we need to inspect and copy the\n      // values. Keys can be ignored because they are all immutable and already\n      // validated.\n      for (let i = 0; i < entries.length; i++) {\n        const entry = entries[i];\n        let value = entry[1];\n        if (value == null || typeof value !== 'object') {\n          // lined up with the behavior of JspbMap.constructor, undefined is\n          // treated as missing and modeled as `null` in the map entry\n          value = undefined;\n          // type inference cannot figure out that `value` is a !Object here :(\n        } else if (isInternalMessage(value)) {\n          value = copyToImmutableMessageOrArray(\n              /** @type {!InternalMessage} */ (value));\n        } else if (Array.isArray(value)) {\n          value = getArrayForClone(\n              value, getPossiblyUnconstructedMessageArrayStateInline(value),\n              !!(mapArrayState & ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED));\n        } else {\n          // This must be some schema skew issue, just drop the value.\n          value = undefined;\n        }\n        entry[1] = value;\n      }\n    } else {\n      // No need to inspect values because they are all immutable and in fact\n      // the constructor has already validated everything.\n    }\n    return entries;\n  }\n  if (v instanceof ByteString) {\n    return v;\n  }\n  // TODO: b/396420284 - remove.\n  asserts.assert(!(v instanceof Uint8Array));\n  // Arrays and sparse objects were handled by our caller, so this is really\n  // just an invalid value. Drop it.\n  return undefined;\n}\n\n/**\n * Returns an array suitable for a clone, possibly without any copying.\n *\n * @param {!Array<?>} array\n * @param {!ArrayState} arrayState\n * @param {boolean} parentIsOwned\n * @return {!Array<?>}\n */\nfunction getArrayForClone(array, arrayState, parentIsOwned) {\n  if (arrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY) {\n    return array;\n  }\n  if (parentIsOwned && canMarkImmutableInPlaceIfParentIsOwned(arrayState)) {\n    addArrayStateFlags(\n        array,\n        ArrayStateFlags.IS_IMMUTABLE_ARRAY |\n            ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED);\n    // Immutable API_FORMATTED arrays must be frozen.\n    if (arrayState & ArrayStateFlags.IS_API_FORMATTED) Object.freeze(array);\n  } else {\n    array = copyArrayWithImmutableFields(\n        array, arrayState, /*markImmutable=*/ false,\n        parentIsOwned && !(arrayState & ArrayStateFlags.UNFROZEN_SHARED));\n  }\n  return array;\n}\n\n/**\n * @param {!InternalMessage} template\n * @param {!Array<?>} array\n * @param {boolean=} mutable\n * @return {!InternalMessage}\n */\nfunction wrapImmutableArray(template, array, mutable) {\n  const ctor = /** @type {function(new:InternalMessage, ?Array=)} */ (\n      template.constructor);\n  const msg = new ctor(array);\n  if (mutable) {\n    setCopyOnWrite(msg, true);\n  }\n  setNoLegacyNull(msg, true);\n  return msg;\n}\n\n/**\n * Returns an immutable message/array (possibly without any copying), or a copy\n * of the message's array suitable for a clone.\n *\n * @param {!InternalMessage} msg Message to copy from.\n * @return {!InternalMessage|!Array<?>}\n */\nfunction copyToImmutableMessageOrArray(msg) {\n  asserts.assert(isInternalMessage(msg));\n  const array = getInternalArray(msg);\n  const arrayState = getMessageArrayState(array);\n  if (isImmutableMessage(msg, arrayState)) {\n    return msg;\n  }\n  if (tryZeroCopyImmutable(msg, array, arrayState)) {\n    // ideally, we just return array here, but we wrap in a message to be able\n    // to mark noLegacyNull.\n    return wrapImmutableArray(msg, array);\n  }\n  return copyArrayWithImmutableFields(array, arrayState);\n}\n\n/**\n * Returns a copy of the provided message with a mutable base messages and\n * immutable submessages.\n *\n * @param {!T} msg Message to copy from.\n * @return {!T} A copied message with immutable fields.\n * @template T\n */\nfunction copyMutableWithImmutableFields(msg) {\n  asserts.assert(isInternalMessage(msg));\n  const array = getInternalArray(msg);\n  const arrayState = getMessageArrayState(array);\n  if (tryZeroCopyImmutable(msg, array, arrayState)) {\n    return wrapImmutableArray(msg, array, /*mutable=*/ true);\n  }\n  return copyArrayToMessageWithImmutableFields(\n      msg, array, arrayState, /*immutable=*/ false);\n}\n\n/**\n * Copies the content of the second argument into the first.\n *\n * @param {!T} toMessage Message which will receive a copy of fromMessage\n * @param {!T} fromMessage Message that will be copied into toMessage.\n * @return {!T} toMessage\n * @template T\n */\nfunction copyMutableIntoMessage(toMessage, fromMessage) {\n  asserts.assert(isInternalMessage(toMessage));\n  asserts.assert(isInternalMessage(fromMessage));\n  checkMutableMessage(toMessage);\n  if (fromMessage.constructor !== toMessage.constructor) {\n    throw new Error('Copy source and target message must have the same type.');\n  }\n  let array = getInternalArray(fromMessage);\n  const arrayState = getMessageArrayState(array);\n  if (tryZeroCopyImmutable(fromMessage, array, arrayState)) {\n    setInternalArrayForNewMessage(toMessage, array);\n    setCopyOnWrite(toMessage, true);\n    setNoLegacyNull(toMessage, true);\n    return toMessage;\n  }\n  array = copyArrayWithImmutableFields(array, arrayState);\n  setInternalArray(toMessage, array);\n  return toMessage;\n}\n\n/**\n * Returns a copy of the provided message `Array` as a message with\n * immutable sub structures.\n *\n * @return {!InternalMessage}\n * @template T\n */\nfunction copyArrayToMessageWithImmutableFields(\n    /** !T */ template, /** !Array<?> */ array, /** number */ arrayState,\n    /** boolean */ immutable) {\n  return new template.constructor(\n      copyArrayWithImmutableFields(array, arrayState, immutable));\n}\n\n/**\n * Returns a copy of the provided message `Array` as a deeply immutable array.\n *\n * The returned array is always newly constructed but may share internal\n * structures with the provided array.\n *\n * @param {!Array<?>} array\n * @param {!ArrayState} arrayState\n * @param {boolean=} markImmutable Whether new array should be marked immutable.\n * @param {boolean=} isOwned Whether array is known not to be exposed to users.\n * @return {!Array}\n */\nfunction copyArrayWithImmutableFields(\n    array, arrayState, markImmutable, isOwned) {\n  if (DETAILED_JSPB_ASSERTS) {\n    logOperation({copyMessageWithImmutableFields: 1});\n  }\n  asserts.assert(arrayState === getArrayState(array));\n\n  isOwned ??= hasFlagBit(\n      arrayState,\n      ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED |\n          ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n  const newArray =\n      cloneJspbArray(array, arrayState, copyImmutableFieldValue, isOwned);\n\n  arrayState = copyArrayBitsClone(arrayState, markImmutable);\n  setArrayState(newArray, arrayState);\n\n  return newArray;\n}\n\n/**\n * Returns a frozen message directly from a JSPB Transport Format encoded\n * string.\n * @param {function(new:JSPB, ?Array=)} ctor Constructor for the message.\n * @param {string} data a string of JSPB Transport Format encoded data.\n * @return {!JSPB} a frozen message.\n * @template JSPB\n */\nfunction deserializeAsImmutable(ctor, data) {\n  asserts.assertString(data);\n  asserts.assertFunction(ctor);\n  const array = JSON.parse(data);\n  if (!Array.isArray(array)) {\n    throw new Error(\n        'Expected jspb data to be an array, got ' + goog.typeOf(array) + ': ' +\n        array);\n  }\n  markArrayImmutable(array);\n  const msg = new ctor(array);\n  asserts.assert(isInternalMessage(msg));\n  return msg;\n}\n\n/**\n * Converts the given message to a mutable instance, if necessary.\n *\n * @param {!InternalMessage} msg\n * @return {!InternalMessage}\n */\nfunction messageToMutable(msg) {\n  const array = getInternalArray(msg);\n  const arrayState = getMessageArrayState(array);\n  if (!isImmutableMessage(msg, arrayState)) {\n    return msg;\n  }\n  if (tryZeroCopyImmutable(msg, array, arrayState)) {\n    return wrapImmutableArray(msg, array, /*mutable=*/ true);\n  }\n  return copyArrayToMessageWithImmutableFields(\n      msg, array, arrayState, /*immutable=*/ false);\n}\n\n/**\n * Converts the given message to an immutable instance, if necessary.\n *\n * @param {!InternalMessage} msg\n * @return {!InternalMessage}\n */\nfunction messageToImmutable(msg) {\n  const array = getInternalArray(msg);\n  const arrayState = getMessageArrayState(array);\n  if (isImmutableMessage(msg, arrayState)) {\n    return msg;\n  }\n  if (tryZeroCopyImmutable(msg, array, arrayState)) {\n    return wrapImmutableArray(msg, array);\n  }\n  return copyArrayToMessageWithImmutableFields(\n      msg, array, arrayState, /*immutable=*/ true);\n}\n\n/**\n * @param {!InternalMessage} msg\n * @return {boolean} whether copy happened\n */\nfunction maybeCopyOnWrite(msg) {\n  if (!isCopyOnWrite(msg)) {\n    return false;\n  }\n  let array = getInternalArray(msg);\n  const arrayState = getMessageArrayState(array);\n  asserts.assert(arrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n  array = copyArrayWithImmutableFields(array, arrayState);\n  setInternalArray(msg, array);\n  return true;\n}\n\n/**\n * Ensures the given message is mutable, and makes array mutable if necessary.\n * Throws otherwise.\n * @param {!InternalMessage} msg\n * @param {!ArrayState=} arrayState\n */\nfunction ensureMutable(msg, arrayState) {\n  if (arrayState !== undefined &&\n      !(arrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY)) {\n    return;\n  }\n  if (!maybeCopyOnWrite(msg)) {\n    checkMutableMessage(\n        msg, arrayState ?? getMessageArrayState(getInternalArray(msg)));\n  }\n}\n\n/**\n * @param {!Array<?>} messageArray\n * @param {!ArrayState=} messageArrayState\n * @return {!ArrayState}\n */\nfunction leakedMutableSubstructures(messageArray, messageArrayState) {\n  if (!ALLOW_COPY_ON_WRITE) {\n    return messageArrayState ?? 0;\n  }\n  if (messageArrayState === undefined) {\n    messageArrayState =\n        getPossiblyUnconstructedMessageArrayStateInline(messageArray);\n  } else {\n    asserts.assert(\n        messageArrayState ===\n        getPossiblyUnconstructedMessageArrayState(messageArray));\n  }\n  asserts.assert(!(messageArrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY));\n  if (DETAILED_JSPB_ASSERTS) {\n    asserts.assert(hasLeakedMutableDebugOnly(messageArray));\n  }\n  if (!hasLeakedMutableSubstructures(messageArrayState)) {\n    messageArrayState |= ArrayStateFlags.MUTABLE_SUBSTRUCTURES;\n    setArrayState(messageArray, messageArrayState);\n  }\n  return messageArrayState;\n}\n\n/**\n * @param {!ArrayState} arrayState\n * @return {boolean}\n */\nfunction hasLeakedMutableSubstructures(arrayState) {\n  return !(arrayState & ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED) ||\n      !!(arrayState & ArrayStateFlags.MUTABLE_SUBSTRUCTURES);\n}\n\n/**\n * Attempts to mark the given array as immutable in place.\n *\n * @param {!InternalMessage} msg\n * @param {!Array<?>} array\n * @param {!ArrayState} arrayState\n * @return {boolean} whether the array was made immutable\n */\nfunction tryZeroCopyImmutable(msg, array, arrayState) {\n  if (!ALLOW_COPY_ON_WRITE) {\n    return false;\n  }\n  // We don't want to copy-on-write unsupported subclasses because they may not\n  // respect expectations about the internal array.\n  if (EXEMPTED_SUBCLASS_MARKER && msg[EXEMPTED_SUBCLASS_MARKER]) {\n    return false;\n  }\n  if (arrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY) {\n    return true;\n  }\n  if (!hasLeakedMutableSubstructures(arrayState)) {\n    if (DETAILED_JSPB_ASSERTS) {\n      asserts.assert(!hasLeakedMutableDebugOnly(array));\n    }\n    setArrayState(array, arrayState | ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n    setCopyOnWrite(msg, true);\n    return true;\n  }\n  return false;\n}\n\n/**\n * @param {!Array<?>} messageArray\n * @return {boolean}\n */\nfunction hasLeakedMutableDebugOnly(messageArray) {\n  const arrayState =\n      getPossiblyUnconstructedMessageArrayStateInline(messageArray);\n  if (!(arrayState & ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED)) {\n    return true;\n  }\n  let leaked = false;\n  iterateFields(messageArray, arrayState, (fieldNumber, value) => {\n    leaked ||= isLeakedMutableFieldDebugOnlyWithOwnedParent(value);\n  });\n  return leaked;\n}\n\n/**\n * @param {*} value\n * @return {boolean}\n */\nfunction isLeakedMutableFieldDebugOnlyWithOwnedParent(value) {\n  if (isInternalMessage(value)) {\n    return !isImmutableMessage(/** @type {!InternalMessage} */ (value));\n  }\n  if (value instanceof JspbMap) {\n    return !isImmutableMap(value);\n  }\n  if (Array.isArray(value)) {\n    const arrayState = getArrayState(value);\n    if (arrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY) return false;\n    return !canMarkImmutableInPlaceIfParentIsOwned(arrayState);\n  }\n  return false;\n}\n\n/**\n * @param {!Array<?>} messageArray\n */\nfunction assertValidLeakedMutableSubstructures(messageArray) {\n  if (ALLOW_COPY_ON_WRITE) {\n    asserts.assert(\n        hasLeakedMutableSubstructures(\n            getPossiblyUnconstructedMessageArrayState(messageArray)) ||\n        !hasLeakedMutableDebugOnly(messageArray));\n  }\n}\n\nexports = {\n  assertValidLeakedMutableSubstructures,\n  canMarkImmutableInPlaceIfParentIsOwned,\n  copyArrayWithImmutableFields,\n  copyImmutableFieldValue,\n  copyMutableIntoMessage,\n  copyMutableWithImmutableFields,\n  deserializeAsImmutable,\n  ensureMutable,\n  leakedMutableSubstructures,\n  maybeCopyOnWrite,\n  messageToImmutable,\n  messageToMutable,\n};\n","/**\n * @fileoverview Holds internal functions for implementing per-field logic for\n * reading/writing data from the jspb internal array.  Use by code other than\n * jspb gencode is forbidden.  You will be broken if you call these functions\n * without explicit approval.\n *\n * DO NOT USE THIS OUTSIDE OF THIS PACKAGE.\n */\ngoog.module('jspb_internal_adapters');\ngoog.module.declareLegacyNamespace();\n\nconst {ArrayState, ArrayStateFlags, EMPTY_LIST_SENTINEL, NO_PIVOT, TypeSpecificApiFormat, addArrayStateFlags, checkMessageStateInvariants, clearFlagBit, clearFlags, clearTypeSpecificFormattedFlagBits, getArrayIndexOffset, getArrayStateInline, getDefaultTypeSpecificApiFormat, getMessageArrayStateInline, getPivot, getPossiblyUnconstructedMessageArrayStateInline, getRepeatedArrayState, getTypeSpecificApiFormat, hasFlagBit, isApiFormattedField, isImmutableArray, markArrayImmutable, markKnownMapArray, markMutableReferencesAreOwned, setArrayState, setFlagBit, setFlagBitTo} = goog.require('jspb.internal_array_state');\nconst {ByteString} = goog.require('jspb.bytestring');\nconst {DETAILED_JSPB_ASSERTS, LegacyNullableBehavior, getAsyncThrowIf64BitIntReturnTypeMismatches, getAsyncThrowIfStringTypedInt64FieldDowngrade, getLegacyNullableBehavior, getWriteBackGbigintValues} = goog.require('jspb.internal_options');\nconst {DO_NOT_FREEZE__LEGACY_OPTION, DoNotFreezeToken, HasMessageId, InternalMessage, OR_UNDEFINED, OrUndefinedToken, assertArrayInvariants, assertRepeated64BitIntegerFieldApiFormattingInvariants, assertValidHasMessageIdOrUndefined, bytesAsByteString, checkNotImmutableState, checkRepeatedIndexInRangeForGet, checkRepeatedIndexInRangeForSet, getHasMessageId, getInternalArrayInline, indexFromFieldNumber, indexFromFieldNumberAndHasMessageId, isImmutableMessage, isInternalMessage, isNoLegacyNull, isSparseObjectInline} = goog.require('jspb.internal');\nconst {ENABLE_ASSERTS, assert, assertExists, assertInstanceof} = goog.require('goog.asserts');\nconst {HAS_NATIVE_SYMBOL, ONEOF_ARRAY_SYMBOL, RETURNED_64BIT_INT_VALUE_MISMATCH_SYMBOL, STRING_TYPE_DOWNGRADES_SYMBOL} = goog.require('jspb.internal_symbols');\nconst {JspbMap, getImmutableEmptyMap, isImmutableMap} = goog.require('jspb.internal_map');\nconst {MessageMeta, constructMessageArrayFromMetaForBinary} = goog.require('jspb.internal_construct');\nconst {assertValidLeakedMutableSubstructures, canMarkImmutableInPlaceIfParentIsOwned, copyArrayWithImmutableFields, ensureMutable, leakedMutableSubstructures, maybeCopyOnWrite, messageToMutable} = goog.require('jspb.internal_immutability');\nconst {asyncThrowWarning, throttledAsyncThrowWarning} = goog.require('jspb.exceptions');\nconst {booleanKeyToApiForMaps, booleanToApiForMaps, bytesToApiForMaps, checkBoolean, checkBytes, checkEnum, checkFloatingPoint, checkInt32, checkInt64, checkMessageType, checkNullishBoolean, checkNullishBytes, checkNullishEnum, checkNullishFloatingPoint, checkNullishInt32, checkNullishInt64, checkNullishString, checkNullishUint32, checkNullishUint64, checkRepeatedFieldIsArray, checkString, checkUint32, checkUint64, coerceToNullishBoolean, coerceToNullishEnum, coerceToNullishFloatingPoint, coerceToNullishInt32, coerceToNullishInt64, coerceToNullishInt64Gbigint, coerceToNullishInt64String, coerceToNullishString, coerceToNullishUint32, coerceToNullishUint64, coerceToNullishUint64Gbigint, coerceToNullishUint64String, enumToApiForMaps, floatToApiForMaps, getDefaultImmutableInstance, int32KeyToApiForMaps, int32ToApiForMaps, int64GbigintKeyToApiForMaps, int64GbigintToApiForMaps, int64KeyToApiForMaps, int64ToApiForMaps, messageFromInlineStorage, stringKeyToApiForMaps, stringToApiForMaps, uint32KeyToApiForMaps, uint32ToApiForMaps, uint64GbigintKeyToApiForMaps, uint64GbigintToApiForMaps, uint64KeyToApiForMaps, uint64ToApiForMaps} = goog.require('jspb.internal_accessor_helpers');\nconst {logNewArray, logOperation, slice} = goog.require('jspb.internal_operations');\nconst {toGbigint} = goog.require('google3.javascript.common.bigint.index');\n\n/**\n * Special field number used to signify a non-existent field.\n * @const {number}\n */\nconst NO_SUCH_FIELD = -1;\n\n/**\n * Default value for 64-bit int fields as a gbigint.\n * @const {!gbigint}\n */\nconst GBIGINT_ZERO = toGbigint(0);\n\n/** @typedef {boolean} */ let ForceTypeChecking;\n\n/**\n * Performs a rate-limited async throw if value is not actually typed as\n * expected.\n *\n * @param {T} msg\n * @param {number|string|null|undefined} value\n * @param {boolean} expectStringValue True if value should be a string, else a\n *     number.\n * @template T\n */\nfunction asyncThrowIf64BitIntReturnTypeMismatches(\n    msg, value, expectStringValue) {\n  if (value == null || !getAsyncThrowIf64BitIntReturnTypeMismatches()) {\n    return;\n  }\n\n  const expectedType = expectStringValue ? 'string' : 'number';\n  if (typeof value === expectedType) {\n    return;\n  } else if (\n      expectedType === 'number' && !Number.isSafeInteger(Number(value))) {\n    return;\n  }\n\n  const error = goog.DEBUG ?\n      `Expected a ${expectedType}-typed 64-bit int value, but got ${\n          goog.typeOf(value)}: ${value}` :\n      '64birm';\n\n  throttledAsyncThrowWarning(\n      msg, RETURNED_64BIT_INT_VALUE_MISMATCH_SYMBOL,\n      /* limit = */ 4, error);\n}\n\n/**\n * Performs a rate-limited async throw if values is not actually typed as\n * expected. This is a convenience version of\n * asyncThrowIf64BitIntReturnTypeMismatches. We only check one element for\n * repeated fields.\n *\n * @param {T} msg\n * @param {!Array<?>} values\n * @param {boolean} expectStringValue True if value should be a string, else a\n *     number.\n * @template T\n */\nfunction asyncThrowIfRepeated64BitIntReturnTypeMismatches(\n    msg, values, expectStringValue) {\n  if (values.length === 0) {\n    return;\n  }\n\n  // The purpose of this guard is to ensure the returned value generally\n  // aligns with the getter return type. In particular, number[] types that\n  // are actually becoming string[] due to traversing ESF.\n  //\n  // Unfortunately, legacy formatting semantics mean the repeated field could\n  // technically consist of both string and number values. We punt on this\n  // detecting this scenario to avoid undue burden.\n  asyncThrowIf64BitIntReturnTypeMismatches(msg, values[0], expectStringValue);\n}\n\n/**\n * Tests whether or not the given array needs to be re-formatted.\n * Returns true if our state is not API formatted or if it corresponds to\n * a 64-bit int field that needs a different type-specific formatting\n * (if expectedFormatType is defined)\n *\n * @param {!InternalMessage} message\n * @param {!ArrayState} state\n * @param {!TypeSpecificApiFormat=} expectedFormatType\n * @param {boolean=} doesntReturnArray\n * @return {boolean} Returns true if field should be (re-)formatted.\n */\nfunction needsApiFormatting(\n    message, state, expectedFormatType, doesntReturnArray) {\n  if (!hasFlagBit(state, ArrayStateFlags.IS_API_FORMATTED)) {\n    // Not formatted to begin with.\n    return true;\n  }\n\n  if (expectedFormatType == null) {\n    // Lack of an expected format means this field isn't a 64-bit int. no\n    // type-specific formatting is required.\n    return false;\n  }\n\n  assert(\n      expectedFormatType === TypeSpecificApiFormat.LEGACY ||\n          expectedFormatType === ArrayStateFlags.STRING_FORMATTED ||\n          expectedFormatType === ArrayStateFlags.GBIGINT_FORMATTED,\n      `Expected format type to be one of legacy, string, or gbigint, but got ${\n          expectedFormatType}`);\n\n  // Complain on attempt to dowgrade to legacy formatting for 64-bit int fields.\n  // Such a conversion is impossible (the legacy values were previously lost on\n  // conversion to string or gbigint formatting).\n  if (!doesntReturnArray &&\n      expectedFormatType === TypeSpecificApiFormat.LEGACY &&\n      (hasFlagBit(state, ArrayStateFlags.STRING_FORMATTED) ||\n       hasFlagBit(state, ArrayStateFlags.GBIGINT_FORMATTED)) &&\n      getAsyncThrowIfStringTypedInt64FieldDowngrade() &&\n      // Emit a warning at most four times per type.\n      (message.constructor[STRING_TYPE_DOWNGRADES_SYMBOL] =\n           (message.constructor[STRING_TYPE_DOWNGRADES_SYMBOL] | 0) + 1) < 5) {\n    asyncThrowWarning(\n        goog.DEBUG ?\n            'an _asLegacyNumberOrString accessor was called after an ' +\n                '_asString accessor: this can cause type errors when numeric ' +\n                'values are expected -- we recommend standardizing your ' +\n                'whole application on the _asString version. See ' +\n                'go/jspb-gencode?polyglot=typescript#int64-string-accessors ' +\n                'for more information.' :\n            'int64 downgrade');\n  }\n\n  // We know state already includes IS_API_FORMATTED (else would've returned\n  // early). If legacy formatting was expected, there's nothing more that can be\n  // done.\n  if (expectedFormatType === TypeSpecificApiFormat.LEGACY) {\n    return false;\n  }\n\n  return !hasFlagBit(\n      state, /** @type {!ArrayStateFlags} */ (expectedFormatType));\n}\n\nclass LegacyNullableToken {}\nconst LEGACY_NULLABLE = /** @type {!LegacyNullableToken} */ ({});\n\n/**\n * Gets the value of a field.\n *\n * If !legacyNullable, result will always be `undefined` if the field is unset.\n * Otherwise, result will use historic legacy nullable behavior (modulo any\n * other setting that overrides it).\n *\n * If you pass a coercion function and a value is present, we will coerce the\n * value. If the result was different and non-nullish, we will set it back.\n *\n * @return {?}\n */\nexports.getFieldNullable = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId|undefined */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable,\n    /** (function(?): ?)= */ coerceFn) {\n  // Don't freeze jspb messages.\n  assert(Object.isExtensible(message));\n  const value = exports.getFieldNullableInternal(\n      getInternalArrayInline(message), /* arrayState= */ undefined, fieldNumber,\n      hasMessageId, coerceFn);\n  if (value === null && (!legacyNullable || shouldReturnUndefined(message))) {\n    return undefined;\n  }\n  return value;\n};\n\n/**\n * @param {!InternalMessage} message\n * @return {boolean}\n */\nfunction shouldReturnUndefined(message) {\n  return getLegacyNullableBehavior() ===\n      LegacyNullableBehavior.ALWAYS_UNDEFINED ||\n      isNoLegacyNull(message);\n}\n\nfunction assertIndexConsistentWithMessageState(\n    /** !Array<?> */ messageArray,\n    /** number */ arrayIndex,\n    /** number */ fieldNumber) {\n  if (ENABLE_ASSERTS) {\n    assert(\n        arrayIndex ===\n        indexFromFieldNumber(\n            fieldNumber,\n            getArrayIndexOffset(getArrayStateInline(messageArray))));\n  }\n}\n\n\n/**\n * Gets the value of a field.\n *\n * If you pass a coercion function and a value is present, we will coerce the\n * value. If the result was different and non-nullish, we will set it back.\n *\n * @return {?}\n */\nexports.getFieldNullableInternal = function(\n    /** !Array */ messageArray,\n    /** number|undefined */ messageArrayState,\n    /** number */ fieldNumber,\n    /** !HasMessageId|undefined */ hasMessageId,\n    /** (function(?): ?)= */ coerceFn) {\n  assertValidHasMessageIdOrUndefined(messageArray, hasMessageId);\n  if (DETAILED_JSPB_ASSERTS) {\n    logOperation({getField: 1});\n    assertValidLeakedMutableSubstructures(messageArray);\n  }\n  if (fieldNumber === NO_SUCH_FIELD) {\n    return null;\n  }\n\n  // This is very performance sensitive code.\n  //\n  // Generally we expect to be finding a value in the array portion of the\n  // message, so we avoid doing any work if the field number is less than\n  // the arrayLength-1.\n  //\n  // We always need to check the array length so do that first and guard all\n  // other checks on length checks first.\n  const arrayIndex =\n      indexFromFieldNumberAndHasMessageId(fieldNumber, hasMessageId);\n  assertIndexConsistentWithMessageState(messageArray, arrayIndex, fieldNumber);\n  assert(arrayIndex >= 0);\n  const last = messageArray.length - 1;\n\n  // Retrieve a value from the array or sparse object.\n  let value;\n  let /** ? */ lastValue;\n  let /** boolean|undefined */ inSparseObject;\n  if (last < indexFromFieldNumberAndHasMessageId(1, hasMessageId)) {\n    return undefined;\n  } else if (arrayIndex >= last) {\n    lastValue = messageArray[last];\n    if (isSparseObjectInline(lastValue)) {\n      value = lastValue[fieldNumber];\n      inSparseObject = true;\n    } else if (arrayIndex === last) {\n      value = lastValue;\n    } else {\n      return undefined;\n    }\n  } else {\n    value = messageArray[arrayIndex];\n  }\n\n  if (coerceFn && value != null) {\n    const coerced = coerceFn(value);\n    // For an invalid value, we treat the field as unknown and preserve its\n    // value. We may consider dropping them but there seems to be no strong\n    // reason to do so and the case is very rare.\n    if (coerced == null) return coerced;\n    if (!Object.is(coerced, value)) {\n      // Write back a coerced value.\n      if (inSparseObject) {\n        lastValue[fieldNumber] = coerced;\n      } else {\n        messageArray[arrayIndex] = coerced;\n      }\n      return coerced;\n    }\n  }\n\n  return value;\n};\n\n/**\n * Sets the value of a field.\n * @param {T} message\n * @param {number} fieldNumber The field number.\n * @param {string|number|boolean|!gbigint|!ByteString|!Array|!JspbMap|!InternalMessage|null|undefined}\n *     value\n * @param {!HasMessageId|undefined} hasMessageId\n * @return {T}\n * @template T\n */\nexports.setField = function(message, fieldNumber, value, hasMessageId) {\n  ensureMutable(message);\n  const messageArray = getInternalArrayInline(message);\n  setFieldIgnoringImmutabilityInternal(\n      messageArray, getMessageArrayStateInline(messageArray), fieldNumber,\n      value, hasMessageId);\n  return message;\n};\n\n/** @const */\nexports.setFieldIgnoringImmutability = setFieldIgnoringImmutabilityInternal;\n\n\n/**\n * Sets the value of a field even on immutable protos\n * @param {!Array<?>} messageArray\n * @param {!ArrayState|undefined} messageArrayState\n * @param {number} fieldNumber The field number.\n * @param {string|number|boolean|!gbigint|!ByteString|!Array|!JspbMap|!InternalMessage|null|undefined}\n *     value\n * @param {!HasMessageId|undefined} hasMessageId\n * @return {!ArrayState|undefined} the new array state.\n */\nfunction setFieldIgnoringImmutabilityInternal(\n    messageArray, messageArrayState, fieldNumber, value, hasMessageId) {\n  assertValidHasMessageIdOrUndefined(messageArray, hasMessageId);\n  if (DETAILED_JSPB_ASSERTS) logOperation({setField: 1});\n  const arrayIndex =\n      indexFromFieldNumberAndHasMessageId(fieldNumber, hasMessageId);\n  assertIndexConsistentWithMessageState(messageArray, arrayIndex, fieldNumber);\n  assert(arrayIndex >= 0);\n  const last = messageArray.length - 1;\n  if (last >= indexFromFieldNumberAndHasMessageId(1, hasMessageId) &&\n      arrayIndex >= last) {\n    const lastValue = messageArray[last];\n    if (isSparseObjectInline(lastValue)) {\n      lastValue[fieldNumber] = value;\n      return messageArrayState;\n    }\n  }\n\n  if (arrayIndex <= last) {\n    messageArray[arrayIndex] = value;\n    return messageArrayState;\n  }\n\n  // if we get here then we need to either extend the array or create a sparse\n  // object.\n  //\n  // no point in doing anything if the value is undefined. However, if the value\n  // is `null` then we need to assign it in order to preserve the behavior of\n  // legacyNullable accessors\n  if (value !== undefined) {\n    const pivot = getPivot(\n        messageArrayState ??= getMessageArrayStateInline(messageArray));\n    if (fieldNumber >= pivot) {\n      assert(pivot !== NO_PIVOT);\n      // don't bother allocating a sparse object if the value is null. We don't\n      // need to maintain null/undefined semantics for sparse objects.\n      if (value != null) {\n        messageArray[indexFromFieldNumberAndHasMessageId(pivot, hasMessageId)] =\n            {[fieldNumber]: value};\n      }\n    } else {\n      // Common case: field is below the pivot belongs in the array portion.\n      messageArray[arrayIndex] = value;  // this will extend the array\n    }\n  }\n  return messageArrayState;\n}\n\n\n/**\n * Returns whether the given field is set.\n * @return {boolean}\n */\nexports.hasWrapperField = function(\n    /** !InternalMessage */ message,\n    /** function(new:InternalMessage, ?Array<?>=)  */ ctor,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  return getReadonlyWrapperFieldOrUndefinedInternal(\n             messageArray, getMessageArrayStateInline(messageArray), ctor,\n             fieldNumber, hasMessageId) !== undefined;\n};\n\n/**\n * Parameter to `getRepeatedWrapperFieldInternal`/`getApiFormattedRepeatedField`\n * to document how frozen the caller wants the array to be.\n * @enum {number}\n */\nconst RepeatedArrayReturnType = {\n  /** The caller intends to return a frozen array to the client. */\n  FROZEN: 1,\n\n  /**\n   * The caller intends to return an unfrozen array to the client.\n   * This is only valid if the message is mutable.\n   */\n  UNFROZEN: 2,\n\n  /**\n   * The caller will not return the array to the client, so the array returned\n   * can either be frozen or unfrozen, no cloning or freezing required.\n   */\n  EITHER_FROZEN_OR_UNFROZEN: 3,\n\n  /**\n   * Same as FROZEN if the array has not already been shared as unfrozen, and\n   * EITHER_FROZEN_OR_UNFROZEN otherwise.\n   */\n  FROZEN_UNLESS_SHARED: 4,\n};\n\nexports.RepeatedArrayReturnType = RepeatedArrayReturnType;\n\n/**\n * Check invariants on returned messages.\n *\n * This ensures that:\n * - A mutable child is never returned from an immutable parent.\n *\n * @return {!InternalMessage|undefined}\n */\nfunction assertMessageReturnedSafely(\n    /** !InternalMessage|undefined */ child, /** !Array<?> */ parent,\n    /** boolean|undefined */ isNewlyConstructed) {\n  // Drop out if no message was present.\n  if (!goog.DEBUG || !child) {\n    return child;\n  }\n\n  // Cannot return a mutable message from an immutable parent.\n  assert(isImmutableArray(parent) ? isImmutableMessage(child) : true);\n\n  // TODO(varomodt): apply these assertions globally: currently they are\n  // disabled due to non-Message values being set into JSPB arrays, especially\n  // mocks.\n  if (DETAILED_JSPB_ASSERTS) {\n    // A child message, if any, should be constructed\n    assert(\n        getMessageArrayStateInline(getInternalArrayInline(child)) &\n        ArrayStateFlags.CONSTRUCTED);\n\n    // Cannot return a mutable message from an immutable parent.\n    assert(\n        !(getMessageArrayStateInline(parent) &\n          ArrayStateFlags.IS_IMMUTABLE_ARRAY) ||\n        (getMessageArrayStateInline(getInternalArrayInline(child)) &\n         ArrayStateFlags.IS_IMMUTABLE_ARRAY));\n\n    if (isNewlyConstructed) {\n      // If the parent is owned, any newly constructed child should be owned or\n      // immutable.\n      if (getMessageArrayStateInline(parent) &\n          ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED) {\n        assert(\n            getMessageArrayStateInline(getInternalArrayInline(child)) &\n                (ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED |\n                 ArrayStateFlags.IS_IMMUTABLE_ARRAY),\n            'Array must be either owned or immutable.');\n      }\n    }\n  }\n  return child;\n}\n\n/**\n * Check invariants on returned maps.\n *\n * This ensures that:\n * - A map is always immutable|constructed|unowned.\n * - A mutable map is never returned from an immutable parent.\n * - An immutable map is never returned from a mutable parent.\n * - All message values in a map returned from an immutable parent are\n *   immutable or unconstructed.\n *\n * @template K, V\n * @return {!JspbMap<K, V>}\n * @suppress {visibility} accesses private properties of Map\n */\nfunction assertMapReturnedSafely(\n    /** !JspbMap<K, V> */ m, /** !Array<?> */ parent) {\n  // A map's mutability should correspond with that of its parent.\n  assert(isImmutableMap(m) === isImmutableArray(parent));\n\n  // Perform complex (especially linear-complexity) assertions only if\n  // DETAILED_JSPB_ASSERTS is set.\n  if (DETAILED_JSPB_ASSERTS && m.valueCtor) {\n    // values() will construct all our submessages before returning and we do\n    // not want that here.\n    for (const value of m.rawValuesInternal_()) {\n      if (isInternalMessage(value)) {\n        assertMessageReturnedSafely(\n            /** @type {!InternalMessage} */ (value), parent,\n            /* isNewlyConstructed = */ undefined);\n      }\n\n      if (Array.isArray(value)) {\n        const state = getArrayStateInline(value);\n        if (state & ArrayStateFlags.CONSTRUCTED) {\n          // State may be constructed if we were parsed from binary\n          checkMessageStateInvariants(value, state);\n        }\n      }\n    }\n  }\n\n  return m;\n}\n\n/**\n * Check invariants on returned repeated fields.\n *\n * @template T\n * @return {!Array<T>}\n */\nfunction assertArrayReturnedSafely(\n    /** !Array<T> */ arr, /** !Array<?> */ parent,\n    /** boolean= */ skipFrozenCheck = false) {\n  if (!ENABLE_ASSERTS) {\n    return arr;\n  }\n  assertArrayInvariants(arr, skipFrozenCheck);\n  const arrayState = getArrayStateInline(arr);\n  assert(arrayState & ArrayStateFlags.IS_REPEATED_FIELD);\n  if (!skipFrozenCheck) {\n    // We should always be frozen or unowned when an array is returned.\n    assert(\n        Object.isFrozen(arr) || (arrayState & ArrayStateFlags.UNFROZEN_SHARED));\n\n    // If the parent was immutable, this array must be frozen, but not\n    // necessarily marked as immutable for primitive fields.\n    assert(isImmutableArray(parent) ? Object.isFrozen(arr) : true);\n  }\n  return arr;\n}\n\n/**\n * Check invariants on returned repeated wrapper fields.\n *\n * @template T\n * @return {!Array<T>}\n */\nfunction assertMessageArrayReturnedSafely(\n    /** !Array<T> */ arr,\n    /** !Array<?> */ parent, /** number */ fieldNumber,\n    /** boolean|undefined */ isNewlyConstructed,\n    /** boolean= */ skipFrozenCheck = false) {\n  if (!ENABLE_ASSERTS) {\n    return arr;\n  }\n  const isParentImmutable = isImmutableArray(parent);\n  const arrayImmutable = isImmutableArray(arr);\n  const arrayFrozen = Object.isFrozen(arr);\n  const frozenAndImmutable = (arrayFrozen && arrayImmutable);\n  assertArrayReturnedSafely(arr, parent, skipFrozenCheck);\n\n  // If the parent or array was immutable, this array must be frozen and\n  // marked as immutable.\n  if (isParentImmutable || arrayImmutable) {\n    if (skipFrozenCheck) {\n      assert(arrayImmutable);\n    } else {\n      assert(frozenAndImmutable);\n    }\n  }\n\n  assert(isApiFormattedField(arr));\n\n  if (arrayImmutable && arr.length) {\n    // Perform linear-complexity assertions only if DETAILED_JSPB_ASSERTS.\n    let length = 1;\n    if (DETAILED_JSPB_ASSERTS) {\n      length = arr.length;\n    }\n    for (let i = 0; i < length; i++) {\n      assertMessageReturnedSafely(\n          /** @type {!InternalMessage} */ (arr[i]), parent, isNewlyConstructed);\n    }\n  }\n  return arr;\n}\n\n/**\n * Returns whether the given field is set.\n * @return {boolean}\n */\nexports.hasOneofWrapperField = function(\n    /** !InternalMessage */ message,\n    /** function(new:InternalMessage, ?Array<?>=)  */ ctor,\n    /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  return getReadonlyWrapperFieldOrUndefinedInternal(\n             messageArray, getMessageArrayStateInline(messageArray), ctor,\n             exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n             hasMessageId) !== undefined;\n};\n\n/**\n * Gets the value of a repeated field.  This is only to be used by the binary\n * implementation for reading packed fields.\n * @return {!Array<?>}\n */\nexports.getRepeatedFieldForBinary = function(\n    /** !Array */ messageArray, /** number */ fieldNumber) {\n  const messageArrayState =\n      getPossiblyUnconstructedMessageArrayStateInline(messageArray);\n  return getRepeatedFieldInternalForBinary(\n      messageArray, messageArrayState, fieldNumber);\n};\n\n/**\n * Gets the count/size of a repeated field.\n * @return {number}\n * @template T\n */\nexports.getRepeatedWrapperCount = function(\n    /** !InternalMessage */ message,\n    /** function(new:T, ?Array<?>)} */ ctor,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  const wrappers = getRepeatedWrapperFieldInternal(\n      message, messageArray, getMessageArrayStateInline(messageArray), ctor,\n      fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId);\n  return wrappers.length;\n};\n\n/**\n * Gets readonly wrapper for the repeated field value at `index`.\n * @return {T}\n * @template T\n */\nexports.getRepeatedIndexedReadonlyWrapper = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** function(new:T, ?Array<?>)} */ ctor,\n    /** number */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  const wrappers = getRepeatedWrapperFieldInternal(\n      message, messageArray, getMessageArrayStateInline(messageArray), ctor,\n      fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId);\n  checkRepeatedIndexInRangeForGet(wrappers, index);\n  return wrappers[index];\n};\n\n/**\n * Gets mutable wrapper for the repeated field value at `index`.\n * @return {T}\n * @template T\n */\nexports.getRepeatedIndexedMutableWrapper = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** function(new:T, ?Array<?>)} */ ctor,\n    /** number */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  const messageArray = getInternalArrayInline(message);\n  const wrappers = getRepeatedWrapperFieldInternal(\n      message, messageArray, getMessageArrayStateInline(messageArray), ctor,\n      fieldNumber, RepeatedArrayReturnType.UNFROZEN, hasMessageId,\n      /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(wrappers, index);\n  const submessage = wrappers[index];\n  const asMutable = messageToMutable(submessage);\n  if (submessage !== asMutable) {\n    wrappers[index] = asMutable;\n    const state = getRepeatedArrayState(wrappers);\n    if (!hasFlagBit(state, ArrayStateFlags.MUTABLE_SUBSTRUCTURES)) {\n      setArrayState(\n          wrappers, setFlagBit(state, ArrayStateFlags.MUTABLE_SUBSTRUCTURES));\n      leakedMutableSubstructures(messageArray);\n    }\n  }\n  return asMutable;\n};\n\n/**\n * Sets wrapper for the repeated field value at `index`.\n * @return {Parent}\n * @template Parent, Child\n */\nexports.setRepeatedIndexedWrapper = function(\n    /** Parent */ message,\n    /** number */ fieldNumber,\n    /** function(new:Child, ?Array<?>=)} */ ctor,\n    /** number */ index,\n    /** Child */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  const self = /** @type {!InternalMessage} */ (message);\n  spliceRepeatedWrapperField(\n      self, fieldNumber, ctor, hasMessageId, value, index,\n      /*deleteCount=*/ 1, /* removeOnly = */ undefined);\n  return message;\n};\n\n/**\n * @return {number|null|undefined}\n */\nexports.getFloatingPointFieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  return exports.getFieldNullable(\n      message, fieldNumber, hasMessageId, legacyNullable,\n      coerceToNullishFloatingPoint);\n};\n\n/**\n * @return {!ByteString|null|undefined}\n */\nexports.getBytesFieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  return exports.getFieldNullable(\n      message, fieldNumber, hasMessageId, legacyNullable, coerceToNullishBytes);\n};\n\n/**\n * Whether a repeated field array should be frozen by the getter based on\n * opt-out and if it's an extension, expressed as a RepeatedArrayReturnType.\n * @param {!DoNotFreezeToken|undefined} freezeOptOut the\n *     DO_NOT_FREEZE__LEGACY_OPTION token if passed by the user to the accessor.\n * @return {!RepeatedArrayReturnType}\n */\nexports.getRepeatedFieldReturnType = function(freezeOptOut) {\n  return freezeOptOut === DO_NOT_FREEZE__LEGACY_OPTION ?\n      RepeatedArrayReturnType.UNFROZEN :\n      RepeatedArrayReturnType.FROZEN_UNLESS_SHARED;\n};\n\n/**\n * Access a repeated field that needs some amount of 'coercion' off the wire.\n *\n * If message is immutable, the returned array will always be frozen.\n *\n * If message is mutable, the returned array will be frozen or unfrozen\n * depending on returnType.\n *\n * @param {!InternalMessage} message\n * @param {number} fieldNumber\n * @param {function(?):(T|undefined|null)} coercionFn If the coercion function\n *     returns a nullish value then the value will be dropped from the repeated\n *     field.\n * @param {!RepeatedArrayReturnType} returnTypeForMutable\n * @param {boolean=} doesntReturnArray\n * @param {!TypeSpecificApiFormat=} formatType Specific type the array should be\n coerced to.\n * @param {!HasMessageId=} hasMessageId\n * @return {!Array<T>}\n * @template T\n */\nfunction getApiFormattedRepeatedField(\n    message, fieldNumber, coercionFn, returnTypeForMutable, doesntReturnArray,\n    formatType, hasMessageId) {\n  let messageArray = getInternalArrayInline(message);\n  let messageArrayState = getMessageArrayStateInline(messageArray);\n  const isImmutableParent = isImmutableMessage(message, messageArrayState);\n  const returnType =\n      isImmutableParent ? RepeatedArrayReturnType.FROZEN : returnTypeForMutable;\n  // EITHER_FROZEN_OR_UNFROZEN implies we don't return the array. Returning the\n  // array requires an explicit frozenness choice\n  doesntReturnArray = !!doesntReturnArray ||\n      returnType === RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN;\n\n  if (returnType === RepeatedArrayReturnType.UNFROZEN) {\n    if (maybeCopyOnWrite(message)) {\n      messageArray = getInternalArrayInline(message);\n      messageArrayState = getMessageArrayStateInline(messageArray);\n    }\n  }\n\n  let values = getRawRepeatedFieldWithDefault(\n      messageArray, messageArrayState, fieldNumber, hasMessageId);\n  let existingState = getRepeatedArrayState(values);\n  let valueState = setFlagsForRepeatedField(existingState, messageArrayState);\n\n  assertRepeated64BitIntegerFieldApiFormattingInvariants(values);\n\n  const needFormat =\n      needsApiFormatting(message, valueState, formatType, doesntReturnArray);\n  if (needFormat) {\n    // If we are changing the type-specific formatting of a\n    // 64-bit int repeated field, then we need to avoid modifying the instance\n    // we previously returned (e.g. a legacy access followed by an _asString\n    // access).\n    if (hasFlagBit(valueState, ArrayStateFlags.IS_API_FORMATTED)) {\n      values = slice(values);\n      existingState = 0;\n      valueState =\n          setFlagsForSlicedRepeatedArray(valueState, messageArrayState);\n      messageArrayState = assertExists(setFieldIgnoringImmutabilityInternal(\n          messageArray, messageArrayState, fieldNumber, values, hasMessageId));\n    }\n\n    let from = 0, to = 0;\n    for (; from < values.length; from++) {\n      const coerced = coercionFn(values[from]);\n      if (coerced != null) {\n        values[to++] = coerced;\n      }\n    }\n    if (to < from) {\n      // trim the end of the array since we dropped some invalid values.\n      values.length = to;\n    }\n\n    valueState = setFlagBit(valueState, ArrayStateFlags.IS_API_FORMATTED);\n    valueState = clearTypeSpecificFormattedFlagBits(valueState);\n    if (formatType) {\n      valueState = setFlagBit(valueState, formatType);\n    }\n    valueState =\n        clearFlagBit(valueState, ArrayStateFlags.MUTABLE_SUBSTRUCTURES);\n  }\n\n  if (valueState !== existingState) {\n    existingState = setArrayState(values, valueState);\n    if (hasFlagBit(valueState, ArrayStateFlags.IS_IMMUTABLE_ARRAY)) {\n      Object.freeze(values);\n    }\n  }\n\n  values = prepareRepeatedArrayForReturn(\n      values, valueState, messageArray, messageArrayState, fieldNumber,\n      hasMessageId, returnType, needFormat, doesntReturnArray);\n\n  assertRepeated64BitIntegerFieldApiFormattingInvariants(values);\n  if (!doesntReturnArray) {\n    assertArrayReturnedSafely(values, messageArray);\n  }\n\n  return values;\n}\n\n/**\n * Determines frozenness of repeated field array as last step before returning.\n *\n * NOTE: After this function, valuesState and messageArrayState may be different\n *\n * @param {!Array<?>} values\n * @param {!ArrayState} valuesState\n * @param {!Array<?>} messageArray\n * @param {!ArrayState} messageArrayState\n * @param {number} fieldNumber\n * @param {!HasMessageId|undefined} hasMessageId\n * @param {!RepeatedArrayReturnType} returnType\n * @param {boolean} newlyFormatted\n * @param {boolean} doesntReturnArray\n * @return {!Array<?>} values (may be different from input)\n */\nfunction prepareRepeatedArrayForReturn(\n    values, valuesState, messageArray, messageArrayState, fieldNumber,\n    hasMessageId, returnType, newlyFormatted, doesntReturnArray) {\n  let existingState = valuesState;\n  if (shouldReturnFrozen(returnType, valuesState, messageArrayState)) {\n    if (!isFrozenByFlags(valuesState, values)) {\n      const parentIsOwned = hasFlagBit(\n          messageArrayState, ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED);\n      // set appropriate bit if freezing\n      const onlyImmutableValues = !values.length ||\n          // if newly formatted, we can trust all values\n          (newlyFormatted &&\n           !hasFlagBit(valuesState, ArrayStateFlags.MUTABLE_SUBSTRUCTURES)) ||\n          // otherwise, standard conditions.\n          (parentIsOwned &&\n           canMarkImmutableInPlaceIfParentIsOwned(valuesState));\n      valuesState = setFlagBit(\n          valuesState,\n          onlyImmutableValues ? ArrayStateFlags.IS_IMMUTABLE_ARRAY :\n                                ArrayStateFlags.FROZEN_ARRAY);\n      if (valuesState !== existingState) {\n        // we're assuming users can't freeze arrays we give them, so this set\n        // should not encounter a frozen array if we didn't freeze it\n        existingState = setArrayState(values, valuesState);\n      }\n      Object.freeze(values);\n    }\n  } else {\n    if (returnType === RepeatedArrayReturnType.UNFROZEN &&\n        isFrozenByFlags(valuesState, values)) {\n      values = slice(values);\n      existingState = 0;\n      valuesState =\n          setFlagsForSlicedRepeatedArray(valuesState, messageArrayState);\n      messageArrayState = assertExists(setFieldIgnoringImmutabilityInternal(\n          messageArray, messageArrayState, fieldNumber, values, hasMessageId));\n    }\n\n    if (!isFrozenByFlags(valuesState, values)) {\n      if (!doesntReturnArray) {\n        valuesState = setFlagBit(valuesState, ArrayStateFlags.UNFROZEN_SHARED);\n      }\n      if (valuesState !== existingState) {\n        existingState = setArrayState(values, valuesState);\n      }\n    }\n  }\n\n  if (!hasFlagBit(valuesState, ArrayStateFlags.IS_IMMUTABLE_ARRAY) &&\n      !canMarkImmutableInPlaceIfParentIsOwned(valuesState)) {\n    messageArrayState =\n        leakedMutableSubstructures(messageArray, messageArrayState);\n  }\n\n  return values;\n}\n\n/**\n * @param {!Array<?>} messageArray\n * @param {number|undefined} messageArrayState\n * @param {number} fieldNumber\n * @param {!HasMessageId|undefined} hasMessageId\n * @return {!Array<?>}\n */\nfunction getRawRepeatedFieldWithDefault(\n    messageArray, messageArrayState, fieldNumber, hasMessageId) {\n  const values = exports.getFieldNullableInternal(\n      messageArray, messageArrayState, fieldNumber, hasMessageId);\n  return Array.isArray(values) ? values : EMPTY_LIST_SENTINEL;\n}\n\n/**\n * @param {number} valueState\n * @param {number} parentState\n * @return {number}\n */\nfunction setFlagsForRepeatedField(valueState, parentState) {\n  if (hasFlagBit(parentState, ArrayStateFlags.IS_IMMUTABLE_ARRAY)) {\n    valueState = setFlagBit(valueState, ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n  }\n  valueState = setFlagBit(valueState, ArrayStateFlags.IS_REPEATED_FIELD);\n  return valueState;\n}\n\n/**\n * Determines if a repeated field array is frozen by flags. We prefer to use\n * flags over Object.isFrozen for performance reasons.\n * @param {number} state\n * @param {!ReadonlyArray<?>} array\n * @return {boolean}\n */\nfunction isFrozenByFlags(state, array) {\n  // we maintain the invariant that repeated field arrays are frozen if it's\n  // marked immutable and api formatted\n  const isFrozen = (hasFlagBit(state, ArrayStateFlags.IS_IMMUTABLE_ARRAY) &&\n                    hasFlagBit(state, ArrayStateFlags.IS_API_FORMATTED)) ||\n      hasFlagBit(state, ArrayStateFlags.FROZEN_ARRAY);\n  if (DETAILED_JSPB_ASSERTS && isFrozen) {\n    assert(Object.isFrozen(array));\n  }\n  return isFrozen;\n}\n\n/**\n * @param {!RepeatedArrayReturnType} returnType\n * @param {!ArrayState} state\n * @param {!ArrayState} parentState\n * @return {boolean}\n */\nfunction shouldReturnFrozen(returnType, state, parentState) {\n  if (returnType === RepeatedArrayReturnType.FROZEN) {\n    return true;\n  }\n  if (returnType !== RepeatedArrayReturnType.FROZEN_UNLESS_SHARED) {\n    return false;\n  }\n  if (hasFlagBit(state, ArrayStateFlags.IS_IMMUTABLE_ARRAY)) {\n    return true;\n  }\n  // If an array has already been returned as mutable before (i.e., from a\n  // getter with DO_NOT_FREEZE), we don't freeze it later even if another\n  // getter call doesn't have the opt-out.\n  return !hasFlagBit(state, ArrayStateFlags.UNFROZEN_SHARED) &&\n      // Historically, if the parent isn't owned, we treated the array as\n      // implicitly already unfrozen shared, so we never froze it. However, we\n      // should consider removing this and freezing arrays even if the parent\n      // isn't owned.\n      hasFlagBit(parentState, ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED);\n}\n\n/**\n * @return {!ByteString|null|undefined}\n */\nfunction coerceToNullishBytes(/** ? */ value) {\n  return bytesAsByteString(\n      value, /* invalidIsMissing=*/ true, /* allowNullishValues= */ true);\n}\n\n\n\n// NOTE: we handwrite this one instead of generating it because of the complex\n// default value.\n/**\n * Gets the value of a bytes field, with proto3 (non-nullable primitives)\n * semantics. Returns `defaultValue` as a ByteString if the field is not\n * otherwise set.\n * @return {!ByteString} The field's value.\n */\nexports.getBytesFieldWithDefault = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** string= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  const value =\n      exports.getBytesFieldNullable(message, fieldNumber, hasMessageId);\n  if (value == null) {\n    if (defaultValue === null) {\n      return defaultValue;\n    } else if (defaultValue === undefined) {\n      return ByteString.empty();\n    }\n    return ByteString.fromBase64(defaultValue);\n  } else {\n    return value;\n  }\n};\n\n\n/** @return{!Array} */\nfunction shallowCopyMapEntryArray(/** !Array */ array) {\n  array = slice(array);\n  for (let i = 0; i < array.length; i++) {\n    // TODO(lukes): we should handle non-array entries gracefully by dropping\n    // them.\n    const e = (array[i] = slice(array[i]));\n    if (Array.isArray(e[1])) {\n      e[1] = markArrayImmutable(e[1]);\n    }\n  }\n  return markKnownMapArray(array);\n}\n\n/**\n * Gets the value of a map field, lazily creating the map container if\n * necessary.\n *\n * IMPORTANT: When this function returns, messageArray and messageArrayState\n * might have new values.\n *\n * @template K, V\n * @return {!JspbMap<K, V>}\n * @suppress {visibility} accesses private properties of Map\n */\nfunction getReadonlyMapFieldInternal(\n    /** !InternalMessage */ message,\n    /** !Array<?> */ messageArray,\n    /** number */ messageArrayState,\n    /** boolean */ immutableMessage,\n    /** number */ fieldNumber,\n    /** ? */ valueCtor,\n    /** ? */ keyToApi,\n    /** ? */ valueToApi,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  if (!immutableMessage && maybeCopyOnWrite(message)) {\n    messageArray = getInternalArrayInline(message);\n    messageArrayState = getMessageArrayStateInline(messageArray);\n  }\n\n  // Wrap the underlying elements array with a Map.\n  let arrOrMap = exports.getFieldNullableInternal(\n      messageArray, messageArrayState, fieldNumber, hasMessageId);\n  let isMapArrayImmutable = false;\n  if (arrOrMap == null) {\n    if (immutableMessage) {\n      return assertMapReturnedSafely(getImmutableEmptyMap(), messageArray);\n    }\n\n    // No need to add a RepeatedField tag,  Because maps are stored inline\n    // there is no need to distinguish these arrays on their own.\n    arrOrMap = logNewArray([]);\n  } else if (arrOrMap.constructor === JspbMap) {\n    // If this is an immutable map in a mutable message, unwrap so we can slice\n    // below.\n    const map = /** @type {!JspbMap<K,V>} */ (arrOrMap);\n    const isImmutableMap = map.arrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY;\n    if (isImmutableMap && !immutableMessage) {\n      // This performs a shallow copy, so we don't need to set\n      // `isMapArrayImmutable` to true. We also don't need to sort, since we are\n      // about to construct a new map\n      arrOrMap = map.toArrayInternalUnsorted();\n    } else {\n      return assertMapReturnedSafely(map, messageArray);\n    }\n  } else if (!Array.isArray(arrOrMap)) {\n    // This implies some kind of schema mismatch.  Treat as empty\n    arrOrMap = logNewArray([]);\n  } else /* if (Array.isArray(arrOrMap)) */ {\n    isMapArrayImmutable = isImmutableArray(arrOrMap);\n  }\n\n  // If we're immutable, ensure the map is marked as immutable.\n  if (immutableMessage) {\n    if (!arrOrMap.length) {\n      // return a standard value instead of mutating the message to replace\n      // an empty array\n      return getImmutableEmptyMap();\n    }\n    if (!isMapArrayImmutable) {\n      isMapArrayImmutable = true;\n      markArrayImmutable(arrOrMap);\n    }\n  } else if (isMapArrayImmutable) {\n    // If we are not immutable but the map array is, we should shallow copy but\n    // preserve the immutability of any submessages.\n    isMapArrayImmutable = false;\n    markKnownMapArray(arrOrMap);\n    arrOrMap = shallowCopyMapEntryArray(arrOrMap);\n  }\n\n  // If this map is mutable and the parent is owned, mark it owned. If the map\n  // is immutable, don't bother.\n  if (!isMapArrayImmutable &&\n      (messageArrayState & ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED)) {\n    markMutableReferencesAreOwned(arrOrMap);\n  }\n\n  // Make a wrapper around our map array. We need to do this after marking it\n  // to maintain array state invariants.\n  const jspbMap = new JspbMap(\n      /** @type {!Array<!Array<!Object>>} */ (arrOrMap), valueCtor, keyToApi,\n      valueToApi);\n\n  // Store the new map back into the array, even if the message is frozen\n  messageArrayState = assertExists(setFieldIgnoringImmutabilityInternal(\n      messageArray, messageArrayState, fieldNumber, jspbMap, hasMessageId));\n  if (!isMapArrayImmutable) {\n    messageArrayState =\n        leakedMutableSubstructures(messageArray, messageArrayState);\n  }\n  return assertMapReturnedSafely(jspbMap, messageArray);\n}\n\n\n/**\n * Gets the value of a map field, lazily creating the map container if\n * necessary. Does not modify the mutability of values.\n *\n * This should only be called from generated code, because it requires knowledge\n * of serialization/parsing callbacks (which are required by the map at\n * construction time, and the map may be constructed here).\n *\n * The return type is non-nullish to match the API, though it may be actually\n * nullish if `noLazyCreate` is set.\n *\n * @template K, V\n * @return {!JspbMap<K, V>}\n */\nfunction getReadonlyMapField(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** ? */ valueCtor,\n    /** ? */ keyToApi,\n    /** ? */ valueToApi,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  const messageArrayState = getMessageArrayStateInline(messageArray);\n  const immutableMessage = isImmutableMessage(message, messageArrayState);\n  return getReadonlyMapFieldInternal(\n      message, messageArray, messageArrayState, immutableMessage, fieldNumber,\n      valueCtor, keyToApi, valueToApi, hasMessageId);\n}\n\n/**\n * Gets the value of a map field, lazily creating the map container if\n * necessary. Ensures that the mutability of values matches that of their\n * container.\n *\n * @template K, V\n * @return {!JspbMap<K, V>}\n * @suppress {visibility} accesses private properties of Map\n */\nfunction getMapFieldInternal(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** ? */ valueCtor,\n    /** ? */ keyToApi,\n    /** ? */ valueToApi,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  let mapValue, immutableMessage;\n  {\n    const messageArray = getInternalArrayInline(message);\n    assertValidHasMessageIdOrUndefined(messageArray, hasMessageId);\n    const messageArrayState = getMessageArrayStateInline(messageArray);\n    immutableMessage = isImmutableMessage(message, messageArrayState);\n    mapValue = getReadonlyMapFieldInternal(\n        message, messageArray, messageArrayState, immutableMessage, fieldNumber,\n        valueCtor, keyToApi, valueToApi, hasMessageId);\n  }\n\n  // If the message is immutable, getReadonlyMapField will have already ensured\n  // all values are immutable. If the message is mutable, some values may be\n  // immutable. Here we indicate to the map that it should shallow-copy in that\n  // case. This will also change the behavior of already accessed readonly maps.\n  if (!immutableMessage && valueCtor) {\n    mapValue.callToMutableOnAccess = true;\n  }\n\n  return mapValue;\n}\n\n\n/**\n * Adds an entry into a map without necessarily constructing it or type\n * checking it.\n *\n * Callers should consider that the entry is 'transferred' to this function, it\n * should not be reused.\n * @suppress {visibility} accesses private properties of Map\n */\nexports.putIntoMapForBinary = function(\n    /** !Array */ messageArray, /** number */ fieldNumber,\n    /** !Array<?> */ entry) {\n  // Slice our entry to prevent its being treated as a message during\n  // serialization, since the CONSTRUCTED bit will be set during\n  // deserialization.\n  //\n  // If we were to treat a map entry as a message, we might change its pivot\n  // and sparse-encode, which would be an invalid encoding. See b/438519440\n  // for when this happened with test randomization.\n  entry = slice(entry);\n\n  let messageArrayState =\n      getPossiblyUnconstructedMessageArrayStateInline(messageArray);\n  const hasMessageId = getHasMessageId(messageArrayState);\n  checkNotImmutableState(messageArrayState);\n  let mapValue = exports.getFieldNullableInternal(\n      messageArray, messageArrayState, fieldNumber, hasMessageId);\n  if (mapValue instanceof JspbMap) {\n    const isImmutableMap =\n        (mapValue.arrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY) != 0;\n    if (isImmutableMap) {\n      // Shallow copy the immutable map into a mutable array so we can mutate it\n      mapValue = mapValue.toArrayInternalUnsorted();\n      mapValue.push(entry);\n      messageArrayState = setFieldIgnoringImmutabilityInternal(\n          messageArray, messageArrayState, fieldNumber, mapValue, hasMessageId);\n    } else {\n      mapValue.setWireEntry(entry);\n    }\n    return;\n  }\n\n  if (!Array.isArray(mapValue)) {\n    // Initialize a 'map' as an array with a single entry\n    messageArrayState = setFieldIgnoringImmutabilityInternal(\n        messageArray, messageArrayState, fieldNumber,\n        markKnownMapArray([entry]), hasMessageId);\n    return;\n  }\n  let arrayState = getArrayStateInline(mapValue);\n  if (!(arrayState & ArrayStateFlags.KNOWN_MAP_ARRAY)) {\n    setArrayState(mapValue, arrayState |= ArrayStateFlags.KNOWN_MAP_ARRAY);\n  }\n  if (arrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY) {\n    mapValue = shallowCopyMapEntryArray(mapValue);\n    messageArrayState = setFieldIgnoringImmutabilityInternal(\n        messageArray, messageArrayState, fieldNumber, mapValue, hasMessageId);\n  }\n  // append the entry\n  mapValue.push(entry);\n};\n\n/**\n * Gets the value of a map field, lazily creating the map container if\n * necessary. Ensures the mutability of values matches their container.\n *\n * This should only be called from generated code, because it requires knowledge\n * of serialization/parsing callbacks (which are required by the map at\n * construction time, and the map may be constructed here).\n *\n * The return type is non-nullish to match the API, though it may be actually\n * nullish if `noLazyCreate` is set.\n *\n * @template K, V\n * @return {!JspbMap<K, V>}\n */\nexports.getMapField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** ? */ valueCtor, /** ? */ keyToApi, /** ? */ valueToApi,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  return getMapFieldInternal(\n      message, fieldNumber, valueCtor, keyToApi, valueToApi, hasMessageId);\n};\n\n/**\n * Gets the value of a map field, lazily creating the map container if\n * necessary. Ensures the mutability of values matches their container.\n *\n * This should only be called from generated code, because it requires knowledge\n * of serialization/parsing callbacks (which are required by the map at\n * construction time, and the map may be constructed here).\n *\n * The return type is non-nullish to match the API, though it may be actually\n * nullish if `noLazyCreate` is set.\n *\n * @template K, V\n * @return {!JspbMap<K, V>}\n */\nfunction getPrimitiveMapField(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !Function */ keyToApi, /** !Function */ valueToApi,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  return getMapFieldInternal(\n      message, fieldNumber, undefined, keyToApi, valueToApi, hasMessageId);\n}\n\n/**\n * Gets the value of a map field, lazily creating the map container if\n * necessary. Ensures the mutability of values matches their container.\n *\n * This should only be called from generated code, because it requires knowledge\n * of serialization/parsing callbacks (which are required by the map at\n * construction time, and the map may be constructed here).\n *\n * The return type is non-nullish to match the API, though it may be actually\n * nullish if `noLazyCreate` is set.\n *\n * @template K, V\n * @return {!JspbMap<K, V>}\n */\nfunction getMessageValuedMapField(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !Function */ valueCtor, /** !Function */ keyToApi,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  return getMapFieldInternal(\n      message, fieldNumber, valueCtor, keyToApi, /* valueToApi=*/ undefined,\n      hasMessageId);\n}\n\n/**\n * Clears a map field.\n * @return {T}\n * @template T\n */\nexports.clearMapField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  const self = /** @type {!InternalMessage} */ (message);\n  ensureMutable(self);\n  const messageArray = getInternalArrayInline(self);\n  let messageArrayState = getMessageArrayStateInline(messageArray);\n  const maybe = exports.getFieldNullableInternal(\n      messageArray, messageArrayState, fieldNumber, hasMessageId);\n  // If the map is immutable, then we have been shallow copied from an immutable\n  // message but the map hasn't been accessed yet. So we might as well simply\n  // clear the field since there is no point in maintaining an instance at all.\n  if (maybe instanceof JspbMap && !isImmutableMap(maybe)) {\n    maybe.clear();\n  } else if (maybe != null) {\n    messageArrayState = setFieldIgnoringImmutabilityInternal(\n        messageArray, messageArrayState, fieldNumber, undefined, hasMessageId);\n  }\n  return self;\n};\n\n/** @this {JspbMap<?,?>} */ function mapSetter(value, key) {\n  this.set(key, value);\n}\n\n/**\n * Access a repeated field that needs some amount of 'coercion' off the wire.\n * @param {!InternalMessage} message\n * @param {number} fieldNumber\n * @param {!ReadonlyArray<T>|null|undefined} values\n * @param {function(?,?=):T} checkFn may throw if a value cannot be converted.\n * @param {!HasMessageId|undefined} hasMessageId\n * @return {!InternalMessage}\n * @template T\n */\nfunction setRepeatedPrimitiveField(\n    message, fieldNumber, values, checkFn, hasMessageId) {\n  ensureMutable(message);\n  const messageArray = getInternalArrayInline(message);\n  let messageArrayState = getMessageArrayStateInline(messageArray);\n  if (values == null) {\n    messageArrayState = setFieldIgnoringImmutabilityInternal(\n        messageArray, messageArrayState, fieldNumber, undefined, hasMessageId);\n    return message;\n  }\n\n  checkRepeatedFieldIsArray(values);\n  let valueState = getRepeatedArrayState(values);\n  let existingState = valueState;\n  const frozenByUs = isFrozenByFlags(valueState, values);\n  let isFrozen = frozenByUs || Object.isFrozen(values);\n\n  // if not frozen by us, we don't trust any of the input array state\n  if (!frozenByUs) {\n    valueState = 0;\n  }\n\n  if (!isFrozen) {\n    values = slice(values);\n    existingState = 0;\n    valueState = setFlagsForSlicedRepeatedArray(valueState, messageArrayState);\n    isFrozen = false;\n  }\n\n  valueState = setFlagBit(\n      valueState,\n      ArrayStateFlags.IS_REPEATED_FIELD | ArrayStateFlags.IS_API_FORMATTED);\n\n  const currentFormat =\n      getTypeSpecificApiFormat(valueState) ?? getDefaultTypeSpecificApiFormat();\n  valueState = setFlagBit(valueState, currentFormat);\n\n  for (let i = 0; i < values.length; i++) {\n    const value = values[i];\n    const newValue = checkFn(value, currentFormat);\n    if (!Object.is(value, newValue)) {\n      if (isFrozen) {\n        values = slice(values);\n        existingState = 0;\n        valueState =\n            setFlagsForSlicedRepeatedArray(valueState, messageArrayState);\n        isFrozen = false;\n      }\n      values[i] = newValue;\n    }\n  }\n\n  if (valueState !== existingState) {\n    if (isFrozen) {\n      values = slice(values);\n      valueState =\n          setFlagsForSlicedRepeatedArray(valueState, messageArrayState);\n    }\n    setArrayState(values, valueState);\n  }\n  assertArrayInvariants(values);\n\n  messageArrayState = setFieldIgnoringImmutabilityInternal(\n      messageArray, messageArrayState, fieldNumber, values, hasMessageId);\n  return message;\n}\n\n/**\n * Clears a field by making it undefined.\n * @return {T}\n * @template T\n */\nexports.clearField = function(/** !T */ message, /** number */ fieldNumber,\n                              /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, /*value=*/ undefined, hasMessageId);\n};\n\n/**\n * Clears a oneof field by making it undefined.\n * @return {T}\n * @template T\n */\nexports.clearOneofField = function(\n    /** !T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneofGroup,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneofGroup, /*value=*/ undefined, hasMessageId);\n};\n\n/**\n * Clears all entries in a oneof field.\n * @return {T}\n * @template T\n */\nexports.clearAllFieldsInOneof = function(\n    /** !T */ message,\n    /** !ReadonlyArray<number> */ oneofGroup,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  const messageArray = getInternalArrayInline(message);\n  const messageArrayState = getMessageArrayStateInline(messageArray);\n  setOneofCaseNumber(\n      messageArray, messageArrayState, oneofGroup, /*fieldNumber=*/ 0,\n      hasMessageId);\n  return message;\n};\n\n\n/**\n * Sets the value of a non-extension primitive field, with proto3 (non-nullable\n * primitives) semantics of ignoring values that are equal to the type's\n * default.\n * @return {T} return msg\n * @template T\n */\nfunction setFieldIgnoringDefault(\n    /** T */ msg, /** number */ fieldNumber,\n    /** string|number|boolean|!gbigint|!ByteString|null|undefined */ value,\n    /** string|number|boolean|!gbigint|!ByteString */ defaultValue,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  const self = /** @type{!InternalMessage} */ (msg);\n  ensureMutable(self);\n  const messageArray = getInternalArrayInline(self);\n  let messageArrayState = getMessageArrayStateInline(messageArray);\n  let isDefault;\n  if (defaultValue === '0') {\n    // '0' defaultValue is used for all int64 types. we allow value to be\n    // number|string|gbigint here\n    isDefault = Number(value) === 0;\n  } else {\n    isDefault = value === defaultValue;\n  }\n  messageArrayState = setFieldIgnoringImmutabilityInternal(\n      messageArray, messageArrayState, fieldNumber,\n      isDefault ? undefined : value, hasMessageId);\n  return msg;\n}\n\n/**\n * Adds all values to a repeated, primitive field.\n * @return {T}\n * @template T\n */\nfunction addAllToRepeatedFieldImpl(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** function(?,?=):? */ checkFn,\n    /** !Iterable<?> */ values,\n    /** function(?):? */ coercionFn,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkFn, values, /*index=*/ undefined, coercionFn,\n      hasMessageId, /*deleteCount=*/ undefined,\n      /*isSpreadable=*/ true, /* removeOnly = */ undefined);\n}\n\n/** @return {!Array<?>} */\nfunction getRepeatedFieldInternalForBinary(\n    /** !Array<?> */ messageArray, /** !ArrayState */ messageArrayState,\n    /** number */ fieldNumber) {\n  checkNotImmutableState(messageArrayState);\n  const hasMessageId = getHasMessageId(messageArrayState);\n\n  let values = getRawRepeatedFieldWithDefault(\n      messageArray, messageArrayState, fieldNumber, hasMessageId);\n  let existingState = getRepeatedArrayState(values);\n  let valueState = setFlagsForRepeatedField(existingState, messageArrayState);\n\n  // Slice any immutable or frozen array, or a shared array.\n  if (hasFlagBit(valueState, ArrayStateFlags.IS_IMMUTABLE_ARRAY) ||\n      isFrozenByFlags(valueState, values) ||\n      hasFlagBit(valueState, ArrayStateFlags.UNFROZEN_SHARED)) {\n    if (valueState !== existingState && !isFrozenByFlags(valueState, values)) {\n      setArrayState(values, valueState);\n    }\n    values = slice(values);\n    existingState = 0;\n    valueState = setFlagsForSlicedRepeatedArray(valueState, messageArrayState);\n    messageArrayState = assertExists(setFieldIgnoringImmutabilityInternal(\n        messageArray, messageArrayState, fieldNumber, values, hasMessageId));\n  }\n\n  // Update state bits.\n  valueState = clearFlagBit(\n      valueState,\n      // The binary implementation will push an unchecked value.\n      ArrayStateFlags.IS_API_FORMATTED |\n          // We may have mutable or immutable submessages.\n          ArrayStateFlags.ONLY_MUTABLE_VALUES);\n\n  // If anything changed, set it on the array.\n  if (valueState !== existingState) {\n    // Note that this is always the case if we sliced the array.\n    existingState = setArrayState(values, valueState);\n  }\n\n  // Perform some basic safety assertions: our returned array should always\n  // be marked as repeated and never immutable or api-formatted, since we will\n  // `push` an unformatted value onto it.\n  if (DETAILED_JSPB_ASSERTS) {\n    assert(valueState & ArrayStateFlags.IS_REPEATED_FIELD);\n    assert(!(valueState & ArrayStateFlags.IS_IMMUTABLE_ARRAY));\n    assert(!(valueState & ArrayStateFlags.IS_API_FORMATTED));\n  }\n  return values;\n}\n\n/**\n * Adds a value to a repeated field for binary implementation.\n * @param {!Array<?>} messageArray,\n * @param {number} fieldNumber\n * @param {*} value\n */\nexports.addToRepeatedFieldForBinary = function(\n    messageArray, fieldNumber, value) {\n  const messageArrayState =\n      getPossiblyUnconstructedMessageArrayStateInline(messageArray);\n  getRepeatedFieldInternalForBinary(\n      messageArray, messageArrayState, fieldNumber)\n      .push(value);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @param {T} message\n * @param {number} fieldNumber\n * @param {function(?,?=):?} checkFn may throw if a value\n *     cannot be converted.\n * @param {number} index\n * @param {string|number|boolean|!gbigint|!ByteString|!Uint8Array} value\n * @param {function(?):?} coercionFn\n * @param {!HasMessageId|undefined} hasMessageId\n * @return {T}\n * @template T\n */\nfunction setRepeatedIndexedFieldImpl(\n    message, fieldNumber, checkFn, index, value, coercionFn, hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkFn, value, index, coercionFn, hasMessageId,\n      /*deleteCount=*/ 1);\n}\n\n/**\n * Sets the value of a field in a oneof union and clears all other fields in\n * the union.\n * @return {T}\n * @template T\n */\nexports.setOneofField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /**\n       string|number|boolean|!gbigint|!ByteString|!Array|!InternalMessage|null|undefined\n     */\n    value, /** !HasMessageId|undefined */ hasMessageId) {\n  const self = /** @type {!InternalMessage} */ (message);\n  ensureMutable(self);\n  const messageArray = getInternalArrayInline(self);\n  let messageArrayState = getMessageArrayStateInline(messageArray);\n  if (value == null) {\n    const oneofsCaseMap = getOneofsCaseMap(messageArray);\n    const oneofCase = computeOneofCaseInternal(\n        oneofsCaseMap, messageArray, messageArrayState, oneof, hasMessageId);\n    if (oneofCase === fieldNumber) {\n      oneofsCaseMap.set(oneof, 0);\n    } else {\n      // some other case is set and we are clearing this one?  That is a no-op.\n      return self;\n    }\n  } else {\n    messageArrayState = setOneofCaseNumber(\n        messageArray, messageArrayState, oneof, fieldNumber, hasMessageId);\n  }\n  messageArrayState = setFieldIgnoringImmutabilityInternal(\n      messageArray, messageArrayState, fieldNumber, value, hasMessageId);\n  return message;\n};\n\n\n/**\n * Sets the value of a field in a oneof union and clears all other fields in\n * the union.\n * @template T\n */\nexports.setOneofFieldForBinary = function(\n    /** !Array<?> */ messageArray, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /** string|number|boolean|!ByteString|!gbigint|!InternalMessage */ value) {\n  assertExists(value);\n  let messageArrayState =\n      getPossiblyUnconstructedMessageArrayStateInline(messageArray);\n  const hasMessageId = getHasMessageId(messageArrayState);\n  messageArrayState = setOneofCaseNumber(\n      messageArray, messageArrayState, oneof, fieldNumber, hasMessageId);\n  messageArrayState = setFieldIgnoringImmutabilityInternal(\n      messageArray, messageArrayState, fieldNumber, value, hasMessageId);\n};\n\n/**\n * Returns fieldNumber if the given oneof group in msg is indeed set to\n * fieldNumber. Otherwise returns NO_SUCH_FIELD.\n *\n * NOTE: this is exposed on, and accessed via, the exports object purely so it\n * can be monkey patched by debug.js.\n *\n * @param {!InternalMessage} message The message.\n * @param {!ReadonlyArray<number>} oneof The fields belonging to the oneof.\n * @param {number} fieldNumber The field number.\n * @param {!HasMessageId|undefined} hasMessageId\n * @return {number}\n */\nexports.isOneofCase = function(message, oneof, fieldNumber, hasMessageId) {\n  return exports.computeOneofCase(message, oneof, hasMessageId) ===\n          fieldNumber ?\n      fieldNumber :\n      NO_SUCH_FIELD;\n};\n\n\n/**\n * Computes the selection in a oneof group for the given message, ensuring\n * only one field is set in the process.\n *\n * According to the protobuf language guide (\n * https://developers.google.com/protocol-buffers/docs/proto#oneof), \"if the\n * parser encounters multiple members of the same oneof on the wire, only the\n * last member seen is used in the parsed message.\" Since JSPB serializes\n * messages to a JSON array, the \"last member seen\" will always be the field\n * with the greatest field number (directly corresponding to the greatest\n * array index).\n *\n * @return {number} The field number currently set in the union, or 0 if none.\n */\nexports.computeOneofCase = function(\n    /** !InternalMessage */ message, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  return computeOneofCaseInternal(\n      getOneofsCaseMap(messageArray), messageArray,\n      /* messageArrayState= */ undefined, oneof, hasMessageId);\n};\n\n\n/** @return {!Map<!ReadonlyArray<number>, number>} */\nfunction getOneofsCaseMap(/** !Array */ internalArray) {\n  const asObject = /** @type {!Object} */ (internalArray);\n  if (HAS_NATIVE_SYMBOL) {\n    return asObject[ONEOF_ARRAY_SYMBOL] ??= new Map();\n  } else if (ONEOF_ARRAY_SYMBOL in internalArray) {\n    return assertInstanceof(asObject[ONEOF_ARRAY_SYMBOL], Map);\n  } else {\n    const oneofsSet = new Map();\n    Object.defineProperty(asObject, ONEOF_ARRAY_SYMBOL, {value: oneofsSet});\n    return oneofsSet;\n  }\n}\n\n/**\n * Updates the oneof case number to the given field number.\n *\n * This enforces the oneof constraint, so any array mutations should come after\n * calling this.\n *\n * @return {!ArrayState|undefined}\n */\nfunction setOneofCaseNumber(\n    /** !Array<?> */ messageArray,\n    /** !ArrayState|undefined */ messageArrayState,\n    /** !ReadonlyArray<number> */ oneof,\n    /** number */ fieldNumber, /** !HasMessageId|undefined */ hasMessageId) {\n  assert(fieldNumber === 0 || oneof.includes(fieldNumber));\n  const oneofsCaseMap = getOneofsCaseMap(messageArray);\n  const oneofCase = computeOneofCaseInternal(\n      oneofsCaseMap, messageArray, messageArrayState, oneof, hasMessageId);\n  if (oneofCase !== fieldNumber) {\n    if (oneofCase) {\n      messageArrayState = setFieldIgnoringImmutabilityInternal(\n          messageArray, messageArrayState, oneofCase, undefined, hasMessageId);\n    }\n    oneofsCaseMap.set(oneof, fieldNumber);\n  }\n  return messageArrayState;\n}\n\n\n/**\n * Enforces the oneof constraint and returns the case number.\n * @return {number}\n */\nfunction computeOneofCaseInternal(\n    /** !Map<!ReadonlyArray<number>, number> */ oneofsCaseMap,\n    /** !Array<?> */ messageArray,\n    /** !ArrayState|undefined */ messageArrayState,\n    /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  assertValidHasMessageIdOrUndefined(messageArray, hasMessageId);\n  let caseNumber = oneofsCaseMap.get(oneof);\n  if (caseNumber != null) {\n    return caseNumber;\n  }\n  // Scan for the last field in the oneof that is set.  Clear out all other\n  // fields.\n  caseNumber = 0;\n  for (let i = 0; i < oneof.length; i++) {\n    const fieldNumber = oneof[i];\n    if (exports.getFieldNullableInternal(\n            messageArray, messageArrayState, fieldNumber, hasMessageId) !=\n        null) {\n      if (caseNumber !== 0) {\n        // Multiple oneof fields are set, clear the previous and keep looking.\n        messageArrayState = setFieldIgnoringImmutabilityInternal(\n            messageArray, messageArrayState, caseNumber, undefined,\n            hasMessageId);\n      }\n      caseNumber = fieldNumber;\n    }\n  }\n  oneofsCaseMap.set(oneof, caseNumber);\n  return caseNumber;\n}\n\n\n/**\n * Gets and wraps a proto field on access, if there is no field present, it\n * creates and inserts one.\n * @return {T} The field as a jspb proto.\n * @template T\n */\nexports.getMutableOneofWrapperField = function(\n    /** !InternalMessage */ message,\n    /** function(new:T, ?Array<?>=) */ ctor, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /** !OrUndefinedToken<?>|undefined */ legacyOrUndefined,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  if (legacyOrUndefined === OR_UNDEFINED) {\n    if (exports.isOneofCase(message, oneof, fieldNumber, hasMessageId) !==\n        fieldNumber) {\n      return undefined;\n    }\n  } else {\n    const messageArray = getInternalArrayInline(message);\n    setOneofCaseNumber(\n        messageArray, /* messageArrayState= */ undefined, oneof, fieldNumber,\n        hasMessageId);\n  }\n  return exports.getMutableWrapperField(\n      message, ctor, fieldNumber, legacyOrUndefined, hasMessageId);\n};\n\n\n/**\n * Gets and wraps a mutable proto field on access, if there is no field present,\n * it creates and inserts one.\n *\n * @template T\n * @return {T} The field as a jspb proto.\n */\nexports.getMutableWrapperField = function(\n    /** !InternalMessage */ message,\n    /** function(new:T, ?Array<?>=) */ ctor,\n    /** number */ fieldNumber,\n    /** !OrUndefinedToken<?>|undefined */ legacyOrUndefined,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  const messageArray = getInternalArrayInline(message);\n  let messageArrayState = getMessageArrayStateInline(messageArray);\n  const data = exports.getFieldNullableInternal(\n      messageArray, messageArrayState, fieldNumber, hasMessageId);\n  const wantOrUndefined = legacyOrUndefined === OR_UNDEFINED;\n  let submessage = messageFromInlineStorage(\n      data, ctor, /* constructMissing= */ !wantOrUndefined,\n      /* arrayState = */ messageArrayState);\n  if (wantOrUndefined && !submessage) {\n    return undefined;\n  }\n  submessage = messageToMutable(submessage);\n  // This will happen if the message was missing, we are constructing from an\n  // Array or we needed to make a mutable copy. In such cases we need to store\n  // back to ensure the wrapper and the value are in sync.\n  if (data !== submessage) {\n    messageArrayState = setFieldIgnoringImmutabilityInternal(\n        messageArray, messageArrayState, fieldNumber, submessage, hasMessageId);\n    messageArrayState =\n        leakedMutableSubstructures(messageArray, messageArrayState);\n  }\n  return submessage;\n};\n\n/**\n * Gets and wraps a mutable proto field on access, if there is no field present,\n * it creates and inserts one.\n *\n * @return {!Array} The field as a jspb proto.\n */\nexports.getMutableOneofWrapperArrayForBinary = function(\n    /** !Array */ messageArray,\n    /** !MessageMeta */ messageMeta,\n    /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof) {\n  let messageArrayState = getArrayStateInline(messageArray);\n  setOneofCaseNumber(\n      messageArray, messageArrayState, oneof, fieldNumber,\n      getHasMessageId(messageArrayState));\n  return exports.getMutableWrapperArrayForBinary(\n      messageArray, messageMeta, fieldNumber);\n};\n\n/**\n * Gets and wraps a mutable proto field on access, if there is no field present,\n * it creates and inserts one.\n *\n * @return {!Array} The field as a jspb proto.\n */\nexports.getMutableWrapperArrayForBinary = function(\n    /** !Array */ messageArray,\n    /** !MessageMeta */ messageMeta,\n    /** number */ fieldNumber) {\n  let messageArrayState =\n      getPossiblyUnconstructedMessageArrayStateInline(messageArray);\n  const hasMessageId = getHasMessageId(messageArrayState);\n  const data = exports.getFieldNullableInternal(\n      messageArray, messageArrayState, fieldNumber, hasMessageId);\n  let /** !Array<?>|undefined */ submessageArray;\n  if (isInternalMessage(data)) {\n    const /** !InternalMessage */ asMessage = data;\n    if (!isImmutableMessage(asMessage)) {\n      maybeCopyOnWrite(asMessage);\n      return getInternalArrayInline(asMessage);\n    }\n    // we know this is an immutable array and will clone it below.\n    submessageArray = getInternalArrayInline(asMessage);\n    assert(\n        getArrayStateInline(submessageArray) &\n        ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n  } else if (Array.isArray(data)) {\n    submessageArray = data;\n  }\n  if (submessageArray) {\n    const dataArrayState = getArrayStateInline(submessageArray);\n    if (dataArrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY) {\n      submessageArray =\n          copyArrayWithImmutableFields(submessageArray, dataArrayState);\n    }\n  }\n  submessageArray =\n      constructMessageArrayFromMetaForBinary(submessageArray, messageMeta);\n  // if we either copied or constructed back, store the new value.\n  if (submessageArray !== data) {\n    messageArrayState = setFieldIgnoringImmutabilityInternal(\n        messageArray, messageArrayState, fieldNumber, submessageArray,\n        hasMessageId);\n  }\n  return submessageArray;\n};\n\n/**\n * Gets and wraps a proto field on access, maintaining null/undefined and\n * mutability state.\n *\n * @return {T_RETURN} The field as a jspb proto.\n * @template T\n * Use go/closure-ttl to modify the return value to be nullable without\n * influencing generic type inference\n * @template T_RETURN := union(T, 'undefined') =:\n */\nfunction getReadonlyWrapperFieldOrUndefinedInternal(\n    /** !Array<?> */ messageArray,\n    /** !ArrayState */ messageArrayState,\n    /** function(new:T, ?Array<?>=) */ ctor,\n    /** number */ fieldNumber,\n    /** !HasMessageId|undefined */ hasMessageId) {\n  let isNewlyConstructed = false;\n  const submsg =\n      /** @type {!InternalMessage} */ (exports.getFieldNullableInternal(\n          messageArray, messageArrayState, fieldNumber, hasMessageId,\n          (data) => {\n            const result = messageFromInlineStorage(\n                data, ctor,\n                /* constructMissing= */ false,\n                /* arrayState = */ messageArrayState);\n            isNewlyConstructed = result !== data && result != null;\n            return result;\n          }));\n  if (submsg == null) return undefined;\n  if (isNewlyConstructed && !isImmutableMessage(submsg)) {\n    leakedMutableSubstructures(messageArray, messageArrayState);\n  }\n  return assertMessageReturnedSafely(submsg, messageArray, isNewlyConstructed);\n}\n\n/**\n * Gets and wraps a proto field on access, returning a default immutable\n * instance if no value is present.\n *\n * @return {!M} The field as a jspb proto.\n * @template M\n */\nexports.getReadonlyWrapperField = function(\n    /** !InternalMessage */ message,\n    /** function(new:M, ?Array<?>=) */ ctor,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  return getReadonlyWrapperFieldOrUndefinedInternal(\n             messageArray, getMessageArrayStateInline(messageArray), ctor,\n             fieldNumber, hasMessageId) ||\n      getDefaultImmutableInstance(ctor);\n};\n\n/**\n * Gets and wraps a proto field on access, returning `undefined` if no value is\n * present.\n *\n * @return {!M|undefined} The field as a jspb proto.\n * @template M\n */\nexports.getReadonlyWrapperFieldOrUndefined = function(\n    /** !InternalMessage */ message,\n    /** function(new:M, ?Array<?>=) */ ctor,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  return getReadonlyWrapperFieldOrUndefinedInternal(\n      messageArray, getMessageArrayStateInline(messageArray), ctor, fieldNumber,\n      hasMessageId);\n};\n\n/**\n * Gets and wraps a proto field on access, with the mutability of the parent\n * message. Returns the literal value if null or undefined.\n *\n * If the value in the message is immutable and its parent is mutable, this\n * method will coerce and copy back to the parent message.\n *\n * @return {T_RETURN} The field as a jspb proto.\n * @template T\n * Use go/closure-ttl to modify the return value to be nullable without\n * influencing generic type inference\n * @template T_RETURN := union(T, 'undefined') =:\n */\nexports.getWrapperFieldOrUndefined = function(\n    /** !InternalMessage */ message,\n    /** function(new:T, ?Array<?>=) */ ctor,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  let messageArray = getInternalArrayInline(message);\n  let messageArrayState = getMessageArrayStateInline(messageArray);\n  let submessage = getReadonlyWrapperFieldOrUndefinedInternal(\n      messageArray, messageArrayState, ctor, fieldNumber, hasMessageId);\n  if (submessage == null) {\n    return submessage;\n  }\n\n  // If we are mutable then we must return a mutable submessage.\n  messageArrayState = getMessageArrayStateInline(messageArray);\n  if (!isImmutableMessage(message, messageArrayState)) {\n    const mutableSubmessage = messageToMutable(submessage);\n    if (mutableSubmessage !== submessage) {\n      if (maybeCopyOnWrite(message)) {\n        messageArray = getInternalArrayInline(message);\n        messageArrayState = getMessageArrayStateInline(messageArray);\n      }\n      submessage = mutableSubmessage;\n      messageArrayState = setFieldIgnoringImmutabilityInternal(\n          messageArray, messageArrayState, fieldNumber, submessage,\n          hasMessageId);\n      messageArrayState =\n          leakedMutableSubstructures(messageArray, messageArrayState);\n    }\n  }\n  return assertMessageReturnedSafely(\n      submessage, messageArray, /* isNewlyConstructed = */ undefined);\n};\n\n/**\n * Gets and wraps a repeated proto field on access, maintaining the current\n * mutability of the values.\n *\n * @param {!InternalMessage} message\n * @param {function(new:T, ?Array<?>)} ctor Constructor for the\n *     field.\n * @param {number} fieldNumber The field number.\n * @param {!HasMessageId=} hasMessageId\n * @return {!Array<T>} The repeated field as an array of protos.\n * @template T\n */\nexports.getReadonlyRepeatedWrapperField = function(\n    message, ctor, fieldNumber, hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  return getRepeatedWrapperFieldInternal(\n      message, messageArray, getMessageArrayStateInline(messageArray), ctor,\n      fieldNumber, RepeatedArrayReturnType.FROZEN, hasMessageId);\n};\n\n/**\n * Gets and wraps a repeated proto field on access.\n *\n * IMPORTANT: When this function returns, messageArray and messageArrayState\n * might have new values.\n *\n * @param {!InternalMessage} message parent message\n * @param {!Array<?>} messageArray\n * @param {number} messageArrayState array state of our parent.\n * @param {function(new:T, ?Array<?>)} ctor Constructor for the field.\n * @param {number} fieldNumber The field number.\n * @param {!RepeatedArrayReturnType} returnTypeForMutable Whether we should\n *     return a frozen or unfrozen array. Ignored if immutable parent.\n * @param {!HasMessageId|undefined} hasMessageId\n * @param {boolean=} doesntReturnArray\n * @param {boolean=} forceMutableValuesIfParentIsMutable Coerce values to\n *     mutable if that has not been done. Only has effect if the parent is\n *     mutable.\n * @return {!Array<T>} The repeated field as an array of protos.\n * @template T\n */\nfunction getRepeatedWrapperFieldInternal(\n    message, messageArray, messageArrayState, ctor, fieldNumber,\n    returnTypeForMutable, hasMessageId, doesntReturnArray,\n    forceMutableValuesIfParentIsMutable) {\n  const immutableMessage = isImmutableMessage(message, messageArrayState);\n  const returnType =\n      immutableMessage ? RepeatedArrayReturnType.FROZEN : returnTypeForMutable;\n  doesntReturnArray = !!doesntReturnArray ||\n      returnType === RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN;\n  const forceMutableValues =\n      forceMutableValuesIfParentIsMutable && !immutableMessage;\n\n  if (returnType === RepeatedArrayReturnType.UNFROZEN || forceMutableValues) {\n    if (maybeCopyOnWrite(message)) {\n      messageArray = getInternalArrayInline(message);\n      messageArrayState = getMessageArrayStateInline(messageArray);\n    }\n  }\n\n  let data = getRawRepeatedFieldWithDefault(\n      messageArray, messageArrayState, fieldNumber, hasMessageId);\n  let existingState = getRepeatedArrayState(data);\n  let valueState = setFlagsForRepeatedField(existingState, messageArrayState);\n\n  const needFormat = !hasFlagBit(valueState, ArrayStateFlags.IS_API_FORMATTED);\n  if (needFormat) {\n    valueState =\n        constructRepeatedSubmessages(data, ctor, valueState, messageArrayState);\n  }\n\n  if (valueState !== existingState) {\n    existingState = setArrayState(data, valueState);\n    if (hasFlagBit(valueState, ArrayStateFlags.IS_IMMUTABLE_ARRAY)) {\n      Object.freeze(data);\n    }\n  }\n\n  if (forceMutableValues) {\n    // if returning frozen, an empty array has only mutable even if not marked\n    const onlyMutableValues =\n        hasFlagBit(valueState, ArrayStateFlags.ONLY_MUTABLE_VALUES) ||\n        (!data.length &&\n         shouldReturnFrozen(returnType, valueState, messageArrayState));\n    if (!onlyMutableValues) {\n      // we assume users can't freeze arrays we give them, so we only have to\n      // slice if we froze this array\n      if (isFrozenByFlags(valueState, data)) {\n        data = slice(data);\n        valueState =\n            setFlagsForSlicedRepeatedArray(valueState, messageArrayState);\n        messageArrayState = assertExists(setFieldIgnoringImmutabilityInternal(\n            messageArray, messageArrayState, fieldNumber, data, hasMessageId));\n      }\n      valueState = coerceToMutable(data, valueState);\n      existingState = setArrayState(data, valueState);\n    }\n  }\n\n  data = prepareRepeatedArrayForReturn(\n      data, valueState, messageArray, messageArrayState, fieldNumber,\n      hasMessageId, returnType, needFormat, doesntReturnArray);\n\n  // TODO: add some assert even when doesntReturnArray\n  if (!doesntReturnArray) {\n    assertMessageArrayReturnedSafely(\n        data, messageArray, fieldNumber,\n        /*isNewlyConstructed=*/ needFormat,\n        /*skipFrozenCheck=*/ returnType === RepeatedArrayReturnType.UNFROZEN);\n  }\n\n  return data;\n}\n\n/**\n * Constructs each of the messages in a repeated message field. Returns the new\n * state bits of the repeated field array. Caller is responsible for setting the\n * new state bits on the array.\n * @param {!Array<?>} data Array of raw submessages to construct.\n * @param {function(new:InternalMessage, ?Array<?>)} ctor Constructor for the\n *     submessages.\n * @param {!ArrayState} dataState array state of data.\n * @param {!ArrayState} messageArrayState array state of our parent.\n * @return {!ArrayState} new array state for data.\n */\nfunction constructRepeatedSubmessages(\n    data, ctor, dataState, messageArrayState) {\n  const isImmutableArray =\n      hasFlagBit(dataState, ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n  // submessages inherit state bits from the parent message by default, but if\n  // the repeated field array is marked immutable, the submessages have to be\n  // immutable\n  if (isImmutableArray) {\n    messageArrayState =\n        setFlagBit(messageArrayState, ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n  }\n  let hasOnlyMutableValues = !isImmutableArray;\n  let hasOnlyImmutableValues = true;\n  let readFrom = 0;\n  let writeTo = 0;\n  for (; readFrom < data.length; readFrom++) {\n    const datum = data[readFrom];\n    // Construct a new message.\n    const msg = messageFromInlineStorage(\n        datum, ctor, /*constructMissing=*/ false,\n        /*messageArrayState=*/ messageArrayState);\n    if (!(msg instanceof ctor)) {\n      // This means the value stored in this position is incorrect, and there\n      // is no message for it.  We need to just keep going.\n      continue;\n    }\n    if (!isImmutableArray) {\n      const isImmutable = isImmutableMessage(msg);\n      hasOnlyMutableValues &&= !isImmutable;\n      hasOnlyImmutableValues &&= isImmutable;\n    }\n    data[writeTo++] = msg;\n  }\n\n  // Trim the end of the array if we had to remove invalid values.\n  if (writeTo < readFrom) {\n    data.length = writeTo;\n  }\n\n  dataState = setFlagBit(dataState, ArrayStateFlags.IS_API_FORMATTED);\n  dataState = setFlagBitTo(\n      dataState, ArrayStateFlags.MUTABLE_SUBSTRUCTURES,\n      !hasOnlyImmutableValues);\n  dataState = setFlagBitTo(\n      dataState, ArrayStateFlags.ONLY_MUTABLE_VALUES, hasOnlyMutableValues);\n\n  return dataState;\n}\n\n/**\n * Coerce all elements of data to be mutable.\n * @param {!Array<?>} data array of messages\n * @param {!ArrayState} state array state of data\n * @return {!ArrayState} new array state for data\n */\nfunction coerceToMutable(data, state) {\n  for (let i = 0; i < data.length; i++) {\n    const msg = data[i];\n    const asMutable = messageToMutable(msg);\n    if (msg !== asMutable) {\n      data[i] = asMutable;\n    }\n  }\n  state = setFlagBit(state, ArrayStateFlags.ONLY_MUTABLE_VALUES);\n  state =\n      setFlagBitTo(state, ArrayStateFlags.MUTABLE_SUBSTRUCTURES, !!data.length);\n  return state;\n}\n\n/**\n * Gets the value of a oneof wrapper field, maintaining its current mutability.\n *\n * @return {!T_NOT_NULL_OR_UNDEFINED}\n * @template T\n * @template T_NOT_NULL_OR_UNDEFINED :=\n *     cond(isUnknown(T), unknown(),\n *       mapunion(T, (X) =>\n *         cond(eq(X, 'null'), none(),\n *           cond(eq(X, 'undefined'), none(), X))))\n * =:\n */\nexports.getReadonlyOneofWrapperField = function(\n    /** !InternalMessage */ message, /** function(new:T, ?Array<?>=) */ ctor,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getReadonlyWrapperField(\n      message, ctor,\n      exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets and wraps a repeated proto field on access, ensuring that each returned\n * value matches the mutability of its parent.\n *\n * If the parent message is mutable and we see an immutable value in the array,\n * we will shallow-copy to a mutable value and copy back to the source arrays.\n *\n * @param {!InternalMessage} message\n * @param {function(new:T, ?Array<?>)} ctor Constructor for the field.\n * @param {number} fieldNumber The field number.\n * @param {!RepeatedArrayReturnType} returnTypeForMutable The return type if\n *     message is mutable. Ignored if message is immutable.\n * @param {!HasMessageId=} hasMessageId\n * @return {!Array<T>} The repeated field as an array of protos.\n * @template T\n */\nexports.getRepeatedWrapperField = function(\n    message, ctor, fieldNumber, returnTypeForMutable, hasMessageId) {\n  const messageArray = getInternalArrayInline(message);\n  return getRepeatedWrapperFieldInternal(\n      message, messageArray, getMessageArrayStateInline(messageArray), ctor,\n      fieldNumber, returnTypeForMutable, hasMessageId,\n      /*doesntReturnArray=*/ false,\n      /*forceMutableValuesIfParentIsMutable=*/ true);\n};\n\n/**\n * @return {M}\n * @template M\n */\nfunction checkWrapperForSetter(\n    /** ?M|undefined */ value,\n    /** function(new:M, ?Array<?>=)|undefined */ ctor) {\n  if (value != null) {\n    // ctor must exist if there is data\n    checkMessageType(value, assertExists(ctor));\n  } else {\n    // Normalize null to undefined in storage\n    value = undefined;\n  }\n  return value;\n}\n\n/**\n * @param {!InternalMessage} message\n * @param {?InternalMessage|undefined} value\n */\nfunction leakedMutableIfValueIsMutable(message, value) {\n  if (value && !isImmutableMessage(value)) {\n    leakedMutableSubstructures(getInternalArrayInline(message));\n  }\n}\n\n/**\n * Sets a proto field and syncs it to the backing array.\n * @return {T}\n * @template T,M\n */\nexports.setWrapperField = function(\n    /** T */ message,\n    /** function(new:M, ?Array<?>=)|undefined */ ctor,\n    /** number */ fieldNumber,\n    /** ?M|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  value = checkWrapperForSetter(value, ctor);\n  exports.setField(message, fieldNumber, value, hasMessageId);\n  leakedMutableIfValueIsMutable(message, value);\n  return message;\n};\n\n/**\n * Sets a proto field in a oneof union and syncs it to the backing array.\n * @return {T}\n * @template T,M\n */\nexports.setOneofWrapperField = function(\n    /** T */ message,\n    /** function(new:M, ?Array<?>=) */ ctor,\n    /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /** ?M|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  value = checkWrapperForSetter(value, ctor);\n  exports.setOneofField(message, fieldNumber, oneof, value, hasMessageId);\n  leakedMutableIfValueIsMutable(message, value);\n  return message;\n};\n\n/**\n * Sets a repeated proto field and syncs it to the backing array.\n * @return {T}\n * @template T,M\n */\nexports.setRepeatedWrapperField = function(\n    /** T */ message,\n    /** function(new:M, ?Array<?>=)|undefined*/ ctor,\n    /** number */ fieldNumber,\n    /** ?ReadonlyArray<?>|undefined */ msgs,\n    /** !HasMessageId= */ hasMessageId) {\n  const self = /** @type {!InternalMessage} */ (message);\n  ensureMutable(self);\n  const messageArray = getInternalArrayInline(self);\n  let messageArrayState = getMessageArrayStateInline(messageArray);\n\n  if (msgs == null) {\n    messageArrayState = setFieldIgnoringImmutabilityInternal(\n        messageArray, messageArrayState, fieldNumber, undefined, hasMessageId);\n    return message;\n  }\n\n  checkRepeatedFieldIsArray(msgs);\n  let valueState = getRepeatedArrayState(msgs);\n  let existingState = valueState;\n  const frozenByUs = isFrozenByFlags(valueState, msgs);\n  const isFrozen = frozenByUs || Object.isFrozen(msgs);\n\n  // go over array and check values are of the right message type. also compute\n  // mutability info if array wasn't frozen by us\n  let hasOnlyMutableValues = true;\n  let hasOnlyImmutableValues = true;\n  for (let i = 0; i < msgs.length; i++) {\n    const item = msgs[i];\n    checkMessageType(item, assertExists(ctor));\n    if (!frozenByUs) {\n      const isImmutable = isImmutableMessage(item);\n      hasOnlyMutableValues &&= !isImmutable;\n      hasOnlyImmutableValues &&= isImmutable;\n    }\n  }\n\n  // we only update state bits if array wasn't already frozen by us\n  if (!frozenByUs) {\n    valueState =\n        ArrayStateFlags.IS_REPEATED_FIELD | ArrayStateFlags.IS_API_FORMATTED;\n    valueState = setFlagBitTo(\n        valueState, ArrayStateFlags.ONLY_MUTABLE_VALUES, hasOnlyMutableValues);\n    valueState = setFlagBitTo(\n        valueState, ArrayStateFlags.MUTABLE_SUBSTRUCTURES,\n        !hasOnlyImmutableValues);\n  }\n  if (!isFrozen || valueState !== existingState) {\n    msgs = slice(msgs);\n    existingState = 0;\n    valueState = setFlagsForSlicedRepeatedArray(valueState, messageArrayState);\n  }\n  if (valueState !== existingState) {\n    setArrayState(msgs, valueState);\n  }\n  assertArrayInvariants(msgs);\n\n  messageArrayState = setFieldIgnoringImmutabilityInternal(\n      messageArray, messageArrayState, fieldNumber, msgs, hasMessageId);\n  if (!hasFlagBit(valueState, ArrayStateFlags.IS_IMMUTABLE_ARRAY) &&\n      !canMarkImmutableInPlaceIfParentIsOwned(valueState)) {\n    messageArrayState =\n        leakedMutableSubstructures(messageArray, messageArrayState);\n  }\n  return message;\n};\n\n/**\n * Updates flags on the state of a newly sliced repeated array.\n *\n * @param {!ArrayState} state the current state\n * @param {!ArrayState} parentState state of the parent message\n * @return {!ArrayState} the new state\n */\nfunction setFlagsForSlicedRepeatedArray(state, parentState) {\n  const immutableParent =\n      hasFlagBit(parentState, ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n  state =\n      setFlagBitTo(state, ArrayStateFlags.IS_IMMUTABLE_ARRAY, immutableParent);\n  state = clearFlagBit(\n      state, ArrayStateFlags.FROZEN_ARRAY | ArrayStateFlags.UNFROZEN_SHARED);\n  return state;\n}\n\n/**\n * Supports four use-cases:\n *   1) Appending new value or iterable of values\n *      * `index` === undefined\n *      * `deleteCount` === undefined\n *      * `isSpreadable` - indicates whether `value` is an iterable\n *   2) Inserting a new value\n *      * `index` - number defining the insertion point\n *      * `deleteCount` === undefined\n *   3) Replace an existing value\n *      * `index` - number defining the insertion point\n *      * `deleteCount` === 1\n *   3) Remove an existing value\n *      * `index` - number defining the removal point, defaulting to the end.\n *      * `removeOnly` === true\n *      * `deleteCount` === 1\n * @param {T} message\n * @param {number} fieldNumber\n * @param {function(?,?=):?} checkFn\n * @param {*} value a singular value or an iterable of values depending on\n *     parameter `isSpreadable`\n * @param {number|undefined} index\n * @param {function(?):?} coercionFn\n * @param {!HasMessageId|undefined} hasMessageId\n * @param {number=} deleteCount\n * @param {boolean=} isSpreadable whether `value` is an iterable\n * @param {boolean=} removeOnly\n * @return {T}\n * @template T\n */\nfunction spliceRepeatedPrimitiveField(\n    message, fieldNumber, checkFn, value, index, coercionFn, hasMessageId,\n    deleteCount, isSpreadable, removeOnly) {\n  const self = /** @type {!InternalMessage} */ (message);\n  ensureMutable(self);\n  const arr = getApiFormattedRepeatedField(\n      self, fieldNumber, coercionFn, RepeatedArrayReturnType.UNFROZEN,\n      /*doesntReturnArray=*/ true, /* formatType = */ undefined, hasMessageId);\n  let arrState = getRepeatedArrayState(arr);\n  const currentFormat =\n      getTypeSpecificApiFormat(arrState) ?? getDefaultTypeSpecificApiFormat();\n\n  if (isSpreadable) {\n    if (Array.isArray(value)) {\n      // in case value === arr, only read up to the original length\n      const length = value.length;\n      for (let i = 0; i < length; i++) {\n        arr.push(checkFn(value[i], currentFormat));\n      }\n    } else {\n      for (const v of /** @type {!Iterable<?>} */ (value)) {\n        arr.push(checkFn(v, currentFormat));\n      }\n    }\n  } else {\n    if (deleteCount) {\n      assert(deleteCount === 1);\n    }\n    if (deleteCount && removeOnly) {\n      index ??= arr.length - 1;\n      checkRepeatedIndexInRangeForGet(arr, index);\n      arr.splice(index, deleteCount);\n    } else {\n      if (deleteCount) {\n        checkRepeatedIndexInRangeForSet(arr, index);\n      }\n      if (index != undefined) {\n        // NOTE: an explicit `undefined` for deleteCount acts like zero.\n        arr.splice(index, deleteCount, checkFn(value, currentFormat));\n      } else {\n        arr.push(checkFn(value, currentFormat));\n      }\n    }\n  }\n\n  assertRepeated64BitIntegerFieldApiFormattingInvariants(arr);\n  return message;\n}\n\n/**\n * Splices a submessage into a repeated proto field, optionally deleting at most\n * one, and returns the newly added submessage.\n *\n * Supports four use-cases:\n *   1) Appending new value\n *      * `index` === undefined\n *      * `deleteCount` === undefined\n *      * `value` can undefined to create a new value, or specify the existing\n *        wrapper value to append.\n *   2) Inserting a new value\n *      * `index` - number defining the insertion point\n *      * `deleteCount` === undefined\n *      * `value` can undefined to create a new value, or specify the existing\n *        wrapper append\n *   3) Replace an existing value\n *      * `index` - number defining the insertion point\n *      * `deleteCount` === 1\n *      * `value` must be specified as an existing wrapper of the field type\n *   4) Removing an existing value\n *      * `index` - number defining the insertion point, defaulting to the end.\n *      * `deleteCount` === 1\n *      * `removeOnly` === true\n * @param {!InternalMessage} message\n * @param {number} fieldNumber The field number.\n * @param {function(new:T_CHILD, ?Array=)} ctor The constructor of the\n *     message type.\n * @param {!HasMessageId|undefined} hasMessageId\n * @param {T_CHILD=} value Proto that will be added to the\n *     repeated field.\n * @param {number|undefined=} index Index at which to insert the value.\n * @param {number=} deleteCount Number of elements to delete when splicing,\n *     defaults to zero and merely inserts.\n * @param {boolean=} removeOnly\n * @return {T_CHILD|undefined} proto that was inserted to the repeated\n *     field, or undefined if removing only\n * @template MessageType\n * Use go/closure-ttl to declare a non-undefined version of T_CHILD. Replace\n * the undefined in blah|undefined with none. This is necessary because the\n * compiler will infer T_CHILD to be |undefined.\n * @template T_CHILD\n * =:\n */\nfunction spliceRepeatedWrapperField(\n    message, fieldNumber, ctor, hasMessageId, value, index, deleteCount,\n    removeOnly) {\n  ensureMutable(message);\n  const messageArray = getInternalArrayInline(message);\n  const msgs = getRepeatedWrapperFieldInternal(\n      message, messageArray, getMessageArrayStateInline(messageArray), ctor,\n      fieldNumber, RepeatedArrayReturnType.UNFROZEN, hasMessageId,\n      /*doesntReturnArray=*/ true);\n\n  // Replacing or appending one value is currently the only use-case for delete\n  // count.\n  if (deleteCount) {\n    assert(deleteCount === 1);\n  }\n  if (deleteCount && removeOnly) {\n    index ??= msgs.length - 1;\n    checkRepeatedIndexInRangeForGet(msgs, index);\n    msgs.splice(index, deleteCount);\n    if (!msgs.length) {\n      clearFlags(msgs, ArrayStateFlags.MUTABLE_SUBSTRUCTURES);\n    }\n    return undefined;\n  } else {\n    if (deleteCount) {\n      checkRepeatedIndexInRangeForSet(msgs, index);\n      // Check that setters pass the right type.\n      checkMessageType(value, ctor);\n    } else {\n      value = value != null ? checkMessageType(value, ctor) : new ctor();\n    }\n    if (index != undefined) {\n      // NOTE: an explicit `undefined` for deleteCount acts like zero.\n      msgs.splice(index, deleteCount, value);\n    } else {\n      msgs.push(value);\n    }\n\n    let arrayState = getRepeatedArrayState(msgs);\n    const oldState = arrayState;\n    const immutableValue = isImmutableMessage(value);\n\n    if (immutableValue) {\n      // We no longer know that this wrapper field has only mutable values.\n      arrayState =\n          clearFlagBit(arrayState, ArrayStateFlags.ONLY_MUTABLE_VALUES);\n      if (msgs.length === 1) {\n        arrayState =\n            clearFlagBit(arrayState, ArrayStateFlags.MUTABLE_SUBSTRUCTURES);\n      }\n    } else {\n      arrayState =\n          setFlagBit(arrayState, ArrayStateFlags.MUTABLE_SUBSTRUCTURES);\n    }\n\n    if (arrayState !== oldState) {\n      setArrayState(msgs, arrayState);\n    }\n    if (!immutableValue) {\n      leakedMutableSubstructures(messageArray);\n    }\n\n    return value;\n  }\n}\n\n/**\n * Adds a submessage to a repeated proto field, and returns the newly added\n * submessage.\n * @param {!InternalMessage} message\n * @param {number} fieldNumber The field number.\n * @param {function(new:T_CHILD, ?Array=)} ctor The constructor of the\n *     message type.\n * @param {T_CHILD=} value Proto that will be added to the\n *     repeated field.\n * @param {number|undefined=} index Index at which to insert the value.\n * @param {!HasMessageId=} hasMessageId\n * @return {T_CHILD_NOT_UNDEFINED} proto that was inserted to the repeated\n *     field\n * @template MessageType\n * Use go/closure-ttl to declare a non-undefined version of T_CHILD. Replace\n * the undefined in blah|undefined with none. This is necessary because the\n * compiler will infer T_CHILD to be |undefined.\n * @template T_CHILD\n * @template T_CHILD_NOT_UNDEFINED :=\n *     cond(isUnknown(T_CHILD), unknown(),\n *       mapunion(T_CHILD, (X) =>\n *         cond(eq(X, 'undefined'), none(), X)))\n * =:\n */\nexports.addAndReturnRepeatedWrapperField = function(\n    message, fieldNumber, ctor, value, index, hasMessageId) {\n  return spliceRepeatedWrapperField(\n      message, fieldNumber, ctor, hasMessageId, value, index);\n};\n\n/**\n * Adds a submessage to a repeated proto field, and returns `this`.\n * @return {T}\n * @template T\n * @template T_CHILD\n */\nexports.addToRepeatedWrapperField = function(\n    /** T */ message,\n    /** number */ fieldNumber, /** function(new:T_CHILD, ?Array=) */ ctor,\n    /** T_CHILD */ value, /**number=*/ index,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.addAndReturnRepeatedWrapperField(\n      message, fieldNumber, ctor, value, index, hasMessageId);\n  return message;\n};\n\n/**\n * Adds a submessage to a repeated proto field, and returns `this`.\n * @return {T}\n * @template T\n * @template T_CHILD\n */\nexports.removeFromRepeatedWrapperField = function(\n    /** T */ message,\n    /** number */ fieldNumber, /** function(new:T_CHILD, ?Array=) */ ctor,\n    /** number= */ index, /** !HasMessageId= */ hasMessageId) {\n  spliceRepeatedWrapperField(\n      message, fieldNumber, ctor, hasMessageId, /*value=*/ undefined, index,\n      /*deleteCount=*/ 1, /*removeOnly=*/ true);\n  return message;\n};\n\n/**\n * Adds a submessage to a repeated proto field, and returns `this`.\n * @return {T}\n * @template T\n * @template T_CHILD\n */\nexports.addAllToRepeatedWrapperField = function(\n    /** T */ message,\n    /** number */ fieldNumber, /** function(new:T_CHILD, ?Array=) */ ctor,\n    /** !Iterable<T_CHILD> */ values, /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  const messageArray = getInternalArrayInline(message);\n  const msgs = getRepeatedWrapperFieldInternal(\n      message, messageArray, getMessageArrayStateInline(messageArray), ctor,\n      fieldNumber, RepeatedArrayReturnType.UNFROZEN, hasMessageId,\n      /*doesntReturnArray=*/ true);\n  let clearedOnlyMutable = 0;\n  let clearedOnlyImmutable = 0;\n  if (Array.isArray(values)) {\n    // in case values === msgs, only read up to the original length\n    const length = values.length;\n    for (let i = 0; i < length; i++) {\n      const insertedValue = checkMessageType(values[i], ctor);\n      msgs.push(insertedValue);\n      const valueIsImmutable = isImmutableMessage(insertedValue);\n      if (valueIsImmutable && !(clearedOnlyMutable++)) {\n        clearFlags(msgs, ArrayStateFlags.ONLY_MUTABLE_VALUES);\n      }\n      if (!valueIsImmutable && !(clearedOnlyImmutable++)) {\n        addArrayStateFlags(msgs, ArrayStateFlags.MUTABLE_SUBSTRUCTURES);\n      }\n    }\n  } else {\n    for (const value of values) {\n      const insertedValue = checkMessageType(value, ctor);\n      msgs.push(insertedValue);\n      const valueIsImmutable = isImmutableMessage(insertedValue);\n      if (valueIsImmutable && !(clearedOnlyMutable++)) {\n        clearFlags(msgs, ArrayStateFlags.ONLY_MUTABLE_VALUES);\n      }\n      if (!valueIsImmutable && !(clearedOnlyImmutable++)) {\n        addArrayStateFlags(msgs, ArrayStateFlags.MUTABLE_SUBSTRUCTURES);\n      }\n    }\n  }\n  if (clearedOnlyImmutable) {\n    leakedMutableSubstructures(messageArray);\n  }\n  return message;\n};\n\n/**\n * @return {number|null|undefined}\n */\nexports.getInt64FieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  if (getWriteBackGbigintValues()) {\n    return coerceToNullishInt64(exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable,\n        coerceToNullishInt64Gbigint));\n  } else {\n    const value = coerceToNullishInt64(exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable));\n    asyncThrowIf64BitIntReturnTypeMismatches(\n        message, value, /* expectStringValue = */ false);\n    return value;\n  }\n};\n\n/**\n * @return {string|null|undefined}\n */\nexports.getInt64FieldNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  if (getWriteBackGbigintValues()) {\n    return coerceToNullishInt64String(exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable,\n        coerceToNullishInt64Gbigint));\n  } else {\n    return coerceToNullishInt64String(\n        exports.getFieldNullable(\n            message, fieldNumber, hasMessageId, legacyNullable),\n        /* forceTypeChecking = */ true);\n  }\n};\n\n/**\n * @return {string|null|undefined}\n */\nexports.getInt64StringFieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  const value = coerceToNullishInt64String(exports.getFieldNullable(\n      message, fieldNumber, hasMessageId, legacyNullable));\n  asyncThrowIf64BitIntReturnTypeMismatches(\n      message, value, /* expectStringValue = */ true);\n  return value;\n};\n\n/**\n * @return {!gbigint|null|undefined}\n */\nexports.getInt64GbigintFieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  if (getWriteBackGbigintValues()) {\n    return exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable,\n        coerceToNullishInt64Gbigint);\n  } else {\n    return coerceToNullishInt64Gbigint(exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable));\n  }\n};\n\n/**\n * @return {number|null|undefined}\n */\nexports.getUint64FieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  if (getWriteBackGbigintValues()) {\n    return coerceToNullishUint64(exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable,\n        coerceToNullishUint64Gbigint));\n  } else {\n    const value = coerceToNullishUint64(exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable));\n    asyncThrowIf64BitIntReturnTypeMismatches(\n        message, value, /* expectStringValue = */ false);\n    return value;\n  }\n};\n\n/**\n * @return {string|null|undefined}\n */\nexports.getUint64FieldNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  if (getWriteBackGbigintValues()) {\n    return coerceToNullishUint64String(exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable,\n        coerceToNullishUint64Gbigint));\n  } else {\n    return coerceToNullishUint64String(\n        exports.getFieldNullable(\n            message, fieldNumber, hasMessageId, legacyNullable),\n        /* forceTypeChecking = */ true);\n  }\n};\n\n/**\n * @return {string|null|undefined}\n */\nexports.getUint64StringFieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  const value = coerceToNullishUint64String(exports.getFieldNullable(\n      message, fieldNumber, hasMessageId, legacyNullable));\n  asyncThrowIf64BitIntReturnTypeMismatches(\n      message, value, /* expectStringValue = */ true);\n  return value;\n};\n\n/**\n * @return {!gbigint|null|undefined}\n */\nexports.getUint64GbigintFieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  if (getWriteBackGbigintValues()) {\n    return exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable,\n        coerceToNullishUint64Gbigint);\n  } else {\n    return coerceToNullishUint64Gbigint(exports.getFieldNullable(\n        message, fieldNumber, hasMessageId, legacyNullable));\n  }\n};\n\n/**\n * Gets the value of a repeated int64 field.\n * @param {!InternalMessage} message\n * @param {number} fieldNumber\n * @param {!RepeatedArrayReturnType} returnType\n * @param {!HasMessageId=} hasMessageId\n * @param {boolean=} doesntReturnArray\n * @return {!Array<number>}\n */\nexports.getRepeatedInt64Field = function(\n    message, fieldNumber, returnType, hasMessageId, doesntReturnArray) {\n  const value = getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishInt64, returnType, doesntReturnArray,\n      TypeSpecificApiFormat.LEGACY, hasMessageId);\n  if (!doesntReturnArray) {\n    asyncThrowIfRepeated64BitIntReturnTypeMismatches(\n        message, value,\n        /* expectStringValue = */ false);\n  }\n  return value;\n};\n\n/**\n * Gets the value of a repeated int64 field.\n * @param {!InternalMessage} message\n * @param {number} fieldNumber\n * @param {!RepeatedArrayReturnType} returnType\n * @param {!HasMessageId=} hasMessageId\n * @param {boolean=} doesntReturnArray\n * @return {!Array<!gbigint>}\n */\nexports.getRepeatedInt64GbigintField = function(\n    message, fieldNumber, returnType, hasMessageId, doesntReturnArray) {\n  return getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishInt64Gbigint, returnType,\n      doesntReturnArray, TypeSpecificApiFormat.GBIGINT, hasMessageId);\n};\n\n/**\n * @param {*} value\n * @return {string|null|undefined}\n */\nfunction coerceToNullishInt64StringWithForcedTypeChecking(value) {\n  return coerceToNullishInt64String(value, /* forceTypeChecking = */ true);\n}\n\n/**\n * Gets the value of a repeated int64 field.\n * @param {!InternalMessage} message\n * @param {number} fieldNumber\n * @param {!RepeatedArrayReturnType} returnType\n * @param {!HasMessageId=} hasMessageId\n * @param {boolean=} doesntReturnArray\n * @return {!ReadonlyArray<string>}\n */\nexports.getRepeatedInt64Field_asString = function(\n    message, fieldNumber, returnType, hasMessageId, doesntReturnArray) {\n  return /** @type {!ReadonlyArray<string>} */ (getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishInt64StringWithForcedTypeChecking,\n      returnType, doesntReturnArray, TypeSpecificApiFormat.STRING,\n      hasMessageId));\n};\n\n/**\n * Gets the value of a repeated int64 as string field.\n * @param {!InternalMessage} message\n * @param {number} fieldNumber\n * @param {!RepeatedArrayReturnType} returnType\n * @param {!HasMessageId=} hasMessageId\n * @param {boolean=} doesntReturnArray\n * @return {!Array<string>}\n */\nexports.getRepeatedInt64StringField = function(\n    message, fieldNumber, returnType, hasMessageId, doesntReturnArray) {\n  const value = getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishInt64String, returnType,\n      doesntReturnArray, TypeSpecificApiFormat.LEGACY, hasMessageId);\n  if (!doesntReturnArray) {\n    asyncThrowIfRepeated64BitIntReturnTypeMismatches(\n        message, value,\n        /* expectStringValue = */ true);\n  }\n\n  return value;\n};\n\n/**\n * Gets the value of a repeated uint64 field.\n * @return {!Array<number>}\n */\nexports.getRepeatedUint64Field = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  const value = getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishUint64, returnType,\n      doesntReturnArray, TypeSpecificApiFormat.LEGACY, hasMessageId);\n  if (!doesntReturnArray) {\n    asyncThrowIfRepeated64BitIntReturnTypeMismatches(\n        message, value,\n        /* expectStringValue = */ false);\n  }\n  return value;\n};\n\n/**\n * @param {*} value\n * @return {string|null|undefined}\n */\nfunction coerceToNullishUint64StringWithForcedTypeChecking(value) {\n  return coerceToNullishUint64String(value, /* forceTypeChecking = */ true);\n}\n\n/**\n * Gets the value of a repeated uint64 field.\n * @return {!ReadonlyArray<string>}\n */\nexports.getRepeatedUint64Field_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  return /** @type {!ReadonlyArray<string>} */ (getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishUint64StringWithForcedTypeChecking,\n      returnType, doesntReturnArray,\n      /* formatType = */ TypeSpecificApiFormat.STRING, hasMessageId));\n};\n\n/**\n * Gets the value of a repeated uint64 field.\n * @return {!Array<!gbigint>}\n */\nexports.getRepeatedUint64GbigintField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  return getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishUint64Gbigint, returnType,\n      doesntReturnArray, TypeSpecificApiFormat.GBIGINT, hasMessageId);\n};\n\n/**\n * Gets the value of a repeated uint64 as string field.\n * @return {!Array<string>}\n */\nexports.getRepeatedUint64StringField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  const value = getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishUint64String, returnType,\n      doesntReturnArray, TypeSpecificApiFormat.LEGACY, hasMessageId);\n  if (!doesntReturnArray) {\n    asyncThrowIfRepeated64BitIntReturnTypeMismatches(\n        message, value,\n        /* expectStringValue = */ true);\n  }\n  return value;\n};\n\nconst checkInt64String = checkInt64;\nconst checkUint64String = checkUint64;\nconst checkNullishInt64String = checkNullishInt64;\nconst checkNullishUint64String = checkNullishUint64;\n\n// These aliases are OK in debug mode because the implementations are\n// handwritten above.\nexports.getRepeatedInt64StringField_asString =\n    exports.getRepeatedInt64Field_asString;\nexports.getRepeatedUint64StringField_asString =\n    exports.getRepeatedUint64Field_asString;\n\n//\n// Generated code follows. To update, run:\n// javascript/apps/jspb/update_adapters.sh\n//\n// BEGIN AUTO-GENERATED ////////////////////////////////////////////////////////\n\n/**\n * @return {boolean|null|undefined}\n */\nexports.getBooleanFieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  return coerceToNullishBoolean(exports.getFieldNullable(\n      message, fieldNumber, hasMessageId, legacyNullable));\n};\n\n/**\n * @return {number|null|undefined}\n */\nexports.getInt32FieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  return coerceToNullishInt32(exports.getFieldNullable(\n      message, fieldNumber, hasMessageId, legacyNullable));\n};\n\n/**\n * @return {number|null|undefined}\n */\nexports.getUint32FieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  return coerceToNullishUint32(exports.getFieldNullable(\n      message, fieldNumber, hasMessageId, legacyNullable));\n};\n\n/**\n * @return {string|null|undefined}\n */\nexports.getStringFieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  return coerceToNullishString(exports.getFieldNullable(\n      message, fieldNumber, hasMessageId, legacyNullable));\n};\n\n/**\n * @return {number|null|undefined}\n */\nexports.getEnumFieldNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId,\n    /** !LegacyNullableToken|undefined= */ legacyNullable) {\n  return coerceToNullishEnum(exports.getFieldNullable(\n      message, fieldNumber, hasMessageId, legacyNullable));\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {boolean}\n */\nexports.getBooleanFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** boolean= */ defaultValue = false, /** !HasMessageId= */ hasMessageId) {\n  return exports.getBooleanFieldNullable(message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {number}\n */\nexports.getInt32FieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number= */ defaultValue = 0, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt32FieldNullable(message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {number}\n */\nexports.getUint32FieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number= */ defaultValue = 0, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint32FieldNullable(message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {number}\n */\nexports.getInt64FieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number= */ defaultValue = 0, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldNullable(message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {number}\n */\nexports.getUint64FieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number= */ defaultValue = 0, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldNullable(message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {string}\n */\nexports.getInt64StringFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** string= */ defaultValue = '0', /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64StringFieldNullable(\n             message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {string}\n */\nexports.getUint64StringFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** string= */ defaultValue = '0', /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64StringFieldNullable(\n             message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {!gbigint}\n */\nexports.getInt64GbigintFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !gbigint= */ defaultValue = GBIGINT_ZERO,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64GbigintFieldNullable(\n             message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {!gbigint}\n */\nexports.getUint64GbigintFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !gbigint= */ defaultValue = GBIGINT_ZERO,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64GbigintFieldNullable(\n             message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {number}\n */\nexports.getFloatingPointFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number= */ defaultValue = 0, /** !HasMessageId= */ hasMessageId) {\n  return exports.getFloatingPointFieldNullable(\n             message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {string}\n */\nexports.getStringFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** string= */ defaultValue = '', /** !HasMessageId= */ hasMessageId) {\n  return exports.getStringFieldNullable(message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {number}\n */\nexports.getEnumFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number= */ defaultValue = 0, /** !HasMessageId= */ hasMessageId) {\n  return exports.getEnumFieldNullable(message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {string}\n */\nexports.getInt64FieldWithDefault_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** string= */ defaultValue = '0', /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldNullable_asString(\n             message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {string}\n */\nexports.getUint64FieldWithDefault_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** string= */ defaultValue = '0', /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldNullable_asString(\n             message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {string}\n */\nexports.getInt64StringFieldWithDefault_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** string= */ defaultValue = '0', /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldNullable_asString(\n             message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * Gets the value of a field or default when unset.\n * @return {string}\n */\nexports.getUint64StringFieldWithDefault_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** string= */ defaultValue = '0', /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldNullable_asString(\n             message, fieldNumber, hasMessageId) ??\n      defaultValue;\n};\n\n/**\n * @return {!Array<boolean>}\n */\nexports.getRepeatedBooleanField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  return getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishBoolean, returnType,\n      doesntReturnArray, /* formatType= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {boolean}\n */\nexports.getRepeatedIndexedBooleanField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedBooleanField(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedBooleanCount = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedBooleanField(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * @return {!Array<number>}\n */\nexports.getRepeatedInt32Field = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  return getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishInt32, returnType, doesntReturnArray,\n      /* formatType= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {number}\n */\nexports.getRepeatedIndexedInt32Field = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedInt32Field(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedInt32Count = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedInt32Field(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * @return {!Array<number>}\n */\nexports.getRepeatedUint32Field = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  return getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishUint32, returnType,\n      doesntReturnArray, /* formatType= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {number}\n */\nexports.getRepeatedIndexedUint32Field = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedUint32Field(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedUint32Count = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedUint32Field(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {number}\n */\nexports.getRepeatedIndexedInt64Field = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedInt64Field(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedInt64Count = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedInt64Field(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {number}\n */\nexports.getRepeatedIndexedUint64Field = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedUint64Field(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedUint64Count = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedUint64Field(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {string}\n */\nexports.getRepeatedIndexedInt64StringField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedInt64StringField(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedInt64StringCount = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedInt64StringField(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {string}\n */\nexports.getRepeatedIndexedUint64StringField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedUint64StringField(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedUint64StringCount = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedUint64StringField(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {!gbigint}\n */\nexports.getRepeatedIndexedInt64GbigintField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedInt64GbigintField(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {!gbigint}\n */\nexports.getRepeatedIndexedUint64GbigintField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedUint64GbigintField(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * @return {!Array<number>}\n */\nexports.getRepeatedFloatingPointField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  return getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishFloatingPoint, returnType,\n      doesntReturnArray, /* formatType= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {number}\n */\nexports.getRepeatedIndexedFloatingPointField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedFloatingPointField(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedFloatingPointCount = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedFloatingPointField(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * @return {!Array<string>}\n */\nexports.getRepeatedStringField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  return getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishString, returnType,\n      doesntReturnArray, /* formatType= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {string}\n */\nexports.getRepeatedIndexedStringField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedStringField(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedStringCount = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedStringField(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * @return {!Array<!ByteString>}\n */\nexports.getRepeatedBytesField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  return getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishBytes, returnType, doesntReturnArray,\n      /* formatType= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {!ByteString}\n */\nexports.getRepeatedIndexedBytesField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedBytesField(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedBytesCount = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedBytesField(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * @return {!Array<number>}\n */\nexports.getRepeatedEnumField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !RepeatedArrayReturnType */ returnType,\n    /** !HasMessageId= */ hasMessageId, /** boolean= */ doesntReturnArray) {\n  return getApiFormattedRepeatedField(\n      message, fieldNumber, coerceToNullishEnum, returnType, doesntReturnArray,\n      /* formatType= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {number}\n */\nexports.getRepeatedIndexedEnumField = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedEnumField(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the count of a primitive repeated field's values.\n * @return {number}\n */\nexports.getRepeatedEnumCount = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports\n      .getRepeatedEnumField(\n          message, fieldNumber,\n          RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN, hasMessageId,\n          /*doesntReturnArray=*/ true)\n      .length;\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {string}\n */\nexports.getRepeatedIndexedInt64Field_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedInt64Field_asString(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {string}\n */\nexports.getRepeatedIndexedUint64Field_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedUint64Field_asString(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {string}\n */\nexports.getRepeatedIndexedInt64StringField_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedInt64Field_asString(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the a primitive repeated field's value at `index`.\n * @return {string}\n */\nexports.getRepeatedIndexedUint64StringField_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** number */ index, /** !HasMessageId= */ hasMessageId) {\n  const data = exports.getRepeatedUint64Field_asString(\n      message, fieldNumber, RepeatedArrayReturnType.EITHER_FROZEN_OR_UNFROZEN,\n      hasMessageId, /*doesntReturnArray=*/ true);\n  checkRepeatedIndexInRangeForGet(data, index);\n  return data[index];\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {boolean}\n */\nexports.getOneofBooleanFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** boolean= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getBooleanFieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofInt32FieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt32FieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofUint32FieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint32FieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofInt64FieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofInt64FieldWithDefault_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** string= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldWithDefault_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofUint64FieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofUint64FieldWithDefault_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** string= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldWithDefault_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofInt64StringFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** string= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64StringFieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofInt64StringFieldWithDefault_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** string= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldWithDefault_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofUint64StringFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** string= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64StringFieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofUint64StringFieldWithDefault_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** string= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldWithDefault_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {!gbigint}\n */\nexports.getOneofInt64GbigintFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !gbigint= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64GbigintFieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {!gbigint}\n */\nexports.getOneofUint64GbigintFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !gbigint= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64GbigintFieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofFloatingPointFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getFloatingPointFieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofStringFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** string= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getStringFieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {!ByteString}\n */\nexports.getOneofBytesFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** string= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getBytesFieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofEnumFieldWithDefault = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number= */ defaultValue,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getEnumFieldWithDefault(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      defaultValue, hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {boolean}\n */\nexports.getOneofBooleanFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getBooleanFieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofInt32FieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt32FieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofUint32FieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint32FieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofInt64FieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofInt64FieldLegacyNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldLegacyNullable_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofUint64FieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofUint64FieldLegacyNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldLegacyNullable_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofInt64StringFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64StringFieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofInt64StringFieldLegacyNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldLegacyNullable_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofUint64StringFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64StringFieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofUint64StringFieldLegacyNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldLegacyNullable_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {!gbigint}\n */\nexports.getOneofInt64GbigintFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64GbigintFieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {!gbigint}\n */\nexports.getOneofUint64GbigintFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64GbigintFieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofFloatingPointFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getFloatingPointFieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string}\n */\nexports.getOneofStringFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getStringFieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {!ByteString}\n */\nexports.getOneofBytesFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getBytesFieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {T|undefined}\n * @template T\n */\nexports.getOneofWrapperFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** function(new:T, ?Array<?>=) */ ctor,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getWrapperFieldOrUndefined(\n      message, ctor,\n      exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number}\n */\nexports.getOneofEnumFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getEnumFieldLegacyNullable(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {boolean|undefined}\n */\nexports.getOneofBooleanFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getBooleanFieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number|undefined}\n */\nexports.getOneofInt32FieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt32FieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number|undefined}\n */\nexports.getOneofUint32FieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint32FieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number|undefined}\n */\nexports.getOneofInt64FieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string|undefined}\n */\nexports.getOneofInt64FieldOrUndefined_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldOrUndefined_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number|undefined}\n */\nexports.getOneofUint64FieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string|undefined}\n */\nexports.getOneofUint64FieldOrUndefined_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldOrUndefined_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string|undefined}\n */\nexports.getOneofInt64StringFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64StringFieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string|undefined}\n */\nexports.getOneofInt64StringFieldOrUndefined_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldOrUndefined_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string|undefined}\n */\nexports.getOneofUint64StringFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64StringFieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string|undefined}\n */\nexports.getOneofUint64StringFieldOrUndefined_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldOrUndefined_asString(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {!gbigint|undefined}\n */\nexports.getOneofInt64GbigintFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64GbigintFieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {!gbigint|undefined}\n */\nexports.getOneofUint64GbigintFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64GbigintFieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number|undefined}\n */\nexports.getOneofFloatingPointFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getFloatingPointFieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {string|undefined}\n */\nexports.getOneofStringFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getStringFieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {!ByteString|undefined}\n */\nexports.getOneofBytesFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getBytesFieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {T|undefined}\n * @template T\n */\nexports.getReadonlyOneofWrapperFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** function(new:T, ?Array<?>=) */ ctor,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getReadonlyWrapperFieldOrUndefined(\n      message, ctor,\n      exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * Gets the value of a oneof field.\n * @return {number|undefined}\n */\nexports.getOneofEnumFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** !HasMessageId= */ hasMessageId) {\n  return exports.getEnumFieldOrUndefined(\n      message, exports.isOneofCase(message, oneof, fieldNumber, hasMessageId),\n      hasMessageId);\n};\n\n/**\n * @return {boolean|undefined}\n */\nexports.getBooleanFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {boolean|undefined} */ (\n      exports.getBooleanFieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {boolean}\n */\nexports.getBooleanFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {boolean} */ (exports.getBooleanFieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {number|undefined}\n */\nexports.getInt32FieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number|undefined} */ (\n      exports.getInt32FieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {number}\n */\nexports.getInt32FieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number} */ (exports.getInt32FieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {number|undefined}\n */\nexports.getUint32FieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number|undefined} */ (\n      exports.getUint32FieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {number}\n */\nexports.getUint32FieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number} */ (exports.getUint32FieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {number|undefined}\n */\nexports.getInt64FieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number|undefined} */ (\n      exports.getInt64FieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {number}\n */\nexports.getInt64FieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number} */ (exports.getInt64FieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {number|undefined}\n */\nexports.getUint64FieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number|undefined} */ (\n      exports.getUint64FieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {number}\n */\nexports.getUint64FieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number} */ (exports.getUint64FieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {string|undefined}\n */\nexports.getInt64StringFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string|undefined} */ (\n      exports.getInt64StringFieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {string}\n */\nexports.getInt64StringFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string} */ (exports.getInt64StringFieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {string|undefined}\n */\nexports.getUint64StringFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string|undefined} */ (\n      exports.getUint64StringFieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {string}\n */\nexports.getUint64StringFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string} */ (exports.getUint64StringFieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {!gbigint|undefined}\n */\nexports.getInt64GbigintFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {!gbigint|undefined} */ (\n      exports.getInt64GbigintFieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {!gbigint}\n */\nexports.getInt64GbigintFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {!gbigint} */ (exports.getInt64GbigintFieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {!gbigint|undefined}\n */\nexports.getUint64GbigintFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {!gbigint|undefined} */ (\n      exports.getUint64GbigintFieldNullable(\n          message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {!gbigint}\n */\nexports.getUint64GbigintFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {!gbigint} */ (exports.getUint64GbigintFieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {number|undefined}\n */\nexports.getFloatingPointFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number|undefined} */ (exports.getFloatingPointFieldNullable(\n      message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {number}\n */\nexports.getFloatingPointFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number} */ (exports.getFloatingPointFieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {string|undefined}\n */\nexports.getStringFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string|undefined} */ (\n      exports.getStringFieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {string}\n */\nexports.getStringFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string} */ (exports.getStringFieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {!ByteString|undefined}\n */\nexports.getBytesFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {!ByteString|undefined} */ (\n      exports.getBytesFieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {!ByteString}\n */\nexports.getBytesFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {!ByteString} */ (exports.getBytesFieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {number|undefined}\n */\nexports.getEnumFieldOrUndefined = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number|undefined} */ (\n      exports.getEnumFieldNullable(message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {number}\n */\nexports.getEnumFieldLegacyNullable = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {number} */ (exports.getEnumFieldNullable(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {string|undefined}\n */\nexports.getInt64FieldOrUndefined_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string|undefined} */ (\n      exports.getInt64FieldNullable_asString(\n          message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {string}\n */\nexports.getInt64FieldLegacyNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string} */ (exports.getInt64FieldNullable_asString(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {string|undefined}\n */\nexports.getUint64FieldOrUndefined_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string|undefined} */ (\n      exports.getUint64FieldNullable_asString(\n          message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {string}\n */\nexports.getUint64FieldLegacyNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string} */ (exports.getUint64FieldNullable_asString(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {string|undefined}\n */\nexports.getInt64StringFieldOrUndefined_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string|undefined} */ (\n      exports.getInt64FieldNullable_asString(\n          message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {string}\n */\nexports.getInt64StringFieldLegacyNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string} */ (exports.getInt64FieldNullable_asString(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {string|undefined}\n */\nexports.getUint64StringFieldOrUndefined_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string|undefined} */ (\n      exports.getUint64FieldNullable_asString(\n          message, fieldNumber, hasMessageId));\n};\n\n/**\n * @return {string}\n */\nexports.getUint64StringFieldLegacyNullable_asString = function(\n    /** !InternalMessage */ message, /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return /** @type {string} */ (exports.getUint64FieldNullable_asString(\n      message, fieldNumber, hasMessageId, LEGACY_NULLABLE));\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setBooleanField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** boolean|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishBoolean(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3BooleanField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** boolean|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishBoolean(value), false, hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofBooleanField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** boolean|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof, checkNullishBoolean(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setInt32Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishInt32(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3Int32Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishInt32(value), 0, hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofInt32Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof, checkNullishInt32(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setUint32Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishUint32(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3Uint32Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishUint32(value), 0, hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofUint32Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof, checkNullishUint32(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setInt64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishInt64(value, requestedFormat),\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3Int64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishInt64(value, requestedFormat), '0',\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofInt64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof, checkNullishInt64(value, requestedFormat),\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setUint64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishUint64(value, requestedFormat),\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3Uint64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishUint64(value, requestedFormat), '0',\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofUint64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof, checkNullishUint64(value, requestedFormat),\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setInt64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishInt64String(value, requestedFormat),\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3Int64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishInt64String(value, requestedFormat),\n      '0', hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofInt64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof,\n      checkNullishInt64String(value, requestedFormat), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setUint64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishUint64String(value, requestedFormat),\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3Uint64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishUint64String(value, requestedFormat),\n      '0', hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofUint64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /** number|string|!gbigint|null|undefined */ value,\n    /** !TypeSpecificApiFormat= */ requestedFormat,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof,\n      checkNullishUint64String(value, requestedFormat), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setFloatingPointField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishFloatingPoint(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3FloatingPointField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishFloatingPoint(value), 0, hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofFloatingPointField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof, checkNullishFloatingPoint(value),\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setStringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** string|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishString(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** string|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishString(value), '', hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofStringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** string|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof, checkNullishString(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setBytesField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** string|!Uint8Array|!ByteString|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishBytes(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3BytesField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** string|!Uint8Array|!ByteString|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishBytes(value), ByteString.empty(),\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofBytesField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof,\n    /** string|!Uint8Array|!ByteString|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof, checkNullishBytes(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setEnumField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return exports.setField(\n      message, fieldNumber, checkNullishEnum(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setProto3EnumField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|null|undefined */ value, /** !HasMessageId= */ hasMessageId) {\n  return setFieldIgnoringDefault(\n      message, fieldNumber, checkNullishEnum(value), 0, hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setOneofEnumField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number> */ oneof, /** number|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.setOneofField(\n      message, fieldNumber, oneof, checkNullishEnum(value), hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedBooleanField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<boolean>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkBoolean, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedBooleanField = function(\n    /** T */ message, /** number */ fieldNumber, /** boolean */ value,\n    /** number= */ index, /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkBoolean, value, index, coerceToNullishBoolean,\n      hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedBooleanField = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkBoolean, undefined, index,\n      coerceToNullishBoolean, hasMessageId, /*deleteCount=*/ 1,\n      /*isSpreadable=*/ false, /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedBooleanField = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<boolean> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkBoolean, values, coerceToNullishBoolean,\n      hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedBooleanField = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** boolean */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkBoolean, index, value, coerceToNullishBoolean,\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedInt32Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkInt32, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedInt32Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ value,\n    /** number= */ index, /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkInt32, value, index, coerceToNullishInt32,\n      hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedInt32Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkInt32, undefined, index, coerceToNullishInt32,\n      hasMessageId, /*deleteCount=*/ 1, /*isSpreadable=*/ false,\n      /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedInt32Field = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<number> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkInt32, values, coerceToNullishInt32,\n      hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedInt32Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** number */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkInt32, index, value, coerceToNullishInt32,\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedUint32Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkUint32, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedUint32Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ value,\n    /** number= */ index, /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkUint32, value, index, coerceToNullishUint32,\n      hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedUint32Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkUint32, undefined, index,\n      coerceToNullishUint32, hasMessageId, /*deleteCount=*/ 1,\n      /*isSpreadable=*/ false, /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedUint32Field = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<number> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkUint32, values, coerceToNullishUint32,\n      hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedUint32Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** number */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkUint32, index, value, coerceToNullishUint32,\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedInt64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number|string|!gbigint>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkInt64, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedInt64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint */ value, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkInt64, value, index, coerceToNullishInt64,\n      hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedInt64Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkInt64, undefined, index, coerceToNullishInt64,\n      hasMessageId, /*deleteCount=*/ 1, /*isSpreadable=*/ false,\n      /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedInt64Field = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<number|string|!gbigint> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkInt64, values, coerceToNullishInt64,\n      hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedInt64Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** number|string|!gbigint */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkInt64, index, value, coerceToNullishInt64,\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedUint64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number|string|!gbigint>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkUint64, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedUint64Field = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint */ value, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkUint64, value, index, coerceToNullishUint64,\n      hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedUint64Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkUint64, undefined, index,\n      coerceToNullishUint64, hasMessageId, /*deleteCount=*/ 1,\n      /*isSpreadable=*/ false, /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedUint64Field = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<number|string|!gbigint> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkUint64, values, coerceToNullishUint64,\n      hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedUint64Field = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** number|string|!gbigint */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkUint64, index, value, coerceToNullishUint64,\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedInt64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number|string|!gbigint>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkInt64String, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedInt64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint */ value, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkInt64String, value, index,\n      coerceToNullishInt64String, hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedInt64StringField = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkInt64String, undefined, index,\n      coerceToNullishInt64String, hasMessageId, /*deleteCount=*/ 1,\n      /*isSpreadable=*/ false, /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedInt64StringField = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<number|string|!gbigint> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkInt64String, values,\n      coerceToNullishInt64String, hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedInt64StringField = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** number|string|!gbigint */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkInt64String, index, value,\n      coerceToNullishInt64String, hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedUint64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number|string|!gbigint>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkUint64String, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedUint64StringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** number|string|!gbigint */ value, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkUint64String, value, index,\n      coerceToNullishUint64String, hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedUint64StringField = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkUint64String, undefined, index,\n      coerceToNullishUint64String, hasMessageId, /*deleteCount=*/ 1,\n      /*isSpreadable=*/ false, /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedUint64StringField = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<number|string|!gbigint> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkUint64String, values,\n      coerceToNullishUint64String, hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedUint64StringField = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** number|string|!gbigint */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkUint64String, index, value,\n      coerceToNullishUint64String, hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedFloatingPointField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkFloatingPoint, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedFloatingPointField = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ value,\n    /** number= */ index, /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkFloatingPoint, value, index,\n      coerceToNullishFloatingPoint, hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedFloatingPointField = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkFloatingPoint, undefined, index,\n      coerceToNullishFloatingPoint, hasMessageId, /*deleteCount=*/ 1,\n      /*isSpreadable=*/ false, /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedFloatingPointField = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<number> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkFloatingPoint, values,\n      coerceToNullishFloatingPoint, hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedFloatingPointField = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** number */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkFloatingPoint, index, value,\n      coerceToNullishFloatingPoint, hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedStringField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<string>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkString, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedStringField = function(\n    /** T */ message, /** number */ fieldNumber, /** string */ value,\n    /** number= */ index, /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkString, value, index, coerceToNullishString,\n      hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedStringField = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkString, undefined, index,\n      coerceToNullishString, hasMessageId, /*deleteCount=*/ 1,\n      /*isSpreadable=*/ false, /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedStringField = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<string> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkString, values, coerceToNullishString,\n      hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedStringField = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** string */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkString, index, value, coerceToNullishString,\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedBytesField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<string|!Uint8Array|!ByteString>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkBytes, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedBytesField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** string|!Uint8Array|!ByteString */ value, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkBytes, value, index, coerceToNullishBytes,\n      hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedBytesField = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkBytes, undefined, index, coerceToNullishBytes,\n      hasMessageId, /*deleteCount=*/ 1, /*isSpreadable=*/ false,\n      /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedBytesField = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<string|!Uint8Array|!ByteString> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkBytes, values, coerceToNullishBytes,\n      hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedBytesField = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** string|!Uint8Array|!ByteString */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkBytes, index, value, coerceToNullishBytes,\n      hasMessageId);\n};\n\n/**\n * @return {T}\n * @template T\n */\nexports.setRepeatedEnumField = function(\n    /** T */ message, /** number */ fieldNumber,\n    /** !ReadonlyArray<number>|null|undefined */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedPrimitiveField(\n      message, fieldNumber, value, checkEnum, hasMessageId);\n};\n\n/**\n * Adds a value to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addToRepeatedEnumField = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ value,\n    /** number= */ index, /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkEnum, value, index, coerceToNullishEnum,\n      hasMessageId);\n};\n\n/**\n * Removes a value from a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.removeFromRepeatedEnumField = function(\n    /** T */ message, /** number */ fieldNumber, /** number= */ index,\n    /** !HasMessageId= */ hasMessageId) {\n  return spliceRepeatedPrimitiveField(\n      message, fieldNumber, checkEnum, undefined, index, coerceToNullishEnum,\n      hasMessageId, /*deleteCount=*/ 1, /*isSpreadable=*/ false,\n      /*removeOnly=*/ true);\n};\n\n/**\n * Adds a collection of values to a repeated primitive field.\n * @return {T}\n * @template T\n */\nexports.addAllToRepeatedEnumField = function(\n    /** T */ message,\n    /** number */ fieldNumber,\n    /** !Iterable<number> */ values,\n    /** !HasMessageId= */ hasMessageId) {\n  return addAllToRepeatedFieldImpl(\n      message, fieldNumber, checkEnum, values, coerceToNullishEnum,\n      hasMessageId);\n};\n\n/**\n * Sets the a primitive repeated field's value at `index`.\n * @return {T}\n * @template T\n */\nexports.setRepeatedIndexedEnumField = function(\n    /** T */ message, /** number */ fieldNumber, /** number */ index,\n    /** number */ value, /** !HasMessageId= */ hasMessageId) {\n  return setRepeatedIndexedFieldImpl(\n      message, fieldNumber, checkEnum, index, value, coerceToNullishEnum,\n      hasMessageId);\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasBooleanField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getBooleanFieldOrUndefined(\n             message, fieldNumber, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofBooleanField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofBooleanFieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasInt32Field = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt32FieldOrUndefined(message, fieldNumber, hasMessageId) !=\n      null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofInt32Field = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofInt32FieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasUint32Field = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint32FieldOrUndefined(\n             message, fieldNumber, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofUint32Field = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofUint32FieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasInt64Field = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64FieldOrUndefined(message, fieldNumber, hasMessageId) !=\n      null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofInt64Field = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofInt64FieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasUint64Field = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64FieldOrUndefined(\n             message, fieldNumber, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofUint64Field = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofUint64FieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasInt64StringField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getInt64StringFieldOrUndefined(\n             message, fieldNumber, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofInt64StringField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofInt64StringFieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasUint64StringField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getUint64StringFieldOrUndefined(\n             message, fieldNumber, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofUint64StringField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofUint64StringFieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasFloatingPointField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getFloatingPointFieldOrUndefined(\n             message, fieldNumber, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofFloatingPointField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofFloatingPointFieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasStringField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getStringFieldOrUndefined(\n             message, fieldNumber, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofStringField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofStringFieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasBytesField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getBytesFieldOrUndefined(message, fieldNumber, hasMessageId) !=\n      null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofBytesField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofBytesFieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasEnumField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getEnumFieldOrUndefined(message, fieldNumber, hasMessageId) !=\n      null;\n};\n\n/**\n * Returns the presence of a field.\n * @return {boolean}\n */\nexports.hasOneofEnumField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyArray<number> */ oneof,\n    /** !HasMessageId= */ hasMessageId) {\n  return exports.getOneofEnumFieldOrUndefined(\n             message, fieldNumber, oneof, hasMessageId) != null;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,boolean>}\n */\nexports.getBooleanBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, booleanToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanBooleanMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanBooleanMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanBooleanMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanBooleanMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,number>}\n */\nexports.getBooleanInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, int32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanInt32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanInt32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanInt32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanInt32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,number>}\n */\nexports.getBooleanUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, uint32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanUint32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanUint32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanUint32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanUint32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,number>}\n */\nexports.getBooleanInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, int64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanInt64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanInt64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanInt64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanInt64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,number>}\n */\nexports.getBooleanUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, uint64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanUint64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanUint64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanUint64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanUint64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,number>}\n */\nexports.getBooleanFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, floatToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanFloatingPointMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanFloatingPointMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanFloatingPointMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanFloatingPointMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,string>}\n */\nexports.getBooleanStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, stringToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanStringMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanStringMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanStringMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanStringMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,!ByteString>}\n */\nexports.getBooleanBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, bytesToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanBytesMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanBytesMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanBytesMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanBytesMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,?>}\n */\nexports.getBooleanEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, enumToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanEnumMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanEnumMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanEnumMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanEnumMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,?>}\n */\nexports.getReadonlyBooleanWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getReadonlyMapField(\n      message, fieldNumber, valueCtor, booleanKeyToApiForMaps,\n      /* valueToApi= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,?>}\n */\nexports.getBooleanWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getMessageValuedMapField(\n      message, fieldNumber, valueCtor, booleanKeyToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyBooleanWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getReadonlyBooleanWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanWrapperMapField(\n        message, fieldNumber, newMap, valueCtor, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyBooleanWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,!gbigint>}\n */\nexports.getBooleanInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, int64GbigintToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanInt64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanInt64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanInt64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanInt64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<boolean,!gbigint>}\n */\nexports.getBooleanUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, booleanKeyToApiForMaps, uint64GbigintToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putBooleanUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanUint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllBooleanUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getBooleanUint64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setBooleanUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllBooleanUint64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteBooleanUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getBooleanUint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,boolean>}\n */\nexports.getInt32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, booleanToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32BooleanMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32BooleanMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32BooleanMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32BooleanMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, int32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Int32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32Int32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32Int32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Int32MapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, uint32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Uint32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32Uint32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32Uint32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Uint32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, int64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Int64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32Int64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32Int64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Int64MapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, uint64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Uint64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32Uint64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32Uint64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Uint64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, floatToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32FloatingPointMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32FloatingPointMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32FloatingPointMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32FloatingPointMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,string>}\n */\nexports.getInt32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, stringToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32StringMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32StringMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32StringMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32StringMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,!ByteString>}\n */\nexports.getInt32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, bytesToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32BytesMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32BytesMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32BytesMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32BytesMapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getInt32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, enumToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32EnumMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32EnumMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32EnumMapField(message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32EnumMapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getReadonlyInt32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getReadonlyMapField(\n      message, fieldNumber, valueCtor, int32KeyToApiForMaps,\n      /* valueToApi= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getInt32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getMessageValuedMapField(\n      message, fieldNumber, valueCtor, int32KeyToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyInt32WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getReadonlyInt32WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32WrapperMapField(\n        message, fieldNumber, newMap, valueCtor, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyInt32WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,!gbigint>}\n */\nexports.getInt32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, int64GbigintToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Int64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32Int64GbigintMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32Int64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Int64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,!gbigint>}\n */\nexports.getInt32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int32KeyToApiForMaps, uint64GbigintToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Uint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt32Uint64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt32Uint64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt32Uint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,boolean>}\n */\nexports.getUint32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, booleanToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32BooleanMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32BooleanMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32BooleanMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32BooleanMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, int32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Int32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32Int32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32Int32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Int32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, uint32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Uint32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32Uint32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32Uint32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Uint32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, int64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Int64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32Int64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32Int64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Int64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, uint64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Uint64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32Uint64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32Uint64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Uint64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, floatToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32FloatingPointMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32FloatingPointMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32FloatingPointMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32FloatingPointMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,string>}\n */\nexports.getUint32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, stringToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32StringMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32StringMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32StringMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32StringMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,!ByteString>}\n */\nexports.getUint32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, bytesToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32BytesMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32BytesMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32BytesMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32BytesMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getUint32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, enumToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32EnumMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32EnumMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32EnumMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32EnumMapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getReadonlyUint32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getReadonlyMapField(\n      message, fieldNumber, valueCtor, uint32KeyToApiForMaps,\n      /* valueToApi= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getUint32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getMessageValuedMapField(\n      message, fieldNumber, valueCtor, uint32KeyToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyUint32WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getReadonlyUint32WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32WrapperMapField(\n        message, fieldNumber, newMap, valueCtor, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyUint32WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,!gbigint>}\n */\nexports.getUint32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, int64GbigintToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Int64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32Int64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32Int64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32Int64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Int64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,!gbigint>}\n */\nexports.getUint32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint32KeyToApiForMaps, uint64GbigintToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Uint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint32Uint64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint32Uint64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint32Uint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint32Uint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,boolean>}\n */\nexports.getInt64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64KeyToApiForMaps, booleanToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64BooleanMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64BooleanMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64BooleanMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64BooleanMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64KeyToApiForMaps, int32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64Int32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64Int32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64Int32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64Int32MapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64KeyToApiForMaps, uint32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64Uint32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64Uint32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64Uint32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64Uint32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64KeyToApiForMaps, int64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64Int64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64Int64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64Int64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64Int64MapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64KeyToApiForMaps, uint64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64Uint64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64Uint64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64Uint64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64Uint64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getInt64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64KeyToApiForMaps, floatToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64FloatingPointMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64FloatingPointMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64FloatingPointMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64FloatingPointMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,string>}\n */\nexports.getInt64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64KeyToApiForMaps, stringToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64StringMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64StringMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64StringMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64StringMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,!ByteString>}\n */\nexports.getInt64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64KeyToApiForMaps, bytesToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64BytesMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64BytesMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64BytesMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64BytesMapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getInt64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64KeyToApiForMaps, enumToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64EnumMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64EnumMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64EnumMapField(message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64EnumMapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getReadonlyInt64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getReadonlyMapField(\n      message, fieldNumber, valueCtor, int64KeyToApiForMaps,\n      /* valueToApi= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getInt64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getMessageValuedMapField(\n      message, fieldNumber, valueCtor, int64KeyToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyInt64WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getReadonlyInt64WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64WrapperMapField(\n        message, fieldNumber, newMap, valueCtor, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyInt64WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,boolean>}\n */\nexports.getUint64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64KeyToApiForMaps, booleanToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64BooleanMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64BooleanMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64BooleanMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64BooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64BooleanMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64KeyToApiForMaps, int32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64Int32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64Int32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64Int32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64Int32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64Int32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64KeyToApiForMaps, uint32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64Uint32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64Uint32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64Uint32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64Uint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64Uint32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64KeyToApiForMaps, int64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64Int64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64Int64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64Int64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64Int64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64Int64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64KeyToApiForMaps, uint64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64Uint64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64Uint64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64Uint64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64Uint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64Uint64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,number>}\n */\nexports.getUint64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64KeyToApiForMaps, floatToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64FloatingPointMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64FloatingPointMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64FloatingPointMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64FloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64FloatingPointMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,string>}\n */\nexports.getUint64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64KeyToApiForMaps, stringToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64StringMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64StringMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64StringMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64StringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64StringMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,!ByteString>}\n */\nexports.getUint64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64KeyToApiForMaps, bytesToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64BytesMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64BytesMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64BytesMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64BytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64BytesMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getUint64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64KeyToApiForMaps, enumToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64EnumMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64EnumMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64EnumMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64EnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64EnumMapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getReadonlyUint64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getReadonlyMapField(\n      message, fieldNumber, valueCtor, uint64KeyToApiForMaps,\n      /* valueToApi= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<number,?>}\n */\nexports.getUint64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getMessageValuedMapField(\n      message, fieldNumber, valueCtor, uint64KeyToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyUint64WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getReadonlyUint64WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64WrapperMapField(\n        message, fieldNumber, newMap, valueCtor, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64WrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyUint64WrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,boolean>}\n */\nexports.getStringBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, booleanToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringBooleanMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringBooleanMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringBooleanMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringBooleanMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,number>}\n */\nexports.getStringInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, int32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringInt32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringInt32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringInt32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringInt32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,number>}\n */\nexports.getStringUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, uint32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringUint32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringUint32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringUint32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringUint32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,number>}\n */\nexports.getStringInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, int64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringInt64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringInt64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringInt64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringInt64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringInt64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,number>}\n */\nexports.getStringUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, uint64ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringUint64MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringUint64MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringUint64MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringUint64MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringUint64MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,number>}\n */\nexports.getStringFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, floatToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringFloatingPointMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringFloatingPointMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringFloatingPointMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringFloatingPointMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,string>}\n */\nexports.getStringStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, stringToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringStringMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringStringMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringStringMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringStringMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,!ByteString>}\n */\nexports.getStringBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, bytesToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringBytesMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringBytesMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringBytesMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringBytesMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,?>}\n */\nexports.getStringEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, enumToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringEnumMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringEnumMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringEnumMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringEnumMapField(message, fieldNumber, hasMessageId).delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,?>}\n */\nexports.getReadonlyStringWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getReadonlyMapField(\n      message, fieldNumber, valueCtor, stringKeyToApiForMaps,\n      /* valueToApi= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,?>}\n */\nexports.getStringWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getMessageValuedMapField(\n      message, fieldNumber, valueCtor, stringKeyToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyStringWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getReadonlyStringWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringWrapperMapField(\n        message, fieldNumber, newMap, valueCtor, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyStringWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,!gbigint>}\n */\nexports.getStringInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, int64GbigintToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringInt64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringInt64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringInt64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringInt64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<string,!gbigint>}\n */\nexports.getStringUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, stringKeyToApiForMaps, uint64GbigintToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putStringUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringUint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllStringUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getStringUint64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setStringUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllStringUint64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteStringUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getStringUint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,boolean>}\n */\nexports.getInt64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64GbigintKeyToApiForMaps, booleanToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintBooleanMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64GbigintBooleanMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintBooleanMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintBooleanMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,number>}\n */\nexports.getInt64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64GbigintKeyToApiForMaps, int32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintInt32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64GbigintInt32MapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintInt32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintInt32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,number>}\n */\nexports.getInt64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64GbigintKeyToApiForMaps, uint32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintUint32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64GbigintUint32MapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintUint32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintUint32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,number>}\n */\nexports.getInt64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64GbigintKeyToApiForMaps, floatToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getInt64GbigintFloatingPointMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64GbigintFloatingPointMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintFloatingPointMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getInt64GbigintFloatingPointMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,string>}\n */\nexports.getInt64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64GbigintKeyToApiForMaps, stringToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintStringMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64GbigintStringMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintStringMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintStringMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,!ByteString>}\n */\nexports.getInt64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64GbigintKeyToApiForMaps, bytesToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintBytesMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64GbigintBytesMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintBytesMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintBytesMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,?>}\n */\nexports.getInt64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64GbigintKeyToApiForMaps, enumToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintEnumMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64GbigintEnumMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintEnumMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getInt64GbigintEnumMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,?>}\n */\nexports.getReadonlyInt64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getReadonlyMapField(\n      message, fieldNumber, valueCtor, int64GbigintKeyToApiForMaps,\n      /* valueToApi= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,?>}\n */\nexports.getInt64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getMessageValuedMapField(\n      message, fieldNumber, valueCtor, int64GbigintKeyToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyInt64GbigintWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getReadonlyInt64GbigintWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintWrapperMapField(\n        message, fieldNumber, newMap, valueCtor, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyInt64GbigintWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,!gbigint>}\n */\nexports.getInt64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64GbigintKeyToApiForMaps,\n      int64GbigintToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getInt64GbigintInt64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64GbigintInt64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintInt64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getInt64GbigintInt64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,!gbigint>}\n */\nexports.getInt64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, int64GbigintKeyToApiForMaps,\n      uint64GbigintToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putInt64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getInt64GbigintUint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllInt64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getInt64GbigintUint64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setInt64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllInt64GbigintUint64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteInt64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getInt64GbigintUint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,boolean>}\n */\nexports.getUint64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64GbigintKeyToApiForMaps, booleanToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintBooleanMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64GbigintBooleanMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintBooleanMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintBooleanMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintBooleanMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,number>}\n */\nexports.getUint64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64GbigintKeyToApiForMaps, int32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintInt32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64GbigintInt32MapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintInt32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintInt32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintInt32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,number>}\n */\nexports.getUint64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64GbigintKeyToApiForMaps, uint32ToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintUint32MapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64GbigintUint32MapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintUint32MapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintUint32MapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintUint32MapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,number>}\n */\nexports.getUint64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64GbigintKeyToApiForMaps, floatToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getUint64GbigintFloatingPointMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64GbigintFloatingPointMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintFloatingPointMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintFloatingPointMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getUint64GbigintFloatingPointMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,string>}\n */\nexports.getUint64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64GbigintKeyToApiForMaps, stringToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintStringMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64GbigintStringMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintStringMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintStringMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintStringMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,!ByteString>}\n */\nexports.getUint64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64GbigintKeyToApiForMaps, bytesToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintBytesMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64GbigintBytesMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintBytesMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintBytesMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintBytesMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,?>}\n */\nexports.getUint64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64GbigintKeyToApiForMaps, enumToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintEnumMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64GbigintEnumMapField(message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintEnumMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintEnumMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.getUint64GbigintEnumMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,?>}\n */\nexports.getReadonlyUint64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getReadonlyMapField(\n      message, fieldNumber, valueCtor, uint64GbigintKeyToApiForMaps,\n      /* valueToApi= */ undefined, hasMessageId);\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,?>}\n */\nexports.getUint64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  return getMessageValuedMapField(\n      message, fieldNumber, valueCtor, uint64GbigintKeyToApiForMaps,\n      hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyUint64GbigintWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getReadonlyUint64GbigintWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** ?= */ valueCtor, /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintWrapperMapField(\n        message, fieldNumber, newMap, valueCtor, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintWrapperMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ?= */ valueCtor,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getReadonlyUint64GbigintWrapperMapField(\n          message, fieldNumber, valueCtor, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,!gbigint>}\n */\nexports.getUint64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64GbigintKeyToApiForMaps,\n      int64GbigintToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getUint64GbigintInt64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64GbigintInt64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintInt64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintInt64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getUint64GbigintInt64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n/**\n * Gets the value of a map field.\n * @return {!Map<!gbigint,!gbigint>}\n */\nexports.getUint64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !HasMessageId= */ hasMessageId) {\n  return getPrimitiveMapField(\n      message, fieldNumber, uint64GbigintKeyToApiForMaps,\n      uint64GbigintToApiForMaps, hasMessageId);\n};\n\n/**\n * Sets a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.putUint64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key, /** ? */ value,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getUint64GbigintUint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .set(key, value);\n  return message;\n};\n\n/**\n * Sets all entries from the passed in map.\n * @return {T}\n * @template T\n */\nexports.putAllUint64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?> */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  ensureMutable(message);\n  newMap.forEach(\n      mapSetter,\n      exports.getUint64GbigintUint64GbigintMapField(\n          message, fieldNumber, hasMessageId));\n  return message;\n};\n\n/**\n * Replaces entries with the passed in map.\n * @return {?}\n */\nexports.setUint64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** !ReadonlyMap<?, ?>|undefined */ newMap,\n    /** !HasMessageId= */ hasMessageId) {\n  exports.clearMapField(message, fieldNumber, hasMessageId);\n  if (newMap) {\n    exports.putAllUint64GbigintUint64GbigintMapField(\n        message, fieldNumber, newMap, hasMessageId);\n  }\n  return message;\n};\n\n/**\n * Deletes a single entry of a map field.\n * @return {T}\n * @template T\n */\nexports.deleteUint64GbigintUint64GbigintMapField = function(\n    /** !InternalMessage */ message,\n    /** number */ fieldNumber, /** ? */ key,\n    /** !HasMessageId= */ hasMessageId) {\n  exports\n      .getUint64GbigintUint64GbigintMapField(message, fieldNumber, hasMessageId)\n      .delete(key);\n  return message;\n};\n\n// END AUTO-GENERATED\n// //////////////////////////////////////////////////////////\n","/**\n * @fileoverview Internal helpers for JSPB field accessors. See\n * go/jspb-interface-type-checking-requirements for more information.\n *\n * This package defines a library of type assertions and coercions for use by\n * JSPB generated code, and specifies the acceptable types in use by the JSPB\n * wire format and API surface for all primitive types, {boolean, string, bytes,\n * float, double, int32, uint32, int64, uint64}.\n *\n * In this abstraction, the \"wire\" is not quite the wire, but rather the JSPB\n * array. All wire types produced by this API are convertible to the actual\n * wire format via the convertToJsonFormat transformation.\n *\n * For each type, if isValidWire${type}, then the value is a valid array\n * representation and can be safely coerced to a user-visible representation via\n * ${type}ToApi. If not, JSPB ignores the wire value, as if it were `null`.\n *\n * For each type, if isValidApi${type}, then the value is a valid API\n * representation (such as we would receive in a setter method) and can be\n * safely stored in our internal state, or converted to a array representation\n * via ${type}ToWire. If this check does not pass, implementations should\n * assert-fail.\n *\n * @public\n */\ngoog.module('jspb.internal_accessor_helpers');\n\nconst asserts = goog.require('goog.asserts');\nconst {ArrayStateFlags, TypeSpecificApiFormat, getArrayState, getDefaultTypeSpecificApiFormat, markArrayImmutable, setArrayState} = goog.require('jspb.internal_array_state');\nconst {ByteString} = goog.require('jspb.bytestring');\nconst {CheckLevel, DETAILED_JSPB_ASSERTS, getTypeCheck32BitIntFields, getTypeCheck64BitIntFields, getTypeCheck64BitIntFieldsAreInRange, getTypeCheckEnumFields, isBigIntAvailable, shouldCoerce64BitIntFieldsByJsType} = goog.require('jspb.internal_options');\nconst {DEFAULT_IMMUTABLE_INSTANCE_SYMBOL} = goog.require('jspb.internal_symbols');\nconst {InternalMessage, bytesAsByteString, getInternalArray, isInternalMessage} = goog.require('jspb.internal');\nconst {asyncThrowWarning, makeTypeError} = goog.require('jspb.exceptions');\nconst {cast} = goog.require('google3.javascript.common.asserts.asserts');\nconst {checkExhaustive} = goog.require('google3.javascript.typescript.contrib.check');\nconst {getSplit64High, getSplit64Low, joinInt64, joinSignedDecimalString, joinUint64, joinUnsignedDecimalString, splitDecimalString, splitInt64} = goog.require('jspb.utils');\nconst {isBigInt: isBigIntImpl, isNumber, isString} = goog.require('google3.javascript.common.asserts.guards');\nconst {isSafeInt52: isSafeInt52Impl, isValidSignedInt64: isValidSignedInt64Impl, toGbigint} = goog.require('google3.javascript.common.bigint.index');\nconst {withoutLogging} = goog.require('jspb.internal_operations');\n\n/** @const {function(number, bigint): bigint} */\nconst bigintAsIntN = /** @pureOrBreakMyCode */ (\n    /** @type {?} */ (\n        typeof BigInt === 'function' ? BigInt.asIntN : undefined));\n\n/** @const {function(number, bigint): bigint} */\nconst bigintAsUintN = /** @pureOrBreakMyCode */ (\n    /** @type {?} */ (\n        typeof BigInt === 'function' ? BigInt.asUintN : undefined));\n\n/** @const {function(number): boolean} */\nconst isSafeInteger = Number.isSafeInteger;\n\n/** @const {function(number): boolean} */\nconst numberIsFinite = Number.isFinite;\n\n/** @const {function(number): number} */\nconst trunc = Math.trunc;\n\n/** @const {number} */\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;\n\nconst /** !gbigint */ GBIGINT_ZERO = /** @pureOrBreakMyCode */ (toGbigint(0));\n\n/**\n * @param {!gbigint|bigint} value\n * @return {boolean}\n * @requireInlining\n */\nfunction isValidSignedInt64(value) {\n  return /** @type {!Function} */ (isValidSignedInt64Impl)(value);\n}\n\n/**\n * @param {!gbigint|bigint} value\n * @return {boolean}\n * @requireInlining\n */\nfunction isSafeInt52(value) {\n  return /** @type {!Function} */ (isSafeInt52Impl)(value);\n}\n\n/**\n * @param {*} value\n * @return {boolean}\n * @requireInlining\n */\nfunction isBigInt(value) {\n  return /** @type {!Function} */ (isBigIntImpl)(value);\n}\n\n/**\n * @param {*} value\n * @return {number}\n */\nfunction checkFloatingPoint(value) {\n  if (typeof value !== 'number') {\n    throw new Error(`Value of float/double field must be a number, found ${\n        typeof value}: ${value}`);\n  }\n  return /** @type {number} */ (value);\n}\n\n/**\n * @param {number|null|undefined} value\n * @return {number|null|undefined}\n */\nfunction checkNullishFloatingPoint(value) {\n  if (value == null) return value;\n  return checkFloatingPoint(value);\n}\n\n/** @return {number|undefined|null} */\nfunction coerceToNullishFloatingPoint(/** ? */ value) {\n  if (value == null || typeof value === 'number') {\n    return value;\n  } else if (value === 'NaN' || value === 'Infinity' || value === '-Infinity') {\n    return Number(value);\n  } else {\n    return undefined;\n  }\n}\n\n/** @return {string} */\nfunction ctorName(/** function(new: ?, ...)*/ ctor) {\n  return ctor.displayName || ctor.name || 'unknown type name';\n}\n\n/** @return {!ByteString|undefined|null} */\nfunction coerceToNullishBytes(/** ? */ value) {\n  if (value == null || value instanceof ByteString) return value;\n  if (typeof value === 'string') {\n    return ByteString.fromBase64(value);\n  }\n  // TODO(b/396420284): remove.\n  asserts.assert(!(value instanceof Uint8Array));\n  return undefined;\n}\n\n/** @return {!ByteString} */\nfunction checkBytes(\n    /** string|!Uint8Array|!ByteString|null|undefined */ value) {\n  return /** @type {!ByteString} */ (bytesAsByteString(\n      value, /* invalidIsMissing=*/ false, /* allowNullishValues= */ false));\n}\n\n/** @return {!ByteString|null|undefined} */\nfunction checkNullishBytes(\n    /** string|!Uint8Array|!ByteString|null|undefined */ value) {\n  return bytesAsByteString(\n      value, /* invalidIsMissing=*/ false, /* allowNullishValues= */ true);\n}\n\n/**\n * @param {*} value\n * @return {boolean}\n */\nfunction checkBoolean(value) {\n  if (typeof value !== 'boolean') {\n    throw new Error(`Expected boolean but got ${goog.typeOf(value)}: ${value}`);\n  }\n  return value;\n}\n\n/**\n * @param {*} value\n * @return {boolean|null|undefined}\n */\nfunction checkNullishBoolean(value) {\n  if (value == null) {\n    return /** @type{null|undefined} */ (value);\n  }\n  return checkBoolean(value);\n}\n\n/** @return {boolean|undefined|null} */\nfunction coerceToNullishBoolean(/** ? */ value) {\n  if (value == null || typeof value === 'boolean') return value;\n  if (typeof value === 'number') return !!value;\n  return undefined;  // some invalid value\n}\n\n// Represents strings formed by calling toString on a number value. Notably,\n// * Values < 1 must have a leading 0 (e.g. '0.5', but not '.5')\n// * Values with a decimal must have a fractional part (e.g. '1.' disallowed)\n// * Hex and exponential syntax are excluded\n// * May not have leading 0s in the whole part (e.g. '0123', such as zip codes)\n// This allows us to better match gbigint (go/bigint#creating-gbigint-values).\nconst NUMBER_SHAPED_CHECK = /^-?([1-9][0-9]*|0)(\\.[0-9]+)?$/;\n\n/**\n * @param {*} value\n * @param {boolean} forceTypeChecking\n * @return {boolean}  Returns true if value will be suitable for constructing\n *     gbigint (go/bigint) after truncation.\n */\nfunction isNumberShaped(value, forceTypeChecking) {\n  switch (typeof value) {\n    case 'bigint':\n      return true;\n    case 'number':\n      return numberIsFinite(value);\n    case 'string':\n      if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking)) {\n        return !!value && isFinite(value);\n      }\n\n      return NUMBER_SHAPED_CHECK.test(value);\n    default:\n      return false;\n  }\n}\n\n/** @return {boolean} @requireInlining */\nfunction isValidEnum(/** ? */ value) {\n  return numberIsFinite(value);\n}\n\n/**\n * @param {?} value\n * @return {string|undefined}\n */\nfunction getEnumErrorMessage(value) {\n  return goog.DEBUG ?\n      `Expected enum as finite number but got ${goog.typeOf(value)}: ${value}` :\n      'enum';\n}\n\n/** @return {number} */\nfunction checkEnum(/** ? */ value) {\n  if (!isValidEnum(value)) {\n    switch (getTypeCheckEnumFields()) {\n      case CheckLevel.THROW:\n        throw makeTypeError(getEnumErrorMessage(value));\n      case CheckLevel.ASYNC_THROW:\n        asyncThrowWarning(getEnumErrorMessage(value));\n      default:  // do nothing\n    }\n  }\n  return getTypeCheckEnumFields() === CheckLevel.THROW ? value | 0 : value;\n}\n\n/** @return {number|null|undefined} */\nfunction checkNullishEnum(/** ? */ value) {\n  return value == null ? value : checkEnum(value);\n}\n\n/** @return {number|undefined|null} */\nfunction coerceToNullishEnum(/** ? */ value) {\n  if (value == null) return value;\n  if (getTypeCheckEnumFields() === CheckLevel.THROW) {\n    return isValidEnum(value) ? value | 0 : undefined;\n  } else {\n    return value;\n  }\n}\n\n/**\n * @return {boolean}\n * @requireInlining\n */\nfunction isValidInt32(/** ? */ value) {\n  return numberIsFinite(value);\n}\n\n/**\n * @param {?} value\n * @return {string|undefined}\n */\nfunction getInt32ErrorMessage(value) {\n  return goog.DEBUG ? `Expected int32 as finite number but got ${\n                          goog.typeOf(value)}: ${value}` :\n                      'int32';\n}\n\n/** @return {number} */\nfunction checkInt32(/** ? */ value) {\n  if (typeof value !== 'number') {\n    throw makeTypeError(getInt32ErrorMessage(value));\n  }\n  if (!isValidInt32(value)) {\n    switch (getTypeCheck32BitIntFields()) {\n      case CheckLevel.THROW:\n        throw makeTypeError(getInt32ErrorMessage(value));\n      case CheckLevel.ASYNC_THROW:\n        asyncThrowWarning(getInt32ErrorMessage(value));\n      default:  // do nothing\n    }\n  }\n  return getTypeCheck32BitIntFields() === CheckLevel.THROW ? value | 0 : value;\n}\n\n/** @return {number|null|undefined} */\nfunction checkNullishInt32(/** ? */ value) {\n  return value == null ? value : checkInt32(value);\n}\n\n/** @return {number|undefined|null} */\nfunction coerceToNullishInt32(/** ? */ value) {\n  if (value == null) return value;\n  if (typeof value === 'string' && value) {\n    // We need to handle strings to support int64 -> int32 conversions.\n    value = +value;\n  } else if (typeof value !== 'number') {\n    return undefined;\n  }\n  if (getTypeCheck32BitIntFields() === CheckLevel.THROW) {\n    return isValidInt32(value) ? value | 0 : undefined;\n  } else {\n    return value;\n  }\n}\n\n/**\n * @param {?} value\n * @return {string|undefined}\n */\nfunction getUint32ErrorMessage(value) {\n  return goog.DEBUG ? `Expected uint32 as finite number but got ${\n                          goog.typeOf(value)}: ${value}` :\n                      'uint32';\n}\n\n/** @return {number} */\nfunction checkUint32(/** ? */ value) {\n  if (typeof value !== 'number') {\n    throw makeTypeError(getUint32ErrorMessage(value));\n  }\n  if (!isValidInt32(value)) {\n    switch (getTypeCheck32BitIntFields()) {\n      case CheckLevel.THROW:\n        throw makeTypeError(getUint32ErrorMessage(value));\n      case CheckLevel.ASYNC_THROW:\n        asyncThrowWarning(getUint32ErrorMessage(value));\n      default:  // do nothing\n    }\n  }\n  return getTypeCheck32BitIntFields() === CheckLevel.THROW ? value >>> 0 :\n                                                             value;\n}\n\n/** @return {number|null|undefined} */\nfunction checkNullishUint32(/** ? */ value) {\n  return value == null ? value : checkUint32(value);\n}\n\n/** @return {number|undefined|null} */\nfunction coerceToNullishUint32(/** ? */ value) {\n  if (value == null) return value;\n  if (typeof value === 'string' && value) {\n    // We need to handle strings to support uint64 -> uint32 conversions.\n    value = +value;\n  } else if (typeof value !== 'number') {\n    return undefined;\n  }\n  if (getTypeCheck32BitIntFields() === CheckLevel.THROW) {\n    return isValidInt32(value) ? value >>> 0 : undefined;\n  } else {\n    return value;\n  }\n}\n\n/**\n * @param {?} value\n * @return {string|undefined}\n */\nfunction getInt64ErrorMessage(value) {\n  return goog.DEBUG ?\n      `Expected an int64 value encoded as a number or a string but got ${\n          goog.typeOf(value)}: ${value}` :\n      'int64';\n}\n\n/**\n * Validate that the provided value is an int64 number|string|bigint. This\n * function may truncate values to fit within the int64 range, but will not\n * change the data type (string -> string, number -> number, bigint -> bigint)\n * so long as the resulting value is within the safe range. Nullish values are\n * rejected.\n *\n * @param {*} value\n * @param {!TypeSpecificApiFormat=} requestedFormat\n * @return {number|string|!gbigint}\n */\nfunction checkInt64(value, requestedFormat) {\n  // TODO: varomodt - Change default format to GBIGINT.\n  requestedFormat ??= getDefaultTypeSpecificApiFormat();\n\n  // If the underlying data is being accessed via the _asString alternates,\n  // which always apply type checking, then we must also apply\n  // type checking here for consistency. Otherwise, the values would be\n  // marked as IS_API_FORMATTED under a different standard and have\n  // invalid values.\n  const shouldForceTypeChecking =\n      requestedFormat !== TypeSpecificApiFormat.LEGACY;\n  if (!getTypeCheck64BitIntFieldsAreInRange(\n          /* forceTypeChecking = */ shouldForceTypeChecking)) {\n    return /** @type{number|string|!gbigint} */ (value);\n  }\n\n  if (!isNumberShaped(\n          value, /* forceTypeChecking = */ shouldForceTypeChecking)) {\n    throw makeTypeError(getInt64ErrorMessage(value));\n  }\n\n  // We permit number|string|!gbigint values regardless of jstype annotations.\n  // In order to avoid unnecessary coercions (particularly string -> number,\n  // which can cause precision loss), guard against cross-type coercions.\n  //\n  // value must be number|string|!gbigint since it's number-shaped.\n\n  const valueType = typeof value;\n\n  switch (requestedFormat) {\n    case TypeSpecificApiFormat.STRING:\n      switch (valueType) {\n        case 'string':\n          return convertStringToInt64String(\n              /** @type {string} */ (value), /* forceTypeChecking = */ true);\n        case 'bigint':\n          return convertBigintToInt64String(/** @type {bigint} */ (value));\n        default:\n          return convertNumberToInt64String(\n              cast(value, isNumber), /* forceTypeChecking = */ true);\n      }\n\n    case TypeSpecificApiFormat.GBIGINT:\n      switch (valueType) {\n        case 'string':\n          return convertStringToInt64Gbigint(/** @type {string} */ (value));\n        case 'bigint':\n          return convertBigintToInt64Gbigint(/** @type {bigint} */ (value));\n        default:\n          return convertNumberToInt64Gbigint(cast(value, isNumber));\n      }\n\n    case TypeSpecificApiFormat.LEGACY:\n      switch (valueType) {\n        case 'string':\n          return convertStringToInt64String(\n              /** @type {string} */ (value), /* forceTypeChecking = */ false);\n        case 'bigint':\n          return convertBigintToInt64Gbigint(/** @type {bigint} */ (value));\n        default:\n          return convertNumberToInt64Number(\n              cast(value, isNumber), /* forceTypeChecking = */ false);\n      }\n\n    default:\n      return checkExhaustive(\n          requestedFormat, 'Unknown format requested type for int64');\n  }\n}\n\n/**\n * Validate that the provided value is an int64 number|string. This function may\n * truncate values to fit within the int64 range, but will not change the data\n * type (string -> string, number -> number) so long as the resulting value is\n * within the safe range. Nullish values are permitted.\n *\n * @param {*} value\n * @param {!TypeSpecificApiFormat=} requestedFormat\n * @return {number|string|!gbigint|null|undefined}\n */\nfunction checkNullishInt64(value, requestedFormat) {\n  // TODO: b/319288438 - Change default format to GBIGINT.\n  return value == null ?\n      /** @type {null|undefined} */ (value) :\n      /** @type{number|string} */ (checkInt64(value, requestedFormat));\n}\n\nconst /** string */ UINT64_MAX_STR = '18446744073709551615';\n\nconst /** number */ UINT64_MAX_STR_LEN = UINT64_MAX_STR.length;\n\n/**\n * Determine if the provided value is within the uint64 value range based on its\n * length and leading digits.\n * @param {string} value\n * @return {boolean}\n */\nfunction isStringInUint64Range(value) {\n  if (value[0] === '-') {\n    return false;\n  }\n\n  const len = value.length;\n  if (len < UINT64_MAX_STR_LEN) {\n    // value is definitely less than uint64 max is 18446744073709551615, which\n    // is 20 digits.\n    return true;\n  }\n\n  return len === UINT64_MAX_STR_LEN && value <= UINT64_MAX_STR;\n}\n\nconst /** string */ INT64_MIN_STR = '-9223372036854775808';\n\nconst /** number */ INT64_MIN_STR_LEN = INT64_MIN_STR.length;\n\nconst /** string */ INT64_MAX_STR = '9223372036854775807';\n\nconst /** number */ INT64_MAX_STR_LEN = INT64_MAX_STR.length;\n\n/**\n * Determine if the provided value is within the int64 value range based on its\n * length and leading digits.\n * @param {string} value\n * @return {boolean}\n */\nfunction isStringInInt64Range(value) {\n  const len = value.length;\n  if (value[0] === '-') {\n    if (len < INT64_MIN_STR_LEN) {\n      // value is definitely greater than int64 min, -9223372036854775808, which\n      // is 20 characters.\n      return true;\n    }\n\n    return len === INT64_MIN_STR_LEN && value <= INT64_MIN_STR;\n  }\n\n  // else value >= 0\n  if (len < INT64_MAX_STR_LEN) {\n    // value is definitely less than int64 max is 9223372036854775807, which\n    // is 19 digits.\n    return true;\n  }\n\n  return len === INT64_MAX_STR_LEN && value <= INT64_MAX_STR;\n}\n\n/**\n * @param {number} value\n * @return {string}\n */\nfunction truncateNumberToUint64RangeString(value) {\n  // This is a slow path, so ensure caller did basic checks before resorting to\n  // truncation.\n  asserts.assert(value < 0 || value > MAX_SAFE_INTEGER);\n  // Ensure no floating point values have made it to this point.\n  asserts.assert(Number.isInteger(value));\n\n  splitInt64(value);\n  return joinUnsignedDecimalString(getSplit64Low(), getSplit64High());\n}\n\n/**\n * @param {number} value\n * @return {number}\n */\nfunction truncateNumberToUint64RangeNumber(value) {\n  // This is a slow path, so ensure caller did basic checks before resorting to\n  // truncation.\n  asserts.assert(value < 0 || value > MAX_SAFE_INTEGER);\n  // Ensure no floating point values have made it to this point.\n  asserts.assert(Number.isInteger(value));\n\n  splitInt64(value);\n  return joinUint64(getSplit64Low(), getSplit64High());\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nfunction truncateStringToInt64RangeString(value) {\n  // Ensure no floating point values have made it to this point.\n  asserts.assert(value.indexOf('.') === -1);\n\n  if (isStringInInt64Range(value)) {\n    return value;\n  }\n\n  splitDecimalString(value);\n  return joinSignedDecimalString(getSplit64Low(), getSplit64High());\n}\n\n/**\n * @param {number} value\n * @return {number}\n */\nfunction truncateNumberToInt64RangeNumber(value) {\n  // This is a slow path, so ensure caller did basic checks before resorting to\n  // truncation.\n  asserts.assert(!isSafeInteger(value));\n  asserts.assert(Number.isInteger(value));\n\n  splitInt64(value);\n  return joinInt64(getSplit64Low(), getSplit64High());\n}\n\n/**\n * @param {number} value\n * @return {string}\n */\nfunction truncateNumberToInt64RangeString(value) {\n  // This is a slow path, so ensure caller did basic checks before resorting to\n  // truncation.\n  asserts.assert(!isSafeInteger(value));\n  // Ensure no floating point values have reached this point. They should've\n  // been truncated by the caller.\n  asserts.assert(Number.isInteger(value));\n\n  splitInt64(value);\n  return joinSignedDecimalString(getSplit64Low(), getSplit64High());\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nfunction truncateStringToUint64RangeString(value) {\n  // Ensure no floating point values have reached this point. They should've\n  // been truncated by the caller.\n  asserts.assert(value.indexOf('.') === -1);\n\n  if (isStringInUint64Range(value)) {\n    return value;\n  }\n\n  splitDecimalString(value);\n  return joinUnsignedDecimalString(getSplit64Low(), getSplit64High());\n}\n\n/**\n * @param {number} value\n * @param {boolean} forceTypeChecking\n * @return {number} The value truncated to the int64 range (if necessary). Note:\n *     this value may actually be a numeric string if the value is outside of\n *     the safe integer range.\n */\nfunction convertNumberToInt64Number(value, forceTypeChecking) {\n  // This is an assert here because the caller is expected to check.\n  asserts.assert(isNumberShaped(value, forceTypeChecking));\n  asserts.assert(getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking));\n\n  value = trunc(value);\n  if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking)) {\n    return value;\n  }\n\n  if (isSafeInteger(value)) {\n    return value;\n  }\n\n  return truncateNumberToInt64RangeNumber(value);\n}\n\n/**\n * @param {number} value\n * @param {boolean} forceTypeChecking\n * @return {number} The value truncated to the uint64 range (if necessary).\n *     Note: this value may actually be a numeric string if the value is outside\n *     of the safe integer range.\n */\nfunction convertNumberToUint64Number(value, forceTypeChecking) {\n  // This is an assert here because the caller is expected to check.\n  asserts.assert(isNumberShaped(value, forceTypeChecking));\n  asserts.assert(getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking));\n\n  value = trunc(value);\n  if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking)) {\n    return value;\n  }\n\n  if (value >= 0 && isSafeInteger(value)) {\n    return value;\n  }\n\n  return truncateNumberToUint64RangeNumber(value);\n}\n\n/**\n * Best effort string -> number within int64 range coercion. This operation will\n * not lose precision because we will return directly unsafe-integer as string\n * values with a type cast.\n *\n * @param {string} value\n * @param {boolean} forceTypeChecking\n * @return {number}\n */\nfunction convertStringToInt64NumberWhenSafe(value, forceTypeChecking) {\n  // These asserts are here because the caller is expected to check.\n  asserts.assert(isNumberShaped(value, forceTypeChecking));\n  asserts.assert(getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking));\n  asserts.assert(shouldCoerce64BitIntFieldsByJsType(forceTypeChecking));\n\n  // Value is a number-shaped string. It must be one of:\n  //   1. A safe, integer string (e.g. '3')\n  //   2. A safe, floating point string (e.g. '3.14')\n  //   3. An unsafe integer string\n  //   4. An unsafe floating point string\n\n  const coerced = Number(value);\n  const numTrunc = trunc(coerced);\n  if (isSafeInteger(numTrunc)) {\n    // Case 1: safe integer or float string\n    return numTrunc;\n  }\n\n  // Case 3 and 4: unsafe numeric string. Will need to apply an unsafe cast to\n  // avoid precision loss.\n  const int64Str = convertStringToInt64String(value, forceTypeChecking);\n  const int64Num = Number(int64Str);\n  return isSafeInteger(int64Num) ?\n      int64Num :\n      /** @type {number} */ (/** @type {?} */ (int64Str));\n}\n\n/**\n * Best effort string -> number within uint64 range coercion. This operation\n * will not lose precision because we will return directly unsafe-integer as\n * string values with a type cast.\n *\n * @param {string} value\n * @param {boolean} forceTypeChecking\n * @return {number}\n */\nfunction convertStringToUint64NumberWhenSafe(value, forceTypeChecking) {\n  // These asserts are here because the caller is expected to check.\n  asserts.assert(isNumberShaped(value, forceTypeChecking));\n  asserts.assert(getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking));\n  asserts.assert(shouldCoerce64BitIntFieldsByJsType(forceTypeChecking));\n\n  // Value is a number-shaped string. It must be one of:\n  //   1. A safe, integer string (e.g. '3')\n  //   2. A safe, floating point string (e.g. '3.14')\n  //   3. An unsafe integer string\n  //   4. An unsafe floating point string\n\n  const coerced = Number(value);\n\n  const numTrunc = trunc(coerced);\n  if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking)) {\n    if (isSafeInteger(numTrunc)) {\n      // Case 1 and 2: safe integer or float string\n      return numTrunc;\n    }\n\n    // Case 3 and 4: unsafe numeric string. Apply an unsafe cast to avoid\n    // precision loss.\n    return /** @type {number} */ (\n        /** @type {*} */ (\n            convertStringToUint64String(value, forceTypeChecking)));\n  }\n\n  if (0 <= numTrunc && numTrunc <= MAX_SAFE_INTEGER) {\n    // Case 1 and 2: safe integer or float string\n    // Positive safe integers do not need range truncation.\n    return numTrunc;\n  }\n\n  // Case 3 and 4: unsafe numeric string. Apply an unsafe cast to avoid\n  // precision loss.\n  const uint64Str = convertStringToUint64String(value, forceTypeChecking);\n  const uint64Num = Number(uint64Str);\n\n  return isSafeInteger(uint64Num) ?\n      uint64Num :\n      /** @type {number} */ (/** @type {*} */ (uint64Str));\n}\n\n/**\n * @param {number} value\n * @param {boolean} forceTypeChecking\n * @return {string}\n */\nfunction convertNumberToInt64String(value, forceTypeChecking) {\n  // This is an assert here because the caller is expected to check.\n  asserts.assert(isNumberShaped(value, forceTypeChecking));\n  asserts.assert(getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking));\n\n  value = trunc(value);\n  if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking)) {\n    return String(value);\n  }\n\n  // There's no positive safe integer value that could result\n  // in an unsafe signed integer after two's complement truncation:\n  // MAX_SAFE_INTEGER (2**53 - 1) < Int64 max (2**63 - 1).\n  if (isSafeInteger(value)) {\n    return String(value);\n  }\n\n  return truncateNumberToInt64RangeString(value);\n}\n\n/**\n * Best effort bigint -> number within int64 range coercion. This operation will\n * not lose precision because we will return directly unsafe-integer as string\n * values with a type cast.\n * @param {bigint} value\n * @return {number}\n */\nfunction convertBigintToInt64NumberWhenSafe(value) {\n  if (isSafeInt52(value)) {\n    return Number(value);\n  }\n\n  const value64 = bigintAsIntN(64, value);\n  if (isSafeInt52(value64)) {\n    return Number(value64);\n  }\n\n  return /** @type {number} */ (/** @type {*} */ (String(value64)));\n}\n\n/**\n * @param {bigint} value\n * @return {string}\n */\nfunction convertBigintToInt64String(value) {\n  return String(bigintAsIntN(64, value));\n}\n\n/**\n * Best effort bigint -> number within uint64 range coercion. This operation\n * will not lose precision because we will return directly unsafe-integer as\n * string values with a type cast.\n * @param {bigint} value\n * @return {number}\n */\nfunction convertBigintToUint64NumberWhenSafe(value) {\n  if (value >= 0 && isSafeInt52(value)) {\n    return Number(value);\n  }\n\n  const value64 = bigintAsUintN(64, value);\n  if (isSafeInt52(value64)) {\n    return Number(value64);\n  }\n\n  return /** @type {number} */ (/** @type {*} */ (String(value64)));\n}\n\n/**\n * @param {bigint} value\n * @return {string}\n */\nfunction convertBigintToUint64String(value) {\n  return String(bigintAsUintN(64, value));\n}\n\n/**\n * @param {number} value\n * @param {boolean} forceTypeChecking\n * @return {string}\n */\nfunction convertNumberToUint64String(value, forceTypeChecking) {\n  // This is an assert here because the caller is expected to check.\n  asserts.assert(isNumberShaped(value, forceTypeChecking));\n  asserts.assert(getTypeCheck64BitIntFields(forceTypeChecking));\n\n  value = trunc(value);\n  if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking)) {\n    return String(value);\n  }\n\n  if (value >= 0 && isSafeInteger(value)) {\n    return String(value);\n  }\n\n  return truncateNumberToUint64RangeString(value);\n}\n\n/**\n * @param {string} value\n * @param {boolean} forceTypeChecking\n * @return {string}\n */\nfunction convertStringToInt64String(value, forceTypeChecking) {\n  // This is an assert here because the caller is expected to check.\n  asserts.assert(isNumberShaped(value, forceTypeChecking));\n  asserts.assert(getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking));\n\n  const coerced = trunc(Number(value));\n  if (isSafeInteger(coerced)) {\n    // This shortcut simplifies the obvious safe floats as well as\n    // edge cases like '+0' and '-0' that gbigint would reject.\n    return String(coerced);\n  }\n\n  const decimalIdx = value.indexOf('.');\n  if (decimalIdx !== -1) {\n    // e.g. '1.5' -> '1'\n    value = value.substring(0, decimalIdx);\n  }\n\n  if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking)) {\n    // No decimal remaining in value.\n    return value;\n  }\n\n  // The truncated value cannot be a safe integer (we would've already\n  // finished), so we can't use the faster splitInt64.\n  return truncateStringToInt64RangeString(value);\n}\n\n/**\n * @param {string} value\n * @return {!gbigint}\n */\nfunction convertStringToInt64Gbigint(value) {\n  const coerced = trunc(Number(value));\n  if (isSafeInteger(coerced)) {\n    // This shortcut simplifies the obvious safe floats as well as\n    // edge cases like '+0' and '-0' that gbigint would reject.\n    return toGbigint(coerced);\n  }\n\n  const decimalIdx = value.indexOf('.');\n  if (decimalIdx !== -1) {\n    // e.g. '1.5' -> '1'\n    value = value.substring(0, decimalIdx);\n  }\n\n  if (isBigIntAvailable()) {\n    return convertBigintToInt64Gbigint(BigInt(value));\n  }\n\n  // The truncated value cannot be a safe integer (we would've already\n  // finished), so we can't use the faster splitInt64.\n  return toGbigint(truncateStringToInt64RangeString(value));\n}\n\n// TODO: b/319288438 - Remove string coercions in convertNumberTo(U)Int64Gbigint\n// once we can deserialize directly into gbigint.\n//\n// Value may be a valid 64-bit int value, but not a safe integer  because we\n// cannot yet binary deserialize directly into gbigint. The binary\n// deserialization to number may have already lost the precision before we ever\n// try to truncate into the 64-bit int range.\n//\n// However, toGbigint will throw on unsafe number inputs, so we may need to\n// coerce to string first to avoid the exception.\n\n/**\n * @param {number} value\n * @return {!gbigint}\n */\nfunction convertNumberToInt64Gbigint(value) {\n  if (isSafeInteger(value)) {\n    return toGbigint(\n        convertNumberToInt64Number(value, /*forceTypeChecking=*/ true));\n  }\n\n  return toGbigint(\n      convertNumberToInt64String(value, /*forceTypeChecking=*/ true));\n}\n\n/**\n * @param {number} value\n * @return {!gbigint}\n */\nfunction convertNumberToUint64Gbigint(value) {\n  if (isSafeInteger(value)) {\n    return toGbigint(\n        convertNumberToUint64Number(value, /*forceTypeChecking=*/ true));\n  }\n\n  return toGbigint(\n      convertNumberToUint64String(value, /*forceTypeChecking=*/ true));\n}\n\n/**\n * @param {string} value\n * @param {boolean} forceTypeChecking\n * @return {string}\n */\nfunction convertStringToUint64String(value, forceTypeChecking) {\n  // This is an assert here because the caller is expected to check.\n  asserts.assert(isNumberShaped(value, forceTypeChecking));\n  asserts.assert(getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking));\n\n  const coerced = trunc(Number(value));\n  if (isSafeInteger(coerced)) {\n    if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking) ||\n        coerced >= 0) {\n      // This shortcut simplifies the obvious safe floats as well as\n      // edge cases like '+0' and '-0' that gbigint would reject.\n      //\n      // Additionally, safe positive integers will always be in uint64 range\n      // without truncation, so we're done. Negative values are omitted\n      // because they will need two's complement truncation to the uint64\n      // range.\n      return String(coerced);\n    }\n  }\n\n  const decimalIdx = value.indexOf('.');\n  if (decimalIdx !== -1) {\n    // e.g. '1.5' -> '1'\n    value = value.substring(0, decimalIdx);\n  }\n\n  return truncateStringToUint64RangeString(value);\n}\n\n/**\n * @param {string} value\n * @return {!gbigint}\n */\nfunction convertStringToUint64Gbigint(value) {\n  const coerced = trunc(Number(value));\n  if (isSafeInteger(coerced) && coerced >= 0) {\n    // This shortcut simplifies the obvious safe floats as well as\n    // edge cases like '+0' and '-0' that gbigint would reject.\n    //\n    // Additionally, safe positive integers will always be in uint64 range\n    // without truncation, so we're done. Negative values are omitted because\n    // they will need two's complement truncation to the uint64 range.\n    return toGbigint(coerced);\n  }\n\n  const decimalIdx = value.indexOf('.');\n  if (decimalIdx !== -1) {\n    // e.g. '1.5' -> '1'\n    value = value.substring(0, decimalIdx);\n  }\n\n  if (isBigIntAvailable()) {\n    return convertBigintToUint64Gbigint(BigInt(value));\n  }\n\n  return toGbigint(truncateStringToUint64RangeString(value));\n}\n\n/**\n * @param {bigint} value\n * @return {!gbigint}\n */\nfunction convertBigintToInt64Gbigint(value) {\n  asserts.assert(typeof value === 'bigint');\n  return toGbigint(bigintAsIntN(64, value));\n}\n\n/**\n * @param {bigint} value\n * @return {!gbigint}\n */\nfunction convertBigintToUint64Gbigint(value) {\n  asserts.assert(typeof value === 'bigint');\n  return toGbigint(bigintAsUintN(64, value));\n}\n\n/**\n * @param {*} value\n *\n * @return {number|undefined|null}\n */\nfunction coerceToNullishInt64(value) {\n  // Nullish values are ok\n  if (value == null) {\n    return /** @type {null|undefined} */ (value);\n  } else if (typeof value === 'bigint') {\n    return convertBigintToInt64NumberWhenSafe(/** @type{bigint} */ (value));\n  }\n\n  // TODO: b/169076588 - Successively tighten value enforcement to nullish\n  // values within int64 range.\n  if (!getTypeCheck64BitIntFieldsAreInRange(\n          /*forceTypeChecking = */ false)) {\n    return /** @type {number|undefined|null} */ (value);\n  }\n\n  if (!isNumberShaped(value, /*forceTypeChecking = */ false)) {\n    return undefined;\n  } else if (typeof value === 'number') {\n    return convertNumberToInt64Number(\n        /** @type {number} */ (value), /*forceTypeChecking = */ false);\n  }\n\n  const strValue = cast(value, isString);\n\n  // Only coerce across types if jstype-driven coercion is enabled.\n  if (shouldCoerce64BitIntFieldsByJsType(/* forceTypeChecking = */ false)) {\n    return convertStringToInt64NumberWhenSafe(\n        strValue, /* forceTypeChecking = */ false);\n  }\n  // We know value is an acceptable number-shaped input, but may still\n  // need to truncate to an integer.\n  return /** @type{number} */ (\n      /** @type {?} */ (convertStringToInt64String(\n          strValue, /*forceTypeChecking = */ false)));\n}\n\n/**\n * @param {*} value\n * @param {boolean=} forceTypeChecking\n *\n * @return {string|undefined|null}\n */\nfunction coerceToNullishInt64String(value, forceTypeChecking = false) {\n  const valueType = typeof value;\n  if (value == null) {\n    return /** @type {undefined|null} */ (value);\n  } else if (valueType === 'bigint') {\n    return convertBigintToInt64String(/** @type {bigint} */ (value));\n  }\n\n  if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking)) {\n    return /** @type {string|undefined|null} */ (value);\n  }\n\n  if (!isNumberShaped(value, forceTypeChecking)) {\n    return undefined;\n  } else if (valueType === 'string') {\n    return convertStringToInt64String(\n        /** @type {string} */ (value), forceTypeChecking);\n  }\n\n  const numValue = cast(value, isNumber);\n\n  // Only coerce across types if jstype-driven coercion is enabled.\n  if (shouldCoerce64BitIntFieldsByJsType(forceTypeChecking)) {\n    return convertNumberToInt64String(numValue, forceTypeChecking);\n  }\n\n  // May still to truncate to an integer and apply range enforcement.\n  return /** @type {string} */ (\n      /** @type {?} */ (\n          convertNumberToInt64Number(numValue, forceTypeChecking)));\n}\n\n/**\n * @param {*} value\n *\n * @return {!gbigint|undefined|null}\n */\nfunction coerceToNullishInt64Gbigint(value) {\n  const valueType = typeof value;\n  if (value == null) {\n    return /** @type {undefined|null} */ (value);\n  } else if (valueType === 'bigint') {\n    return convertBigintToInt64Gbigint(/** @type {bigint} */ (value));\n  }\n\n  if (!isNumberShaped(value, /* forceTypeChecking = */ true)) {\n    return undefined;\n  } else if (valueType === 'string') {\n    return convertStringToInt64Gbigint(/** @type {string} */ (value));\n  }\n\n  const numValue = cast(value, isNumber);\n\n  return convertNumberToInt64Gbigint(numValue);\n}\n\n/**\n * @param {?} value\n * @return {string|undefined}\n */\nfunction getUint64ErrorMessage(value) {\n  return goog.DEBUG ?\n      `Expected an uint64 value encoded as a number or a string but got ${\n          goog.typeOf(value)}: ${value}` :\n      'uint64';\n}\n\n/**\n * @param {*} value\n * @param {!TypeSpecificApiFormat=} requestedFormat\n * @return {number|string|!gbigint}\n */\nfunction checkUint64(value, requestedFormat) {\n  // TODO: varomodt - Change default format to GBIGINT.\n  requestedFormat ??= getDefaultTypeSpecificApiFormat();\n\n  // If the underlying data is being accessed via the _asString alternates,\n  // which always apply type checking, then we must also apply\n  // type checking here for consistency. Otherwise, the values would be\n  // marked as IS_API_FORMATTED under a different standard and have\n  // invalid values.\n  const shouldForceTypeChecking =\n      requestedFormat !== TypeSpecificApiFormat.LEGACY;\n  if (!getTypeCheck64BitIntFieldsAreInRange(\n          /* forceTypeChecking = */ shouldForceTypeChecking)) {\n    return /** @type{number|string|!gbigint} */ (value);\n  }\n\n  if (!isNumberShaped(\n          value, /* forceTypeChecking = */ shouldForceTypeChecking)) {\n    throw makeTypeError(getUint64ErrorMessage(value));\n  }\n\n  // We permit number|string values regardless of jstype annotations. In\n  // order to avoid unnecessary coercions (particularly string -> number,\n  // which can cause precision loss), guard against cross-type coercions.\n  //\n  // value must be number|string|!gbigint since it's number-shaped.\n  const valueType = typeof value;\n  switch (requestedFormat) {\n    case TypeSpecificApiFormat.STRING:\n      switch (valueType) {\n        case 'string':\n          return convertStringToUint64String(\n              /** @type {string} */ (value), /* forceTypeChecking = */ true);\n        case 'bigint':\n          return convertBigintToUint64String(/** @type {bigint} */ (value));\n        default:\n          return convertNumberToUint64String(\n              cast(value, isNumber), /* forceTypeChecking = */ true);\n      }\n\n    case TypeSpecificApiFormat.GBIGINT:\n      switch (valueType) {\n        case 'string':\n          return convertStringToUint64Gbigint(/** @type {string} */ (value));\n        case 'bigint':\n          return convertBigintToUint64Gbigint(/** @type {bigint} */ (value));\n        default:\n          return convertNumberToUint64Gbigint(cast(value, isNumber));\n      }\n\n    case TypeSpecificApiFormat.LEGACY:\n      switch (valueType) {\n        case 'string':\n          return convertStringToUint64String(\n              /** @type {string} */ (value), /* forceTypeChecking = */ false);\n        case 'bigint':\n          return convertBigintToUint64Gbigint(/** @type {bigint} */ (value));\n        default:\n          return convertNumberToUint64Number(\n              cast(value, isNumber), /* forceTypeChecking = */ false);\n      }\n\n    default:\n      return checkExhaustive(\n          requestedFormat, 'Unknown format requested type for int64');\n  }\n}\n\n/**\n * @param {*} value\n * @param {!TypeSpecificApiFormat=} requestedFormat\n * @return {number|string|null|undefined}\n */\nfunction checkNullishUint64(value, requestedFormat) {\n  // TODO: b/319288438 - Change default format to GBIGINT.\n  return value == null ?\n      /** @type {null|undefined} */ (value) :\n      /** @type {number|string} */ (checkUint64(value, requestedFormat));\n}\n\n/**\n * @param {*} value\n *\n * @return {number|undefined|null}\n */\nfunction coerceToNullishUint64(value) {\n  if (value == null) {\n    return /** @type{undefined|null} */ (value);\n  } else if (typeof value === 'bigint') {\n    return convertBigintToUint64NumberWhenSafe(/** @type{bigint} */ (value));\n  }\n\n  if (!getTypeCheck64BitIntFieldsAreInRange(/*forceTypeChecking = */ false)) {\n    return /** @type {number|undefined|null} */ (value);\n  }\n\n  if (!isNumberShaped(value, /*forceTypeChecking = */ false)) {\n    return undefined;\n  } else if (typeof value === 'number') {\n    return convertNumberToUint64Number(value, /*forceTypeChecking = */ false);\n  }\n\n  const strValue = cast(value, isString);\n\n  // Only coerce across type if full jstype-driven coercion is enabled.\n  if (shouldCoerce64BitIntFieldsByJsType(/* forceTypeChecking = */ false)) {\n    return convertStringToUint64NumberWhenSafe(\n        strValue, /* forceTypeChecking = */ false);\n  }\n\n  // We know value is an acceptable number-shaped input, but may still\n  // need to truncate to an integer.\n  return /** @type{number} */ (\n      /** @type {?} */ (convertStringToUint64String(\n          strValue, /*forceTypeChecking = */ false)));\n}\n\n/**\n * @param {*} value\n * @param {boolean=} forceTypeChecking\n *\n * @return {string|undefined|null}\n */\nfunction coerceToNullishUint64String(value, forceTypeChecking = false) {\n  const valueType = typeof value;\n  if (value == null) {\n    return /** @type {null|undefined} */ (value);\n  } else if (valueType === 'bigint') {\n    return convertBigintToUint64String(/** @type {bigint} */ (value));\n  }\n\n  if (!getTypeCheck64BitIntFieldsAreInRange(forceTypeChecking)) {\n    return /** @type {string|undefined|null} */ (value);\n  }\n\n  if (!isNumberShaped(value, forceTypeChecking)) {\n    return undefined;\n  } else if (valueType === 'string') {\n    return convertStringToUint64String(\n        /** @type{string} */ (value), forceTypeChecking);\n  }\n\n  const numValue = cast(value, isNumber);\n\n  // Only coerce across type if jstype-driven coercion is enabled.\n  if (shouldCoerce64BitIntFieldsByJsType(forceTypeChecking)) {\n    return convertNumberToUint64String(numValue, forceTypeChecking);\n  }\n  // May still need to truncate to an integer and apply range enforcement.\n  return /** @type {string} */ (\n      /** @type {?} */ (\n          convertNumberToUint64Number(numValue, forceTypeChecking)));\n}\n\n/**\n * @param {*} value\n * @return {!gbigint|undefined|null}\n */\nfunction coerceToNullishUint64Gbigint(value) {\n  const valueType = typeof value;\n  if (value == null) {\n    return /** @type {undefined|null} */ (value);\n  } else if (valueType === 'bigint') {\n    return convertBigintToUint64Gbigint(/** @type {bigint} */ (value));\n  }\n\n  if (!isNumberShaped(value, /* forceTypeChecking = */ true)) {\n    return undefined;\n  } else if (valueType === 'string') {\n    return convertStringToUint64Gbigint(/** @type {string} */ (value));\n  }\n\n  const numValue = cast(value, isNumber);\n\n  return convertNumberToUint64Gbigint(numValue);\n}\n\n/**\n * Replacement for int64 coercion helpers to avoid precision loss. True\n * numbers and numbers as strings are both acceptable values for binary\n * serialization.\n *\n * @param {*} value\n *\n * @return {number|string|undefined|null}\n */\nfunction coerceToNullishInt64StringOrNumber(value) {\n  // Nullish values are ok\n  if (value == null) {\n    return /** @type{null|undefined} */ (value);\n  }\n\n  const valueType = typeof value;\n  if (valueType === 'bigint') {\n    return convertBigintToInt64String(/** @type{bigint} */ (value));\n  }\n\n  // This function is only used by binary serialization so it cannot/should\n  // not force type checking. We only want to enable type checking early when\n  // a user specifically opts into it via a specialized getter.\n  const doNotForceTypeChecking = false;\n\n  if (!getTypeCheck64BitIntFieldsAreInRange(doNotForceTypeChecking)) {\n    return /** @type{number|string|undefined|null} */ (value);\n  }\n\n  if (!isNumberShaped(value, doNotForceTypeChecking)) {\n    return undefined;\n  } else if (valueType === 'string') {\n    return convertStringToInt64String(\n        /** @type {string} */ (value), doNotForceTypeChecking);\n  } else if (valueType === 'number') {\n    return convertNumberToInt64Number(\n        /** @type {number} */ (value), doNotForceTypeChecking);\n  }\n\n  return undefined;\n}\n\n/**\n * Replacement for uint64 coercion helpers to avoid precision loss. True\n * numbers and numbers as strings are both acceptable values for binary\n * serialization.\n *\n * @param {*} value\n *\n * @return {number|string|undefined|null}\n */\nfunction coerceToNullishUint64StringOrNumber(value) {\n  // Nullish values are ok\n  if (value == null) {\n    return /** @type{null|undefined} */ (value);\n  }\n\n  const valueType = typeof value;\n  if (valueType === 'bigint') {\n    return convertBigintToUint64String(/** @type{bigint} */ (value));\n  }\n\n  // This function is only used by binary serialization so it cannot/should\n  // not force type checking. We only want to enable type checking early when\n  // a user specifically opts into it via a specialized getter.\n  const doNotForceTypeChecking = false;\n\n  if (!getTypeCheck64BitIntFieldsAreInRange(doNotForceTypeChecking)) {\n    return /** @type{number|string|undefined|null} */ (value);\n  }\n\n  if (!isNumberShaped(value, doNotForceTypeChecking)) {\n    return undefined;\n  } else if (valueType === 'string') {\n    return convertStringToUint64String(\n        /** @type {string} */ (value), doNotForceTypeChecking);\n  } else if (valueType === 'number') {\n    return convertNumberToUint64Number(\n        /** @type {number} */ (value), doNotForceTypeChecking);\n  }\n\n  return undefined;\n}\n\n/**\n * Coercion for use in the binary implementation that doesn't eagerly\n * construct bytestrings.\n *\n * @return {string|!ByteString|null|undefined}\n */\nfunction coerceToNullishBytesAsStringByteString(/** ? */ v) {\n  if (v == null || typeof v == 'string' || v instanceof ByteString) {\n    return v;\n  }\n  // TODO(b/396420284): remove.\n  asserts.assert(!(v instanceof Uint8Array));\n  return undefined;\n}\n\n\n/**\n * @param {*} value\n * @return {string}\n */\nfunction checkString(value) {\n  if (typeof value !== 'string') {\n    throw (\n        goog.DEBUG ?\n            new Error(\n                `Expected a string but got ${value} a ${goog.typeOf(value)}`) :\n            new Error());\n  }\n  return /** @type {string} */ (value);\n}\n\n/**\n * @param {*} value\n * @return {string|null|undefined}\n */\nfunction checkNullishString(value) {\n  if (value != null && typeof value !== 'string') {\n    throw (\n        goog.DEBUG ?\n            new Error(`Expected a string or null or undefined but got ${\n                value} a ${goog.typeOf(value)}`) :\n            new Error());\n  }\n  return /** @type{string|null|undefined} */ (value);\n}\n\n/** @return {string|undefined|null} */\nfunction coerceToNullishString(/** ? */ value) {\n  return (value == null || typeof value === 'string') ?\n      /** @type{string|undefined|null} */ (value) :\n      undefined;\n}\n\n/**\n * Checks that the value matches the type, subject to the current checkLevel.\n *\n * @param {?} value The value to check.\n * @param {function(new: T, ...)} ctor A user-defined constructor.\n * @return {T}\n * @template T\n * @closurePrimitive {asserts.matchesReturn}\n */\nfunction checkMessageType(value, ctor) {\n  // It would be faster to do a .constructor === ctor check, but that would\n  // break applications using `exemptUnsupportedSubclass` :-{. So instead we use\n  // instanceof.\n  if (!(value instanceof ctor)) {\n    throw new Error(`Expected instanceof ${ctorName(ctor)} but got ${\n        value && ctorName(value.constructor)}`);\n  }\n  return value;\n}\n\n/**\n * Inspects the value and either returns it if is already constructed,\n * constructs it in place, or otherwise returns `undefined`.\n *\n * @param {*} value\n * @param {function(new: T, ...)} ctor A user-defined constructor.\n * @param {boolean} constructMissing if the value is not an array or a\n *     message, construct an empty proto\n * @param {number} parentArrayState the array state of the parent array\n * @return {T_RETURN}\n * @template T\n * Use TTL to avoid weird inference\n * @template T_RETURN := union(T, 'null', 'undefined') =:\n * @suppress {visibility} access to message internals\n */\nfunction messageFromInlineStorage(\n    value, ctor, constructMissing, parentArrayState) {\n  // We want a fast check that it is a message, since in the common case we\n  // expect that value is either null/undefined or already constructed. If we\n  // find an array we will bootstrap it.\n\n  // The obvious choice is 'instanceof ctor' but that is about half as fast as\n  // the property test implemented by isMessage.\n  // The second choice is to do `value.constructor === ctor` but that would\n  // break applications using `exemptUnsupportedSubclass` :-{. So instead we use\n  // the messagePrototype property test.\n  if (isInternalMessage(value)) {\n    return value;\n  }\n\n  if (!Array.isArray(value)) {\n    if (!constructMissing) {\n      return undefined;\n    }\n\n    return (parentArrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY) ?\n        getDefaultImmutableInstanceInternalInline(ctor) :\n        new ctor();\n  }\n\n  // Otherwise, find our array.\n  updateArrayStateForNewlyParsedArray(value, parentArrayState);\n\n  // And return a new instance.\n  return new ctor(value);\n}\n\n\n/**\n * @param {!Array<*>} arr\n * @param {number} parentArrayState\n */\nfunction updateArrayStateForNewlyParsedArray(arr, parentArrayState) {\n  // Copy the immutable and owned bits bits from our parent to the\n  // submessage if they are set.\n  const originalArrState = getArrayState(arr);\n  let arrState = originalArrState;\n\n  // Newly parsed arrays get their owned bit from their parent.\n  arrState |= parentArrayState & ArrayStateFlags.MUTABLE_REFERENCES_ARE_OWNED;\n\n  // If our parent is immutable, we must be immutable.\n  arrState |= parentArrayState & ArrayStateFlags.IS_IMMUTABLE_ARRAY;\n\n  if (arrState !== originalArrState) setArrayState(arr, arrState);\n}\n\n/**\n * @param {?} value\n * @return {string|undefined}\n */\nfunction getArrayErrorMessage(value) {\n  return goog.DEBUG ? `Expected array but got ${goog.typeOf(value)}: ${value}` :\n                      undefined;\n}\n\n/**\n * @param {*} value\n * @return {!Array<*>}\n * @closurePrimitive {asserts.matchesReturn}\n */\nfunction checkRepeatedFieldIsArray(value) {\n  if (!Array.isArray(value)) {\n    throw makeTypeError(getArrayErrorMessage(value));\n  }\n  return /** @type {!Array<*>} */ (value);\n}\n\n/**\n * Gets a default immutable instance for the given type.\n *\n * @return {!InternalMessage} The immutable instance.\n * @requireInlining\n */\nfunction getDefaultImmutableInstanceInternalInline(\n    /** function(new:InternalMessage, ?Array<?>=) */ ctor) {\n  return /** @type {!Object} */ (ctor)[DEFAULT_IMMUTABLE_INSTANCE_SYMBOL] ||=\n             emptyImmutableMessage(ctor);\n}\n\n/** @return {!InternalMessage} */\nfunction getDefaultImmutableInstanceInternal(\n    /** function(new:InternalMessage, ?Array<?>=) */ ctor) {\n  return getDefaultImmutableInstanceInternalInline(ctor);\n}\n\n/** @return {!InternalMessage} */\nfunction getDefaultImmutableInstanceInternalWithoutLoggingOperations(\n    /** function(new:InternalMessage, ?Array<?>=) */ ctor) {\n  // Avoid side-effects from this function in operations logs so that we\n  // do not have deltas due to test ordering.\n  return withoutLogging(() => getDefaultImmutableInstanceInternal(ctor));\n}\n\n/**\n * Gets a default immutable instance for the given type.\n *\n * @return {!InternalMessage} The immutable instance.\n */\nfunction getDefaultImmutableInstance(\n    /** function(new:InternalMessage, ?Array<?>=) */ ctor) {\n  if (DETAILED_JSPB_ASSERTS) {\n    // This is defined in another function because the JSCompiler's inlining\n    // will back off if you write _any_ lambda.\n    return getDefaultImmutableInstanceInternalWithoutLoggingOperations(ctor);\n  }\n\n  return getDefaultImmutableInstanceInternalInline(ctor);\n}\n\n/**\n * Gets an empty immutable instance for the given type.\n *\n * @param {function(new:InternalMessage, ?Array<?>=)} ctor A user-defined\n *     constructor.\n * @return {!InternalMessage} The immutable instance.\n */\nfunction emptyImmutableMessage(ctor) {\n  const newMsg = new ctor();\n  markArrayImmutable(\n      getInternalArray(/** @type {!InternalMessage} */ (newMsg)));\n  return newMsg;\n}\n\n/**\n * Coerces the given value to a boolean for map keys or values. Returns\n * undefined if the value is invalid.\n *\n * @return {boolean|undefined}\n */\nfunction booleanToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  if (assertCorrectTypeForSetters) return checkBoolean(value);\n  const coerced = coerceToNullishBoolean(value);\n  return coerced ?? (constructMissing ? false : undefined);\n}\n\n/**\n * Coerces the given value to a boolean for map keys. Returns undefined if the\n * value is invalid.\n *\n * @const\n */\nconst booleanKeyToApiForMaps = booleanToApiForMaps;\n\n\n/**\n * Coerces the given value to a number for map keys or values. Returns\n * undefined if the value is invalid.\n *\n * @return {number|undefined}\n */\nfunction int32ToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  value = assertCorrectTypeForSetters ? checkInt32(value) :\n                                        coerceToNullishInt32(value);\n  // TODO (b//280497549): remove the `| 0` bit once we coerce consistently.\n  return (value == null) ? (constructMissing ? 0 : undefined) : (value | 0);\n}\n\n/**\n * Coerces the given value to a number for map keys. Returns undefined if the\n * value is invalid.\n *\n * @const\n */\nconst int32KeyToApiForMaps = int32ToApiForMaps;\n\n/**\n * Coerces the given value to a number for map keys or values. Returns\n * undefined if the value is invalid.\n *\n * @return {number|undefined}\n */\nfunction uint32ToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  value = assertCorrectTypeForSetters ? checkUint32(value) :\n                                        coerceToNullishUint32(value);\n  // TODO (b//280497549): remove the `>>> 0` bit once we coerce consistently.\n  return (value == null) ? (constructMissing ? 0 : undefined) : (value >>> 0);\n}\n\n/**\n * Coerces the given value to a number for map keys. Returns undefined if the\n * value is invalid.\n *\n * @return {number|undefined}\n */\nfunction uint32KeyToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  let coerced =\n      uint32ToApiForMaps(value, assertCorrectTypeForSetters, constructMissing);\n  if (typeof coerced === 'number') {\n    return coerced >>> 0;\n  }\n  return coerced;\n}\n\n/**\n * Coerces the given value to a number for map values. Returns undefined if\n * the value is invalid.\n *\n * @return {number|string|!gbigint|undefined}\n */\nfunction int64ToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  value = assertCorrectTypeForSetters ? checkInt64(value) :\n                                        coerceToNullishInt64(value);\n  return (value == null) ? (constructMissing ? 0 : undefined) : value;\n}\n\n/**\n * Coerces the given value to a number for map keys. Returns undefined if the\n * value is invalid.\n *\n * @return {number|string|!gbigint|undefined}\n */\nfunction int64KeyToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  let coerced =\n      int64ToApiForMaps(value, assertCorrectTypeForSetters, constructMissing);\n  if (typeof coerced === 'string') {\n    const num = +coerced;\n    if (isSafeInteger(num)) {\n      return num;\n    }\n  }\n  return coerced;\n}\n\n/**\n * Coerces the given value to a number for map values. Returns undefined if\n * the value is invalid.\n *\n * @return {!gbigint|undefined}\n */\nfunction int64GbigintToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  value = assertCorrectTypeForSetters ?\n      /** @type {!gbigint} */ (\n          checkInt64(value, TypeSpecificApiFormat.GBIGINT)) :\n      coerceToNullishInt64Gbigint(value);\n  return (value == null) ? (constructMissing ? GBIGINT_ZERO : undefined) :\n                           value;\n}\n\n\n/**\n * Coerces the given value to a number for map keys. Returns undefined if the\n * value is invalid.\n *\n * @return {!gbigint|undefined}\n */\nfunction int64GbigintKeyToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  return int64GbigintToApiForMaps(\n      value, assertCorrectTypeForSetters, constructMissing);\n}\n\n/**\n * Coerces the given value to a number for map values. Returns  undefined if\n * the value is invalid.\n *\n * @return {number|string|!gbigint|undefined}\n */\nfunction uint64ToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  value = assertCorrectTypeForSetters ? checkUint64(value) :\n                                        coerceToNullishUint64(value);\n  return (value == null) ? (constructMissing ? 0 : undefined) : value;\n}\n\n/**\n * Coerces the given value to a number for map keys. Returns undefined if the\n * value is invalid.\n *\n * @return {number|string|!gbigint|undefined}\n */\nfunction uint64KeyToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  let coerced =\n      uint64ToApiForMaps(value, assertCorrectTypeForSetters, constructMissing);\n  if (typeof coerced === 'string') {\n    const num = +coerced;\n    if (isSafeInteger(num)) {\n      return num;\n    }\n  }\n  return coerced;\n}\n\n/**\n * Coerces the given value to a number for map values. Returns undefined if\n * the value is invalid.\n *\n * @return {!gbigint|undefined}\n */\nfunction uint64GbigintToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  value = assertCorrectTypeForSetters ?\n      /** @type {!gbigint} */ (\n          checkUint64(value, TypeSpecificApiFormat.GBIGINT)) :\n      coerceToNullishUint64Gbigint(value);\n  return (value == null) ? (constructMissing ? GBIGINT_ZERO : undefined) :\n                           value;\n}\n\n\n/**\n * Coerces the given value to a number for map keys. Returns undefined if the\n * value is invalid.\n *\n * @return {!gbigint|undefined}\n */\nfunction uint64GbigintKeyToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  return uint64GbigintToApiForMaps(\n      value, assertCorrectTypeForSetters, constructMissing);\n}\n\n/**\n * Coerces the given value to a number for map keys or values. Returns\n * undefined if the value is invalid.\n *\n * @return {number|undefined}\n */\nfunction floatToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  if (assertCorrectTypeForSetters) return checkFloatingPoint(value);\n  const coerced = coerceToNullishFloatingPoint(value);\n  return coerced ?? (constructMissing ? 0 : undefined);\n}\n\n/**\n * Coerces the given value to a string for map keys or values. Returns\n * undefined if the value is invalid.\n *\n * @return {string|undefined}\n */\nfunction stringToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  if (assertCorrectTypeForSetters) return checkString(value);\n  const coerced = coerceToNullishString(value);\n  return coerced ?? (constructMissing ? '' : undefined);\n}\n\n/**\n * Coerces the given value to a string for map keys. Returns undefined if the\n * value is invalid.\n *\n * @const\n */\nconst stringKeyToApiForMaps = stringToApiForMaps;\n\n/**\n * Coerces the given value to a ByteString for map keys or values. Returns\n * undefined if the value is invalid.\n *\n * @return {!ByteString|undefined}\n */\nfunction bytesToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  if (assertCorrectTypeForSetters) return checkBytes(value);\n  const coerced = coerceToNullishBytes(value);\n  return coerced ?? (constructMissing ? ByteString.empty() : undefined);\n}\n\n/**\n * Coerces the given value to a number for map keys or values. Returns\n * undefined if the value is invalid.\n *\n * @return {number|undefined}\n */\nfunction enumToApiForMaps(\n    /** ? */ value, /** boolean */ assertCorrectTypeForSetters,\n    /** boolean */ constructMissing) {\n  value = assertCorrectTypeForSetters ? checkEnum(value) :\n                                        coerceToNullishEnum(value);\n  if (value == null) {\n    // NOTE: 0 is not necessarily the correct default value for a proto2 enum\n    // (it should be the first value defined in the enum), but we don't have\n    // that information here.\n    return constructMissing ? 0 : undefined;\n  }\n  return value;\n}\n\nexports = {\n  booleanKeyToApiForMaps,\n  booleanToApiForMaps,\n  bytesToApiForMaps,\n  checkBoolean,\n  checkBytes,\n  checkEnum,\n  checkFloatingPoint,\n  checkInt32,\n  checkInt64,\n  checkMessageType,\n  checkNullishBoolean,\n  checkNullishBytes,\n  checkNullishEnum,\n  checkNullishFloatingPoint,\n  checkNullishInt32,\n  checkNullishInt64,\n  checkNullishString,\n  checkNullishUint32,\n  checkNullishUint64,\n  // TODO: b/237837118 - update callers to checkFloatingPoint and remove\n  checkNumber: checkFloatingPoint,\n  checkRepeatedFieldIsArray,\n  checkString,\n  checkUint32,\n  checkUint64,\n  coerceToNullishBoolean,\n  coerceToNullishBytes,\n  coerceToNullishEnum,\n  coerceToNullishInt32,\n  coerceToNullishInt64,\n  coerceToNullishInt64Gbigint,\n  coerceToNullishInt64String,\n  coerceToNullishInt64StringOrNumber,\n  coerceToNullishFloatingPoint,\n  coerceToNullishString,\n  coerceToNullishUint32,\n  coerceToNullishUint64,\n  coerceToNullishUint64Gbigint,\n  coerceToNullishUint64String,\n  coerceToNullishUint64StringOrNumber,\n  convertBigintToInt64Gbigint,\n  convertBigintToUint64Gbigint,\n  convertNumberToInt64Gbigint,\n  convertNumberToUint64Gbigint,\n  convertStringToInt64Gbigint,\n  convertStringToUint64Gbigint,\n  enumToApiForMaps,\n  floatToApiForMaps,\n  getDefaultImmutableInstance,\n  int32KeyToApiForMaps,\n  int32ToApiForMaps,\n  int64KeyToApiForMaps,\n  int64ToApiForMaps,\n  int64GbigintKeyToApiForMaps,\n  int64GbigintToApiForMaps,\n  isNumberShaped,\n  isSafeInt52,\n  isValidSignedInt64,\n  messageFromInlineStorage,\n  stringKeyToApiForMaps,\n  stringToApiForMaps,\n  uint32KeyToApiForMaps,\n  uint32ToApiForMaps,\n  uint64KeyToApiForMaps,\n  uint64ToApiForMaps,\n  uint64GbigintKeyToApiForMaps,\n  uint64GbigintToApiForMaps,\n  coerceToNullishBytesAsStringByteString,\n};\n","// source: uservoice/common/flags/flag_service.proto\n/**\n * @fileoverview\n * @suppress {useOfGoogProvide,missingRequire}\n */\n// NO CHECKED-IN PROTOBUF GENCODE\n// GENERATED CODE -- DO NOT EDIT!\n\ngoog.provide('jspb$ro.uservoice$common$flags$ReadonlyAlohaFormPropertiesResponse');\ngoog.provide('jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse');\n\ngoog.require('jspb$uservoice$common$flags$MutableAlohaFlags');\ngoog.require('jspb_internal_adapters');\ngoog.require('jspb_internal_public_for_gencode');\n/** @suppress {extraRequire} */\ngoog.requireType('google3.javascript.apps.jspb.internal_records');\ngoog.requireType('google3.javascript.common.asserts.asserts');\ngoog.requireType('jspb$r$uservoice$common$flags$AlohaFormPropertiesResponse$internalDoNotUseReader');\ngoog.requireType('jspb$ro.uservoice$common$flags$ReadonlyAlohaFlags');\ngoog.requireType('jspb$uservoice$common$flags$ImmutableAlohaFormPropertiesResponse');\n\n/**\n * @final\n * @extends {jspb_internal_public_for_gencode.GeneratedMessage<!jspb$uservoice$common$flags$ImmutableAlohaFormPropertiesResponse>}\n * @implements {jspb$r$uservoice$common$flags$AlohaFormPropertiesResponse$internalDoNotUseReader}\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse = class extends jspb_internal_public_for_gencode.GeneratedMessage {\n  /**\n   * @usedViaDotConstructor\n   * @param {?Array<?>=} data See go/jspb-api-gotchas#construct_from_array\n   */\n  constructor(data) {\n    super(data);\n  }\n\n\n  /**\n   * optional AlohaFlags aloha_flags = 1;\n   * @override\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags|undefined}\n   */\n  getAlohaFlags() {\n    return jspb_internal_adapters.getWrapperFieldOrUndefined(this, jspb$uservoice$common$flags$MutableAlohaFlags, 1);\n  }\n\n\n  /**\n   * optional AlohaFlags aloha_flags = 1;\n   * @override\n   * @return {!jspb$ro.uservoice$common$flags$ReadonlyAlohaFlags}\n   */\n  getReadonlyAlohaFlags() {\n    return jspb_internal_adapters.getReadonlyWrapperField(this, jspb$uservoice$common$flags$MutableAlohaFlags, 1);\n  }\n\n\n  /**\n   * optional AlohaFlags aloha_flags = 1;\n   * @param {!jspb_internal_public_for_gencode.OrUndefinedToken<U>=} legacyOrUndefined\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags|R}\n   * @template U\n   * @template R := cond(eq(U, 'undefined'), 'undefined', 'jspb$uservoice$common$flags$MutableAlohaFlags') =:\n   * @tsType (legacyOrUndefined: import('google3/javascript/apps/jspb/internal_public').OrUndefinedToken<undefined>): \u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFlags|undefined\n   * @tsType (): \u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFlags\n   */\n  getMutableAlohaFlags(legacyOrUndefined) {\n    return jspb_internal_adapters.getMutableWrapperField(this, jspb$uservoice$common$flags$MutableAlohaFlags, 1, legacyOrUndefined);\n  }\n\n\n  /**\n   * @param {!jspb$ro.uservoice$common$flags$ReadonlyAlohaFlags|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse} returns this\n   */\n  setAlohaFlags(value) {\n    return jspb_internal_adapters.setWrapperField(this, jspb$uservoice$common$flags$MutableAlohaFlags, 1, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse} returns this\n   */\n  clearAlohaFlags() {\n    return jspb_internal_adapters.clearField(this, 1);\n  }\n\n\n  /**\n   * Returns whether this field is set.\n   * @override\n   * @return {boolean}\n   */\n  hasAlohaFlags() {\n    return jspb_internal_adapters.hasWrapperField(this, jspb$uservoice$common$flags$MutableAlohaFlags, 1);\n  }\n\n\n  /**\n   * optional AlohaFlags aloha_flags = 1;\n   * @override\n   * @return {!jspb$ro.uservoice$common$flags$ReadonlyAlohaFlags|undefined}\n   */\n  getAlohaFlagsOrUndefined() {\n    return jspb_internal_adapters.getReadonlyWrapperFieldOrUndefined(this, jspb$uservoice$common$flags$MutableAlohaFlags, 1);\n  }\n\n\n};\n\n/**\n * @override\n * @return {!jspb$uservoice$common$flags$ImmutableAlohaFormPropertiesResponse}\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.prototype.toImmutable;\n/**\n * @override\n * @return {!jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse}\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.prototype.clone;\n/**\n * @const {function(string):!jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse}\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.deserialize = /** @pureOrBreakMyCode */(jspb_internal_public_for_gencode.makeMutableDeserializeFunction(jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse));\n\n/**\n * Returns whether the given value is an instance of jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.\n * @const {!google3.javascript.common.asserts.asserts.TypeGuard<!jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse>}\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.hasInstance = /** @pureOrBreakMyCode */ (jspb_internal_public_for_gencode.makeHasMutableInstance(jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse));\n\n/**\n * Object form of AlohaFormPropertiesResponse as accepted by the `fromObject` method.\n * @typedef {{\n *  alohaFlags: (?jspb$uservoice$common$flags$MutableAlohaFlags.ObjectFormat|undefined)\n * }}\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.ObjectFormat;\n/**\n * Serializes the message to binary data (in protobuf wire format).\n *\n * If you see this method undefined, you probably need to import\n * the message type directly.\n *\n * @return {!Uint8Array}\n * @deprecated please call the static method instead: this one is only sometimes defined.\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.prototype.serializeBinary;\n\n/**\n * Serializes the message to an unstable object format.\n *\n * @private\n * @return {!jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.ObjectFormat}\n * @deprecated see go/jspb-api-gotchas#objects. This is only sometimes defined.\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.prototype.toObject;\n\nif (jspb_internal_public_for_gencode.GENERATE_TYPE_NAME_PROPERTIES) {\n  /**\n   * The proto type name for uservoice$common$flags$MutableAlohaFormPropertiesResponse.\n   *\n   * @nodts\n   * @nocollapse\n   * @const {string|undefined}\n   */\n  jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.internalDoNotUse_debugOnlyProtoTypeName = \"uservoice.common.flags.AlohaFormPropertiesResponse\";\n}\n\n/**\n * @typedef {!jspb$uservoice$common$flags$ImmutableAlohaFormPropertiesResponse|!jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse}\n */\njspb$ro.uservoice$common$flags$ReadonlyAlohaFormPropertiesResponse = {};\n\nif (goog.DEBUG && !COMPILED) {\n  /**\n   * @public\n   * @override\n   * @type {string}\n   */\n  jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.displayName = 'proto.uservoice.common.flags.AlohaFormPropertiesResponse';\n}\n/**\n * Interface form of AlohaFormPropertiesResponse as accepted by `fromFields` and produced by `getFields`.\n * @typedef {{\n *  alohaFlags: (!jspb$ro.uservoice$common$flags$ReadonlyAlohaFlags|undefined)\n * }}\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.FieldsInterface;\n\n/**\n * Constructs a set of proto fields into an immutable proto.\n *\n * This method can only be called in TS and must be passed an object.\n * literal with keys matching the setter names (so where you have\n * setFooList on the type, you can write {fooList: ...} here).\n *\n * See go/jspb-fields-interface for more information.\n *\n * This record format is **not a serialization format**.\n * @package this cannot be called from JS.\n * @param {!jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.FieldsInterface} record\n * @return {!jspb$uservoice$common$flags$ImmutableAlohaFormPropertiesResponse}\n * @tsType (fields : import('google3/javascript/apps/jspb/internal_records').PartialFields<\u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse, \u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.FieldsInterface, \u0ca0_\u0ca0.clutz.jspbInternalDoNotUse$RecordExtensionRegistry>): \u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$ImmutableAlohaFormPropertiesResponse\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.fromFields = /** @pureOrBreakMyCode */ (jspb_internal_public_for_gencode.makeFromFieldsForTesting(jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse));\n\n/**\n * Retrieves the fields of this proto in a destructurable interface.\n *\n * This method can only be called in TS and the result must be\n * immediately destructured (so you can write\n * const {a} = Foo.getFields(value);).\n *\n * See go/jspb-fields-interface for more information.\n *\n * @package this cannot be called from JS.\n * @param {!jspb$ro.uservoice$common$flags$ReadonlyAlohaFormPropertiesResponse} value\n * @return {!jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.FieldsInterface}\n * @tsType (value: \u0ca0_\u0ca0.clutz.jspb$ro.uservoice$common$flags$ReadonlyAlohaFormPropertiesResponse): import('google3/javascript/apps/jspb/internal_records').ReadonlyFields<\u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse, \u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.FieldsInterface, \u0ca0_\u0ca0.clutz.jspbInternalDoNotUse$RecordExtensionRegistry>\n */\njspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse.getFields = /** @pureOrBreakMyCode */ (jspb_internal_public_for_gencode.makeGetFieldsForTesting());\n","/**\n * @fileoverview Main library for JSPB, includes functions and classes related\n * to `Message` the baseclass of all generated protocol buffers.\n *\n * Functionality should go in this file if it is part of `Message` or is\n * directly related to `Message` and can't be reasonably used independently of\n * `Message`.  If the functionality is only needed for rare cases or by the\n * generated code, it would ideally go in a different file.\n */\ngoog.module('jspb');\n\nconst asserts = goog.require('goog.asserts');\nconst xid = goog.requireType('xid');\nconst {ArrayStateFlags, copyArrayBitsClone, getMessageArrayState, markArrayImmutable, markMutableReferencesAreOwned, setArrayState} = goog.require('jspb.internal_array_state');\nconst {DETAILED_JSPB_ASSERTS, GENERATE_TYPE_NAME_PROPERTIES, USE_DETAILED_MESSAGE_TYPE_HIERARCHY, getCheckEqualsConsistentWithHashCode, getCheckEqualsDoesNotChangeWithTypeInformation} = goog.require('jspb.internal_options');\nconst {EXEMPTED_SUBCLASS_MARKER, GENERATED_SUBCLASS_MARKER, InternalMessage, MESSAGE_PROTOTYPE_MARKER_VALUE, checkMutableMessage, disallowPassingToStructuredClone, getHasMessageId, getInternalArray, isImmutableMessage, isSparseObject, setInternalArray, setInternalArrayForNewMessage, setMessageCtorInDebug} = goog.require('jspb.internal');\nconst {ExtensionFieldInfo} = goog.requireType('jspb.extension_field_info');\nconst {ImmutableMessage} = goog.requireType('jspb.immutable_message');\nconst {MESSAGE_PROTOTYPE_MARKER} = goog.require('jspb.internal_symbols');\nconst {MutableMessageInterface} = goog.require('jspb.message_interface');\nconst {MutableMessage} = goog.requireType('jspb.mutable_message');\nconst {PivotSelector} = goog.require('jspb.dynamic_pivot_selection');\nconst {clearField, getMutableWrapperField, getReadonlyRepeatedWrapperField, getReadonlyWrapperField, getRepeatedFieldReturnType, getRepeatedIndexedMutableWrapper, hasWrapperField} = goog.require('jspb_internal_adapters');\nconst {clearUnknownField, maybeReviveUnknownField, recordUnknownFieldAccess} = goog.require('jspb.internal_unknown_fields');\nconst {cloneRaw, toJsonValue} = goog.require('jspb.internal_copy');\nconst {compareFields, compareMessages} = goog.require('jspb.internal_compare');\nconst {constructMessageArrayForMessageConstructor} = goog.require('jspb.internal_construct');\nconst {copyMutableIntoMessage, copyMutableWithImmutableFields, deserializeAsImmutable, messageToImmutable, messageToMutable} = goog.require('jspb.internal_immutability');\nconst {dumpInternal} = goog.require('jspb.internal_dump');\nconst {getDefaultImmutableInstance} = goog.require('jspb.internal_accessor_helpers');\nconst {hashCode} = goog.require('jspb.internal_j2cl_helpers');\nconst {logNewArray, logOperation, withoutLogging} = goog.require('jspb.internal_operations');\nconst {transferArray} = goog.require('jspb.internal.transfer_array');\n/** @suppress {extraRequire} used by TTL. */\ngoog.requireType('jspb.immutable_message.ImmutableMessage');\n/** @suppress {extraRequire} used by TTL. */\ngoog.requireType('jspb.mutable_message.MutableMessage');\n\n\n/**\n * @define {boolean} Whether to generate toString methods for objects. Turn\n *     this off if you do not use toString in your project and want to trim it\n *     from the compiled JS.\n */\nconst GENERATE_TO_STRING = goog.define('jspb.Message.GENERATE_TO_STRING', true);\n\n\n/**\n * Base class for all JsPb messages.\n *\n * Several common methods (toObject, serializeBinary, in particular) are not\n * defined on the prototype to encourage code patterns that minimize code bloat\n * due to otherwise unused code on all protos contained in the project.\n *\n * If you want to call these methods on a generic message, either\n * pass in your instance of method as a parameter:\n *     someFunction(instanceOfKnownProto,\n *                  KnownProtoClass.prototype.serializeBinary);\n * or use a lambda that knows the type:\n *     someFunction(()=>instanceOfKnownProto.serializeBinary());\n * or, if you don't care about code size, just suppress the\n *     WARNING - Property serializeBinary never defined on Message\n * and call it the intuitive way.\n *\n * @abstract\n * @struct\n * @implements {InternalMessage}\n * @implements {MutableMessageInterface<ImmutableMessage, MutableMessage>}\n */\nclass Message {\n  /**\n   * @param {?Array<?>|undefined} data An initial data array.\n   * @param {number=} suggestedPivot The field number at which to\n   *     firstFieldIndex putting fields into the extension object. This is only\n   *     used if data does not contain an extension object already. 0/undefined\n   *     if no extension object is required for this message type.\n   * @param {string=} messageId The jspb message_id if any\n   */\n  constructor(data, suggestedPivot, messageId) {\n    // We set this below if it's a property and not a symbol but we need to\n    // declare it here.\n    /** @const {undefined} */\n    this.messagePrototypeMarker;\n\n    if (goog.DEBUG) {\n      makeMessageUnpredicable(this);\n      disallowPassingToStructuredClone(this);\n\n      // Add some debug only consistency checks\n      // Were we directly called?\n      asserts.assertInstanceof(\n          this, Message,\n          'The message constructor should only be used by subclasses');\n\n      // Were we directly instantiated?\n      asserts.assert(\n          this.constructor !== Message,\n          'Message is an abstract class and cannot be directly constructed');\n\n      // Now check that we are an expected subclass, or explicitly exempted.\n      if (asserts.ENABLE_ASSERTS &&\n          // Cast is necessary to remove @struct\n          (/** @type {!Object} */ (this)[EXEMPTED_SUBCLASS_MARKER] !== true) &&\n          USE_DETAILED_MESSAGE_TYPE_HIERARCHY) {\n        // We could technically do both checks at once with the second assert,\n        // but this leads to slightly better error messages.\n\n        // Is this a subclass of GeneratedMessage?\n        asserts.assert(\n            // Cast is necessary to remove @struct\n            /** @type{!Object} */ (this)[GENERATED_SUBCLASS_MARKER] === true,\n            'Message can only be subclassed by proto gencode.');\n        const parentPrototype =\n            Object.getPrototypeOf(asserts.assert(Object.getPrototypeOf(this)));\n        // Is the concrete type a direct subclass of GeneratedMessage.\n        asserts.assert(\n            parentPrototype.hasOwnProperty(GENERATED_SUBCLASS_MARKER),\n            'Generated jspb classes should not be extended');\n      }\n    }\n\n    setInternalArrayForNewMessage(\n        this,\n        constructMessageArrayForMessageConstructor(\n            data, suggestedPivot, messageId));\n\n    if (goog.DEBUG && asserts.ENABLE_ASSERTS) {\n      const arrayState = getMessageArrayState(getInternalArray(this));\n      asserts.assert(arrayState & ArrayStateFlags.CONSTRUCTED);\n      asserts.assert(arrayState & ArrayStateFlags.HAS_WRAPPER);\n      if (DETAILED_JSPB_ASSERTS) logOperation({constructMessage: 1});\n    }\n  }\n\n  /**\n   * Returns the JsPb message_id of this proto.\n   * @deprecated using this can encourage changing the value of message_id on\n   *   the message, which is highly breaking per go/jspb-options#message_id.\n   * @override\n   * @return {string|undefined} the message id or undefined if this message\n   *     has no id.\n   */\n  getJsPbMessageId() {\n    return /** @type {{messageId: (string|undefined)}} */ (this.constructor)\n        .messageId;\n  }\n\n  /**\n   * Returns this JSPB as a JSON-compatible array.\n   *\n   * WARNING: The objects returned should be treated as opaque values and only\n   * used for passing data eventually to a supported JSPB parser. Dereferencing\n   * into these objects to retrieve data is not supported and subject to random\n   * breakages.\n   *\n   * See go/jspb-api-gotchas#toJsonValue for more information.\n   *\n   * This value is NOT the go/jsonpb format. For that, see go/jspb-json-interop.\n   *\n   * Generally, `serialize()` should be called instead, but this may be useful\n   * when a JSON stringifiable value is required for compatibility with other\n   * APIs.\n   *\n   * Note that this function performs a deep clone and converts internal\n   * Uint8Array objects to base64 strings, and therefore the function is fairly\n   * expensive, though not quite as expensive as serializing then deserializing.\n   *\n   * @param {!PivotSelector=} pivotSelector to use for selecting a pivot.\n   * @return {!Array<?>} The proto represented as an array.\n   * @override\n   */\n  toJsonValue(pivotSelector) {\n    return toJsonValue(this, pivotSelector);\n  }\n\n  /**\n   * Returns this JSPB as a JSON.stringify-compatible array.\n   *\n   * Generally, `serialize()` should be called instead, but this may be useful\n   * when a JSON stringifiable value is required for compatibility with other\n   * APIs.\n   *\n   * @return {!Array<?>} The proto represented as an array.\n   * @override\n   * @private\n   */\n  toJSON() {\n    // TODO(b/385213186): delete this method. The JSPB runtime no longer relies\n    // on it. Add an assert fail, then delete.\n    return toJsonValue(this);\n  }\n\n  /**\n   * Serializes a message to the go/jspb-wireformat for use in server requests.\n   *\n   * @override\n   * @this {!Message}\n   * @param {!PivotSelector=} pivotSelector to use for selecting a pivot.\n   * @return {string} The serialized proto.\n   */\n  serialize(pivotSelector) {\n    return JSON.stringify(toJsonValue(this, pivotSelector));\n  }\n\n  /**\n   * Deserialize a JsPb string.\n   * @param {function(new:JSPB, ?Array=)} ctor The constructor of the\n   *     message type.\n   * @param {string} data Our serialized data.\n   * @return {JSPB} The new message with the serialized data populating\n   *     its fields.\n   * @template JSPB\n   */\n  static deserializeWithCtor(ctor, data) {\n    // use asserts on parameters as a defense in depth for our type signatures\n    // use actual errors for issues related to data.\n    asserts.assertFunction(ctor);\n    // Treat null/undefined/'' as an empty message. This is heavily depended\n    // upon by tests and production applications.\n    //\n    // TODO(b/219382249): null/undefined is somewhat defensible but '' less so,\n    // try to eliminate that case.\n    if (data == null || data == '') {\n      return asserts.assertInstanceof(new ctor(), Message);\n    }\n\n    asserts.assertString(data);\n    const array = JSON.parse(data);\n    if (!Array.isArray(array)) {\n      throw new Error(\n          goog.DEBUG ? ('Expected to deserialize an Array but got ' +\n                        goog.typeOf(array) + ': ' + array) :\n                       'dnarr');\n    }\n\n    return new ctor(markMutableReferencesAreOwned(array));\n  }\n\n  /**\n   * Gets the value of the extension field from the extended object.\n   *\n   * This may actually return `null|undefined` (b/26920357) but is incorrectly\n   * typed: prefer using `getExtensionOrUndefined` which is more explicit. See\n   * go/jspb-api-gotchas#nullability\n   *\n   * @override\n   * @param {!ExtensionFieldInfo<M, I, EXTENDEE, IE>} fieldInfo Specifies the\n   *     field to get.\n   * @return {M} The value of the field.\n   * @template M, I, IE\n   * @template THIS\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * @this {THIS}\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS,\n   *   MValue,\n   *   IValue,\n   *   MExtendee extends\n   *     | THIS\n   *     |\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>,\n   *   IExtendee extends\n   *     | THIS\n   *     | import('google3/javascript/apps/jspb/immutable_message')\n   *           .ImmutableMessage<THIS>\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     MExtendee,\n   *     IExtendee\n   *   >\n   * ): THIS extends\n   *     import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage\n   *   ? IValue\n   *   : MValue\n   */\n  getExtension(fieldInfo) {\n    asserts.assertInstanceof(this, fieldInfo.extendeeCtor);\n    const self = /** @type {!MutableMessage<I>} */ (\n        asserts.assertInstanceof(this, Message));\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(self, fieldInfo.fieldIndex, fieldInfo.lazyParse);\n    const freezeOptOut = undefined;\n    const value = fieldInfo.ctor ?\n        (fieldInfo.isRepeated ? fieldInfo.getExtensionFn(\n                                    self, fieldInfo.ctor, fieldInfo.fieldIndex,\n                                    getRepeatedFieldReturnType(freezeOptOut),\n                                    fieldInfo.hasMessageId) :\n                                fieldInfo.getExtensionFn(\n                                    self, fieldInfo.ctor, fieldInfo.fieldIndex,\n                                    fieldInfo.hasMessageId)) :\n        (fieldInfo.isRepeated ?\n             fieldInfo.getExtensionFn(\n                 self, fieldInfo.fieldIndex,\n                 getRepeatedFieldReturnType(freezeOptOut),\n                 fieldInfo.hasMessageId) :\n             fieldInfo.getExtensionFn(\n                 self, fieldInfo.fieldIndex, fieldInfo.defaultValue,\n                 fieldInfo.hasMessageId));\n\n    // Otherwise, return.\n    return value;\n  }\n\n  /**\n   * Gets the value of the message-valued extension field from the extended\n   * object. This can be singular or repeated, if singular and not present, this\n   * accessor returns a default instance.\n   *\n   * This cannot be used with ImmutableJS extensions.\n   *\n   * @override\n   * @param {!ExtensionFieldInfo<M, I, EXTENDEE>} fieldInfo Specifies the field\n   *     to get.\n   * @return {READONLY_RESULT_WITHOUT_UNKNOWNS} The value of the field.\n   * @template M, I\n   * @template THIS\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * @template READONLY_RESULT :=\n   *   mapunion(union(M, I), (X) =>\n   *     cond(\n   *       sub(\n   *         cond(isTemplatized(X) && (\n   *           eq(rawTypeOf(X), 'Array') || eq(rawTypeOf(X), 'ReadonlyArray')),\n   *           templateTypeOf(X, 0),\n   *           X),\n   *         union(\n   *           'jspb.mutable_message.MutableMessage',\n   *           'jspb.immutable_message.ImmutableMessage')),\n   *       X,\n   *       none()))\n   * =:\n   * @template READONLY_RESULT_WITHOUT_UNKNOWNS :=\n   *   cond(isUnknown(READONLY_RESULT), 'undefined', READONLY_RESULT)\n   * =:\n   * @this {THIS}\n   * @tsType <\n   *   THIS,\n   *   MValue extends\n   *     | import('google3/javascript/apps/jspb/mutable_message').MutableMessage\n   *     | ReadonlyArray<\n   *         import('google3/javascript/apps/jspb/mutable_message').MutableMessage\n   *       >,\n   *   IValue extends\n   *     |\n   * import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage\n   *     | ReadonlyArray<\n   *         import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage\n   *       >,\n   *   MExtendee extends\n   *     THIS extends import('google3/javascript/apps/jspb/immutable_message')\n   *         .ImmutableMessage<unknown>\n   *       ?\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>\n   *       : THIS\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     MExtendee\n   *   >\n   * ): THIS extends import('google3/javascript/apps/jspb/immutable_message')\n   *     .ImmutableMessage<unknown>\n   *   ? IValue\n   *   : MValue | IValue\n   */\n  getReadonlyExtension(fieldInfo) {\n    asserts.assert(fieldInfo.ctor);\n    asserts.assertInstanceof(this, fieldInfo.extendeeCtor);\n    const self = /** @type {!Message} */ (this);\n    // TODO: b/397982381 - this is buggy with unknown fields, we only report\n    // for now to preserve existing behavior.\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(self, fieldInfo.fieldIndex, fieldInfo.lazyParse);\n    return fieldInfo.isRepeated ?\n        getReadonlyRepeatedWrapperField(\n            self, fieldInfo.ctor, fieldInfo.fieldIndex,\n            fieldInfo.hasMessageId) :\n        getReadonlyWrapperField(\n            self, fieldInfo.ctor, fieldInfo.fieldIndex, fieldInfo.hasMessageId);\n  }\n\n  /**\n   * Gets the value of the message-valued extension field from the extended\n   * object as a mutable message. The field must be singular, since getExtension\n   * will already return only truthy mutable values for repeated fields.\n   *\n   * This cannot be used with ImmutableJS extensions.\n   *\n   * @protected exposed on mutable messages\n   * @param {!ExtensionFieldInfo<M, I, EXTENDEE>} fieldInfo Specifies the field\n   *     to get.\n   * @return {MUTABLE_RESULT_WITHOUT_UNKNOWNS} The value of the field.\n   * @template M, I\n   * @template THIS\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * @template MUTABLE_RESULT :=\n   *   mapunion(union(M, I), (X) =>\n   *     cond(sub(X, 'jspb.mutable_message.MutableMessage'), X, none()))\n   * =:\n   * @template MUTABLE_RESULT_WITHOUT_UNKNOWNS :=\n   *   cond(isUnknown(MUTABLE_RESULT), 'undefined', MUTABLE_RESULT)\n   * =:\n   * @this {THIS}\n   * @tsType <\n   *   THIS,\n   *   MValue extends\n   *     import('google3/javascript/apps/jspb/mutable_message').MutableMessage,\n   *   IValue extends\n   *     import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage,\n   *   MExtendee extends\n   *     THIS extends import('google3/javascript/apps/jspb/immutable_message')\n   *         .ImmutableMessage<unknown>\n   *       ?\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>\n   *       : THIS\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     MExtendee\n   *   >\n   * ): THIS extends import('google3/javascript/apps/jspb/immutable_message')\n   *     .ImmutableMessage<unknown>\n   *   ? never\n   *   : MValue\n   */\n  getMutableExtension(fieldInfo) {\n    asserts.assert(fieldInfo.ctor);\n    asserts.assertInstanceof(this, fieldInfo.extendeeCtor);\n    asserts.assert(!fieldInfo.isRepeated);\n    const self = /** @type {!Message} */ (this);\n    // TODO: b/397982381 - this is buggy with unknown fields, we only report\n    // for now to preserve existing behavior.\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(self, fieldInfo.fieldIndex, fieldInfo.lazyParse);\n    return getMutableWrapperField(\n        self, fieldInfo.ctor, fieldInfo.fieldIndex,\n        /* legacyOrUndefined= */ undefined, fieldInfo.hasMessageId);\n  }\n\n  /**\n   * Gets the value of the singular extension field from the extended object,\n   * returning `undefined` if it is not present.\n   *\n   * @param {!ExtensionFieldInfo<M, I, EXTENDEE, IE>} fieldInfo Specifies the\n   *     field to get.\n   * @return {MESSAGE_TYPE_NOT_ARRAY|undefined} The value of the field.\n   * @template M, I, IE\n   * @template THIS\n   * @this {THIS}\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * @template MESSAGE_TYPE_NOT_ARRAY :=\n   *     cond(isUnknown(M), unknown(),\n   *       mapunion(M, (X) =>\n   *         cond(eq(X, 'undefined'), none(),\n   *           cond(sub(X, 'ReadonlyArray'), none(),\n   *             X))))\n   * =:\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS extends\n   *     import('google3/javascript/apps/jspb/mutable_message').MutableMessage,\n   *   MValue,\n   *   IValue,\n   *   MExtendee extends THIS,\n   *   IExtendee extends\n   *     import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage<THIS>\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     Exclude<MValue, readonly unknown[]>,\n   *     Exclude<IValue, readonly unknown[]>,\n   *     MExtendee,\n   *     IExtendee\n   *   >\n   * ): MValue | undefined\n   * @tsType <\n   *   THIS extends\n   *     import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage,\n   *   MValue,\n   *   IValue,\n   *   MExtendee extends\n   *     import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>,\n   *   IExtendee extends THIS\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     Exclude<MValue, readonly unknown[]>,\n   *     Exclude<IValue, readonly unknown[]>,\n   *     MExtendee,\n   *     IExtendee\n   *   >\n   * ): IValue | undefined\n   * @tsType <\n   *   THIS,\n   *   MValue,\n   *   IValue,\n   *   MExtendee extends\n   *     | THIS\n   *     |\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>,\n   *   IExtendee extends\n   *     | THIS\n   *     | import('google3/javascript/apps/jspb/immutable_message')\n   *           .ImmutableMessage<THIS>\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     Exclude<MValue, readonly unknown[]>,\n   *     Exclude<IValue, readonly unknown[]>,\n   *     MExtendee,\n   *     IExtendee\n   *   >\n   * ): MValue | IValue | undefined\n   */\n  getExtensionOrUndefined(fieldInfo) {\n    asserts.assert(\n        !fieldInfo.isRepeated,\n        'repeated extensions don\\'t support getExtensionOrUndefined');\n    asserts.assertInstanceof(this, fieldInfo.extendeeCtor);\n    const self = /** @type {!MutableMessage<I>} */ (\n        asserts.assertInstanceof(this, Message));\n    // TODO: b/397982381 - this is buggy with unknown fields, we only report\n    // for now to preserve existing behavior.\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(self, fieldInfo.fieldIndex, fieldInfo.lazyParse);\n    const result = fieldInfo.ctor ?\n        fieldInfo.getExtensionFn(\n            self, fieldInfo.ctor, fieldInfo.fieldIndex,\n            fieldInfo.hasMessageId) :\n        // Deliberately use null as the defaultValue to identify absence\n        fieldInfo.getExtensionFn(\n            self, fieldInfo.fieldIndex, /* defaultValue= */ null,\n            fieldInfo.hasMessageId);\n    return result === null ? undefined : result;\n  }\n\n  /**\n   * Returns whether the given singular extension is present.\n   *\n   * @override\n   * @param {!ExtensionFieldInfo<T, I, EXTENDEE, IE>} fieldInfo Specifies the\n   *     field to get.\n   * @return {boolean} Whether the extension is present.\n   * @template T, I, IE\n   * @template THIS\n   * @this {THIS}\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS,\n   *   MValue,\n   *   IValue,\n   *   MExtendee extends\n   *     | THIS\n   *     |\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>,\n   *   IExtendee extends\n   *     | THIS\n   *     | import('google3/javascript/apps/jspb/immutable_message')\n   *           .ImmutableMessage<THIS>\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     Exclude<MValue, readonly unknown[]>,\n   *     IValue,\n   *     MExtendee,\n   *     IExtendee\n   *   >\n   * ): boolean\n   */\n  hasExtension(fieldInfo) {\n    asserts.assert(\n        !fieldInfo.isRepeated,\n        'repeated extensions don\\'t support hasExtension');\n    const self = /** @type{!MutableMessage<I>} */ (\n        asserts.assertInstanceof(this, Message));\n    // TODO: b/397982381 - this is buggy with unknown fields, we only report\n    // for now to preserve existing behavior.\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(self, fieldInfo.fieldIndex, fieldInfo.lazyParse);\n    return fieldInfo.ctor ?\n        hasWrapperField(\n            self, fieldInfo.ctor, fieldInfo.fieldIndex,\n            fieldInfo.hasMessageId) :\n        (self.getExtensionOrUndefined(fieldInfo) !== undefined);\n  }\n\n  /**\n   * Gets a value in a repeated extension field.\n   *\n   * @override\n   * @param {!ExtensionFieldInfo<!ReadonlyArray<M>, !ReadonlyArray<I>,\n   *     EXTENDEE>} fieldInfo Specifies the field to get.\n   * @param {number} idx The index to read from this field.\n   * @return {M|I} The value of the field.\n   * @template M, I\n   * @template THIS\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * @this {THIS}\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS,\n   *   MValue extends ReadonlyArray<any>,\n   *   IValue extends ReadonlyArray<any>,\n   *   MExtendee extends\n   *     | THIS\n   *     |\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>,\n   *   IExtendee extends\n   *     | THIS\n   *     | import('google3/javascript/apps/jspb/immutable_message')\n   *           .ImmutableMessage<THIS>\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     MExtendee,\n   *     IExtendee\n   *   >,\n   *   idx: number\n   * ): MValue[number] | IValue[number]\n   */\n  getExtensionAtIndex(fieldInfo, idx) {\n    const self = asserts.assertInstanceof(this, Message);\n    asserts.assertInstanceof(self, fieldInfo.extendeeCtor);\n    asserts.assert(fieldInfo.isRepeated);\n    // TODO: b/397982381 - this is buggy with unknown fields, we only report\n    // for now to preserve existing behavior.\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(self, fieldInfo.fieldIndex, fieldInfo.lazyParse);\n    return fieldInfo.ctor ?\n        fieldInfo.getExtensionAtIndexFn(\n            self, fieldInfo.fieldIndex, fieldInfo.ctor, idx,\n            fieldInfo.hasMessageId) :\n        fieldInfo.getExtensionAtIndexFn(\n            self, fieldInfo.fieldIndex, idx, fieldInfo.hasMessageId);\n  }\n\n  /**\n   * Gets the length of a repeated extension field.\n   *\n   * @override\n   * @param {!ExtensionFieldInfo<!ReadonlyArray<M>, !ReadonlyArray<I>,\n   *     EXTENDEE>} fieldInfo Specifies the field to get.\n   * @return {number} The number of values in this field.\n   * @template M, I\n   * @template THIS\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * @this {THIS}\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS,\n   *   MValue extends ReadonlyArray<any>,\n   *   IValue extends ReadonlyArray<any>,\n   *   MExtendee extends\n   *     THIS extends import('google3/javascript/apps/jspb/immutable_message')\n   *         .ImmutableMessage<unknown>\n   *       ?\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>\n   *       : THIS\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     MExtendee\n   *   >\n   * ): number\n   */\n  getExtensionCount(fieldInfo) {\n    const self = /** @type {!Message} */ (this);\n    asserts.assertInstanceof(self, fieldInfo.extendeeCtor);\n    asserts.assertInstanceof(self, Message);\n    asserts.assert(fieldInfo.isRepeated);\n    // TODO: b/397982381 - this is buggy with unknown fields, we only report\n    // for now to preserve existing behavior.\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(self, fieldInfo.fieldIndex, fieldInfo.lazyParse);\n    return fieldInfo.ctor ?\n        fieldInfo.getExtensionCountFn(\n            self, fieldInfo.ctor, fieldInfo.fieldIndex,\n            fieldInfo.hasMessageId) :\n        fieldInfo.getExtensionCountFn(\n            self, fieldInfo.fieldIndex, fieldInfo.hasMessageId);\n  }\n\n  /**\n   * Creates a difference object between two messages.\n   *\n   * The result will contain the top-level fields of m2 that differ from those\n   * of m1 at any level of nesting.\n   *\n   * @param {MESSAGE_TYPE} m1 The first message object.\n   * @param {MESSAGE_TYPE} m2 The second message object.\n   * @return {MESSAGE_TYPE_NOT_UNDEFINED} The difference returned as a proto\n   *     message. Note that the returned message may be missing required fields.\n   *     This is currently tolerated in JS, but would cause an error if you\n   *     tried to send such a proto to the server.\n   * @throws {!Error} If the messages are responses with different types.\n   *\n   * Use go/closure-ttl to declare a non-undefined version of T_CHILD. Replace\n   * the undefined in blah|undefined with none. This is necessary because the\n   * compiler will infer MESSAGE_TYPE to be |undefined.\n   * @template MESSAGE_TYPE\n   * @template MESSAGE_TYPE_NOT_UNDEFINED :=\n   *     cond(isUnknown(MESSAGE_TYPE), unknown(),\n   *       mapunion(MESSAGE_TYPE, (X) =>\n   *         cond(eq(X, 'undefined'), none(), X)))\n   * =:\n   * @tsType <T extends\n   * import('google3/javascript/apps/jspb/message').Message>(m1: T, m2: T): T\n   * @deprecated Avoid using this method, consider tracking differences manually\n   *     or using APIs like `jspb.debug.messageEquals` to compare protos. See\n   *     go/jspb-api-gotchas#difference for more information.\n   */\n  static difference(m1, m2) {\n    if (!(m1 instanceof Message)) {\n      throw new Error('Message.difference called on non-Message.');\n    }\n    if (m1.constructor !== m2.constructor) {\n      throw new Error('Messages have different types.');\n    }\n    const isImmutable = isImmutableMessage(m1);\n    if (isImmutable !== isImmutableMessage(m2)) {\n      throw new Error('Messages must both be immutable or both be mutable.');\n    }\n    const arr1 = getInternalArray(m1);\n    // Convert to immutable to make field values safe to share.\n    const arr2 = getInternalArray(messageToImmutable(m2));\n    const res = logNewArray([]);\n    let firstFieldIndex = 0;\n    const length = Math.max(arr1.length, arr2.length);\n    const messageId = m1.getJsPbMessageId();\n    if (messageId) {\n      res[0] = messageId;\n      firstFieldIndex = 1;\n    }\n    for (let i = firstFieldIndex; i < length; i++) {\n      const v1 = arr1[i];\n      const v2 = arr2[i];\n      if (i === arr2.length - 1 && isSparseObject(v2)) {\n        // According to the implementation of compareFields, if one is a\n        // sparse object, they should both be.\n        const resObj = (res[i] = {});\n        const fromObj = isSparseObject(v1) ? v1 : {};\n        const toObj = arr2[i];\n        for (const key in toObj) {\n          if (!compareFields(fromObj[key], toObj[key])) {\n            resObj[key] = toObj[key];\n          }\n        }\n      } else if (!compareFields(v1, v2)) {\n        res[i] = v2;\n      }\n    }\n    if (isImmutable) {\n      markArrayImmutable(res);\n    }\n    return new m1.constructor(markMutableReferencesAreOwned(res));\n  }\n\n\n  /**\n   * Tests whether two messages are equal.\n   *\n   * See go/jspb-api-gotchas#equals for more information.\n   *\n   * @param {?Message|undefined} m1 The first message object.\n   * @param {?Message|undefined} m2 The second message object.\n   * @return {boolean} true if both messages are null/undefined, or if both are\n   *     of the same type and have the same field values.\n   */\n  static equals(m1, m2) {\n    const result = m1 === m2 || (m1 == null && m2 == null) ||\n        (!!(m1 && m2) && (m1 instanceof m2.constructor) &&\n         compareMessages(m1, m2));\n\n    // If the result of this comparison would've changed from type information\n    // being present, instruct the user to add a call to\n    // makeCrossSerializerComparisonsCompatible.\n    if (getCheckEqualsDoesNotChangeWithTypeInformation() && goog.DEBUG && m1 &&\n        m2 && (m1.constructor === m2.constructor) && !result) {\n      const ctor = m1.constructor;\n      const makeCrossSerializerComparisonsCompatible =\n          ctor['makeCrossSerializerComparisonsCompatible'];\n      if (makeCrossSerializerComparisonsCompatible) {\n        withoutLogging(() => {\n          const m1WithTypeInfo = new ctor(m1.toJsonValue());\n          makeCrossSerializerComparisonsCompatible(m1WithTypeInfo);\n          const resultWithLeftTypeInfo =\n              compareMessages(m1WithTypeInfo, asserts.assert(m2));\n          if (resultWithLeftTypeInfo) {\n            throw new Error(\n                'Comparison between protos had a false negative and would ' +\n                'have changed from false to true with type information. ' +\n                `Please add a call to ${\n                    ctor.displayName}.makeCrossSerializerComparisonsCompatible ` +\n                'to one or both sides of the comparison to ensure it is ' +\n                'reliable.\\n\\nCompared protos were:\\n' +\n                `${m1.serialize()} and ${m2.serialize()}\\n`);\n          }\n        });\n      }\n    }\n\n    // Test validity of our hash function when possible.\n    if (getCheckEqualsConsistentWithHashCode() && goog.DEBUG && m1 && result) {\n      const h1 = hashCode(m1);\n      const h2 = hashCode(m2);\n      if (h1 !== h2) {\n        asserts.fail(\n            'expect messages %s and %s to have the same hashCode, got %s and %s',\n            m1.serialize(), m2.serialize(), h1, h2);\n      }\n    }\n    return result;\n  }\n\n  /**\n   * Makes a mutable copy of this message. This copies any mutable state.\n   *\n   * Named `clone` for compatibility with `goog.object.unsafeClone`\n   *\n   * @override\n   * @return {!MutableMessage}\n   * @tsType ():\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage\n   */\n  clone() {\n    const self = asserts.assertInstanceof(this, Message);\n    return /** @type {!MutableMessage} */ (\n        copyMutableWithImmutableFields(self));\n  }\n\n  /**\n   * Returns whether this message is mutable.\n   *\n   * @return {boolean}\n   * @tsType <T>(\n   *   this: T\n   * ): this is T extends import('google3/javascript/apps/jspb/mutable_message')\n   *     .MutableMessage<any>\n   *   ? T\n   *   :\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<unknown>\n   */\n  isMutable() {\n    return !isImmutableMessage(/** @type {!Message} */ (this));\n  }\n\n  /**\n   * Returns whether this message is immutable.\n   *\n   * @return {boolean}\n   * @override\n   * @tsType <T>(\n   *   this: T\n   * ): this is T extends\n   * import('google3/javascript/apps/jspb/immutable_message')\n   *     .ImmutableMessage<any>\n   *   ? T\n   *   : import('google3/javascript/apps/jspb/immutable_message')\n   *         .ImmutableMessage<unknown>\n   */\n  isImmutable() {\n    return isImmutableMessage(/** @type {!Message} */ (this));\n  }\n\n  /**\n   * Coerces this message to a mutable message. Performs no copy if it is\n   * already mutable.\n   *\n   * @override\n   * @return {!MutableMessage<?>}\n   * @protected this is made public by subclasses with better types.\n   */\n  toMutable() {\n    return /** @type {!MutableMessage<?>} */ (messageToMutable(this));\n  }\n\n  /**\n   * Coerces this message to an immutable message. Performs no copy if it is\n   * already immutable.\n   *\n   * @override\n   * @return {!ImmutableMessage<?>}\n   */\n  toImmutable() {\n    return /** @type {!ImmutableMessage<?>} */ (messageToImmutable(this));\n  }\n\n  /**\n   * Sets the value of the extension field in the extended object.\n   *\n   * If you pass `undefined` to this method, it unsets the extension.\n   *\n   * @override\n   * @package will be presented only on MutableMessage or via J2CL\n   * @param {!ExtensionFieldInfo<EM, EI, EXTENDEE>} fieldInfo Specifies the\n   *     field to set.\n   * @param {M_OR_I_OR_NULL_OR_UNDEFINED} value The value to set.\n   * @return {THIS} For chaining\n   * @template THIS, EM, EI\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * Use TTL to prevent type inference on value\n   * @template M_OR_I_OR_NULL_OR_UNDEFINED := union(EM, EI, 'null', 'undefined')\n   *     =:\n   * @this {THIS}\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS extends\n   *     import('google3/javascript/apps/jspb/mutable_message').MutableMessage<unknown>,\n   *   MValue,\n   *   IValue\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     THIS\n   *   >,\n   *   value: MValue | IValue | null | undefined\n   * ): this\n   */\n  setExtension(fieldInfo, value) {\n    const self = /** @type {!MutableMessage<?>} */ (this);\n    asserts.assertInstanceof(self, fieldInfo.extendeeCtor);\n    clearUnknownField(self, fieldInfo.fieldIndex);\n    return fieldInfo.ctor ?\n        fieldInfo.setExtensionFn(\n            self, fieldInfo.ctor, fieldInfo.fieldIndex, value,\n            fieldInfo.hasMessageId) :\n        fieldInfo.setExtensionFn(\n            self, fieldInfo.fieldIndex, value, fieldInfo.hasMessageId);\n  }\n\n  /**\n   * Clears the value of an extension field in the extended object.\n   *\n   * If you pass `undefined` to this method, it unsets the extension.\n   *\n   * @override\n   * @package will be presented only on MutableMessage or via J2CL\n   * @param {!ExtensionFieldInfo<EM, EI, EXTENDEE>} fieldInfo Specifies the\n   *     field to set.\n   * @return {THIS} For chaining\n   * @template THIS, EM, EI\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * Use TTL to prevent type inference on value\n   * @template M_OR_I_OR_NULL_OR_UNDEFINED := union(EM, EI, 'null', 'undefined')\n   *     =:\n   * @this {THIS}\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS extends\n   *     import('google3/javascript/apps/jspb/mutable_message').MutableMessage<unknown>,\n   *   MValue,\n   *   IValue\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     THIS\n   *   >\n   * ): this\n   */\n  clearExtension(fieldInfo) {\n    const self = /** @type {!MutableMessage<?>} */ (this);\n    asserts.assertInstanceof(self, fieldInfo.extendeeCtor);\n    clearUnknownField(self, fieldInfo.fieldIndex);\n    return clearField(self, fieldInfo.fieldIndex, fieldInfo.hasMessageId);\n  }\n\n  /**\n   * Sets the value of the extension field in the extended object.\n   *\n   * If you pass `undefined` to this method, it unsets the extension.\n   *\n   * @override\n   * @package will be presented only on MutableMessage or via J2CL\n   * @param {!ExtensionFieldInfo<!ReadonlyArray<M>, !ReadonlyArray<I>,\n   *     EXTENDEE>} fieldInfo Specifies the field to get.\n   * @param {number} index The index of the value to set.\n   * @param {M_OR_I} value The value to set.\n   * @return {THIS} For chaining\n   * @template THIS, M, I\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * Use TTL to prevent type inference on value\n   * @template M_OR_I := union(M, I) =:\n   * @this {THIS}\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS,\n   *   MValue extends ReadonlyArray<any>,\n   *   IValue extends ReadonlyArray<any>,\n   *   MExtendee extends\n   *     | THIS\n   *     |\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>,\n   *   IExtendee extends\n   *     | THIS\n   *     | import('google3/javascript/apps/jspb/immutable_message')\n   *           .ImmutableMessage<THIS>\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     MExtendee,\n   *     IExtendee\n   *   >,\n   *   idx: number,\n   *   value: MValue[number] | IValue[number]\n   * ): THIS\n   */\n  setExtensionAtIndex(fieldInfo, index, value) {\n    const self = /** @type {!MutableMessage<?>} */ (this);\n    // TODO: b/397982381 - this is buggy with unknown fields, we only report\n    // for now to preserve existing behavior.\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(\n        self, fieldInfo.fieldIndex, fieldInfo.lazyParse, /* orClear= */ true);\n    asserts.assertInstanceof(self, fieldInfo.extendeeCtor);\n    asserts.assert(fieldInfo.isRepeated);\n    if (fieldInfo.ctor) {\n      fieldInfo.setExtensionAtIndexFn(\n          self, fieldInfo.fieldIndex, fieldInfo.ctor, index, value,\n          fieldInfo.hasMessageId);\n    } else {\n      fieldInfo.setExtensionAtIndexFn(\n          self, fieldInfo.fieldIndex, index, value, fieldInfo.hasMessageId);\n    }\n    return self;\n  }\n\n  /**\n   * Gets a value in a repeated extension field.\n   *\n   * @package will be presented only on MutableMessage\n   * @param {!ExtensionFieldInfo<!ReadonlyArray<M>, !ReadonlyArray<I>,\n   *     EXTENDEE>} fieldInfo Specifies the field to get.\n   * @param {number} idx The index to read from this field.\n   * @return {M} The value of the field.\n   * @template M, I\n   * @template THIS\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * @this {THIS}\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS,\n   *   MValue extends ReadonlyArray<\n   *         import('google3/javascript/apps/jspb/mutable_message').MutableMessage\n   *       >,\n   *   IValue extends ReadonlyArray<\n   *         import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage\n   *       >,\n   *   MExtendee extends\n   *     | THIS\n   *     |\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>,\n   *   IExtendee extends\n   *     | THIS\n   *     | import('google3/javascript/apps/jspb/immutable_message')\n   *           .ImmutableMessage<THIS>\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     MExtendee,\n   *     IExtendee\n   *   >,\n   *   idx: number\n   * ): MValue[number]\n   */\n  getMutableExtensionAtIndex(fieldInfo, idx) {\n    const self = asserts.assertInstanceof(this, Message);\n    asserts.assert(fieldInfo.ctor);\n    asserts.assertInstanceof(self, fieldInfo.extendeeCtor);\n    asserts.assert(fieldInfo.isRepeated);\n    // TODO: b/397982381 - this is buggy with unknown fields, we only report\n    // for now to preserve existing behavior.\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(self, fieldInfo.fieldIndex, fieldInfo.lazyParse);\n    return getRepeatedIndexedMutableWrapper(\n        self, fieldInfo.fieldIndex, fieldInfo.ctor, idx,\n        fieldInfo.hasMessageId);\n  }\n\n  /**\n   * Sets the value of the extension field in the extended object.\n   *\n   * If you pass `undefined` to this method, it unsets the extension.\n   *\n   * @override\n   * @package will be presented only on MutableMessage or via J2CL\n   * @param {!ExtensionFieldInfo<!ReadonlyArray<EM>, !ReadonlyArray<EI>,\n   *     EXTENDEE>} fieldInfo Specifies the field to get.\n   * @param {M_OR_I} value The value to set.\n   * @return {THIS} For chaining\n   * @template THIS, EM, EI\n   * Use TTL to force agreement between the extendee and this, otherwise the\n   * jscompiler may resolve mismatches with a union which may cause errors to go\n   * unnoticed or create odd error messages.\n   * @template EXTENDEE := THIS =:\n   * Use TTL to prevent type inference on value\n   * @template M_OR_I := union(EM, EI) =:\n   * @this {THIS}\n   * @suppress {visibility} ExtensionFieldInfo internals.\n   * @tsType <\n   *   THIS,\n   *   MValue extends ReadonlyArray<any>,\n   *   IValue extends ReadonlyArray<any>,\n   *   MExtendee extends\n   *     | THIS\n   *     |\n   * import('google3/javascript/apps/jspb/mutable_message').MutableMessage<THIS>,\n   *   IExtendee extends\n   *     | THIS\n   *     | import('google3/javascript/apps/jspb/immutable_message')\n   *           .ImmutableMessage<THIS>\n   * >(\n   *   this: THIS,\n   *   fieldInfo: import('google3/javascript/apps/jspb/extension_field_info')\n   *       .ExtensionFieldInfo<\n   *     MValue,\n   *     IValue,\n   *     MExtendee,\n   *     IExtendee\n   *   >,\n   *   value: MValue[number] | IValue[number]\n   * ): THIS\n   */\n  addExtension(fieldInfo, value) {\n    const self = /** @type {!MutableMessage<?>} */ (this);\n    // TODO: b/397982381 - this is buggy with unknown fields, we only report\n    // for now to preserve existing behavior.\n    recordUnknownFieldAccess(self, fieldInfo.fieldIndex);\n    maybeReviveUnknownField(\n        self, fieldInfo.fieldIndex, fieldInfo.lazyParse, /* orClear= */ true);\n    asserts.assertInstanceof(self, fieldInfo.extendeeCtor);\n    asserts.assert(fieldInfo.isRepeated);\n    if (fieldInfo.ctor) {\n      fieldInfo.addExtensionFn(\n          self, fieldInfo.fieldIndex, fieldInfo.ctor, value,\n          fieldInfo.hasMessageId);\n    } else {\n      fieldInfo.addExtensionFn(\n          self, fieldInfo.fieldIndex, value, fieldInfo.hasMessageId);\n    }\n    return self;\n  }\n\n  /**\n   * Returns a function which deserializes the type of this message.\n   *\n   * Always deserializes values as immutable.\n   *\n   * @override\n   * @this {THIS}\n   * @template THIS\n   * @return {function(string): THIS}\n   * @tsType (): ((serialized: string) => this)\n   */\n  getParserForType() {\n    const self = /** @type {!Message} */ (this);\n    if (!self.isImmutable()) {\n      if (goog.DEBUG) {\n        throw new Error(\n            'getParserForType can only be called on immutable messages');\n      } else {\n        throw new Error('gpft');\n      }\n    }\n\n    const ctor = self.constructor;\n    const withCachedLambda =\n        /**\n           @type {{internalJspbCachedParserFn_: ((function(string):\n               THIS)|undefined)}}\n         */\n        (ctor);\n    if (withCachedLambda.internalJspbCachedParserFn_) {\n      return withCachedLambda.internalJspbCachedParserFn_;\n    }\n\n    return (\n        withCachedLambda.internalJspbCachedParserFn_ = (serialized) =>\n            deserializeAsImmutable(ctor, serialized));\n  }\n\n  /**\n   * Returns an immutable default instance for the type of this message.\n   *\n   * @override\n   * @protected exposed by subtypes\n   * @return {!ImmutableMessage}\n   */\n  getDefaultInstanceForType() {\n    const defaultInstance = getDefaultImmutableInstance(\n        /** function(new:MutableMessage<I>, ?Array<?>=) */ (\n            /** @type {!Message} */ (this).constructor));\n    asserts.assertInstanceof(\n        defaultInstance, Message,\n        'value was not a mutable message constructor');\n    return /** @type {!ImmutableMessage} */ (defaultInstance);\n  }\n\n  /**\n   * Converts this message to a mutable one.\n   *\n   * @override\n   * @private can only be called from poorly typed immutablejs code\n   * @return {?}\n   */\n  toBuilder() {\n    asserts.assert(this.isImmutable());\n    return /** @type {!MutableMessage} */ (messageToMutable(this));\n  }\n}\n\n// Inject our message constructor into internal.js so that we can ensure that\n// the result of isMessage is always correct.\nif (goog.DEBUG) {\n  setMessageCtorInDebug(Message);\n}\n\n/**\n * Forward declaration of an `equals` function for J2CL.\n *\n * This satisfies the subtyping relation with (Readonly|Mutable)MessageInterface\n * for subtypes. The real implementation is provided by\n * j2cl_accessor_patches_message.js.\n *\n * @private will only be called via interface from j2cl\n * @override\n * @param {?} other\n * @return {boolean}\n */\nMessage.prototype.equals;\n\n/**\n * Forward declaration of a `hashCode` function for J2CL.\n *\n * This satisfies the subtyping relation with MessageLike and BuilderLike for\n * subtypes. The real implementation is provided by\n * j2cl_accessor_patches_message.js.\n *\n * @override\n * @private will only be called via interface from j2cl\n * @return {number}\n */\nMessage.prototype.hashCode;\n\n/**\n * Forward declaration of `build` for j2cl.\n *\n * @override\n * @private can only be called from poorly typed immutablejs code\n * @return {?}\n */\nMessage.prototype.build;\n\n/**\n * Indicates to J2CL that equals and hashCode should be available.\n *\n * @private will only be accessed via interface from j2cl\n * @const {*}\n */\nMessage.prototype.equalsAndHashCodeShouldBeAvailable = 1;\n\nMessage.prototype[MESSAGE_PROTOTYPE_MARKER] = MESSAGE_PROTOTYPE_MARKER_VALUE;\n\n/**\n * The xid of this proto type (The same for all instances of a proto). Provides\n * a way to identify a proto by stable obfuscated name.\n * @see {xid}.\n * Available if {@link jspb.generate_xid} is added as a Message option to\n * a protocol buffer.\n * @type {!xid.String|undefined} The xid or undefined if message is\n *     annotated to generate the xid.\n * See go/const-js-library-faq\n */\nMessage.prototype.messageXid;\n\nif (GENERATE_TO_STRING) {\n  /**\n   * Creates a string representation of the internal data array of this proto.\n   *\n   * NOTE: This string is *not* suitable for use in server requests.\n   *\n   * @this {Message}\n   * @return {string} A string representation of this proto.\n   * @override\n   * @deprecated please use .serialize() instead.\n   */\n  Message.prototype.toString = function() {\n    // TODO(b/385213186): delete this method. The JSPB runtime does not rely on\n    // this method, it has undefined behavior and cannot be dead code eliminated\n    return getInternalArray(this).toString();\n  };\n}\n\n\n/**\n * Clear all fields of the message and set them to their default values.\n *\n * After this operation the message will be equivalent to a newly constructed\n * instance.\n *\n * You probably don't need this and are better off just constructing a new\n * message.\n *\n * @param {T} msg\n * @template T\n * @return {T}\n * @tsType <T extends\n * import('google3/javascript/apps/jspb/message').Message>(msg: T): T\n */\nfunction clearMessage(msg) {\n  asserts.assertInstanceof(msg, Message);\n  checkMutableMessage(msg);\n  let array = getInternalArray(msg);\n  const arrayState = getMessageArrayState(array);\n  if (getHasMessageId(arrayState)) {\n    array = [array[0]];\n  } else {\n    array = [];\n  }\n  setArrayState(array, copyArrayBitsClone(arrayState));\n  setInternalArray(msg, array);\n  return msg;\n}\n\n/**\n * Copies the content of the second argument into the first.\n *\n * This method takes two messages of the same type and copies the contents of\n * fromMessage into toMessage. After this call, both arguments will be\n * `Message.equals`, but will share no mutable state. All data in the\n * destination message will be overwritten.\n *\n * This function has equivalent functionality to `CopyFrom` found in other\n * proto implementations (C++, Python), and the signature is meant to match that\n * of core web methods like `Object.assign`.\n *\n * You probably don't need this and are better off just cloning and\n * constructing a new message.\n *\n * @param {MESSAGE} toMessage Message which will receive a copy of fromMessage\n * @param {MESSAGE} fromMessage Message that will be copied into toMessage.\n *     as its contents.\n * @template MESSAGE\n * @return {MESSAGE} toMessage\n * @tsType <\n *   M extends\n * import('google3/javascript/apps/jspb/mutable_message').MutableMessage\n * >(\n *   to: M,\n *   from:\n *     | M\n *     |\n * import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage<M>\n * ): M\n */\nfunction copyMessage(toMessage, fromMessage) {\n  return copyMutableIntoMessage(toMessage, fromMessage);\n}\n\n/**\n * Copies the content of the second argument into the first.\n *\n * This method takes two messages of the same type and copies the contents of\n * fromMessage into toMessage. After this call, both arguments will be\n * `Message.equals`, but will share no mutable state. All data in the\n * destination message will be overwritten.\n *\n * When `fromMessage` is `null` or `undefined`, clears all fields of the message\n * and sets them to their default values. After this operation the message will\n * be equivalent to a newly constructed instance.\n *\n * This function has equivalent functionality to `CopyFrom` found in other\n * proto implementations (C++, Python), and the signature is meant to match that\n * of core web methods like `Object.assign`.\n *\n * @param {MESSAGE} toMessage Message which will receive a copy of fromMessage\n * @param {?MESSAGE|undefined} fromMessage Message that will be copied into\n *     toMessage. as its contents.\n * @template MESSAGE\n * @return {MESSAGE} toMessage\n * @tsType <\n *   M extends\n * import('google3/javascript/apps/jspb/mutable_message').MutableMessage\n * >(\n *   to: M,\n *   from:\n *     | M\n *     |\n * import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage<M>\n *     | null\n *     | undefined\n * ): M\n */\nfunction copyMessageOrClear(toMessage, fromMessage) {\n  if (fromMessage != null) {\n    return copyMessage(toMessage, fromMessage);\n  }\n  return clearMessage(toMessage);\n}\n\n/** @type {number} */\nlet messageCounter = 0;\n\n/**\n * Adds a unique property to the message that will ensure that instances don't\n * compare structurally in tests.\n */\nfunction makeMessageUnpredicable(/** ? */ m) {\n  if (goog.DEBUG && !COMPILED) {\n    m['See go/jspb-testing for how to use protos in tests'] = messageCounter++;\n  }\n}\n\n/**\n * Constructs a mutable JSPB message from an array.\n *\n * The JSPB runtime takes ownership of the passed array, callers should not use\n * the array after passing it to this method.  Generally, messages should be\n * parsed with the `deserialize` or `deserializeBinary` functions, or\n * constructed from scratch using `new Foo()`.Consider using `cloneJspbArray` to\n * make a copy if you need the original array to be reused after calling this\n * method.\n *\n * @param {function(new:T, ?Array=)} ctor The constructor of the\n *     message type.\n * @param {!Array<?>|!OpaqueJspbArray|null|undefined} array Our serialized data.\n * @return {T} The new message with the serialized data populating\n *     its fields.\n * @template T\n * @noinline because these methods break coverage when inlined.\n * @tsType <\n *   T extends\n * import('google3/javascript/apps/jspb/mutable_message').MutableMessage\n * >(\n *   ctor: new (data?: unknown[] | null) => T,\n *   array:\n *     | unknown[]\n *     | import('google3/javascript/apps/jspb/message').OpaqueJspbArray\n *     | null\n *     | undefined\n * ): T\n */\n// TODO(b/271560370): remove the @noinline on this method\nfunction newMutableMessageFromTransferredArray(ctor, array) {\n  if (array == null) {\n    return new ctor();\n  }\n  array = transferArray(/** @type{!Array<?>} */ (array));\n  const newMessage = new ctor(markMutableReferencesAreOwned(array));\n  asserts.assertInstanceof(newMessage, Message);\n  return newMessage;\n}\n\n/**\n * Constructs an immutable JSPB message from an array.\n *\n * The JSPB runtime takes ownership of the passed array, callers should not use\n * the array after passing it to this method.  Generally, messages should be\n * parsed with the `deserialize` or `deserializeBinary` functions, or\n * constructed from scratch using `new Foo()`.Consider using `cloneJspbArray` to\n * make a copy if you need the original array to be reused after calling this\n * method.\n *\n * @param {T} defaultInstance The `defaultInstance` of the immutable message\n *     type.\n * @param {!Array<?>|!OpaqueJspbArray|null|undefined} array Our serialized data.\n * @return {T} The new message with the serialized data populating\n *     its fields.\n * @template T\n * @noinline because these methods break coverage when inlined.\n * @tsType <\n *   T extends\n * import('google3/javascript/apps/jspb/immutable_message').ImmutableMessage\n * >(\n *   defaultInstance: T,\n *   array:\n *     | unknown[]\n *     | import('google3/javascript/apps/jspb/message').OpaqueJspbArray\n *     | null\n *     | undefined\n * ): T\n */\n// TODO(b/271560370): remove the @noinline on this method\nfunction newImmutableMessageFromTransferredArray(defaultInstance, array) {\n  asserts.assertInstanceof(defaultInstance, Message);\n  asserts.assert(defaultInstance.isImmutable());\n  const newMessage = /** @type {!Message} */ (\n      (array == null) ?\n          getDefaultImmutableInstance(defaultInstance.constructor) :\n          new defaultInstance.constructor(\n              markArrayImmutable(transferArray(/** @type{!Array<?>} */ (\n                  /** @type{?} */ (array))))));\n  asserts.assertInstanceof(newMessage, Message);\n  return /** @type {!T} */ (newMessage);\n}\n\n// Do not export. Do not mark @private\n// The intent is just to be a type that is not externally instantiable and has\n// no useful properties/behaviors.\nclass InternalOpaqueJspbArray {}\n\n/**\n * An opaque type representing a jspb array.\n *\n * Should only be used as a marker for eventually passing to\n * `newImmutableMessageFromTransferredArray` and\n * `newMutableMessageFromTransferredArray`\n *\n * @typedef {typeof InternalOpaqueJspbArray}\n */\nlet OpaqueJspbArray;\n\n/**\n * Makes a deep copy of a jspb array.\n *\n * This is useful for passing to `newImmutableMessageFromTransferredArray` and\n * `newMutableMessageFromTransferredArray`.\n *\n * @param {!Array<?>} array\n * @return {!OpaqueJspbArray}\n */\nfunction cloneJspbArray(array) {\n  return /** @type {!OpaqueJspbArray} */ (/** @type {?} */ (cloneRaw(array)));\n}\n\nif (goog.DEBUG) {\n  // Constructs a debug-only representation. Do not call this in code.\n  Object.defineProperties(Message.prototype, {\n    urlToInspectInProtoshop: {\n      get: /** @return {?} */ function() {\n        const /** !Function|undefined */ inspect =\n            globalThis?.['top']?.['protoshop']?.['inspect'];\n        if (!inspect) {\n          return 'You need http://go/protoshop-browser-extension';\n        }\n\n        return inspect(\n            /** @type {?} */ (this),\n            GENERATE_TYPE_NAME_PROPERTIES ?\n                /**\n                   @type {{internalDoNotUse_debugOnlyProtoTypeName:\n                       (string|undefined)}}\n                 */\n                (\n                    /** @type {?} */ (this).constructor)\n                    .internalDoNotUse_debugOnlyProtoTypeName :\n                undefined);\n      },\n      enumerable: false,\n      configurable: false,\n    },\n    // DO NOT RENAME: this is used in\n    // javascript/apps/jspb/testing/install_jspb_custom_formatter.js\n    fieldsForDebugging: {\n      get: /** @return {?} */ function() {\n        return dumpInternal(/** @type {?} */ (this));\n      },\n      enumerable: false,\n      configurable: false,\n    }\n  });\n}\n\nexports = {\n  Message,\n  OpaqueJspbArray,\n  clearMessage,\n  cloneJspbArray,\n  copyMessage,\n  copyMessageOrClear,\n  newImmutableMessageFromTransferredArray,\n  newMutableMessageFromTransferredArray,\n};\n","// source: uservoice/common/flags/flag_service.proto\n/**\n * @fileoverview\n * @suppress {useOfGoogProvide,missingRequire}\n */\n// NO CHECKED-IN PROTOBUF GENCODE\n// GENERATED CODE -- DO NOT EDIT!\n\ngoog.provide('jspb$ro.uservoice$common$flags$ReadonlyAlohaFlags');\ngoog.provide('jspb$uservoice$common$flags$MutableAlohaFlags');\n\ngoog.require('jspb_internal_adapters');\ngoog.require('jspb_internal_public_for_gencode');\n/** @suppress {extraRequire} */\ngoog.requireType('google3.javascript.apps.jspb.internal_records');\ngoog.requireType('google3.javascript.common.asserts.asserts');\ngoog.requireType('jspb$r$uservoice$common$flags$AlohaFlags$internalDoNotUseReader');\ngoog.requireType('jspb$uservoice$common$flags$ImmutableAlohaFlags');\n\n/**\n * @final\n * @extends {jspb_internal_public_for_gencode.GeneratedMessage<!jspb$uservoice$common$flags$ImmutableAlohaFlags>}\n * @implements {jspb$r$uservoice$common$flags$AlohaFlags$internalDoNotUseReader}\n */\njspb$uservoice$common$flags$MutableAlohaFlags = class extends jspb_internal_public_for_gencode.GeneratedMessage {\n  /**\n   * @usedViaDotConstructor\n   * @param {?Array<?>=} data See go/jspb-api-gotchas#construct_from_array\n   */\n  constructor(data) {\n    super(data);\n  }\n\n\n  /**\n   * optional bool aloha_launch = 1;\n   * @override\n   * @return {boolean}\n   * @deprecated\n   */\n  getAlohaLaunch() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 1);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   * @deprecated\n   */\n  setAlohaLaunch(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 1, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   * @deprecated\n   */\n  clearAlohaLaunch() {\n    return jspb_internal_adapters.clearField(this, 1);\n  }\n\n\n  /**\n   * optional bool enable_ss_engine = 2;\n   * @override\n   * @return {boolean}\n   */\n  getEnableSsEngine() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 2);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableSsEngine(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 2, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableSsEngine() {\n    return jspb_internal_adapters.clearField(this, 2);\n  }\n\n\n  /**\n   * optional bool enable_awr = 3;\n   * @override\n   * @return {boolean}\n   */\n  getEnableAwr() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 3);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableAwr(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 3, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableAwr() {\n    return jspb_internal_adapters.clearField(this, 3);\n  }\n\n\n  /**\n   * optional bool enable_help_suggestions = 4;\n   * @override\n   * @return {boolean}\n   */\n  getEnableHelpSuggestions() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 4);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableHelpSuggestions(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 4, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableHelpSuggestions() {\n    return jspb_internal_adapters.clearField(this, 4);\n  }\n\n\n  /**\n   * optional bool aloha_auto_ga_rollout = 5;\n   * @override\n   * @return {boolean}\n   */\n  getAlohaAutoGaRollout() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 5);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setAlohaAutoGaRollout(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 5, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearAlohaAutoGaRollout() {\n    return jspb_internal_adapters.clearField(this, 5);\n  }\n\n\n  /**\n   * optional bool enable_configurator = 6;\n   * @override\n   * @return {boolean}\n   */\n  getEnableConfigurator() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 6);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableConfigurator(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 6, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableConfigurator() {\n    return jspb_internal_adapters.clearField(this, 6);\n  }\n\n\n  /**\n   * optional bool enable_mweb = 7;\n   * @override\n   * @return {boolean}\n   */\n  getEnableMweb() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 7);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableMweb(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 7, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableMweb() {\n    return jspb_internal_adapters.clearField(this, 7);\n  }\n\n\n  /**\n   * optional bool enable_ctl_consent_checkbox = 8;\n   * @override\n   * @return {boolean}\n   */\n  getEnableCtlConsentCheckbox() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 8);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableCtlConsentCheckbox(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 8, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableCtlConsentCheckbox() {\n    return jspb_internal_adapters.clearField(this, 8);\n  }\n\n\n  /**\n   * optional bool enable_iframe = 9;\n   * @override\n   * @return {boolean}\n   */\n  getEnableIframe() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 9);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableIframe(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 9, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableIframe() {\n    return jspb_internal_adapters.clearField(this, 9);\n  }\n\n\n  /**\n   * optional bool enable_screenshot_nudge = 10;\n   * @override\n   * @return {boolean}\n   */\n  getEnableScreenshotNudge() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 10);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableScreenshotNudge(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 10, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableScreenshotNudge() {\n    return jspb_internal_adapters.clearField(this, 10);\n  }\n\n\n  /**\n   * optional bool enable_web_startup_config_endpoint = 11;\n   * @override\n   * @return {boolean}\n   */\n  getEnableWebStartupConfigEndpoint() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 11);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableWebStartupConfigEndpoint(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 11, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableWebStartupConfigEndpoint() {\n    return jspb_internal_adapters.clearField(this, 11);\n  }\n\n\n  /**\n   * optional bool enable_junk_nudge = 12;\n   * @override\n   * @return {boolean}\n   */\n  getEnableJunkNudge() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 12);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableJunkNudge(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 12, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableJunkNudge() {\n    return jspb_internal_adapters.clearField(this, 12);\n  }\n\n\n  /**\n   * optional bool enable_configurator_locale = 13;\n   * @override\n   * @return {boolean}\n   */\n  getEnableConfiguratorLocale() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 13);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableConfiguratorLocale(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 13, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableConfiguratorLocale() {\n    return jspb_internal_adapters.clearField(this, 13);\n  }\n\n\n  /**\n   * optional bool enable_tiny_no_pointer = 14;\n   * @override\n   * @return {boolean}\n   */\n  getEnableTinyNoPointer() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 14);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableTinyNoPointer(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 14, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableTinyNoPointer() {\n    return jspb_internal_adapters.clearField(this, 14);\n  }\n\n\n  /**\n   * optional bool enable_support_session_logging = 15;\n   * @override\n   * @return {boolean}\n   */\n  getEnableSupportSessionLogging() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 15);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableSupportSessionLogging(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 15, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableSupportSessionLogging() {\n    return jspb_internal_adapters.clearField(this, 15);\n  }\n\n\n  /**\n   * optional bool enable_file_upload_for_screenshot = 16;\n   * @override\n   * @return {boolean}\n   */\n  getEnableFileUploadForScreenshot() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 16);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableFileUploadForScreenshot(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 16, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableFileUploadForScreenshot() {\n    return jspb_internal_adapters.clearField(this, 16);\n  }\n\n\n  /**\n   * optional bool enable_direct_deflection_for_single_category = 17;\n   * @override\n   * @return {boolean}\n   */\n  getEnableDirectDeflectionForSingleCategory() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 17);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableDirectDeflectionForSingleCategory(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 17, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableDirectDeflectionForSingleCategory() {\n    return jspb_internal_adapters.clearField(this, 17);\n  }\n\n\n  /**\n   * optional bool enable_image_sanitization = 18;\n   * @override\n   * @return {boolean}\n   */\n  getEnableImageSanitization() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 18);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableImageSanitization(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 18, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableImageSanitization() {\n    return jspb_internal_adapters.clearField(this, 18);\n  }\n\n\n  /**\n   * optional bool enable_aloha_binary_split = 19;\n   * @override\n   * @return {boolean}\n   */\n  getEnableAlohaBinarySplit() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 19);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableAlohaBinarySplit(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 19, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableAlohaBinarySplit() {\n    return jspb_internal_adapters.clearField(this, 19);\n  }\n\n\n  /**\n   * optional bool enable_db_feedback_intents = 20;\n   * @override\n   * @return {boolean}\n   */\n  getEnableDbFeedbackIntents() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 20);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableDbFeedbackIntents(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 20, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableDbFeedbackIntents() {\n    return jspb_internal_adapters.clearField(this, 20);\n  }\n\n\n  /**\n   * optional bool enable_mark_mandatory_fields_with_required = 21;\n   * @override\n   * @return {boolean}\n   */\n  getEnableMarkMandatoryFieldsWithRequired() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 21);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableMarkMandatoryFieldsWithRequired(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 21, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableMarkMandatoryFieldsWithRequired() {\n    return jspb_internal_adapters.clearField(this, 21);\n  }\n\n\n  /**\n   * optional bool enable_feedback_category_custom_ui = 22;\n   * @override\n   * @return {boolean}\n   */\n  getEnableFeedbackCategoryCustomUi() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 22);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableFeedbackCategoryCustomUi(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 22, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableFeedbackCategoryCustomUi() {\n    return jspb_internal_adapters.clearField(this, 22);\n  }\n\n\n  /**\n   * optional bool enable_realtime_ctl = 23;\n   * @override\n   * @return {boolean}\n   */\n  getEnableRealtimeCtl() {\n    return jspb_internal_adapters.getBooleanFieldWithDefault(this, 23);\n  }\n\n\n  /**\n   * @param {boolean|null|undefined} value\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  setEnableRealtimeCtl(value) {\n    return jspb_internal_adapters.setProto3BooleanField(this, 23, value);\n  }\n\n\n  /**\n   * Clears the field.\n   * @return {!jspb$uservoice$common$flags$MutableAlohaFlags} returns this\n   */\n  clearEnableRealtimeCtl() {\n    return jspb_internal_adapters.clearField(this, 23);\n  }\n\n\n};\n\n/**\n * @override\n * @return {!jspb$uservoice$common$flags$ImmutableAlohaFlags}\n */\njspb$uservoice$common$flags$MutableAlohaFlags.prototype.toImmutable;\n/**\n * @override\n * @return {!jspb$uservoice$common$flags$MutableAlohaFlags}\n */\njspb$uservoice$common$flags$MutableAlohaFlags.prototype.clone;\n/**\n * @const {function(string):!jspb$uservoice$common$flags$MutableAlohaFlags}\n */\njspb$uservoice$common$flags$MutableAlohaFlags.deserialize = /** @pureOrBreakMyCode */(jspb_internal_public_for_gencode.makeMutableDeserializeFunction(jspb$uservoice$common$flags$MutableAlohaFlags));\n\n/**\n * Returns whether the given value is an instance of jspb$uservoice$common$flags$MutableAlohaFlags.\n * @const {!google3.javascript.common.asserts.asserts.TypeGuard<!jspb$uservoice$common$flags$MutableAlohaFlags>}\n */\njspb$uservoice$common$flags$MutableAlohaFlags.hasInstance = /** @pureOrBreakMyCode */ (jspb_internal_public_for_gencode.makeHasMutableInstance(jspb$uservoice$common$flags$MutableAlohaFlags));\n\n/**\n * Object form of AlohaFlags as accepted by the `fromObject` method.\n * @typedef {{\n *  alohaLaunch: (?boolean|undefined),\n *  enableSsEngine: (?boolean|undefined),\n *  enableAwr: (?boolean|undefined),\n *  enableHelpSuggestions: (?boolean|undefined),\n *  alohaAutoGaRollout: (?boolean|undefined),\n *  enableConfigurator: (?boolean|undefined),\n *  enableMweb: (?boolean|undefined),\n *  enableCtlConsentCheckbox: (?boolean|undefined),\n *  enableIframe: (?boolean|undefined),\n *  enableScreenshotNudge: (?boolean|undefined),\n *  enableWebStartupConfigEndpoint: (?boolean|undefined),\n *  enableJunkNudge: (?boolean|undefined),\n *  enableConfiguratorLocale: (?boolean|undefined),\n *  enableTinyNoPointer: (?boolean|undefined),\n *  enableSupportSessionLogging: (?boolean|undefined),\n *  enableFileUploadForScreenshot: (?boolean|undefined),\n *  enableDirectDeflectionForSingleCategory: (?boolean|undefined),\n *  enableImageSanitization: (?boolean|undefined),\n *  enableAlohaBinarySplit: (?boolean|undefined),\n *  enableDbFeedbackIntents: (?boolean|undefined),\n *  enableMarkMandatoryFieldsWithRequired: (?boolean|undefined),\n *  enableFeedbackCategoryCustomUi: (?boolean|undefined),\n *  enableRealtimeCtl: (?boolean|undefined)\n * }}\n */\njspb$uservoice$common$flags$MutableAlohaFlags.ObjectFormat;\n/**\n * Serializes the message to binary data (in protobuf wire format).\n *\n * If you see this method undefined, you probably need to import\n * the message type directly.\n *\n * @return {!Uint8Array}\n * @deprecated please call the static method instead: this one is only sometimes defined.\n */\njspb$uservoice$common$flags$MutableAlohaFlags.prototype.serializeBinary;\n\n/**\n * Serializes the message to an unstable object format.\n *\n * @private\n * @return {!jspb$uservoice$common$flags$MutableAlohaFlags.ObjectFormat}\n * @deprecated see go/jspb-api-gotchas#objects. This is only sometimes defined.\n */\njspb$uservoice$common$flags$MutableAlohaFlags.prototype.toObject;\n\nif (jspb_internal_public_for_gencode.GENERATE_TYPE_NAME_PROPERTIES) {\n  /**\n   * The proto type name for uservoice$common$flags$MutableAlohaFlags.\n   *\n   * @nodts\n   * @nocollapse\n   * @const {string|undefined}\n   */\n  jspb$uservoice$common$flags$MutableAlohaFlags.internalDoNotUse_debugOnlyProtoTypeName = \"uservoice.common.flags.AlohaFlags\";\n}\n\n/**\n * @typedef {!jspb$uservoice$common$flags$ImmutableAlohaFlags|!jspb$uservoice$common$flags$MutableAlohaFlags}\n */\njspb$ro.uservoice$common$flags$ReadonlyAlohaFlags = {};\n\nif (goog.DEBUG && !COMPILED) {\n  /**\n   * @public\n   * @override\n   * @type {string}\n   */\n  jspb$uservoice$common$flags$MutableAlohaFlags.displayName = 'proto.uservoice.common.flags.AlohaFlags';\n}\n/**\n * Interface form of AlohaFlags as accepted by `fromFields` and produced by `getFields`.\n * @typedef {{\n *  alohaLaunch: (boolean|undefined),\n *  enableSsEngine: (boolean|undefined),\n *  enableAwr: (boolean|undefined),\n *  enableHelpSuggestions: (boolean|undefined),\n *  alohaAutoGaRollout: (boolean|undefined),\n *  enableConfigurator: (boolean|undefined),\n *  enableMweb: (boolean|undefined),\n *  enableCtlConsentCheckbox: (boolean|undefined),\n *  enableIframe: (boolean|undefined),\n *  enableScreenshotNudge: (boolean|undefined),\n *  enableWebStartupConfigEndpoint: (boolean|undefined),\n *  enableJunkNudge: (boolean|undefined),\n *  enableConfiguratorLocale: (boolean|undefined),\n *  enableTinyNoPointer: (boolean|undefined),\n *  enableSupportSessionLogging: (boolean|undefined),\n *  enableFileUploadForScreenshot: (boolean|undefined),\n *  enableDirectDeflectionForSingleCategory: (boolean|undefined),\n *  enableImageSanitization: (boolean|undefined),\n *  enableAlohaBinarySplit: (boolean|undefined),\n *  enableDbFeedbackIntents: (boolean|undefined),\n *  enableMarkMandatoryFieldsWithRequired: (boolean|undefined),\n *  enableFeedbackCategoryCustomUi: (boolean|undefined),\n *  enableRealtimeCtl: (boolean|undefined)\n * }}\n */\njspb$uservoice$common$flags$MutableAlohaFlags.FieldsInterface;\n\n/**\n * Constructs a set of proto fields into an immutable proto.\n *\n * This method can only be called in TS and must be passed an object.\n * literal with keys matching the setter names (so where you have\n * setFooList on the type, you can write {fooList: ...} here).\n *\n * See go/jspb-fields-interface for more information.\n *\n * This record format is **not a serialization format**.\n * @package this cannot be called from JS.\n * @param {!jspb$uservoice$common$flags$MutableAlohaFlags.FieldsInterface} record\n * @return {!jspb$uservoice$common$flags$ImmutableAlohaFlags}\n * @tsType (fields : import('google3/javascript/apps/jspb/internal_records').PartialFields<\u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFlags, \u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFlags.FieldsInterface, \u0ca0_\u0ca0.clutz.jspbInternalDoNotUse$RecordExtensionRegistry>): \u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$ImmutableAlohaFlags\n */\njspb$uservoice$common$flags$MutableAlohaFlags.fromFields = /** @pureOrBreakMyCode */ (jspb_internal_public_for_gencode.makeFromFieldsForTesting(jspb$uservoice$common$flags$MutableAlohaFlags));\n\n/**\n * Retrieves the fields of this proto in a destructurable interface.\n *\n * This method can only be called in TS and the result must be\n * immediately destructured (so you can write\n * const {a} = Foo.getFields(value);).\n *\n * See go/jspb-fields-interface for more information.\n *\n * @package this cannot be called from JS.\n * @param {!jspb$ro.uservoice$common$flags$ReadonlyAlohaFlags} value\n * @return {!jspb$uservoice$common$flags$MutableAlohaFlags.FieldsInterface}\n * @tsType (value: \u0ca0_\u0ca0.clutz.jspb$ro.uservoice$common$flags$ReadonlyAlohaFlags): import('google3/javascript/apps/jspb/internal_records').ReadonlyFields<\u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFlags, \u0ca0_\u0ca0.clutz.jspb$uservoice$common$flags$MutableAlohaFlags.FieldsInterface, \u0ca0_\u0ca0.clutz.jspbInternalDoNotUse$RecordExtensionRegistry>\n */\njspb$uservoice$common$flags$MutableAlohaFlags.getFields = /** @pureOrBreakMyCode */ (jspb_internal_public_for_gencode.makeGetFieldsForTesting());\n","/**\n * @fileoverview Public APIs exposed purely for use by generated code.  Use of\n * these APIs outside of that context is not supported and actively discouraged.\n * @public\n *\n * DO NOT USE THIS OUTSIDE OF THIS PACKAGE.\n */\n\ngoog.module('jspb_internal_public_for_gencode');\ngoog.module.declareLegacyNamespace();\n\nconst asserts = goog.require('goog.asserts');\nconst garray = goog.require('goog.array');\nconst {ANY_PROTOTYPE_MARKER_VALUE, DoNotFreezeToken, GENERATED_SUBCLASS_MARKER, HAS_MESSAGE_ID, NO_MESSAGE_ID, OrUndefinedToken, SUPPORTS_HAS_INSTANCE, SerializeBinaryFnHolder, getInternalArray, invisiblePropValue, isImmutableMessage, isInternalMessage, registerExtensionsForDebugging} = goog.require('jspb.internal');\nconst {ArrayState, ArrayStateFlags, TypeSpecificApiFormat, getMessageArrayState, hasFlagBit} = goog.require('jspb.internal_array_state');\nconst {BinaryReader, BinaryReaderOptions} = goog.require('jspb.binary.reader');\nconst {ByteSource} = goog.requireType('jspb.binary.bytesource');\nconst {ByteString} = goog.require('jspb.bytestring');\nconst {DescriptorTypeReference, EnumDescriptorTypeReference} = goog.require('google3.javascript.apps.jspb.descriptor');\nconst {ExtensionReference, makeDescriptorGetter, makeEnumDescriptorGetter, makeExtensionReference} = goog.require('google3.javascript.apps.jspb.internal_descriptor');\nconst {GENERATE_FIELDS_INTERFACE_FOR_TESTING, GENERATE_TYPE_NAME_PROPERTIES, USE_DETAILED_MESSAGE_TYPE_HIERARCHY, getUnsafeDisableJspbAnyTypeChecks} = goog.require('jspb.internal_options');\nconst {LAZILY_PARSE_LATE_LOADED_EXTENSIONS_SYMBOL} = goog.require('jspb.internal_symbols');\nconst {Message} = goog.require('jspb');\nconst {MutableMessage} = goog.require('jspb.mutable_message');\nconst {OpaqueTypeTable} = goog.require('google3.javascript.apps.jspb.opaque_type_table_internal');\nconst {RecordExtensionRegistry, createMessageExtension, createPrimitiveExtension, createRepeatedMessageExtension, createRepeatedPrimitiveExtension} = goog.require('jspb.internal_extension_field_info');\nconst {coerceToNullishBytes, getDefaultImmutableInstance, messageFromInlineStorage} = goog.require('jspb.internal_accessor_helpers');\nconst {defineTypeGuard} = goog.require('google3.javascript.common.asserts.asserts');\nconst {deserializeAsImmutable, leakedMutableSubstructures, maybeCopyOnWrite} = goog.require('jspb.internal_immutability');\nconst {deserializeBinary, makeCrossSerializerComparisonsCompatible, makeDeserializeBinaryFromReaderFromBinaryFields, serializeBinary, serializeBinaryToByteString} = goog.require('jspb_internal_binary');\nconst {fromFieldsForTestingGeneric, getFieldsForTestingGeneric} = goog.require('google3.javascript.apps.jspb.internal_records');\nconst {fromObjectAnyValue, toObjectAnyValue} = goog.require('jspb.internal_dump');\nconst {getBytesFieldWithDefault, getFieldNullable, getFieldNullableInternal, getStringFieldWithDefault, setFieldIgnoringImmutability, setProto3BytesField, setProto3StringField, setWrapperField} = goog.require('jspb_internal_adapters');\nconst {getCtorTypeName, installTypeNameExport} = goog.require('jspb.internal_get_type_name');\nconst {logNewArray} = goog.require('jspb.internal_operations');\nconst {toGbigint} = goog.require('google3.javascript.common.bigint.index');\nconst {wrappedTypeTableForBinaryFields} = goog.require('google3.javascript.apps.jspb.internal_binary_table');\n\n// Install jspbGetTypeName for debugging. All generated messages require this\n// file so this ensures it's available.\ninstallTypeNameExport();\n\n/**\n * @define {boolean} Whether to generate toObject methods for objects. Turn\n *     this off, if you do not want toObject to be ever used in your project.\n *     When turning off this flag, consider adding a conformance test that bans\n *     calling toObject. Enabling this will disable the JSCompiler's ability to\n *     dead code eliminate fields used in protocol buffers that are never used\n *     in an application.\n */\nconst GENERATE_TO_OBJECT = goog.define('jspb.Message.GENERATE_TO_OBJECT', true);\n\n\n/**\n * @define {boolean} Whether to generate fromObject methods for objects. Turn\n *     this off, if you do not want fromObject to be ever used in your project.\n *     When turning off this flag, consider adding a conformance test that bans\n *     calling fromObject. Enabling this might disable the JSCompiler's ability\n *     to dead code eliminate fields used in protocol buffers that are never\n *     used in an application.\n *     By default this is enabled for test code only.\n */\nconst GENERATE_FROM_OBJECT = goog.define(\n    'jspb.Message.GENERATE_FROM_OBJECT', !goog.DISALLOW_TEST_ONLY_CODE);\n\n\n/**\n * Converts a JsPb repeated message field into an object list.\n * @param {!ReadonlyArray<T>} field The repeated message field to be\n *     converted.\n * @param {function(T_OR_NULL_UNDEFINED):(!O|undefined)}\n *     toObjectFn The toObject function for this field.  We need to pass this\n *     for effective dead code removal.\n * @return {!Array<O>} An array of converted message objects.\n * @template T, O\n * Use go/closure-ttl  to create a `?T|undefined` type\n * @template T_OR_NULL_UNDEFINED := union(T, 'null', 'undefined') =:\n */\nfunction toObjectList(field, toObjectFn) {\n  // Not using array.map in the generated code to keep it small.\n  // And not using it here to avoid a function call.\n  const result = logNewArray([]);\n  for (let i = 0; i < field.length; i++) {\n    result.push(toObjectFn(field[i]));\n  }\n  return result;\n}\n\n/**\n * Converts an object-formatted list into a repeated message field.\n *\n * @param {?Array<!O_ALIAS>|undefined} field The repeated message\n *     field to be converted.\n * @param {function(!O):!T} fromObjectFn The fromObject function for type T.\n * @return {?Array<!T>|undefined} An array of converted message objects.\n * @template T, O\n * Use go/closure-ttl  to create a `?O|undefined` type\n * @template O_ALIAS := O =:\n */\nfunction fromObjectList(field, fromObjectFn) {\n  // Not using array.map in the generated code to keep it small.\n  // And not using it here to avoid a function call.\n  const result = logNewArray([]);\n  if (field == null) {\n    return field;\n  }\n  for (let i = 0; i < field.length; i++) {\n    if (field[i] != null) {\n      result.push(fromObjectFn(field[i]));\n    }\n  }\n  return result;\n}\n\n/**\n * Converts an object-formatted message field into a JSPB message.\n *\n * @param {?O_OR_NULL_OR_UNDEFINED} field The object field to be converted.\n * @param {function(!O):!T} fromObjectFn The fromObject function for type T.\n * @return {?T|undefined} A converted message object, if any.\n * @template T, O\n * Use go/closure-ttl to create a `?O|undefined` type\n * @template O_OR_NULL_OR_UNDEFINED := union(O, 'null', 'undefined') =:\n */\nfunction fromObjectNullable(field, fromObjectFn) {\n  return field == null ? field : fromObjectFn(field);\n}\n\n/**\n * Coerce a 'bytes' field to base 64 or Uint8Array.\n * @param {string|!Uint8Array|!ByteString|null} value\n * @return {string|!Uint8Array|null} The field's coerced value.\n */\nfunction bytesAsBase64OrUint8Array(value) {\n  return value instanceof ByteString ? value.legacyUnwrap() : value;\n}\n\n\n/** @return {string} */\nfunction nonNullByteStringAsB64(/** !ByteString*/ b) {\n  return b.asBase64();\n}\n\n/** @return {string|null|undefined} */\nfunction byteStringAsB64(/** !ByteString|null|undefined */ b) {\n  return b == null ? b : b.asBase64();\n}\n\n/**\n * Coerce a repeated 'bytes' field to an array of base 64 strings.\n * Note: the returned array should be treated as immutable.\n * @param {!Array<!ByteString>} value\n * @return {!Array<string>} The field's coerced value.\n */\nfunction byteStringListAsB64(value) {\n  return logNewArray(garray.map(value, nonNullByteStringAsB64));\n}\n\n/** @return {!Uint8Array} */\nfunction nonNullByteStringAsU8(/** !ByteString*/ b) {\n  return b.asUint8Array();\n}\n\n/** @return {!Uint8Array|null|undefined} */\nfunction byteStringAsU8(/** !ByteString|null|undefined */ b) {\n  return b == null ? b : b.asUint8Array();\n}\n\n/**\n * Coerce a repeated 'bytes' field to an array of Uint8Array byte buffers.\n * Note: the returned array should be treated as immutable.\n * Note that Uint8Array is not supported on IE versions before 10 nor on Opera\n * Mini. @see http://caniuse.com/Uint8Array\n * @param {!Array<!ByteString>} value\n * @return {!Array<!Uint8Array>} The field's coerced value.\n */\nfunction byteStringListAsU8(value) {\n  return logNewArray(garray.map(value, nonNullByteStringAsU8));\n}\n\n/** @return {string|!Uint8Array} */\nfunction nonNullByteStringLegacyUnwrap(/** !ByteString*/ b) {\n  return b.legacyUnwrap();\n}\n\n/** @return {string|!Uint8Array|null|undefined} */\nfunction byteStringAsBase64OrUint8Array(/** null|undefined|!ByteString*/ b) {\n  return b == null ? b : b.legacyUnwrap();\n}\n\n/**\n * @param {?} v The value to normalize. True bigints will be converted to\n *     numbers when within the safe integer range and strings otherwise.\n *     Non-bigints will be returned as-is.\n * @return {?}\n */\nfunction normalizeBigInt(v) {\n  if (typeof v === 'bigint') {\n    const num = Number(v);\n    return Number.isSafeInteger(num) ? num : '' + v;\n  }\n\n  return v;\n}\n\n/**\n * Returns the map formatted as an array of key-value pairs, suitable for the\n * toObject() form of a message.\n *\n * @template K, V\n * Use go/closure-ttl  to create a `?V|undefined` type\n * @template V_OR_NULL_UNDEFINED := union(V, 'null', 'undefined') =:\n * @param {!Map<K,V>} map\n * @param {function(V_OR_NULL_UNDEFINED):(!Object|undefined)=}\n *     valueToObject\n *    The static toObject() method, if V is a message type.\n * @return {!Array<!Array<!Object>>}\n */\nfunction mapToObject(map, valueToObject) {\n  // this would be more natural as a call to Array.from passing a mapper\n  // but that is disallowed by some applications.\n  const entries = logNewArray([]);\n  map.forEach(valueToObject ? (v, k) => {\n    entries.push(logNewArray([normalizeBigInt(k), valueToObject(v)]));\n  } : (v, k) => {\n    entries.push(logNewArray([normalizeBigInt(k), normalizeBigInt(v)]));\n  });\n  return entries;\n}\n\n/**\n * Normalize `null` -> `undefined`, and slice arrays, for the `ObjectFormat` of\n * a message.\n * @return {?}\n */\nfunction toObjectPrimitive(/** ? */ v) {\n  if (Array.isArray(v)) {\n    return logNewArray(v.map(normalizeBigInt));\n  }\n\n  return v == null ? undefined : normalizeBigInt(v);\n}\n\n/**\n * Normalizes a bytes field for toObject. Returns base64 string, array of\n * string (for repeated field), or normalizes null to undefined.\n * @return {string|!Array<string>|undefined}\n */\nfunction toObjectBytes(/** ?ByteString|!ReadonlyArray<!ByteString> */ value) {\n  return value == null     ? undefined :\n      Array.isArray(value) ? logNewArray(value.map(b => b.asBase64())) :\n                             /** @type {!ByteString} */ (value).asBase64();\n}\n\n/**\n * Returns a Map from the given array of key-value pairs when the values are\n * of message type. The values in the array must match the format returned by\n * their message type's toObject() method.\n *\n * @template K, V\n * @template V_OR_NULL_UNDEFINED := union(V, 'null', 'undefined') =:\n * @param {!Map<K,V>} map\n * @param {!Array<!Array<?>>} entries\n * @param {(function(?):V_OR_NULL_UNDEFINED)=} valueFromObject\n *    The fromObject function for type V.\n * @return {!Map<K, V>}\n */\nfunction mapFromObject(map, entries, valueFromObject) {\n  for (let i = 0; i < entries.length; i++) {\n    const key = entries[i][0];\n    const value =\n        valueFromObject ? valueFromObject(entries[i][1]) : entries[i][1];\n    map.set(key, value);\n  }\n  return map;\n}\n\n/**\n * Virtual baseclass used by generated code.\n *\n * This class does not exist at runtime in compiled code: do not reference it.\n *\n * @extends {MutableMessage<I>}\n * @template I\n */\nclass GeneratedMessageImpl extends MutableMessage {\n  /**\n   * Builds this message into an immutable one.\n   *\n   * @public\n   * @return {!I}\n   * @override\n   * @tsType (): I\n   */\n  toImmutable() {\n    return super.toImmutable();\n  }\n\n  /**\n   * Returns a mutable copy of this message.\n   *\n   * @protected\n   * @return {!THIS}\n   * @this {THIS}\n   * @template THIS\n   * @override\n   * @tsType (): this\n   */\n  toMutable() {\n    return super.toMutable();\n  }\n}\n\nif (asserts.ENABLE_ASSERTS && USE_DETAILED_MESSAGE_TYPE_HIERARCHY) {\n  GeneratedMessageImpl.prototype[GENERATED_SUBCLASS_MARKER] = true;\n}\n\n/*\n * Install hasInstance handlers.\n *\n * Technically, the runtime instances declared as `ImmutableMessage` will\n * have `MutableMessage` in their prototype chain; so an `instanceof` check\n * will be a highly incorrect means to decide a value's immutability. For this\n * reason, we should prevent `instanceof` checks on `MutableMessage`, but we\n * have to revert the handler on `GeneratedMessage`.\n */\nif (SUPPORTS_HAS_INSTANCE && USE_DETAILED_MESSAGE_TYPE_HIERARCHY) {\n  // TODO(b/219105470): use defineProperty once JSC supports it\n  Object.defineProperties(GeneratedMessageImpl, {\n    [Symbol.hasInstance]: invisiblePropValue(Object[Symbol.hasInstance]),\n  });\n  asserts.assert(\n      GeneratedMessageImpl[Symbol.hasInstance] === Object[Symbol.hasInstance],\n      'broken defineProperties implementation');\n}\n\n/**\n * Virtual baseclass used by generated code.\n *\n * This class does not exist at runtime in compiled code: do not reference it.\n *\n * This is conditional so that we get detailed type overrides in DEBUG but\n * they do not incur additional costs due to the length of their prototype\n * chain in production (especially during message construction.\n *\n * @type {typeof GeneratedMessageImpl}\n */\nconst GeneratedMessage = /** @type {typeof GeneratedMessageImpl} */ (\n    USE_DETAILED_MESSAGE_TYPE_HIERARCHY ? GeneratedMessageImpl : Message);\n\n/** Field number for the `type_url` field. */\nconst ANY_TYPE_URL_FIELD_NUMBER = 1;\n\n/** Field number for the `value` field. */\nconst ANY_VALUE_FIELD_NUMBER = 2;\n\n/** @return {!ByteString} */\nfunction getAnyValueField(/** !Message */ any) {\n  const value = getFieldNullable(any, ANY_VALUE_FIELD_NUMBER, NO_MESSAGE_ID);\n  if (Array.isArray(value) || (value instanceof Message)) {\n    throw new Error(\n        'Cannot access the Any.value field on Any protos encoded using the jspb format, call unpackJspb instead');\n  }\n  return getBytesFieldWithDefault(any, ANY_VALUE_FIELD_NUMBER);\n}\n\n/**\n * Implementation of pack()\n * `T` is really proto.google.protobuf.Any, but we can't reference that type\n * here for circular deps reasons\n * @template T\n * @return {T}\n */\nfunction packAnyValueBinary(\n    /** T */ any, /** !Uint8Array|string|!ByteString*/ bytes, /** string*/ name,\n    /** string= */ typeUrlPrefix) {\n  asserts.assertInstanceof(any, Message);\n  setAnyTypeName(any, name, typeUrlPrefix);\n  return setProto3BytesField(any, ANY_VALUE_FIELD_NUMBER, bytes);\n}\n\n\n/**\n * Sets the type URL on an Any.\n *\n * `T` is really proto.google.protobuf.Any, but we can't reference that type\n * here for circular deps reasons.\n *\n * @template T\n * @return {T}\n */\nfunction setAnyTypeUrl(/** T */ any, /** string */ type_url) {\n  return setProto3StringField(any, ANY_TYPE_URL_FIELD_NUMBER, type_url);\n}\n\n/**\n * Sets the type name on an Any.\n *\n * `T` is really proto.google.protobuf.Any, but we can't reference that type\n * here for circular deps reasons.\n *\n * @template T\n * @return {T}\n */\nfunction setAnyTypeName(\n    /** T */ any, /** string */ name,\n    /** string= */ typeUrlPrefix = 'type.googleapis.com/') {\n  if (typeUrlPrefix.substr(-1) !== '/') {\n    typeUrlPrefix += '/';\n  }\n  return setAnyTypeUrl(any, typeUrlPrefix + name);\n}\n\n/**\n * Packs a message into an Any.\n *\n * `T` is really proto.google.protobuf.Any, but we can't reference that type\n * here for circular deps reasons.\n *\n * @template T\n * @return {T}\n */\nfunction packAnyValueJspb(\n    /** T */ any, /** !Message */ value, /** string */ name,\n    /** function(?):!Uint8Array= */ serializeBinaryFn,\n    /** string= */ typeUrlPrefix) {\n  asserts.assertInstanceof(any, Message);\n  asserts.assertInstanceof(value, Message);\n  const ctor = value.constructor;\n  assertCorrectAnyType(ctor, name, /* isPack = */ true);\n  // Store serializer as a new function on the any proto\n  // Note: must cast to ? first to avoid disambiguation invalidation\n  const holder =\n      /** @type{!SerializeBinaryFnHolder} */ (/** @type{?} */ (value));\n  // TODO(varomodt): copy this property in clone and toImmutable, and\n  // maybe also attach it to the ctor as well.\n  holder.serializeBinaryFnForAnyProto_ = serializeBinaryFn;\n  setAnyTypeName(any, name, typeUrlPrefix);\n  setWrapperField(any, ctor, ANY_VALUE_FIELD_NUMBER, value, NO_MESSAGE_ID);\n  return any;\n}\n\n/**\n * @return {string}\n */\nfunction getAnyTypeName(/** !Message */ msg) {\n  return getStringFieldWithDefault(msg, ANY_TYPE_URL_FIELD_NUMBER)\n      .split('/')\n      .pop();\n}\n\n/**\n * @template M, I\n * @return {function(new:M,?Array<?>=)}\n */\nfunction ctorFromCtorOrDefaultInstance(\n    /** function(new:M, !Array<?>=)|I */ ctorOrDefaultInstance) {\n  return typeof ctorOrDefaultInstance === 'function' ?\n      ctorOrDefaultInstance :\n      ctorOrDefaultInstance.constructor;\n}\n\n/**\n * @template M,I\n * @return {!M|I}\n */\nfunction unpackAnyJspbCompat(\n    /** !Message */ msg,\n    /** function(new:M, !Array<?>=)|I|undefined */ ctorOrDefaultInstance,\n    /** (function(!Uint8Array):M)|undefined */ deserializeFn,\n    /** string */ typeName) {\n  // If we have a deserialize function, we can derive a ctor.\n  if (deserializeFn != null) {\n    ctorOrDefaultInstance ??=\n        /** @type {!DeserializeFnWithCtorAndTypeName} */ (deserializeFn)\n            .internalDoNotUse_ctor;\n  }\n\n  // If this Any did not have the expected type name, return null.\n  if (getAnyTypeName(msg) != typeName) return null;\n\n  // Derive a constructor from the passed in value, since we use default\n  // instances for immutable protos.\n  const ctor = ctorFromCtorOrDefaultInstance(ctorOrDefaultInstance);\n\n  // Assert that the passed in type name matches the type name on the Any.\n  //\n  // This should be a throw but for now we only do this in debug mode because\n  // for JSPB unpacks we do not have a type name on the constructor at runtime.\n  assertCorrectAnyType(ctor, typeName, /* isPack = */ false);\n\n  // Retrieve the value field from the Any.\n  let messageArray = getInternalArray(msg);\n  let messageArrayState = getMessageArrayState(messageArray);\n  const value = getFieldNullableInternal(\n      messageArray, messageArrayState, ANY_VALUE_FIELD_NUMBER, NO_MESSAGE_ID);\n  let result;\n  if (!deserializeFn || value == null || isArrayOrMessage(value)) {\n    // If the parent is mutable we must CoW: if we had an immutable value we\n    // would have to write it back as mutable anyway to obey the types.\n    if (maybeCopyOnWrite(msg)) {\n      messageArray = getInternalArray(msg);\n      messageArrayState = getMessageArrayState(messageArray);\n    }\n\n    // If the value was JSPB-formatted, use the inline value to construct\n    // a JSPB message. We follow this path for `null` as it should be a little\n    // faster than deserializing an empty byte string.\n    result = getInlineAnyValue(messageArray, messageArrayState, ctor, value);\n  } else {\n    // Otherwise the value must be binary-formatted.\n    //\n    // TODO(varomodt): should we write this back? It would save the\n    // deserialization cost of subsequent reads and we could attach a binary\n    // serializer to avoid dropping the value (though serializeBinary would\n    // get a bit more expensive).\n    result = deserializeFn(\n        (coerceToNullishBytes(value) ?? ByteString.empty())\n            // TODO(varomodt): change deserializeFn to `function(ByteString):M`\n            // so we don't have to convert ByteStrings. And enforce that it is\n            // our generated deserializer.\n            .asUint8Array());\n\n    // Ensure our mutabilities match.\n    if (isImmutableMessage(msg)) {\n      if (!isImmutableMessage(result)) result = result.toImmutable();\n    } else {\n      if (isImmutableMessage(result)) result = result.toMutable();\n    }\n  }\n\n  // According to the types our result should have the parent's mutability.\n  asserts.assert(isImmutableMessage(result) === isImmutableMessage(msg));\n  return result;\n}\n\n/**\n * Asserts that this message is mutable.\n * @param {!Message} msg\n */\nfunction assertMutable(msg) {\n  if (isImmutableMessage(msg)) {\n    throw new Error('message must be mutable');\n  }\n}\n\n/**\n * @param {*} value\n * @return {boolean}\n */\nfunction isArrayOrMessage(value) {\n  return Array.isArray(value) || isInternalMessage(value);\n}\n\n/**\n * Gets and wraps an inline proto field on access, with the mutability of the\n * parent message. Returns the literal value if null or undefined.\n *\n * If the value in the message is immutable and its parent is mutable, this\n * method will coerce and copy back to the parent message.\n *\n * @param {!Array<?>} parentArray\n * @param {!ArrayState} parentArrayState\n * @param {function(new:T, ?Array<?>=)} ctor\n * @param {?} inlineValue\n * @return {!T} The message field, or else null or undefined.\n * @template T\n * @suppress {visibility}\n */\nfunction getInlineAnyValue(parentArray, parentArrayState, ctor, inlineValue) {\n  // We specifically throw on invalid values (instead of treating them as\n  // missing a la messageFromInlineStorage) to guard against accidentally having\n  // a binary wire proto in the payload\n  if (inlineValue != null && !isArrayOrMessage(inlineValue)) {\n    throw new Error(`saw an invalid value of type '${\n        goog.typeOf(inlineValue)}' in the Any.value field`);\n  }\n\n  // Construct a new value if we need to.\n  let value = messageFromInlineStorage(\n      inlineValue, ctor,\n      /* constructMissing = */ true,\n      /* parentArrayState = */ parentArrayState);\n  if (!(value instanceof ctor)) {\n    throw new Error(`incorrect type in any value: got ${\n        value.constructor.displayName}, expected ${ctor.displayName}`);\n  }\n\n  // We always return a mutable value from a mutable parent.\n  const isParentImmutable =\n      hasFlagBit(parentArrayState, ArrayStateFlags.IS_IMMUTABLE_ARRAY);\n  if (!isParentImmutable) {\n    value = /** @type {!Message} */ (value).toMutable();\n  }\n\n  // Write back if we constructed a new message.\n  if (inlineValue !== value) {\n    setFieldIgnoringImmutability(\n        parentArray, parentArrayState, ANY_VALUE_FIELD_NUMBER, value,\n        NO_MESSAGE_ID);\n    // The value is always mutable so we have always leaked.\n    if (!isParentImmutable) leakedMutableSubstructures(parentArray);\n  }\n  return value;\n}\n\n/** @typedef {!ByteString|!ByteSource} */\nlet BinarySource;\n\n/** @return {string} */\nfunction getTypeName(/** function(new:Message, !Array<?>=) */ ctor) {\n  let name;\n  if (GENERATE_TYPE_NAME_PROPERTIES) {\n    name = getCtorTypeName(ctor);\n    if (name) {\n      return name;\n    }\n  }\n  name = ctor.displayName;\n  if (name) {\n    return name;\n  }\n  return ctor.name || '';\n}\n\n/**\n * Asserts that the given constructor represents the type described by the given\n * type.\n *\n * @param {function(new:Message, !Array<?>=)} ctor\n * @param {string} typeName\n * @param {boolean} isPack\n */\nfunction assertCorrectAnyType(ctor, typeName, isPack) {\n  // To be extra sure we don't retain the type name.\n  if (!GENERATE_TYPE_NAME_PROPERTIES || getUnsafeDisableJspbAnyTypeChecks()) {\n    return;\n  }\n  const ctorType = getCtorTypeName(ctor);\n  if (ctorType !== typeName) {\n    if (isPack) {\n      throw new Error(`tried to pack type ${\n          ctorType} into an Any with type label ${typeName}`);\n    } else {\n      throw new Error(`tried to unpack type ${\n          ctorType} out of an Any with type label ${typeName}`);\n    }\n  }\n}\n\n// NOTE: for nearly all the factory functions below we mark the return type as\n// `?` to avoid needing casts in the gencode\n// For some of these it is possible to write valid types, but not all (e.g.\n// `makeGetDefaultInstanceFunction`), so for simplicity we just don't bother.\n\n/**\n * Returns a `getDefaultInstance` function implementation.\n * @return {?}\n * @nosideeffects\n */\nfunction makeGetDefaultInstanceFunction(\n    /** function(new:Message, ?Array<?>=)*/ ctor) {\n  return () => getDefaultImmutableInstance(ctor);\n}\n\n\n/** @record */\nfunction DeserializeFnWithCtorAndTypeName() {\n  /** @type {!Function} */\n  this.internalDoNotUse_ctor;\n}\n\n/**\n * Returns a `deserializeBinary` function for an immutable message\n * @return {?}\n * @nosideeffects\n */\nfunction makeDeserializeBinaryImmutableFunction(\n    /** function(!BinarySource, !BinaryReaderOptions=):!Message */\n    deserializeBinaryFn) {\n  const fn = /** @return {!Message} */ (\n      /** !BinarySource */ source,\n      /** !BinaryReaderOptions= */ options) => {\n    return deserializeBinaryFn(source, options).toImmutable();\n  };\n  /** @type {!DeserializeFnWithCtorAndTypeName} */ (fn).internalDoNotUse_ctor =\n      /** @type {!DeserializeFnWithCtorAndTypeName} */ (deserializeBinaryFn)\n          .internalDoNotUse_ctor;\n  return fn;\n}\n\n/**\n * Returns a `deserializeBinary` function for a mutable message.\n * @return {function(?BinarySource,!BinaryReaderOptions=):T}\n * @template T\n * @nosideeffects\n */\nfunction makeDeserializeBinaryFunction(\n    /** function(new:T, ?Array<?>=) */ ctor, /** !Array<?> */ binaryFields) {\n  const fn = /** @return {!T} */ (\n      /** ?BinarySource */ source,\n      /** !BinaryReaderOptions= */ options) =>\n      deserializeBinary(source, ctor, binaryFields, options);\n  /** @type {!DeserializeFnWithCtorAndTypeName} */ (fn).internalDoNotUse_ctor =\n      ctor;\n  return fn;\n}\n\n/**\n * Returns a `deserializeBinaryFromReader` function implementation.\n * @return {?}\n * @suppress{visibility} accesses private properties of message\n * @nosideeffects\n */\nfunction makeDeserializeBinaryFromReaderFunction(\n    /** !Array<?> */ binaryFields) {\n  return /** @return {T} @template T */ (\n             /** !T */ msg, /** !BinaryReader*/ reader) => {\n    maybeCopyOnWrite(msg);\n    makeDeserializeBinaryFromReaderFromBinaryFields(binaryFields)(\n        getInternalArray(/** @type{!Message}*/ (msg)), reader);\n    return msg;\n  };\n}\n\n/**\n * Returns a `serializeBinary` static function for a message.\n * @return {?}\n * @nosideeffects\n */\nfunction makeSerializeBinaryFunction(/** !Array<?> */ binaryFields) {\n  return (/** !Message */ msg) => serializeBinary(msg, binaryFields);\n}\n\n/**\n * Returns a `serializeBinaryToByteString` static function for a message.\n * @return {?}\n * @nosideeffects\n */\nfunction makeSerializeBinaryToByteStringFunction(\n    /** !Array<?> */ binaryFields) {\n  return (/** !Message */ msg) =>\n             serializeBinaryToByteString(msg, binaryFields);\n}\n\n/**\n * Returns an opaque binary type table for a message.\n * @template T\n * @return {function(): !OpaqueTypeTable<T>}\n * @nosideeffects\n * @tsType <\n *   T extends\n * import('google3/javascript/apps/jspb/mutable_message').MutableMessage\n * >(\n *   messageType: new (data?: unknown[] | null) => T,\n *   binaryFields: unknown[],\n * ): () => OpaqueTypeTable<T>\n */\nfunction makeGetTypeTable(\n    /** function(new:T, ?Array<?>=) */ messageType,\n    /** !Array<?> */ binaryFields) {\n  let /** ? */ table;\n  return () => /** @type {!OpaqueTypeTable<T>} */ (\n             table ??=\n                 wrappedTypeTableForBinaryFields(messageType, binaryFields));\n}\n\n/**\n * Returns a `serializeBinary` instance method for a message.\n * @return {?}\n * @nosideeffects\n */\nfunction makePrototypeSerializeBinaryFunction(/** !Array<?> */ binaryFields) {\n  return (/**\n           * @this {!Message}\n           * @return {!Uint8Array}\n           */\n          function() {\n            return serializeBinary(this, binaryFields);\n          });\n}\n\n/**\n * Returns a `makeCrossSerializerComparisonsCompatible` static function for a\n * message.\n * @return {?}\n * @nosideeffects\n */\nfunction makeCrossSerializerComparisonsCompatibleFunction(\n    /** !Function*/ ctor, /** !Array<?> */ binaryFields) {\n  const fn = (/** !Message */ msg) => makeCrossSerializerComparisonsCompatible(\n      asserts.assertInstanceof(asserts.assertInstanceof(msg, ctor), Message),\n      binaryFields);\n  if (goog.DEBUG) {\n    // In debug mode we can leverage this property to improve an error message.\n    ctor['makeCrossSerializerComparisonsCompatible'] = fn;\n  }\n  return fn;\n}\n\n/**\n * Returns a `hasInstance` function for an ImmutableMessage\n * @return {?}\n * @nosideeffects\n */\nfunction makeHasImmutableInstance(\n    /** function(new:Message, ?Array<?>=) */ ctor) {\n  return defineTypeGuard(\n      /**\n       * @param {*} value\n       * @return {boolean}\n       */\n      (value) => value instanceof ctor && isImmutableMessage(value),\n      () => 'ImmutableMessage:' + getTypeName(ctor));\n}\n\n/**\n * Returns a `hasInstance` function for a MutableMessage\n * @return {?}\n * @nosideeffects\n */\nfunction makeHasMutableInstance(\n    /** function(new:Message, ?Array<?>=) */ ctor) {\n  return defineTypeGuard(\n      /**\n       * @param {*} value\n       * @return {boolean}\n       */\n      (value) => value instanceof ctor && !isImmutableMessage(value),\n      () => 'MutableMessage:' + getTypeName(ctor));\n}\n\n\n/**\n * Returns a `deserialize` function for an immutable message.\n * @param {function(new:?, ?Array=)} ctor Constructor for the message.\n * @return {!Function} a deserializeFunction\n * @nosideeffects\n */\nfunction makeImmutableDeserializeFunction(ctor) {\n  return (/** string */ data) => deserializeAsImmutable(ctor, data);\n}\n\n/**\n * Returns a `deserialize` function for a message.\n * @return {?}\n * @nosideeffects\n */\nfunction makeMutableDeserializeFunction(\n    /** function(new:Message, ?Array<?>=) */ ctor) {\n  return (/** string */ data) => Message.deserializeWithCtor(ctor, data);\n}\n\n/**\n * Returns a `fromFields` function for a message.\n * @return {?}\n * @nosideeffects\n */\nfunction makeFromFieldsForTesting(\n    /** function(new:Message, ?Array<?>=) */ ctor) {\n  if (COMPILED || !GENERATE_FIELDS_INTERFACE_FOR_TESTING) {\n    return undefined;\n  }\n  return /** @return {?} */ (/** !Object */ fields) => {\n    triggerLeakTest(ctor);\n    return fromFieldsForTestingGeneric(ctor, fields);\n  };\n}\n\n/**\n * Returns a `getFields` function for a message.\n * @return {?}\n * @nosideeffects\n */\nfunction makeGetFieldsForTesting() {\n  if (COMPILED || !GENERATE_FIELDS_INTERFACE_FOR_TESTING) {\n    return undefined;\n  }\n  return /** @return {?} */ (/** !Message */ msg) => {\n    triggerLeakTest(msg.constructor);\n    return getFieldsForTestingGeneric(msg);\n  };\n}\n\n/** @return {!Object<number, *>} */\nfunction makeExtensionsObject(/** function(new:Message, ?Array<?>=) */ ctor) {\n  const extensions = {};\n  if (goog.DEBUG) {\n    registerExtensionsForDebugging(ctor, extensions);\n  }\n  return extensions;\n}\n\n\n/** Triggers leak tests if this code ever ends up in an optimized binary. */\nfunction triggerLeakTest(/** ? */ ctor) {\n  if (ctor['property_that_will_never_exist_do_not_use_jspb-syntax-that-must-be-optimized']) {\n    throw new Error(\n        'jspb-syntax-that-must-be-optimized: see go/closure-js-conformance#jspbRecords');\n  }\n}\n\n/**\n * This is a constant which will compile to `false` but will not trigger useless\n * code checks.\n *\n * @const {boolean}\n */\nconst ALWAYS_FALSE = !COMPILED && (Math.random() < 0);\n\n/**\n * An empty record type.\n *\n * We use this in fromObject so that the JSCompiler does not degrade the\n * receiver type and emit JSConformance violations from gencode.\n *\n * @record\n */\nfunction EmptyRecord() {}\n\nexports = {\n  ALWAYS_FALSE,\n  ANY_PROTOTYPE_MARKER_VALUE,\n  BinaryReaderOptions,\n  BinarySource,\n  DescriptorTypeReference,\n  DoNotFreezeToken,\n  EmptyRecord,\n  EnumDescriptorTypeReference,\n  ExtensionReference,\n  GENERATE_FROM_OBJECT,\n  GENERATE_TO_OBJECT,\n  GENERATE_TYPE_NAME_PROPERTIES,  // Re-export for gencode\n  GeneratedMessage,\n  HAS_MESSAGE_ID,\n  LAZILY_PARSE_LATE_LOADED_EXTENSIONS_SYMBOL,\n  OpaqueTypeTable,\n  OrUndefinedToken,\n  RecordExtensionRegistry,\n  assertCorrectAnyType,\n  assertMutable,\n  byteStringAsB64,\n  byteStringAsBase64OrUint8Array,\n  byteStringAsU8,\n  byteStringListAsB64,\n  byteStringListAsU8,\n  checkCanCallToObject: assertMutable,\n  registerExtensionsForDebugging,\n  createMessageExtension,\n  createPrimitiveExtension,\n  createRepeatedMessageExtension,\n  createRepeatedPrimitiveExtension,\n  fromObjectAnyValue,\n  fromObjectBytes: coerceToNullishBytes,\n  fromObjectList,\n  fromObjectNullable,\n  getAnyTypeName,\n  getAnyValueField,\n  makeCrossSerializerComparisonsCompatibleFunction,\n  makeDeserializeBinaryFromReaderFunction,\n  makeDeserializeBinaryFunction,\n  makeDeserializeBinaryImmutableFunction,\n  makeExtensionsObject,\n  makeFromFieldsForTesting,\n  makeGetDefaultInstanceFunction,\n  makeGetFieldsForTesting,\n  makeHasImmutableInstance,\n  makeHasMutableInstance,\n  makeImmutableDeserializeFunction,\n  makeMutableDeserializeFunction,\n  makePrototypeSerializeBinaryFunction,\n  makeSerializeBinaryFunction,\n  makeSerializeBinaryToByteStringFunction,\n  mapFromObject,\n  mapToObject,\n  packAnyValueBinary,\n  packAnyValueJspb,\n  makeDescriptorGetter,\n  makeEnumDescriptorGetter,\n  makeExtensionReference,\n  makeGetTypeTable,\n  setAnyTypeName,\n  setAnyTypeUrl,\n  toGbigint,\n  toObjectAnyValue,\n  toObjectBytes,\n  toObjectList,\n  toObjectPrimitive,\n  TypeSpecificApiFormat,\n  unpackAnyJspbCompat,\n};\n","import {UserVoiceFeedbackConfigEnums} from 'google3/engage/enums/uservoice/feedback/config.proto';\nimport {ImageData} from 'google3/userfeedback/javascript/screenshots/image_data/image_data';\nimport {\n  AlohaFlags,\n  AlohaFormPropertiesResponse,\n} from 'google3/uservoice/common/flags/flag_service.proto';\nimport {FeedbackFormModelParameters} from 'google3/uservoice/feedback/client/web/shared/models/feedback_form_model';\nimport {IssueCategory} from 'google3/uservoice/feedback/client/web/shared/types';\n\nconst enumFeedbackIntent = UserVoiceFeedbackConfigEnums.FeedbackIntent;\n\n/**\n * List of static constants to be used by the client\n */\nexport const DEFAULT_MIN_CHAR_COUNT_FOR_DESCRIPTION = 1;\n\n/**\n * Default language in which the form will be rendered\n */\nexport const DEFAULT_FORM_LANGUAGE = 'en';\n\n/**\n * Default form content. Used when user has not specified any form content\n */\nexport const DEFAULT_FORM_CONTENT: {\n  locale: string;\n} = {\n  locale: DEFAULT_FORM_LANGUAGE,\n};\n\n/**\n * Issue intent string. Used to hard code some behavior for backward\n * compatibility.\n */\nexport const FEEDBACK_INTENT_ISSUE = 'FEEDBACK_INTENT_ISSUE';\n\n/**\n * Suggestion intent string. Used to hard code some behavior for backward\n * compatibility.\n */\nexport const FEEDBACK_INTENT_SUGGESTION = 'FEEDBACK_INTENT_SUGGESTION';\n\n/**\n * Generic intent string. Used to hard code some behavior for backward\n * compatibility.\n */\nexport const FEEDBACK_INTENT_GENERIC = 'FEEDBACK_INTENT_GENERIC';\n\n/**\n * Unknown intent string. Used to hard code some behavior for backward\n * compatibility.\n */\nexport const FEEDBACK_INTENT_UNKNOWN = 'FEEDBACK_INTENT_UNKNOWN';\n\n/**\n * Key for storing the whether the user has opened the feedback form on a\n * particular website or not.\n */\nexport const TOOLTIP_SEEN_STORAGE_KEY = 'feedback-fre-tooltip-seen-storage-key';\n\n/**\n * Key for storing the number of times user has seen the multistep fre tooltip.\n */\nexport const MULTISTEP_TOOLTIP_SEEN_STORAGE_KEY =\n  'feedback-fre-multistep-seen-storage-key';\n\n/**\n * Maximum number of times to show the multistep fre tooltip.\n */\nexport const MULTISTEP_TOOLTIP_SEEN_MAX_COUNT = 3;\n\n/**\n * DEPRECATED:- Not used anymore. To be removed soon.\n * Key for storing the new ss engine experiment flag\n */\nexport const ALOHA_FEEDBACK_ENABLE_SSENGINE = 'aloha_feedback_enable_ssengine';\n\n/**\n * Key for storing the new smart compose/auto correct experiment flag\n */\nexport const ALOHA_FEEDBACK_ENABLE_AWR = 'aloha_feedback_enable_awr';\n\n/**\n * Key for storing the new help suggestions experiment flag\n */\nexport const ALOHA_FEEDBACK_ENABLE_HELP_SUGGESTIONS =\n  'aloha_feedback_enable_help_suggestions';\n\n/**\n * Default value for the aloha form properties to be fetched from receiver.\n */\nexport function defaultAlohaFormProperties(): AlohaFormPropertiesResponse {\n  return new AlohaFormPropertiesResponse().setAlohaFlags(\n    new AlohaFlags()\n      .setAlohaAutoGaRollout(true)\n      .setEnableSsEngine(true)\n      .setEnableHelpSuggestions(false)\n      .setEnableCtlConsentCheckbox(true)\n      .setEnableIframe(true)\n      .setEnableMweb(true)\n      .setEnableScreenshotNudge(true)\n      .setEnableJunkNudge(true)\n      .setEnableConfiguratorLocale(false)\n      .setEnableTinyNoPointer(true)\n      .setEnableSupportSessionLogging(true)\n      .setEnableDbFeedbackIntents(false),\n  );\n}\n\n/**\n * If the user email contains this trailing part then the thank you message\n * contains some more information for tracking.\n */\nexport const GOOGLER_EMAIL_SUFFIX = '@google.com';\n\n/** Go link to direct internal users to my feedback page. */\nexport const MY_FEEDBACK_GO_LINK = 'go/myfeedback';\n\n/**\n * The z-index required to render the overlay container and tooltip.\n */\nexport const Z_INDEX_FOR_OVERLAYS = 10000000;\n\n/**\n * Time for the feedback form to open/close. During this time, feedback form\n * animates from an open state to close state or vice versa.\n */\nexport const FEEDBACK_MANAGER_OPEN_CLOSE_ANIMATION = 500;\n\n/** The default locale to use if not provided. */\nexport const DEFAULT_LOCALE = 'en';\n\n/**\n * Product ids that bypass experiment flags check to load aloha or classic\n * feedback. This is for pilot integrations like Gmail which implement this flag\n * on their own.\n */\nexport const PRODUCT_IDS_BYPASS_EXP_CHECK: Set<string> = new Set([\n  '17',\n  '1026354',\n]);\n\n/**\n * Element that wraps Aloha form when hosted inside an iframe instead of shadow\n * dom. This is for defining id as well grabbing the same element from\n * selectors.\n */\nexport const IFRAME_INTERNAL_WRAPPER = 'iframe-internal-wrapper';\n\n/** Different data realms of Feedback Oneplatform Server. */\nexport enum FeedbackOneplatformRealms {\n  PROD = 'prod',\n  STAGING_QUAL = 'qual',\n  AUTOPUSH = 'autopush',\n}\n\n/** Feedback Oneplatform Urls for different environments. */\nexport const FEEDBACK_ONEPLATFORM_URLS: Map<FeedbackOneplatformRealms, string> =\n  new Map([\n    [FeedbackOneplatformRealms.PROD, 'https://feedback-pa.clients6.google.com'],\n    [\n      FeedbackOneplatformRealms.STAGING_QUAL,\n      'https://stagingqual-feedback-pa-googleapis.sandbox.google.com',\n    ],\n    [\n      FeedbackOneplatformRealms.AUTOPUSH,\n      'https://autopush-feedback-pa-googleapis.sandbox.google.com',\n    ],\n  ]);\n\n/** Feedback pantheon project API key to call Feedback Oneplatform APIs. */\nexport const FEEDBACK_ONEPLATFORM_API_KEY =\n  'AIzaSyCZpWLY6vArGGMkRnpLtdPfz3yR-5xoKRs';\n\n/** Checks whether the report submission URL is for test/qual data realms. */\nexport function isTestDataRealm(url: string): boolean {\n  return TEST_DATA_SUBMISSION_URLS.some((regex) => regex.test(url));\n}\n\n/* URLs which belong to test and qual data realm. */\nconst TEST_DATA_SUBMISSION_URLS = [\n  /https:\\/\\/sandbox\\.google\\.com\\/tools\\/feedback/,\n  /https:\\/\\/feedback-frontend-qual[a-z0-9.]*\\.google\\.com\\/inapp/,\n  /https:\\/\\/feedback-frontend-qual[a-z0-9.]*\\.google\\.com\\/tools\\/feedback/,\n  /https:\\/\\/.*\\.googleusercontent\\.com\\/inapp/,\n];\n\n// LINT.IfChange\n/**\n * Width of Aloha Form\n */\nexport const ALOHA_FORM_WIDTH_PX = 412;\n// LINT.ThenChange(//depot/google3/uservoice/feedback/client/web/feedback_manager/feedback_manager.gss)\n\nconst DEFAULT_ISSUE_CATEGORIES: IssueCategory[] = [\n  {key: '', msg: '', msgInEnglish: ''},\n];\n\n/**\n * Default parameters into `FeedbackFormModel`.\n */\nexport const DEFAULT_FEEDBACK_FORM_MODEL_PARAMS: FeedbackFormModelParameters = {\n  announcement: '',\n  feedbackIssueCategories: DEFAULT_ISSUE_CATEGORIES,\n  selectedFeedbackIssueCategoryIndex: -1,\n  selectedFeedbackCategoryKey: '',\n  selectedFeedbackCategoryMessage: '',\n  feedbackUrgencyLevel: '',\n  description: '',\n  imageData: new ImageData('image', 'base64'),\n  feedbackUserCtlConsent: false,\n  feedbackJunkNudgeShown: false,\n  helpArticles: [],\n  title: '',\n  helpArticlesHtml: [],\n  realTimeCtlDetails: [],\n  csatImpression: [],\n  additionalDataConsent: false,\n};\n\n/**\n * Deflection Intents.\n */\nexport const DEFLECTION_INTENTS: UserVoiceFeedbackConfigEnums.FeedbackIntent[] =\n  [\n    enumFeedbackIntent.FEEDBACK_INTENT_PII,\n    enumFeedbackIntent.FEEDBACK_INTENT_LEGAL,\n  ];\n\n/**\n * Manually dispatch this event when expansion panel expands or collapsed to\n * re-render fre tooltip position.\n */\nexport const EVENT_TO_DISPATCH_WHEN_EXPANSION_PANEL_EXPANDS_OR_COLLAPSED =\n  'expansionpanelexpandsorcollapsed';\n\n/**\n * The product id to be set in clearcutBuilder when dma product id is missing\n * from configurator service response.\n */\nexport const CUSTOMER_SUPPORT_DMA_PRODUCT_ID = 72366329;\n\n/** Represents storage access request statuses */\nexport enum StorageAccessRequestStatus {\n  UNAVAILABLE = 0,\n  AUTO_GRANTED = 1,\n  ACCESS_ALREADY_GRANTED = 2,\n  SHOULD_REQUEST = 3,\n  API_ERROR = 4,\n}\n\n/** Represents post message ids used for callbacks  */\nexport enum PostMessageId {\n  UNKNOWN = 0,\n  MAIN_RSA_CALLBACK = 1,\n}\n","import {DEFAULT_FORM_LANGUAGE} from 'google3/uservoice/feedback/client/web/shared/constants';\nimport {FeedbackClientConfig} from 'google3/uservoice/feedback/client/web/shared/types';\n\n// LINT.IfChange\nconst SUPPORTED_LANGUAGES = [\n  'af',\n  'am',\n  'ar-EG',\n  'ar-JO',\n  'ar-MA',\n  'ar-SA',\n  'ar-XB',\n  'ar',\n  'az',\n  'be',\n  'bg',\n  'bn',\n  'bs',\n  'ca',\n  'cs',\n  'cy',\n  'da',\n  'de-AT',\n  'de-CH',\n  'de',\n  'el',\n  'en',\n  'en-GB',\n  'en-AU',\n  'en-CA',\n  'en-IE',\n  'en-IN',\n  'en-NZ',\n  'en-SG',\n  'en-XA',\n  'en-XC',\n  'en-ZA',\n  'es',\n  'es-419',\n  'es-AR',\n  'es-BO',\n  'es-CL',\n  'es-CO',\n  'es-CR',\n  'es-DO',\n  'es-EC',\n  'es-GT',\n  'es-HN',\n  'es-MX',\n  'es-NI',\n  'es-PA',\n  'es-PE',\n  'es-PR',\n  'es-PY',\n  'es-SV',\n  'es-US',\n  'es-UY',\n  'es-VE',\n  'et',\n  'eu',\n  'fa',\n  'fi',\n  'fil',\n  'fr-CA',\n  'fr-CH',\n  'fr',\n  'gl',\n  'gsw',\n  'gu',\n  'he',\n  'hi',\n  'hr',\n  'hu',\n  'hy',\n  'id',\n  'in',\n  'is',\n  'it',\n  'iw',\n  'ja',\n  'ka',\n  'kk',\n  'km',\n  'kn',\n  'ko',\n  'ky',\n  'ln',\n  'lo',\n  'lt',\n  'lv',\n  'mk',\n  'ml',\n  'mn',\n  'mo',\n  'mr',\n  'ms',\n  'my',\n  'nb',\n  'ne',\n  'nl',\n  'no',\n  'pa',\n  'pl',\n  'pt',\n  'pt-BR',\n  'pt-PT',\n  'ro',\n  'ru',\n  'si',\n  'sk',\n  'sl',\n  'sq',\n  'sr-Latn',\n  'sr',\n  'sv',\n  'sw',\n  'ta',\n  'te',\n  'th',\n  'tl',\n  'tr',\n  'uk',\n  'ur',\n  'uz',\n  'vi',\n  'zh',\n  'zh-CN',\n  'zh-HK',\n  'zh-TW',\n  'zu',\n];\n// LINT.ThenChange(//depot/google3/uservoice/feedback/client/web/build_defs.bzl\n// ,\n// //depot/google3/uservoice/feedback/client/dart/feedback_form/lib/utils.dart)\n\n/**\n * Returns the locale before making the configurator call.\n * Identifies the preferred language from the config or browser setting.\n * First selects the config's language if it is among the supported languages.\n * If not then selects the first language from all the browser preferred\n *   languages set by the end user that is among the preferred languages.\n * If none are then defaults to English.\n * DO NOT USE TO LOAD FORM ENTITIES OR MESSAGES BINARY.\n */\n// LINT.IfChange\nexport function getLanguageFromClientConfig(\n  config: FeedbackClientConfig,\n): string {\n  return getSupportedLocaleFromConfig(config) ?? DEFAULT_FORM_LANGUAGE;\n}\n\n/**\n * Checks if locale present in config is supported\n */\nexport function isConfigLocaleSupported(config: FeedbackClientConfig): boolean {\n  return getSupportedLocaleFromConfig(config) !== undefined;\n}\n\n/**\n * Tries to get a supported locale from the config. If the raw locale is not in\n * the list of supported locales, tries to match the language portion of the\n * locale only. If none are supported, returns undefined.\n */\nfunction getSupportedLocaleFromConfig(config: FeedbackClientConfig) {\n  const locale = config.formContent?.locale;\n  const language = locale?.split('-')[0];\n\n  if (locale && SUPPORTED_LANGUAGES.includes(locale)) {\n    return locale;\n  } else if (language && SUPPORTED_LANGUAGES.includes(language)) {\n    return language;\n  } else {\n    return undefined;\n  }\n}\n\n/**\n * Returns the locale of the config\n */\nexport function getLocaleFromConfig(\n  feedbackClientConfig: FeedbackClientConfig,\n): string | undefined {\n  return feedbackClientConfig.formContent?.locale;\n}\n// LINT.ThenChange(//depot/google3/uservoice/feedback/client/dart/feedback_form/lib/utils.dart)\n","import {getLanguageFromClientConfig} from 'google3/uservoice/feedback/client/web/languages/languages';\nimport {\n  AlohaExperimentFlags,\n  FeedbackClientConfig,\n} from 'google3/uservoice/feedback/client/web/shared/types';\nimport {TrustedResourceUrl, trustedResourceUrl} from 'safevalues';\n\n/**\n * A utility function for getting feedback url based on the language and\n * environment.\n * @param config The config object for initializing the feedback client\n */\n// LINT.IfChange\nexport function getFeedbackJsUrl(\n  config: FeedbackClientConfig,\n  expFlags: AlohaExperimentFlags | null,\n): TrustedResourceUrl {\n  const language = getLanguageFromClientConfig(config)\n    .replaceAll('-', '_')\n    .toLowerCase();\n  const env = config.initializationData?.useNightlyRelease ? 'nightly' : 'live';\n  if (expFlags?.getEnableAlohaBinarySplit?.()) {\n    return trustedResourceUrl`https://www.gstatic.com/uservoice/feedback/client/web/${env}/main_light_binary.js`;\n  }\n  return trustedResourceUrl`https://www.gstatic.com/uservoice/feedback/client/web/${env}/main_binary__${language}.js`;\n}\n// LINT.ThenChange(//depot/google3/uservoice/feedback/client/dart/feedback_form/lib/utils.dart)\n","/**\n * @fileoverview A loader implementation for the Aloha Feedback Client. This is\n * the loading mechanism used by the Help API and the userfeedback.api.\n */\n\nimport * as googDom from 'google3/third_party/javascript/closure/dom/dom';\nimport {TagName} from 'google3/third_party/javascript/closure/dom/tagname';\nimport {setScriptSrc} from 'safevalues/dom';\n\nimport {\n  FeedbackV2GlobalObject as FeedbackV2GlobalObjectForMainLightBinary,\n  FeedbackV2WindowExtension as FeedbackV2WindowExtensionForMainLightBinary,\n} from '../shared/feedbackGlobalObject';\nimport {\n  AlohaExperimentFlags,\n  FeedbackClient,\n  FeedbackClientConfig,\n  FeedbackV2GlobalObject,\n  FeedbackV2WindowExtension,\n  FormCloseData,\n} from '../shared/types';\n\nimport {getFeedbackJsUrl} from './loader_util';\n\n/**\n * Error thrown when feedback is initialized while another instance is already\n * loading or open.\n */\nexport class DuplicateFormError extends Error {\n  constructor() {\n    super('Form is either loading or already opened');\n    this.name = 'DuplicateFormError';\n  }\n}\n\nlet loadFeedbackScriptPromise: Promise<FeedbackV2GlobalObject> | undefined;\nlet loadFeedbackScriptPromisUsingMainLightBinary:\n  | Promise<FeedbackV2GlobalObjectForMainLightBinary>\n  | undefined;\nlet lastFeedbackWindow: FeedbackV2WindowExtension | undefined;\nlet lastFeedbackWindowForMainLightBinary:\n  | FeedbackV2WindowExtensionForMainLightBinary\n  | undefined;\n\n/**\n * Appends the Aloha binaries to the clients DOM.\n *\n * @param config Aloha client configuration\n * @param feedbackWindow The indicated window to be used to grab feedback for.\n * @param dom The document object of the feedbackWindow\n */\nfunction getFeedbackClientInitializerAsync(\n  config: FeedbackClientConfig,\n  feedbackWindow: FeedbackV2WindowExtension,\n  dom: Document,\n  expFlags: AlohaExperimentFlags | null,\n): Promise<FeedbackV2GlobalObject> {\n  // We can't reuse the promise when the feedback window is changed otherwise\n  // the feedback will be loaded in the previous window.\n  if (loadFeedbackScriptPromise && lastFeedbackWindow === feedbackWindow) {\n    return loadFeedbackScriptPromise;\n  }\n  lastFeedbackWindow = feedbackWindow;\n  const scriptSrc = getFeedbackJsUrl(config, expFlags);\n\n  // TODO(b/215055786): Write test case to check for aloha binary getting\n  // appended to the window passed from the product.\n\n  // Set in main.ts\n  if (feedbackWindow.feedbackV2GlobalObject) {\n    // In the case that loader.ts was loaded in two different binaries and the\n    // script was already downloaded using the other instance, just use that\n    // instance.\n    loadFeedbackScriptPromise = Promise.resolve(\n      feedbackWindow.feedbackV2GlobalObject,\n    );\n  } else {\n    loadFeedbackScriptPromise = new Promise((resolve, reject) => {\n      const scriptEl = googDom.createElement(TagName.SCRIPT);\n      setScriptSrc(scriptEl, scriptSrc);\n      scriptEl.onload = () => {\n        if (feedbackWindow.feedbackV2GlobalObject) {\n          resolve(feedbackWindow.feedbackV2GlobalObject);\n        } else {\n          reject(new Error('feedbackV2GlobalObject not found on window.'));\n          // TODO(b/204402197): log binary load failures using third eye.\n        }\n      };\n      scriptEl.onerror = () => {\n        reject(\n          new Error(\n            `Feedback binary script tag failed to load: ${scriptSrc.toString()}`,\n          ),\n        );\n      };\n      dom.body.appendChild(scriptEl);\n    });\n  }\n  return loadFeedbackScriptPromise;\n}\n\n/**\n * Appends the Aloha binaries to the clients DOM.\n *\n * @param config Aloha client configuration\n * @param feedbackWindow The indicated window to be used to grab feedback for.\n * @param dom The document object of the feedbackWindow\n */\nfunction getFeedbackClientInitializerAsyncUsingMainLightBinary(\n  config: FeedbackClientConfig,\n  feedbackWindow: FeedbackV2WindowExtensionForMainLightBinary,\n  dom: Document,\n  expFlags: AlohaExperimentFlags | null,\n): Promise<FeedbackV2GlobalObjectForMainLightBinary> {\n  // We can't reuse the promise when the feedback window is changed otherwise\n  // the feedback will be loaded in the previous window.\n  if (\n    loadFeedbackScriptPromisUsingMainLightBinary &&\n    lastFeedbackWindowForMainLightBinary === feedbackWindow\n  ) {\n    return loadFeedbackScriptPromisUsingMainLightBinary;\n  }\n  lastFeedbackWindowForMainLightBinary = feedbackWindow;\n  const scriptSrc = getFeedbackJsUrl(config, expFlags);\n\n  // TODO(b/215055786): Write test case to check for aloha binary getting\n  // appended to the window passed from the product.\n\n  // Set in main_light.ts\n  if (feedbackWindow.feedbackV2GlobalObject) {\n    // In the case that loader.ts was loaded in two different binaries and the\n    // script was already downloaded using the other instance, just use that\n    // instance.\n    loadFeedbackScriptPromisUsingMainLightBinary = Promise.resolve(\n      feedbackWindow.feedbackV2GlobalObject,\n    );\n  } else {\n    loadFeedbackScriptPromisUsingMainLightBinary = new Promise(\n      (resolve, reject) => {\n        const scriptEl = googDom.createElement(TagName.SCRIPT);\n        setScriptSrc(scriptEl, scriptSrc);\n        scriptEl.onload = () => {\n          if (feedbackWindow.feedbackV2GlobalObject) {\n            resolve(feedbackWindow.feedbackV2GlobalObject);\n          } else {\n            reject(new Error('feedbackV2GlobalObject not found on window.'));\n            // TODO(b/204402197): log binary load failures using third eye.\n          }\n        };\n        scriptEl.onerror = () => {\n          reject(\n            new Error(\n              `Feedback binary script tag failed to load: ${scriptSrc.toString()}`,\n            ),\n          );\n        };\n        dom.body.appendChild(scriptEl);\n      },\n    );\n  }\n  return loadFeedbackScriptPromisUsingMainLightBinary;\n}\n\n/**\n * Appends the Aloha binaries to the clients DOM.\n *\n * @param config Aloha client configuration\n * @param expFlags Flag object fetched from receiver.\n * @param feedbackWindow The indicated window to be used to grab feedback for.\n * @param dom The document object of the feedbackWindow\n */\nasync function load(\n  config: FeedbackClientConfig,\n  expFlags: AlohaExperimentFlags | null,\n  feedbackWindow: FeedbackV2WindowExtension,\n  dom: Document,\n  useAsyncApi = true,\n): Promise<FeedbackClient> {\n  const binaryLoadStartTime = Date.now();\n  const clientInitializer = await getFeedbackClientInitializerAsync(\n    config,\n    feedbackWindow,\n    dom,\n    expFlags,\n  );\n  let feedbackClient: FeedbackClient;\n  if (\n    useAsyncApi ||\n    config.initializationData?.useNightlyRelease ||\n    config.initializationData?.isLocalServer\n  ) {\n    feedbackClient = await clientInitializer.initializeFeedbackClientAsync(\n      config,\n      binaryLoadStartTime,\n      expFlags,\n    );\n  } else {\n    feedbackClient = clientInitializer.initializeFeedbackClient(\n      config,\n      binaryLoadStartTime,\n      expFlags,\n    );\n  }\n  feedbackClient.initiateAloha();\n  return feedbackClient;\n}\n\n/**\n * Appends the Aloha binaries to the clients DOM.\n *\n * @param config Aloha client configuration\n * @param expFlags Flag object fetched from receiver.\n * @param feedbackWindow The indicated window to be used to grab feedback for.\n * @param window The indicated window to be used to grab feedback\n *     for. Defaults to the script window.\n */\nasync function loadMainLightBinary(\n  config: FeedbackClientConfig,\n  expFlags: AlohaExperimentFlags | null,\n  feedbackWindow: FeedbackV2WindowExtensionForMainLightBinary,\n  window: Window,\n  useAsyncApi = true,\n): Promise<FeedbackClient> {\n  const binaryLoadStartTime = Date.now();\n  const clientInitializer =\n    await getFeedbackClientInitializerAsyncUsingMainLightBinary(\n      config,\n      feedbackWindow,\n      window.document,\n      expFlags,\n    );\n\n  let feedbackClient: FeedbackClient;\n  feedbackClient = await clientInitializer.initializeFeedbackClientAsync(\n    config,\n    binaryLoadStartTime,\n    expFlags,\n    window,\n  );\n\n  feedbackClient.initiateAloha();\n  return feedbackClient;\n}\n\n/**\n * Loads the Aloha binary, which exports its API to the window object.\n *\n * @param config Aloha client configuration.\n * @param expFlags Flag object fetched from receiver.\n * @param window The indicated window to be used to grab feedback\n *     for. Defaults to the script window.\n * @param useAsyncApi Flag to load the binary asynchronously or synchronously.\n */\nexport async function loadAndInitializeFeedbackClient(\n  config: FeedbackClientConfig,\n  expFlags: AlohaExperimentFlags | null,\n  window: Window | null,\n  useAsyncApi = true,\n): Promise<FeedbackClient> {\n  const win = window || goog.global;\n  if (expFlags?.getEnableAlohaBinarySplit?.()) {\n    const feedbackWindow =\n      win as unknown as FeedbackV2WindowExtensionForMainLightBinary;\n    if (feedbackWindow.isFormOpened) {\n      throw new DuplicateFormError();\n    }\n    feedbackWindow.isFormOpened = true;\n\n    config.callbacks = config.callbacks || {};\n    const existingOnClose = config.callbacks.onClose || (() => {});\n    config.callbacks.onClose = (formCloseData: FormCloseData) => {\n      feedbackWindow.isFormOpened = false;\n      existingOnClose(formCloseData);\n    };\n\n    try {\n      return loadMainLightBinary(\n        config,\n        expFlags,\n        feedbackWindow,\n        win,\n        useAsyncApi,\n      );\n    } catch (e: unknown) {\n      feedbackWindow.isFormOpened = false;\n      throw e;\n    }\n  } else {\n    const feedbackWindow = win as unknown as FeedbackV2WindowExtension;\n    if (feedbackWindow.isFormOpened) {\n      throw new DuplicateFormError();\n    }\n    feedbackWindow.isFormOpened = true;\n\n    config.callbacks = config.callbacks || {};\n    const existingOnClose = config.callbacks.onClose || (() => {});\n    config.callbacks.onClose = (formCloseData: FormCloseData) => {\n      feedbackWindow.isFormOpened = false;\n      existingOnClose(formCloseData);\n    };\n\n    try {\n      return load(config, expFlags, feedbackWindow, win.document, useAsyncApi);\n    } catch (e: unknown) {\n      feedbackWindow.isFormOpened = false;\n      throw e;\n    }\n  }\n}\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Defines the goog.dom.TagName class. Its constants enumerate\n * all HTML tag names specified in either the W3C HTML 4.01 index of elements\n * or the HTML5.1 specification.\n *\n * References:\n * https://www.w3.org/TR/html401/index/elements.html\n * https://www.w3.org/TR/html51/dom.html#elements\n */\ngoog.provide('goog.dom.TagName');\n\ngoog.require('goog.dom.HtmlElement');\n\n/**\n * A tag name for an HTML element.\n *\n * This type is a lie. All instances are actually strings. Do not implement it.\n *\n * It exists because we need an object type to host the template type parameter,\n * and that's not possible with literal or enum types. It is a record type so\n * that runtime type checks don't try to validate the lie.\n *\n * @template T\n * @record\n */\ngoog.dom.TagName = class {\n  /**\n   * Cast a string into the tagname for the associated constructor.\n   *\n   * @template T\n   * @param {string} name\n   * @param {function(new:T, ...?)} type\n   * @return {!goog.dom.TagName<T>}\n   */\n  static cast(name, type) {\n    return /** @type {?} */ (name);\n  }\n\n  constructor() {\n    /** @private {null} */\n    this.googDomTagName_doNotImplementThisTypeOrElse_;\n\n    /** @private {T} */\n    this.ensureTypeScriptRemembersTypeT_;\n  }\n\n  /**\n   * Appease the compiler that instances are stringafiable for the\n   * purpose of being a dictionary key.\n   *\n   * Never implemented; always backed by `String::toString`.\n   *\n   * @override\n   * @return {string}\n   */\n  toString() {}\n};\n\n\n\n/** @const {!goog.dom.TagName<!HTMLAnchorElement>} */\ngoog.dom.TagName.A = /** @type {?} */ ('A');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.ABBR = /** @type {?} */ ('ABBR');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.ACRONYM = /** @type {?} */ ('ACRONYM');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.ADDRESS = /** @type {?} */ ('ADDRESS');\n\n/** @const {!goog.dom.TagName<!HTMLAppletElement>} */\ngoog.dom.TagName.APPLET = /** @type {?} */ ('APPLET');\n\n/** @const {!goog.dom.TagName<!HTMLAreaElement>} */\ngoog.dom.TagName.AREA = /** @type {?} */ ('AREA');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.ARTICLE = /** @type {?} */ ('ARTICLE');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.ASIDE = /** @type {?} */ ('ASIDE');\n\n/** @const {!goog.dom.TagName<!HTMLAudioElement>} */\ngoog.dom.TagName.AUDIO = /** @type {?} */ ('AUDIO');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.B = /** @type {?} */ ('B');\n\n/** @const {!goog.dom.TagName<!HTMLBaseElement>} */\ngoog.dom.TagName.BASE = /** @type {?} */ ('BASE');\n\n/** @const {!goog.dom.TagName<!HTMLBaseFontElement>} */\ngoog.dom.TagName.BASEFONT = /** @type {?} */ ('BASEFONT');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.BDI = /** @type {?} */ ('BDI');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.BDO = /** @type {?} */ ('BDO');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.BIG = /** @type {?} */ ('BIG');\n\n/** @const {!goog.dom.TagName<!HTMLQuoteElement>} */\ngoog.dom.TagName.BLOCKQUOTE = /** @type {?} */ ('BLOCKQUOTE');\n\n/** @const {!goog.dom.TagName<!HTMLBodyElement>} */\ngoog.dom.TagName.BODY = /** @type {?} */ ('BODY');\n\n/** @const {!goog.dom.TagName<!HTMLBRElement>} */\ngoog.dom.TagName.BR = /** @type {?} */ ('BR');\n\n/** @const {!goog.dom.TagName<!HTMLButtonElement>} */\ngoog.dom.TagName.BUTTON = /** @type {?} */ ('BUTTON');\n\n/** @const {!goog.dom.TagName<!HTMLCanvasElement>} */\ngoog.dom.TagName.CANVAS = /** @type {?} */ ('CANVAS');\n\n/** @const {!goog.dom.TagName<!HTMLTableCaptionElement>} */\ngoog.dom.TagName.CAPTION = /** @type {?} */ ('CAPTION');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.CENTER = /** @type {?} */ ('CENTER');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.CITE = /** @type {?} */ ('CITE');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.CODE = /** @type {?} */ ('CODE');\n\n/** @const {!goog.dom.TagName<!HTMLTableColElement>} */\ngoog.dom.TagName.COL = /** @type {?} */ ('COL');\n\n/** @const {!goog.dom.TagName<!HTMLTableColElement>} */\ngoog.dom.TagName.COLGROUP = /** @type {?} */ ('COLGROUP');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.COMMAND = /** @type {?} */ ('COMMAND');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.DATA = /** @type {?} */ ('DATA');\n\n/** @const {!goog.dom.TagName<!HTMLDataListElement>} */\ngoog.dom.TagName.DATALIST = /** @type {?} */ ('DATALIST');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.DD = /** @type {?} */ ('DD');\n\n/** @const {!goog.dom.TagName<!HTMLModElement>} */\ngoog.dom.TagName.DEL = /** @type {?} */ ('DEL');\n\n/** @const {!goog.dom.TagName<!HTMLDetailsElement>} */\ngoog.dom.TagName.DETAILS = /** @type {?} */ ('DETAILS');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.DFN = /** @type {?} */ ('DFN');\n\n/** @const {!goog.dom.TagName<!HTMLDialogElement>} */\ngoog.dom.TagName.DIALOG = /** @type {?} */ ('DIALOG');\n\n/** @const {!goog.dom.TagName<!HTMLDirectoryElement>} */\ngoog.dom.TagName.DIR = /** @type {?} */ ('DIR');\n\n/** @const {!goog.dom.TagName<!HTMLDivElement>} */\ngoog.dom.TagName.DIV = /** @type {?} */ ('DIV');\n\n/** @const {!goog.dom.TagName<!HTMLDListElement>} */\ngoog.dom.TagName.DL = /** @type {?} */ ('DL');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.DT = /** @type {?} */ ('DT');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.EM = /** @type {?} */ ('EM');\n\n/** @const {!goog.dom.TagName<!HTMLEmbedElement>} */\ngoog.dom.TagName.EMBED = /** @type {?} */ ('EMBED');\n\n/** @const {!goog.dom.TagName<!HTMLFieldSetElement>} */\ngoog.dom.TagName.FIELDSET = /** @type {?} */ ('FIELDSET');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.FIGCAPTION = /** @type {?} */ ('FIGCAPTION');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.FIGURE = /** @type {?} */ ('FIGURE');\n\n/** @const {!goog.dom.TagName<!HTMLFontElement>} */\ngoog.dom.TagName.FONT = /** @type {?} */ ('FONT');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.FOOTER = /** @type {?} */ ('FOOTER');\n\n/** @const {!goog.dom.TagName<!HTMLFormElement>} */\ngoog.dom.TagName.FORM = /** @type {?} */ ('FORM');\n\n/** @const {!goog.dom.TagName<!HTMLFrameElement>} */\ngoog.dom.TagName.FRAME = /** @type {?} */ ('FRAME');\n\n/** @const {!goog.dom.TagName<!HTMLFrameSetElement>} */\ngoog.dom.TagName.FRAMESET = /** @type {?} */ ('FRAMESET');\n\n/** @const {!goog.dom.TagName<!HTMLHeadingElement>} */\ngoog.dom.TagName.H1 = /** @type {?} */ ('H1');\n\n/** @const {!goog.dom.TagName<!HTMLHeadingElement>} */\ngoog.dom.TagName.H2 = /** @type {?} */ ('H2');\n\n/** @const {!goog.dom.TagName<!HTMLHeadingElement>} */\ngoog.dom.TagName.H3 = /** @type {?} */ ('H3');\n\n/** @const {!goog.dom.TagName<!HTMLHeadingElement>} */\ngoog.dom.TagName.H4 = /** @type {?} */ ('H4');\n\n/** @const {!goog.dom.TagName<!HTMLHeadingElement>} */\ngoog.dom.TagName.H5 = /** @type {?} */ ('H5');\n\n/** @const {!goog.dom.TagName<!HTMLHeadingElement>} */\ngoog.dom.TagName.H6 = /** @type {?} */ ('H6');\n\n/** @const {!goog.dom.TagName<!HTMLHeadElement>} */\ngoog.dom.TagName.HEAD = /** @type {?} */ ('HEAD');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.HEADER = /** @type {?} */ ('HEADER');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.HGROUP = /** @type {?} */ ('HGROUP');\n\n/** @const {!goog.dom.TagName<!HTMLHRElement>} */\ngoog.dom.TagName.HR = /** @type {?} */ ('HR');\n\n/** @const {!goog.dom.TagName<!HTMLHtmlElement>} */\ngoog.dom.TagName.HTML = /** @type {?} */ ('HTML');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.I = /** @type {?} */ ('I');\n\n/** @const {!goog.dom.TagName<!HTMLIFrameElement>} */\ngoog.dom.TagName.IFRAME = /** @type {?} */ ('IFRAME');\n\n/** @const {!goog.dom.TagName<!HTMLImageElement>} */\ngoog.dom.TagName.IMG = /** @type {?} */ ('IMG');\n\n/** @const {!goog.dom.TagName<!HTMLInputElement>} */\ngoog.dom.TagName.INPUT = /** @type {?} */ ('INPUT');\n\n/** @const {!goog.dom.TagName<!HTMLModElement>} */\ngoog.dom.TagName.INS = /** @type {?} */ ('INS');\n\n/** @const {!goog.dom.TagName<!HTMLIsIndexElement>} */\ngoog.dom.TagName.ISINDEX = /** @type {?} */ ('ISINDEX');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.KBD = /** @type {?} */ ('KBD');\n\n// HTMLKeygenElement is deprecated.\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.KEYGEN = /** @type {?} */ ('KEYGEN');\n\n/** @const {!goog.dom.TagName<!HTMLLabelElement>} */\ngoog.dom.TagName.LABEL = /** @type {?} */ ('LABEL');\n\n/** @const {!goog.dom.TagName<!HTMLLegendElement>} */\ngoog.dom.TagName.LEGEND = /** @type {?} */ ('LEGEND');\n\n/** @const {!goog.dom.TagName<!HTMLLIElement>} */\ngoog.dom.TagName.LI = /** @type {?} */ ('LI');\n\n/** @const {!goog.dom.TagName<!HTMLLinkElement>} */\ngoog.dom.TagName.LINK = /** @type {?} */ ('LINK');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.MAIN = /** @type {?} */ ('MAIN');\n\n/** @const {!goog.dom.TagName<!HTMLMapElement>} */\ngoog.dom.TagName.MAP = /** @type {?} */ ('MAP');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.MARK = /** @type {?} */ ('MARK');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.MATH = /** @type {?} */ ('MATH');\n\n/** @const {!goog.dom.TagName<!HTMLMenuElement>} */\ngoog.dom.TagName.MENU = /** @type {?} */ ('MENU');\n\n/** @const {!goog.dom.TagName<!HTMLMenuItemElement>} */\ngoog.dom.TagName.MENUITEM = /** @type {?} */ ('MENUITEM');\n\n/** @const {!goog.dom.TagName<!HTMLMetaElement>} */\ngoog.dom.TagName.META = /** @type {?} */ ('META');\n\n/** @const {!goog.dom.TagName<!HTMLMeterElement>} */\ngoog.dom.TagName.METER = /** @type {?} */ ('METER');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.NAV = /** @type {?} */ ('NAV');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.NOFRAMES = /** @type {?} */ ('NOFRAMES');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.NOSCRIPT = /** @type {?} */ ('NOSCRIPT');\n\n/** @const {!goog.dom.TagName<!HTMLObjectElement>} */\ngoog.dom.TagName.OBJECT = /** @type {?} */ ('OBJECT');\n\n/** @const {!goog.dom.TagName<!HTMLOListElement>} */\ngoog.dom.TagName.OL = /** @type {?} */ ('OL');\n\n/** @const {!goog.dom.TagName<!HTMLOptGroupElement>} */\ngoog.dom.TagName.OPTGROUP = /** @type {?} */ ('OPTGROUP');\n\n/** @const {!goog.dom.TagName<!HTMLOptionElement>} */\ngoog.dom.TagName.OPTION = /** @type {?} */ ('OPTION');\n\n/** @const {!goog.dom.TagName<!HTMLOutputElement>} */\ngoog.dom.TagName.OUTPUT = /** @type {?} */ ('OUTPUT');\n\n/** @const {!goog.dom.TagName<!HTMLParagraphElement>} */\ngoog.dom.TagName.P = /** @type {?} */ ('P');\n\n/** @const {!goog.dom.TagName<!HTMLParamElement>} */\ngoog.dom.TagName.PARAM = /** @type {?} */ ('PARAM');\n\n/** @const {!goog.dom.TagName<!HTMLPictureElement>} */\ngoog.dom.TagName.PICTURE = /** @type {?} */ ('PICTURE');\n\n/** @const {!goog.dom.TagName<!HTMLPreElement>} */\ngoog.dom.TagName.PRE = /** @type {?} */ ('PRE');\n\n/** @const {!goog.dom.TagName<!HTMLProgressElement>} */\ngoog.dom.TagName.PROGRESS = /** @type {?} */ ('PROGRESS');\n\n/** @const {!goog.dom.TagName<!HTMLQuoteElement>} */\ngoog.dom.TagName.Q = /** @type {?} */ ('Q');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.RP = /** @type {?} */ ('RP');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.RT = /** @type {?} */ ('RT');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.RTC = /** @type {?} */ ('RTC');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.RUBY = /** @type {?} */ ('RUBY');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.S = /** @type {?} */ ('S');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.SAMP = /** @type {?} */ ('SAMP');\n\n/** @const {!goog.dom.TagName<!HTMLScriptElement>} */\ngoog.dom.TagName.SCRIPT = /** @type {?} */ ('SCRIPT');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.SECTION = /** @type {?} */ ('SECTION');\n\n/** @const {!goog.dom.TagName<!HTMLSelectElement>} */\ngoog.dom.TagName.SELECT = /** @type {?} */ ('SELECT');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.SMALL = /** @type {?} */ ('SMALL');\n\n/** @const {!goog.dom.TagName<!HTMLSourceElement>} */\ngoog.dom.TagName.SOURCE = /** @type {?} */ ('SOURCE');\n\n/** @const {!goog.dom.TagName<!HTMLSpanElement>} */\ngoog.dom.TagName.SPAN = /** @type {?} */ ('SPAN');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.STRIKE = /** @type {?} */ ('STRIKE');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.STRONG = /** @type {?} */ ('STRONG');\n\n/** @const {!goog.dom.TagName<!HTMLStyleElement>} */\ngoog.dom.TagName.STYLE = /** @type {?} */ ('STYLE');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.SUB = /** @type {?} */ ('SUB');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.SUMMARY = /** @type {?} */ ('SUMMARY');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.SUP = /** @type {?} */ ('SUP');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.SVG = /** @type {?} */ ('SVG');\n\n/** @const {!goog.dom.TagName<!HTMLTableElement>} */\ngoog.dom.TagName.TABLE = /** @type {?} */ ('TABLE');\n\n/** @const {!goog.dom.TagName<!HTMLTableSectionElement>} */\ngoog.dom.TagName.TBODY = /** @type {?} */ ('TBODY');\n\n/** @const {!goog.dom.TagName<!HTMLTableCellElement>} */\ngoog.dom.TagName.TD = /** @type {?} */ ('TD');\n\n/** @const {!goog.dom.TagName<!HTMLTemplateElement>} */\ngoog.dom.TagName.TEMPLATE = /** @type {?} */ ('TEMPLATE');\n\n/** @const {!goog.dom.TagName<!HTMLTextAreaElement>} */\ngoog.dom.TagName.TEXTAREA = /** @type {?} */ ('TEXTAREA');\n\n/** @const {!goog.dom.TagName<!HTMLTableSectionElement>} */\ngoog.dom.TagName.TFOOT = /** @type {?} */ ('TFOOT');\n\n/** @const {!goog.dom.TagName<!HTMLTableCellElement>} */\ngoog.dom.TagName.TH = /** @type {?} */ ('TH');\n\n/** @const {!goog.dom.TagName<!HTMLTableSectionElement>} */\ngoog.dom.TagName.THEAD = /** @type {?} */ ('THEAD');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.TIME = /** @type {?} */ ('TIME');\n\n/** @const {!goog.dom.TagName<!HTMLTitleElement>} */\ngoog.dom.TagName.TITLE = /** @type {?} */ ('TITLE');\n\n/** @const {!goog.dom.TagName<!HTMLTableRowElement>} */\ngoog.dom.TagName.TR = /** @type {?} */ ('TR');\n\n/** @const {!goog.dom.TagName<!HTMLTrackElement>} */\ngoog.dom.TagName.TRACK = /** @type {?} */ ('TRACK');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.TT = /** @type {?} */ ('TT');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.U = /** @type {?} */ ('U');\n\n/** @const {!goog.dom.TagName<!HTMLUListElement>} */\ngoog.dom.TagName.UL = /** @type {?} */ ('UL');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.VAR = /** @type {?} */ ('VAR');\n\n/** @const {!goog.dom.TagName<!HTMLVideoElement>} */\ngoog.dom.TagName.VIDEO = /** @type {?} */ ('VIDEO');\n\n/** @const {!goog.dom.TagName<!goog.dom.HtmlElement>} */\ngoog.dom.TagName.WBR = /** @type {?} */ ('WBR');\n","/** @fileoverview Exports a null-safe `propagateAsyncContext` function. */\n\n/**\n * Null-safe and polyfill-safe wrapper to propagate the current context into the\n * given function.\n */\nexport const propagateAsyncContext: <F extends Function | null | undefined>(\n  fn: F,\n) => F =\n  typeof AsyncContext !== 'undefined' &&\n  typeof AsyncContext.Snapshot === 'function'\n    ? (fn) => fn && AsyncContext.Snapshot.wrap(fn)\n    : (fn) => fn;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Implements the disposable interface.\n */\n\ngoog.provide('goog.Disposable');\n\ngoog.require('goog.disposable.IDisposable');\ngoog.require('goog.dispose');\n/**\n * TODO(b/175587766): Remove this require.\n * @suppress {extraRequire}\n */\ngoog.require('goog.disposeAll');\n\n/**\n * Class that provides the basic implementation for disposable objects. If your\n * class holds references or resources that can't be collected by standard GC,\n * it should extend this class or implement the disposable interface (defined\n * in goog.disposable.IDisposable). See description of\n * goog.disposable.IDisposable for examples of cleanup.\n * @constructor\n * @implements {goog.disposable.IDisposable}\n */\ngoog.Disposable = function() {\n  'use strict';\n  /**\n   * If monitoring the goog.Disposable instances is enabled, stores the creation\n   * stack trace of the Disposable instance.\n   * @type {string|undefined}\n   */\n  this.creationStack;\n\n  if (goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF) {\n    if (goog.Disposable.INCLUDE_STACK_ON_CREATION) {\n      this.creationStack = new Error().stack;\n    }\n    goog.Disposable.instances_[goog.getUid(this)] = this;\n  }\n  // Support sealing\n  this.disposed_ = this.disposed_;\n  this.onDisposeCallbacks_ = this.onDisposeCallbacks_;\n};\n\n\n/**\n * @enum {number} Different monitoring modes for Disposable.\n */\ngoog.Disposable.MonitoringMode = {\n  /**\n   * No monitoring.\n   */\n  OFF: 0,\n  /**\n   * Creating and disposing the goog.Disposable instances is monitored. All\n   * disposable objects need to call the `goog.Disposable` base\n   * constructor. The PERMANENT mode must be switched on before creating any\n   * goog.Disposable instances.\n   */\n  PERMANENT: 1,\n  /**\n   * INTERACTIVE mode can be switched on and off on the fly without producing\n   * errors. It also doesn't warn if the disposable objects don't call the\n   * `goog.Disposable` base constructor.\n   */\n  INTERACTIVE: 2\n};\n\n\n/**\n * @define {number} The monitoring mode of the goog.Disposable\n *     instances. Default is OFF. Switching on the monitoring is only\n *     recommended for debugging because it has a significant impact on\n *     performance and memory usage. If switched off, the monitoring code\n *     compiles down to 0 bytes.\n */\ngoog.Disposable.MONITORING_MODE =\n    goog.define('goog.Disposable.MONITORING_MODE', 0);\n\n\n/**\n * @define {boolean} Whether to attach creation stack to each created disposable\n *     instance; This is only relevant for when MonitoringMode != OFF.\n */\ngoog.Disposable.INCLUDE_STACK_ON_CREATION =\n    goog.define('goog.Disposable.INCLUDE_STACK_ON_CREATION', true);\n\n\n/**\n * Maps the unique ID of every undisposed `goog.Disposable` object to\n * the object itself.\n * @type {!Object<number, !goog.Disposable>}\n * @private\n */\ngoog.Disposable.instances_ = {};\n\n\n/**\n * @return {!Array<!goog.Disposable>} All `goog.Disposable` objects that\n *     haven't been disposed of.\n */\ngoog.Disposable.getUndisposedObjects = function() {\n  'use strict';\n  const ret = [];\n  for (const id in goog.Disposable.instances_) {\n    if (goog.Disposable.instances_.hasOwnProperty(id)) {\n      ret.push(goog.Disposable.instances_[Number(id)]);\n    }\n  }\n  return ret;\n};\n\n\n/**\n * Clears the registry of undisposed objects but doesn't dispose of them.\n */\ngoog.Disposable.clearUndisposedObjects = function() {\n  'use strict';\n  goog.Disposable.instances_ = {};\n};\n\n\n/**\n * Whether the object has been disposed of.\n * @type {boolean}\n * @private\n */\ngoog.Disposable.prototype.disposed_ = false;\n\n\n/**\n * Callbacks to invoke when this object is disposed.\n * @type {Array<!Function>}\n * @private\n */\ngoog.Disposable.prototype.onDisposeCallbacks_;\n\n\n/**\n * @return {boolean} Whether the object has been disposed of.\n * @override\n */\ngoog.Disposable.prototype.isDisposed = function() {\n  'use strict';\n  return this.disposed_;\n};\n\n\n/**\n * @return {boolean} Whether the object has been disposed of.\n * @deprecated Use {@link #isDisposed} instead.\n */\ngoog.Disposable.prototype.getDisposed = goog.Disposable.prototype.isDisposed;\n\n\n/**\n * Disposes of the object. If the object hasn't already been disposed of, calls\n * {@link #disposeInternal}. Classes that extend `goog.Disposable` should\n * override {@link #disposeInternal} in order to cleanup references, resources\n * and other disposable objects. Reentrant.\n *\n * @return {void} Nothing.\n * @override\n */\ngoog.Disposable.prototype.dispose = function() {\n  'use strict';\n  if (!this.disposed_) {\n    // Set disposed_ to true first, in case during the chain of disposal this\n    // gets disposed recursively.\n    this.disposed_ = true;\n    this.disposeInternal();\n    if (goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF) {\n      const uid = goog.getUid(this);\n      if (goog.Disposable.MONITORING_MODE ==\n              goog.Disposable.MonitoringMode.PERMANENT &&\n          !goog.Disposable.instances_.hasOwnProperty(uid)) {\n        throw new Error(\n            this + ' did not call the goog.Disposable base ' +\n            'constructor or was disposed of after a clearUndisposedObjects ' +\n            'call');\n      }\n      if (goog.Disposable.MONITORING_MODE !=\n              goog.Disposable.MonitoringMode.OFF &&\n          this.onDisposeCallbacks_ && this.onDisposeCallbacks_.length > 0) {\n        throw new Error(\n            this + ' did not empty its onDisposeCallbacks queue. This ' +\n            'probably means it overrode dispose() or disposeInternal() ' +\n            'without calling the superclass\\' method.');\n      }\n      delete goog.Disposable.instances_[uid];\n    }\n  }\n};\n\n/**\n * The same as calling {@link #dispose}.\n *\n * This makes a goog.Disposable object a standard disposable object, in the\n * sense of the Explicit Resource Management spec. Details at\n * {@link https://github.com/tc39/proposal-explicit-resource-management}.\n *\n * @return {void} Nothing.\n */\ngoog.Disposable.prototype[Symbol.dispose] = function() {\n  'use strict';\n  // By implementing it this way rather than assigning this.dispose to\n  // Symbol.dispose, we support cases where subclasses have overridden\n  // dispose.\n  this.dispose();\n};\n\n\n/**\n * Associates a disposable object with this object so that they will be disposed\n * together.\n * @param {goog.disposable.IDisposable} disposable that will be disposed when\n *     this object is disposed.\n */\ngoog.Disposable.prototype.registerDisposable = function(disposable) {\n  'use strict';\n  this.addOnDisposeCallback(goog.partial(goog.dispose, disposable));\n};\n\n\n/**\n * Invokes a callback function when this object is disposed. Callbacks are\n * invoked in the order in which they were added. If a callback is added to\n * an already disposed Disposable, it will be called immediately.\n * @param {function(this:T):?} callback The callback function.\n * @param {T=} opt_scope An optional scope to call the callback in.\n * @template T\n */\ngoog.Disposable.prototype.addOnDisposeCallback = function(callback, opt_scope) {\n  'use strict';\n  if (this.disposed_) {\n    opt_scope !== undefined ? callback.call(opt_scope) : callback();\n    return;\n  }\n\n  if (!this.onDisposeCallbacks_) {\n    this.onDisposeCallbacks_ = [];\n  }\n\n  if (opt_scope) {\n    callback = (goog.TRUSTED_SITE) ? callback.bind(opt_scope) :\n                                     goog.bind(callback, opt_scope);\n  }\n\n  this.onDisposeCallbacks_.push(callback);\n};\n\n\n/**\n * Performs appropriate cleanup. See description of goog.disposable.IDisposable\n * for examples. Classes that extend `goog.Disposable` should override this\n * method. Not reentrant. To avoid calling it twice, it must only be called from\n * the subclass' `disposeInternal` method. Everywhere else the public `dispose`\n * method must be used. For example:\n *\n * <pre>\n * mypackage.MyClass = function() {\n * mypackage.MyClass.base(this, 'constructor');\n *     // Constructor logic specific to MyClass.\n *     ...\n *   };\n *   goog.inherits(mypackage.MyClass, goog.Disposable);\n *\n *   mypackage.MyClass.prototype.disposeInternal = function() {\n *     // Dispose logic specific to MyClass.\n *     ...\n *     // Call superclass's disposeInternal at the end of the subclass's, like\n *     // in C++, to avoid hard-to-catch issues.\n *     mypackage.MyClass.base(this, 'disposeInternal');\n *   };\n * </pre>\n *\n * @protected\n */\ngoog.Disposable.prototype.disposeInternal = function() {\n  'use strict';\n  if (this.onDisposeCallbacks_) {\n    while (this.onDisposeCallbacks_.length) {\n      this.onDisposeCallbacks_.shift()();\n    }\n  }\n};\n\n\n/**\n * Returns True if we can verify the object is disposed.\n * Calls `isDisposed` on the argument if it supports it.  If obj\n * is not an object with an isDisposed() method, return false.\n * @param {*} obj The object to investigate.\n * @return {boolean} True if we can verify the object is disposed.\n */\ngoog.Disposable.isDisposed = function(obj) {\n  'use strict';\n  if (obj && typeof obj.isDisposed == 'function') {\n    return obj.isDisposed();\n  }\n  return false;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A base class for event objects.\n */\n\n\ngoog.provide('goog.events.Event');\n\n/**\n * goog.events.Event no longer depends on goog.Disposable. Keep requiring\n * goog.Disposable here to not break projects which assume this dependency.\n * @suppress {extraRequire}\n */\ngoog.require('goog.Disposable');\ngoog.require('goog.events.EventId');\n\n\n/**\n * A base class for event objects, so that they can support preventDefault and\n * stopPropagation.\n *\n * @param {string|!goog.events.EventId} type Event Type.\n * @param {Object=} opt_target Reference to the object that is the target of\n *     this event. It has to implement the `EventTarget` interface\n *     declared at {@link http://developer.mozilla.org/en/DOM/EventTarget}.\n * @constructor\n */\ngoog.events.Event = function(type, opt_target) {\n  'use strict';\n  /**\n   * Event type.\n   * @type {string}\n   */\n  this.type = type instanceof goog.events.EventId ? String(type) : type;\n\n  /**\n   * TODO(tbreisacher): The type should probably be\n   * EventTarget|goog.events.EventTarget.\n   *\n   * Target of the event.\n   * @type {Object|undefined}\n   */\n  this.target = opt_target;\n\n  /**\n   * Object that had the listener attached.\n   * @type {Object|undefined}\n   */\n  this.currentTarget = this.target;\n\n  /**\n   * Whether to cancel the event in internal capture/bubble processing for IE.\n   * @type {boolean}\n   * @private\n   */\n  this.propagationStopped_ = false;\n\n  /**\n   * Whether the default action has been prevented.\n   * This is a property to match the W3C specification at\n   * {@link http://www.w3.org/TR/DOM-Level-3-Events/\n   * #events-event-type-defaultPrevented}.\n   * Must be treated as read-only outside the class.\n   * @type {boolean}\n   */\n  this.defaultPrevented = false;\n};\n\n/**\n * @return {boolean} true iff internal propagation has been stopped.\n */\ngoog.events.Event.prototype.hasPropagationStopped = function() {\n  'use strict';\n  return this.propagationStopped_;\n};\n\n/**\n * Stops event propagation.\n * @return {void}\n */\ngoog.events.Event.prototype.stopPropagation = function() {\n  'use strict';\n  this.propagationStopped_ = true;\n};\n\n\n/**\n * Prevents the default action, for example a link redirecting to a url.\n * @return {void}\n */\ngoog.events.Event.prototype.preventDefault = function() {\n  'use strict';\n  this.defaultPrevented = true;\n};\n\n\n/**\n * Stops the propagation of the event. It is equivalent to\n * `e.stopPropagation()`, but can be used as the callback argument of\n * {@link goog.events.listen} without declaring another function.\n * @param {!goog.events.Event} e An event.\n * @return {void}\n */\ngoog.events.Event.stopPropagation = function(e) {\n  'use strict';\n  e.stopPropagation();\n};\n\n\n/**\n * Prevents the default action. It is equivalent to\n * `e.preventDefault()`, but can be used as the callback argument of\n * {@link goog.events.listen} without declaring another function.\n * @param {!goog.events.Event} e An event.\n * @return {void}\n */\ngoog.events.Event.preventDefault = function(e) {\n  'use strict';\n  e.preventDefault();\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Browser capability checks for the events package.\n */\n\ngoog.module('goog.events.BrowserFeature');\ngoog.module.declareLegacyNamespace();\n\n\n/**\n * Tricks Closure Compiler into believing that a function is pure.  The compiler\n * assumes that any `valueOf` function is pure, without analyzing its contents.\n *\n * @param {function(): T} fn\n * @return {T}\n * @template T\n */\nconst purify = (fn) => {\n  return ({valueOf: fn}).valueOf();\n};\n\n\n/**\n * Enum of browser capabilities.\n * @enum {boolean}\n */\nexports = {\n  /**\n   * Whether touch is enabled in the browser.\n   */\n  TOUCH_ENABLED:\n      !!((goog.global.navigator && goog.global.navigator.maxTouchPoints) ||\n         (goog.FEATURESET_YEAR < 2018 &&\n          ('ontouchstart' in goog.global ||\n           (goog.global.document && document.documentElement &&\n            'ontouchstart' in document.documentElement) ||\n           // IE10 uses non-standard touch events, so it has a different check.\n           (goog.global.navigator && goog.global.navigator.msMaxTouchPoints)))),\n\n  /**\n   * Whether addEventListener supports W3C standard pointer events.\n   * http://www.w3.org/TR/pointerevents/\n   */\n  POINTER_EVENTS:\n      (goog.FEATURESET_YEAR >= 2019) || ('PointerEvent' in goog.global),\n\n  /**\n   * Whether addEventListener supports {passive: true}.\n   * https://developers.google.com/web/updates/2016/06/passive-event-listeners\n   */\n  PASSIVE_EVENTS:\n      (goog.FEATURESET_YEAR > 2018) || purify(function() {\n        // If we're in a web worker or other custom environment, we can't tell.\n        if (!goog.global.addEventListener || !Object.defineProperty) {  // IE 8\n          return false;\n        }\n\n        var passive = false;\n        var options = Object.defineProperty({}, 'passive', {\n          get: function() {\n            passive = true;\n          }\n        });\n        try {\n          const nullFunction = () => {};\n          goog.global.addEventListener('test', nullFunction, options);\n          goog.global.removeEventListener('test', nullFunction, options);\n        } catch (e) {\n        }\n\n        return passive;\n      })\n};\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A patched, standardized event object for browser events.\n *\n * <pre>\n * The patched event object contains the following members:\n * - type           {string}    Event type, e.g. 'click'\n * - target         {Object}    The element that actually triggered the event\n * - currentTarget  {Object}    The element the listener is attached to\n * - relatedTarget  {Object}    For mouseover and mouseout, the previous object\n * - offsetX        {number}    X-coordinate relative to target\n * - offsetY        {number}    Y-coordinate relative to target\n * - clientX        {number}    X-coordinate relative to viewport\n * - clientY        {number}    Y-coordinate relative to viewport\n * - screenX        {number}    X-coordinate relative to the edge of the screen\n * - screenY        {number}    Y-coordinate relative to the edge of the screen\n * - button         {number}    Mouse button. Use isButton() to test.\n * - keyCode        {number}    Key-code\n * - ctrlKey        {boolean}   Was ctrl key depressed\n * - altKey         {boolean}   Was alt key depressed\n * - shiftKey       {boolean}   Was shift key depressed\n * - metaKey        {boolean}   Was meta key depressed\n * - pointerId      {number}    Pointer ID\n * - pointerType    {string}    Pointer type, e.g. 'mouse', 'pen', or 'touch'\n * - defaultPrevented {boolean} Whether the default action has been prevented\n * - state          {Object}    History state object\n * - timeStamp      {number}    Number of milliseconds since the window's time\n *                              origin\n *\n * NOTE: The keyCode member contains the raw browser keyCode. For normalized\n * key and character code use {@link goog.events.KeyHandler}.\n * </pre>\n */\n\ngoog.provide('goog.events.BrowserEvent');\n\ngoog.require('goog.events.Event');\ngoog.require('goog.events.EventType');\ngoog.require('goog.userAgent');\n\n/**\n * Accepts a browser event object and creates a patched, cross browser event\n * object.\n * The content of this object will not be initialized if no event object is\n * provided. If this is the case, init() needs to be invoked separately.\n * @param {Event=} opt_e Browser event object.\n * @param {EventTarget=} opt_currentTarget Current target for event.\n * @constructor\n * @extends {goog.events.Event}\n */\ngoog.events.BrowserEvent = function(opt_e, opt_currentTarget) {\n  'use strict';\n  goog.events.BrowserEvent.base(this, 'constructor', opt_e ? opt_e.type : '');\n\n  /**\n   * Target that fired the event.\n   * @override\n   * @type {?Node}\n   */\n  this.target = null;\n\n  /**\n   * Node that had the listener attached.\n   * @override\n   * @type {?Node|undefined}\n   */\n  this.currentTarget = null;\n\n  /**\n   * For mouseover and mouseout events, the related object for the event.\n   * @type {?Node}\n   */\n  this.relatedTarget = null;\n\n  /**\n   * X-coordinate relative to target.\n   * @type {number}\n   */\n  this.offsetX = 0;\n\n  /**\n   * Y-coordinate relative to target.\n   * @type {number}\n   */\n  this.offsetY = 0;\n\n  /**\n   * X-coordinate relative to the window.\n   * @type {number}\n   */\n  this.clientX = 0;\n\n  /**\n   * Y-coordinate relative to the window.\n   * @type {number}\n   */\n  this.clientY = 0;\n\n  /**\n   * X-coordinate relative to the monitor.\n   * @type {number}\n   */\n  this.screenX = 0;\n\n  /**\n   * Y-coordinate relative to the monitor.\n   * @type {number}\n   */\n  this.screenY = 0;\n\n  /**\n   * Which mouse button was pressed.\n   * @type {number}\n   */\n  this.button = 0;\n\n  /**\n   * Key of key press.\n   * @type {string}\n   */\n  this.key = '';\n\n  /**\n   * Keycode of key press.\n   * @type {number}\n   */\n  this.keyCode = 0;\n\n  /**\n   * Keycode of key press.\n   * @type {number}\n   */\n  this.charCode = 0;\n\n  /**\n   * Whether control was pressed at time of event.\n   * @type {boolean}\n   */\n  this.ctrlKey = false;\n\n  /**\n   * Whether alt was pressed at time of event.\n   * @type {boolean}\n   */\n  this.altKey = false;\n\n  /**\n   * Whether shift was pressed at time of event.\n   * @type {boolean}\n   */\n  this.shiftKey = false;\n\n  /**\n   * Whether the meta key was pressed at time of event.\n   * @type {boolean}\n   */\n  this.metaKey = false;\n\n  /**\n   * History state object, only set for PopState events where it's a copy of the\n   * state object provided to pushState or replaceState.\n   * @type {?Object}\n   */\n  this.state = null;\n\n  /**\n   * Whether the default platform modifier key was pressed at time of event.\n   * (This is control for all platforms except Mac, where it's Meta.)\n   * @type {boolean}\n   */\n  this.platformModifierKey = false;\n\n  /**\n   * @type {number}\n   */\n  this.pointerId = 0;\n\n  /**\n   * @type {string}\n   */\n  this.pointerType = '';\n\n  /**\n   * @type {number}\n   */\n  this.timeStamp = 0;\n\n  /**\n   * The browser event object.\n   * @private {?Event}\n   */\n  this.event_ = null;\n\n  if (opt_e) {\n    this.init(opt_e, opt_currentTarget);\n  }\n};\ngoog.inherits(goog.events.BrowserEvent, goog.events.Event);\n\n/**\n * @define {boolean} If true, use the layerX and layerY properties of a native\n * browser event over the offsetX and offsetY properties, which cause expensive\n * reflow. If layerX or layerY is not defined, offsetX and offsetY will be used\n * as usual.\n */\ngoog.events.BrowserEvent.USE_LAYER_XY_AS_OFFSET_XY =\n    goog.define('goog.events.BrowserEvent.USE_LAYER_XY_AS_OFFSET_XY', false);\n\n\n/**\n * Normalized button constants for the mouse.\n * @enum {number}\n */\ngoog.events.BrowserEvent.MouseButton = {\n  LEFT: 0,\n  MIDDLE: 1,\n  RIGHT: 2,\n  BACK: 3,\n  FORWARD: 4,\n};\n\n\n/**\n * Normalized pointer type constants for pointer events.\n * @enum {string}\n */\ngoog.events.BrowserEvent.PointerType = {\n  MOUSE: 'mouse',\n  PEN: 'pen',\n  TOUCH: 'touch'\n};\n\n\n/**\n * Accepts a browser event object and creates a patched, cross browser event\n * object.\n * @param {Event} e Browser event object.\n * @param {EventTarget=} opt_currentTarget Current target for event.\n */\ngoog.events.BrowserEvent.prototype.init = function(e, opt_currentTarget) {\n  'use strict';\n  const type = this.type = e.type;\n\n  /**\n   * On touch devices use the first \"changed touch\" as the relevant touch.\n   * @type {?Touch}\n   * @suppress {strictMissingProperties} Added to tighten compiler checks\n   */\n  const relevantTouch =\n      e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : null;\n\n  // TODO(nicksantos): Change this.target to type EventTarget.\n  this.target = /** @type {Node} */ (e.target) || e.srcElement;\n\n  // TODO(nicksantos): Change this.currentTarget to type EventTarget.\n  this.currentTarget = /** @type {Node} */ (opt_currentTarget);\n\n  let relatedTarget = /** @type {Node} */ (e.relatedTarget);\n  if (!relatedTarget) {\n    if (type == goog.events.EventType.MOUSEOVER) {\n      relatedTarget = e.fromElement;\n    } else if (type == goog.events.EventType.MOUSEOUT) {\n      relatedTarget = e.toElement;\n    }\n  }\n\n  this.relatedTarget = relatedTarget;\n\n  if (relevantTouch) {\n    this.clientX = relevantTouch.clientX !== undefined ? relevantTouch.clientX :\n                                                         relevantTouch.pageX;\n    this.clientY = relevantTouch.clientY !== undefined ? relevantTouch.clientY :\n                                                         relevantTouch.pageY;\n    this.screenX = relevantTouch.screenX || 0;\n    this.screenY = relevantTouch.screenY || 0;\n  } else {\n    if (goog.events.BrowserEvent.USE_LAYER_XY_AS_OFFSET_XY) {\n      this.offsetX = (e.layerX !== undefined) ? e.layerX : e.offsetX;\n      this.offsetY = (e.layerY !== undefined) ? e.layerY : e.offsetY;\n    } else {\n      // Webkit emits a lame warning whenever layerX/layerY is accessed.\n      // http://code.google.com/p/chromium/issues/detail?id=101733\n      this.offsetX = (goog.userAgent.WEBKIT || e.offsetX !== undefined) ?\n          e.offsetX :\n          e.layerX;\n      this.offsetY = (goog.userAgent.WEBKIT || e.offsetY !== undefined) ?\n          e.offsetY :\n          e.layerY;\n    }\n    this.clientX = e.clientX !== undefined ? e.clientX : e.pageX;\n    this.clientY = e.clientY !== undefined ? e.clientY : e.pageY;\n    this.screenX = e.screenX || 0;\n    this.screenY = e.screenY || 0;\n  }\n\n  this.button = e.button;\n\n  this.keyCode = e.keyCode || 0;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  this.key = e.key || '';\n  this.charCode = e.charCode || (type == 'keypress' ? e.keyCode : 0);\n  this.ctrlKey = e.ctrlKey;\n  this.altKey = e.altKey;\n  this.shiftKey = e.shiftKey;\n  this.metaKey = e.metaKey;\n  this.platformModifierKey = goog.userAgent.MAC ? e.metaKey : e.ctrlKey;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  this.pointerId = e.pointerId || 0;\n  this.pointerType = goog.events.BrowserEvent.getPointerType_(e);\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  this.state = e.state;\n  this.timeStamp = e.timeStamp;\n  this.event_ = e;\n  if (e.defaultPrevented) {\n    // Sync native event state to internal state via super class, where default\n    // prevention is implemented and managed.\n    goog.events.BrowserEvent.superClass_.preventDefault.call(this);\n  }\n};\n\n\n/**\n * Tests to see which button was pressed during the event. This is really only\n * useful in IE and Gecko browsers. And in IE, it's only useful for\n * mousedown/mouseup events, because click only fires for the left mouse button.\n *\n * Safari 2 only reports the left button being clicked, and uses the value '1'\n * instead of 0. Opera only reports a mousedown event for the middle button, and\n * no mouse events for the right button. Opera has default behavior for left and\n * middle click that can only be overridden via a configuration setting.\n *\n * There's a nice table of this mess at http://www.unixpapa.com/js/mouse.html.\n *\n * @param {goog.events.BrowserEvent.MouseButton} button The button\n *     to test for.\n * @return {boolean} True if button was pressed.\n */\ngoog.events.BrowserEvent.prototype.isButton = function(button) {\n  'use strict';\n  return this.event_.button == button;\n};\n\n\n/**\n * Whether this has an \"action\"-producing mouse button.\n *\n * By definition, this includes left-click on windows/linux, and left-click\n * without the ctrl key on Macs.\n *\n * @return {boolean} The result.\n */\ngoog.events.BrowserEvent.prototype.isMouseActionButton = function() {\n  'use strict';\n  // Ctrl+click should never behave like a left-click on mac, regardless of\n  // whether or not the browser will actually ever emit such an event.  If\n  // we see it, treat it like right-click always.\n  return this.isButton(goog.events.BrowserEvent.MouseButton.LEFT) &&\n      !(goog.userAgent.MAC && this.ctrlKey);\n};\n\n\n/**\n * @override\n */\ngoog.events.BrowserEvent.prototype.stopPropagation = function() {\n  'use strict';\n  goog.events.BrowserEvent.superClass_.stopPropagation.call(this);\n  if (this.event_.stopPropagation) {\n    this.event_.stopPropagation();\n  } else {\n    this.event_.cancelBubble = true;\n  }\n};\n\n\n/**\n * @override\n */\ngoog.events.BrowserEvent.prototype.preventDefault = function() {\n  'use strict';\n  goog.events.BrowserEvent.superClass_.preventDefault.call(this);\n  const be = this.event_;\n  if (!be.preventDefault) {\n    be.returnValue = false;\n  } else {\n    be.preventDefault();\n  }\n};\n\n\n/**\n * @return {Event} The underlying browser event object.\n */\ngoog.events.BrowserEvent.prototype.getBrowserEvent = function() {\n  'use strict';\n  return this.event_;\n};\n\n\n/**\n * Extracts the pointer type from the given event.\n * @param {!Event} e\n * @return {string} The pointer type, e.g. 'mouse', 'pen', or 'touch'.\n * @private\n * @suppress {strictMissingProperties} \"pointerType\" on Event\n */\ngoog.events.BrowserEvent.getPointerType_ = function(e) {\n  'use strict';\n  return e.pointerType;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.provide('goog.events.EventType');\n\ngoog.require('goog.events.eventTypeHelpers');\n\n\n/**\n * Constants for event names.\n * @enum {string}\n */\ngoog.events.EventType = {\n  // Mouse events\n  CLICK: 'click',\n  RIGHTCLICK: 'rightclick',\n  DBLCLICK: 'dblclick',\n  AUXCLICK: 'auxclick',\n  MOUSEDOWN: 'mousedown',\n  MOUSEUP: 'mouseup',\n  MOUSEOVER: 'mouseover',\n  MOUSEOUT: 'mouseout',\n  MOUSEMOVE: 'mousemove',\n  MOUSEENTER: 'mouseenter',\n  MOUSELEAVE: 'mouseleave',\n\n  // Non-existent event; will never fire. This exists as a mouse counterpart to\n  // POINTERCANCEL.\n  MOUSECANCEL: 'mousecancel',\n\n  // Selection events.\n  // https://www.w3.org/TR/selection-api/\n  SELECTIONCHANGE: 'selectionchange',\n  SELECTSTART: 'selectstart',  // IE, Safari, Chrome\n\n  // Wheel events\n  // http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents\n  WHEEL: 'wheel',\n\n  // Key events\n  KEYPRESS: 'keypress',\n  KEYDOWN: 'keydown',\n  KEYUP: 'keyup',\n\n  // Focus\n  BLUR: 'blur',\n  FOCUS: 'focus',\n  DEACTIVATE: 'deactivate',  // IE only\n  FOCUSIN: 'focusin',\n  FOCUSOUT: 'focusout',\n\n  // Forms\n  CHANGE: 'change',\n  RESET: 'reset',\n  SELECT: 'select',\n  SUBMIT: 'submit',\n  INPUT: 'input',\n  PROPERTYCHANGE: 'propertychange',  // IE only\n\n  // Drag and drop\n  DRAGSTART: 'dragstart',\n  DRAG: 'drag',\n  DRAGENTER: 'dragenter',\n  DRAGOVER: 'dragover',\n  DRAGLEAVE: 'dragleave',\n  DROP: 'drop',\n  DRAGEND: 'dragend',\n\n  // Touch events\n  // Note that other touch events exist, but we should follow the W3C list here.\n  // http://www.w3.org/TR/touch-events/#list-of-touchevent-types\n  TOUCHSTART: 'touchstart',\n  TOUCHMOVE: 'touchmove',\n  TOUCHEND: 'touchend',\n  TOUCHCANCEL: 'touchcancel',\n\n  // Misc\n  BEFOREUNLOAD: 'beforeunload',\n  CONSOLEMESSAGE: 'consolemessage',\n  CONTEXTMENU: 'contextmenu',\n  DEVICECHANGE: 'devicechange',\n  DEVICEMOTION: 'devicemotion',\n  DEVICEORIENTATION: 'deviceorientation',\n  DOMCONTENTLOADED: 'DOMContentLoaded',\n  ERROR: 'error',\n  HELP: 'help',\n  LOAD: 'load',\n  LOSECAPTURE: 'losecapture',\n  ORIENTATIONCHANGE: 'orientationchange',\n  READYSTATECHANGE: 'readystatechange',\n  RESIZE: 'resize',\n  SCROLL: 'scroll',\n  UNLOAD: 'unload',\n\n  // Media events\n  CANPLAY: 'canplay',\n  CANPLAYTHROUGH: 'canplaythrough',\n  DURATIONCHANGE: 'durationchange',\n  EMPTIED: 'emptied',\n  ENDED: 'ended',\n  LOADEDDATA: 'loadeddata',\n  LOADEDMETADATA: 'loadedmetadata',\n  PAUSE: 'pause',\n  PLAY: 'play',\n  PLAYING: 'playing',\n  PROGRESS: 'progress',\n  RATECHANGE: 'ratechange',\n  SEEKED: 'seeked',\n  SEEKING: 'seeking',\n  STALLED: 'stalled',\n  SUSPEND: 'suspend',\n  TIMEUPDATE: 'timeupdate',\n  VOLUMECHANGE: 'volumechange',\n  WAITING: 'waiting',\n\n  // Media Source Extensions events\n  // https://www.w3.org/TR/media-source/#mediasource-events\n  SOURCEOPEN: 'sourceopen',\n  SOURCEENDED: 'sourceended',\n  SOURCECLOSED: 'sourceclosed',\n  // https://www.w3.org/TR/media-source/#sourcebuffer-events\n  ABORT: 'abort',\n  UPDATE: 'update',\n  UPDATESTART: 'updatestart',\n  UPDATEEND: 'updateend',\n\n  // HTML 5 History events\n  // See http://www.w3.org/TR/html5/browsers.html#event-definitions-0\n  HASHCHANGE: 'hashchange',\n  PAGEHIDE: 'pagehide',\n  PAGESHOW: 'pageshow',\n  POPSTATE: 'popstate',\n\n  // Copy and Paste\n  // Support is limited. Make sure it works on your favorite browser\n  // before using.\n  // http://www.quirksmode.org/dom/events/cutcopypaste.html\n  COPY: 'copy',\n  PASTE: 'paste',\n  CUT: 'cut',\n  BEFORECOPY: 'beforecopy',\n  BEFORECUT: 'beforecut',\n  BEFOREPASTE: 'beforepaste',\n\n  // HTML5 online/offline events.\n  // http://www.w3.org/TR/offline-webapps/#related\n  ONLINE: 'online',\n  OFFLINE: 'offline',\n\n  // HTML 5 worker events\n  MESSAGE: 'message',\n  CONNECT: 'connect',\n\n  // Service Worker Events - ServiceWorkerGlobalScope context\n  // See https://w3c.github.io/ServiceWorker/#execution-context-events\n  // Note: message event defined in worker events section\n  INSTALL: 'install',\n  ACTIVATE: 'activate',\n  FETCH: 'fetch',\n  FOREIGNFETCH: 'foreignfetch',\n  MESSAGEERROR: 'messageerror',\n\n  // Service Worker Events - Document context\n  // See https://w3c.github.io/ServiceWorker/#document-context-events\n  STATECHANGE: 'statechange',\n  UPDATEFOUND: 'updatefound',\n  CONTROLLERCHANGE: 'controllerchange',\n\n  // CSS animation events.\n  ANIMATIONSTART:\n      goog.events.eventTypeHelpers.getVendorPrefixedName('AnimationStart'),\n  ANIMATIONEND:\n      goog.events.eventTypeHelpers.getVendorPrefixedName('AnimationEnd'),\n  ANIMATIONITERATION:\n      goog.events.eventTypeHelpers.getVendorPrefixedName('AnimationIteration'),\n\n  // CSS transition events. Based on the browser support described at:\n  // https://developer.mozilla.org/en/css/css_transitions#Browser_compatibility\n  TRANSITIONEND:\n      goog.events.eventTypeHelpers.getVendorPrefixedName('TransitionEnd'),\n\n  // W3C Pointer Events\n  // http://www.w3.org/TR/pointerevents/\n  POINTERDOWN: 'pointerdown',\n  POINTERUP: 'pointerup',\n  POINTERCANCEL: 'pointercancel',\n  POINTERMOVE: 'pointermove',\n  POINTEROVER: 'pointerover',\n  POINTEROUT: 'pointerout',\n  POINTERENTER: 'pointerenter',\n  POINTERLEAVE: 'pointerleave',\n  GOTPOINTERCAPTURE: 'gotpointercapture',\n  LOSTPOINTERCAPTURE: 'lostpointercapture',\n\n  // IE specific events.\n  // See http://msdn.microsoft.com/en-us/library/ie/hh772103(v=vs.85).aspx\n  // Note: these events will be supplanted in IE11.\n  MSGESTURECHANGE: 'MSGestureChange',\n  MSGESTUREEND: 'MSGestureEnd',\n  MSGESTUREHOLD: 'MSGestureHold',\n  MSGESTURESTART: 'MSGestureStart',\n  MSGESTURETAP: 'MSGestureTap',\n  MSGOTPOINTERCAPTURE: 'MSGotPointerCapture',\n  MSINERTIASTART: 'MSInertiaStart',\n  MSLOSTPOINTERCAPTURE: 'MSLostPointerCapture',\n  MSPOINTERCANCEL: 'MSPointerCancel',\n  MSPOINTERDOWN: 'MSPointerDown',\n  MSPOINTERENTER: 'MSPointerEnter',\n  MSPOINTERHOVER: 'MSPointerHover',\n  MSPOINTERLEAVE: 'MSPointerLeave',\n  MSPOINTERMOVE: 'MSPointerMove',\n  MSPOINTEROUT: 'MSPointerOut',\n  MSPOINTEROVER: 'MSPointerOver',\n  MSPOINTERUP: 'MSPointerUp',\n\n  // Native IMEs/input tools events.\n  TEXT: 'text',\n  TEXTINPUT: 'textInput',\n  COMPOSITIONSTART: 'compositionstart',\n  COMPOSITIONUPDATE: 'compositionupdate',\n  COMPOSITIONEND: 'compositionend',\n\n  // The beforeinput event is initially only supported in Safari. See\n  // https://bugs.chromium.org/p/chromium/issues/detail?id=342670 for Chrome\n  // implementation tracking.\n  BEFOREINPUT: 'beforeinput',\n\n  // Fullscreen API events. See https://fullscreen.spec.whatwg.org/.\n  FULLSCREENCHANGE: 'fullscreenchange',\n  // iOS-only fullscreen events. See\n  // https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/ControllingMediaWithJavaScript/ControllingMediaWithJavaScript.html\n  WEBKITBEGINFULLSCREEN: 'webkitbeginfullscreen',\n  WEBKITENDFULLSCREEN: 'webkitendfullscreen',\n\n  // Webview tag events\n  // See https://developer.chrome.com/apps/tags/webview\n  EXIT: 'exit',\n  LOADABORT: 'loadabort',\n  LOADCOMMIT: 'loadcommit',\n  LOADREDIRECT: 'loadredirect',\n  LOADSTART: 'loadstart',\n  LOADSTOP: 'loadstop',\n  RESPONSIVE: 'responsive',\n  SIZECHANGED: 'sizechanged',\n  UNRESPONSIVE: 'unresponsive',\n\n  // HTML5 Page Visibility API.  See details at\n  // `goog.labs.dom.PageVisibilityMonitor`.\n  VISIBILITYCHANGE: 'visibilitychange',\n\n  // LocalStorage event.\n  STORAGE: 'storage',\n\n  // Print events.\n  BEFOREPRINT: 'beforeprint',\n  AFTERPRINT: 'afterprint',\n\n  // Web app manifest events.\n  BEFOREINSTALLPROMPT: 'beforeinstallprompt',\n  APPINSTALLED: 'appinstalled',\n\n  // Web Animation API (WAAPI) playback events\n  // https://www.w3.org/TR/web-animations-1/#animation-playback-event-types\n  CANCEL: 'cancel',\n  FINISH: 'finish',\n  REMOVE: 'remove'\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview An interface for a listenable JavaScript object.\n */\n\ngoog.provide('goog.events.Listenable');\n\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventLike');\ngoog.requireType('goog.events.ListenableKey');\n\n\n/**\n * A listenable interface. A listenable is an object with the ability\n * to dispatch/broadcast events to \"event listeners\" registered via\n * listen/listenOnce.\n *\n * The interface allows for an event propagation mechanism similar\n * to one offered by native browser event targets, such as\n * capture/bubble mechanism, stopping propagation, and preventing\n * default actions. Capture/bubble mechanism depends on the ancestor\n * tree constructed via `#getParentEventTarget`; this tree\n * must be directed acyclic graph. The meaning of default action(s)\n * in preventDefault is specific to a particular use case.\n *\n * Implementations that do not support capture/bubble or can not have\n * a parent listenable can simply not implement any ability to set the\n * parent listenable (and have `#getParentEventTarget` return\n * null).\n *\n * Implementation of this class can be used with or independently from\n * goog.events.\n *\n * Implementation must call `#addImplementation(implClass)`.\n *\n * @interface\n * @see goog.events\n * @see http://www.w3.org/TR/DOM-Level-2-Events/events.html\n */\ngoog.events.Listenable = function() {};\n\n\n/**\n * An expando property to indicate that an object implements\n * goog.events.Listenable.\n *\n * See addImplementation/isImplementedBy.\n *\n * @type {string}\n * @const\n */\ngoog.events.Listenable.IMPLEMENTED_BY_PROP =\n    'closure_listenable_' + ((Math.random() * 1e6) | 0);\n\n\n/**\n * Marks a given class (constructor) as an implementation of\n * Listenable, so that we can query that fact at runtime. The class\n * must have already implemented the interface.\n * @param {function(new:goog.events.Listenable,...)} cls The class constructor.\n *     The corresponding class must have already implemented the interface.\n */\ngoog.events.Listenable.addImplementation = function(cls) {\n  'use strict';\n  cls.prototype[goog.events.Listenable.IMPLEMENTED_BY_PROP] = true;\n};\n\n\n/**\n * @param {?Object} obj The object to check.\n * @return {boolean} Whether a given instance implements Listenable. The\n *     class/superclass of the instance must call addImplementation.\n */\ngoog.events.Listenable.isImplementedBy = function(obj) {\n  'use strict';\n  return !!(obj && obj[goog.events.Listenable.IMPLEMENTED_BY_PROP]);\n};\n\n\n/**\n * Adds an event listener. A listener can only be added once to an\n * object and if it is added again the key for the listener is\n * returned. Note that if the existing listener is a one-off listener\n * (registered via listenOnce), it will no longer be a one-off\n * listener after a call to listen().\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.listen = function(\n    type, listener, opt_useCapture, opt_listenerScope) {};\n\n\n/**\n * Adds an event listener that is removed automatically after the\n * listener fired once.\n *\n * If an existing listener already exists, listenOnce will do\n * nothing. In particular, if the listener was previously registered\n * via listen(), listenOnce() will not turn the listener into a\n * one-off listener. Similarly, if there is already an existing\n * one-off listener, listenOnce does not modify the listeners (it is\n * still a once listener).\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.listenOnce = function(\n    type, listener, opt_useCapture, opt_listenerScope) {};\n\n\n/**\n * Removes an event listener which was added with listen() or listenOnce().\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call\n *     the listener.\n * @return {boolean} Whether any listener was removed.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.unlisten = function(\n    type, listener, opt_useCapture, opt_listenerScope) {};\n\n\n/**\n * Removes an event listener which was added with listen() by the key\n * returned by listen().\n *\n * @param {!goog.events.ListenableKey} key The key returned by\n *     listen() or listenOnce().\n * @return {boolean} Whether any listener was removed.\n */\ngoog.events.Listenable.prototype.unlistenByKey = function(key) {};\n\n\n/**\n * Dispatches an event (or event like object) and calls all listeners\n * listening for events of this type. The type of the event is decided by the\n * type property on the event object.\n *\n * If any of the listeners returns false OR calls preventDefault then this\n * function will return false.  If one of the capture listeners calls\n * stopPropagation, then the bubble listeners won't fire.\n *\n * @param {?goog.events.EventLike} e Event object.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the listeners returns false) this will also return false.\n */\ngoog.events.Listenable.prototype.dispatchEvent = function(e) {};\n\n\n/**\n * Removes all listeners from this listenable. If type is specified,\n * it will only remove listeners of the particular type. otherwise all\n * registered listeners will be removed.\n *\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove,\n *     default is to remove all types.\n * @return {number} Number of listeners removed.\n */\ngoog.events.Listenable.prototype.removeAllListeners = function(opt_type) {};\n\n\n/**\n * Returns the parent of this event target to use for capture/bubble\n * mechanism.\n *\n * NOTE(chrishenry): The name reflects the original implementation of\n * custom event target (`goog.events.EventTarget`). We decided\n * that changing the name is not worth it.\n *\n * @return {?goog.events.Listenable} The parent EventTarget or null if\n *     there is no parent.\n */\ngoog.events.Listenable.prototype.getParentEventTarget = function() {};\n\n\n/**\n * Fires all registered listeners in this listenable for the given\n * type and capture mode, passing them the given eventObject. This\n * does not perform actual capture/bubble. Only implementors of the\n * interface should be using this.\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The type of the\n *     listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @param {EVENTOBJ} eventObject The event object to fire.\n * @return {boolean} Whether all listeners succeeded without\n *     attempting to prevent default behavior. If any listener returns\n *     false or called goog.events.Event#preventDefault, this returns\n *     false.\n * @template EVENTOBJ\n */\ngoog.events.Listenable.prototype.fireListeners = function(\n    type, capture, eventObject) {};\n\n\n/**\n * Gets all listeners in this listenable for the given type and\n * capture mode.\n *\n * @param {string|!goog.events.EventId} type The type of the listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @return {!Array<!goog.events.ListenableKey>} An array of registered\n *     listeners.\n * @template EVENTOBJ\n */\ngoog.events.Listenable.prototype.getListeners = function(type, capture) {};\n\n\n/**\n * Gets the goog.events.ListenableKey for the event or null if no such\n * listener is in use.\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The name of the event\n *     without the 'on' prefix.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener The\n *     listener function to get.\n * @param {boolean} capture Whether the listener is a capturing listener.\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {?goog.events.ListenableKey} the found listener or null if not found.\n * @template SCOPE,EVENTOBJ\n */\ngoog.events.Listenable.prototype.getListener = function(\n    type, listener, capture, opt_listenerScope) {};\n\n\n/**\n * Whether there is any active listeners matching the specified\n * signature. If either the type or capture parameters are\n * unspecified, the function will match on the remaining criteria.\n *\n * @param {string|!goog.events.EventId<EVENTOBJ>=} opt_type Event type.\n * @param {boolean=} opt_capture Whether to check for capture or bubble\n *     listeners.\n * @return {boolean} Whether there is any active listeners matching\n *     the requested type and/or capture phase.\n * @template EVENTOBJ\n */\ngoog.events.Listenable.prototype.hasListener = function(\n    opt_type, opt_capture) {};\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview An interface that describes a single registered listener.\n */\ngoog.module('goog.events.ListenableKey');\ngoog.module.declareLegacyNamespace();\n\nconst Listenable = goog.requireType('goog.events.Listenable');\n\n/**\n * An interface that describes a single registered listener.\n * @interface\n */\nfunction ListenableKey() {}\n\n/**\n * Counter used to create a unique key\n * @type {number}\n * @private\n */\nListenableKey.counter_ = 0;\n\n/**\n * Reserves a key to be used for ListenableKey#key field.\n * @return {number} A number to be used to fill ListenableKey#key\n *     field.\n */\nListenableKey.reserveKey = function() {\n  return ++ListenableKey.counter_;\n};\n\n/**\n * The source event target.\n * @type {?Object|?Listenable}\n */\nListenableKey.prototype.src;\n\n/**\n * The event type the listener is listening to.\n * @type {string}\n */\nListenableKey.prototype.type;\n\n/**\n * The listener function.\n * @type {function(?):?|{handleEvent:function(?):?}|null}\n */\nListenableKey.prototype.listener;\n\n/**\n * Whether the listener works on capture phase.\n * @type {boolean}\n */\nListenableKey.prototype.capture;\n\n/**\n * The 'this' object for the listener function's scope.\n * @type {?Object|undefined}\n */\nListenableKey.prototype.handler;\n\n/**\n * A globally unique number to identify the key.\n * @type {number}\n */\nListenableKey.prototype.key;\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n\nexports = ListenableKey;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Listener object.\n */\n\ngoog.module('goog.events.Listener');\ngoog.module.declareLegacyNamespace();\n\nconst Listenable = goog.requireType('goog.events.Listenable');\nconst ListenableKey = goog.require('goog.events.ListenableKey');\n\n/**\n * Simple class that stores information about a listener\n * @param {function(?):?} listener Callback function.\n * @param {Function} proxy Wrapper for the listener that patches the event.\n * @param {EventTarget|Listenable} src Source object for\n *     the event.\n * @param {string} type Event type.\n * @param {boolean} capture Whether in capture or bubble phase.\n * @param {Object=} opt_handler Object in whose context to execute the callback.\n * @implements {ListenableKey}\n * @constructor\n */\nfunction Listener(listener, proxy, src, type, capture, opt_handler) {\n  if (Listener.ENABLE_MONITORING) {\n    this.creationStack = new Error().stack;\n  }\n\n  /** @override */\n  this.listener = listener;\n\n  /**\n   * A wrapper over the original listener. This is used solely to\n   * handle native browser events (it is used to simulate the capture\n   * phase and to patch the event object).\n   * @type {Function}\n   */\n  this.proxy = proxy;\n\n  /**\n   * Object or node that callback is listening to\n   * @type {EventTarget|Listenable}\n   */\n  this.src = src;\n\n  /**\n   * The event type.\n   * @const {string}\n   */\n  this.type = type;\n\n  /**\n   * Whether the listener is being called in the capture or bubble phase\n   * @const {boolean}\n   */\n  this.capture = !!capture;\n\n  /**\n   * Optional object whose context to execute the listener in\n   * @type {Object|undefined}\n   */\n  this.handler = opt_handler;\n\n  /**\n   * The key of the listener.\n   * @const {number}\n   * @override\n   */\n  this.key = ListenableKey.reserveKey();\n\n  /**\n   * Whether to remove the listener after it has been called.\n   * @type {boolean}\n   */\n  this.callOnce = false;\n\n  /**\n   * Whether the listener has been removed.\n   * @type {boolean}\n   */\n  this.removed = false;\n}\n\n/**\n * @define {boolean} Whether to enable the monitoring of the\n *     Listener instances. Switching on the monitoring is only\n *     recommended for debugging because it has a significant impact on\n *     performance and memory usage. If switched off, the monitoring code\n *     compiles down to 0 bytes.\n */\nListener.ENABLE_MONITORING =\n    goog.define('goog.events.Listener.ENABLE_MONITORING', false);\n\n/**\n * If monitoring the Listener instances is enabled, stores the\n * creation stack trace of the Disposable instance.\n * @type {string}\n */\nListener.prototype.creationStack;\n\n/**\n * Marks this listener as removed. This also remove references held by\n * this listener object (such as listener and event source).\n */\nListener.prototype.markAsRemoved = function() {\n  this.removed = true;\n  this.listener = null;\n  this.proxy = null;\n  this.src = null;\n  this.handler = null;\n};\n\nexports = Listener;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A map of listeners that provides utility functions to\n * deal with listeners on an event target. Used by\n * `goog.events.EventTarget`.\n *\n * WARNING: Do not use this class from outside goog.events package.\n *\n */\n\ngoog.module('goog.events.ListenerMap');\n\ngoog.module.declareLegacyNamespace();\n\nconst EventId = goog.requireType('goog.events.EventId');\nconst Listenable = goog.requireType('goog.events.Listenable');\nconst ListenableKey = goog.requireType('goog.events.ListenableKey');\nconst Listener = goog.require('goog.events.Listener');\nconst array = goog.require('goog.array');\nconst object = goog.require('goog.object');\n\n/**\n * Creates a new listener map.\n * @param {EventTarget|Listenable} src The src object.\n * @constructor\n * @final\n */\nfunction ListenerMap(src) {\n  /** @type {EventTarget|Listenable} */\n  this.src = src;\n\n  /**\n   * Maps of event type to an array of listeners.\n   * @type {!Object<string, !Array<!Listener>>}\n   */\n  this.listeners = {};\n\n  /**\n   * The count of types in this map that have registered listeners.\n   * @private {number}\n   */\n  this.typeCount_ = 0;\n}\n\n\n/**\n * @return {number} The count of event types in this map that actually\n *     have registered listeners.\n */\nListenerMap.prototype.getTypeCount = function() {\n  return this.typeCount_;\n};\n\n\n/**\n * @return {number} Total number of registered listeners.\n */\nListenerMap.prototype.getListenerCount = function() {\n  let count = 0;\n  for (const type in this.listeners) {\n    count += this.listeners[type].length;\n  }\n  return count;\n};\n\n\n/**\n * Adds an event listener. A listener can only be added once to an\n * object and if it is added again the key for the listener is\n * returned.\n *\n * Note that a one-off listener will not change an existing listener,\n * if any. On the other hand a normal listener will change existing\n * one-off listener to become a normal listener.\n *\n * @param {string|!EventId} type The listener event type.\n * @param {!Function} listener This listener callback method.\n * @param {boolean} callOnce Whether the listener is a one-off\n *     listener.\n * @param {boolean=} opt_useCapture The capture mode of the listener.\n * @param {Object=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!ListenableKey} Unique key for the listener.\n */\nListenerMap.prototype.add = function(\n    type, listener, callOnce, opt_useCapture, opt_listenerScope) {\n  const typeStr = type.toString();\n  let listenerArray = this.listeners[typeStr];\n  if (!listenerArray) {\n    listenerArray = this.listeners[typeStr] = [];\n    this.typeCount_++;\n  }\n\n  let listenerObj;\n  const index = ListenerMap.findListenerIndex_(\n      listenerArray, listener, opt_useCapture, opt_listenerScope);\n  if (index > -1) {\n    listenerObj = listenerArray[index];\n    if (!callOnce) {\n      // Ensure that, if there is an existing callOnce listener, it is no\n      // longer a callOnce listener.\n      listenerObj.callOnce = false;\n    }\n  } else {\n    listenerObj = new Listener(\n        listener, null, this.src, typeStr, !!opt_useCapture, opt_listenerScope);\n    listenerObj.callOnce = callOnce;\n    listenerArray.push(listenerObj);\n  }\n  return listenerObj;\n};\n\n\n/**\n * Removes a matching listener.\n * @param {string|!EventId} type The listener event type.\n * @param {!Function} listener This listener callback method.\n * @param {boolean=} opt_useCapture The capture mode of the listener.\n * @param {Object=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {boolean} Whether any listener was removed.\n */\nListenerMap.prototype.remove = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  const typeStr = type.toString();\n  if (!(typeStr in this.listeners)) {\n    return false;\n  }\n\n  const listenerArray = this.listeners[typeStr];\n  const index = ListenerMap.findListenerIndex_(\n      listenerArray, listener, opt_useCapture, opt_listenerScope);\n  if (index > -1) {\n    const listenerObj = listenerArray[index];\n    listenerObj.markAsRemoved();\n    array.removeAt(listenerArray, index);\n    if (listenerArray.length == 0) {\n      delete this.listeners[typeStr];\n      this.typeCount_--;\n    }\n    return true;\n  }\n  return false;\n};\n\n\n/**\n * Removes the given listener object.\n * @param {!ListenableKey} listener The listener to remove.\n * @return {boolean} Whether the listener is removed.\n */\nListenerMap.prototype.removeByKey = function(listener) {\n  const type = listener.type;\n  if (!(type in this.listeners)) {\n    return false;\n  }\n\n  const removed = array.remove(this.listeners[type], listener);\n  if (removed) {\n    /** @type {!Listener} */ (listener).markAsRemoved();\n    if (this.listeners[type].length == 0) {\n      delete this.listeners[type];\n      this.typeCount_--;\n    }\n  }\n  return removed;\n};\n\n\n/**\n * Removes all listeners from this map. If opt_type is provided, only\n * listeners that match the given type are removed.\n * @param {string|!EventId=} opt_type Type of event to remove.\n * @return {number} Number of listeners removed.\n */\nListenerMap.prototype.removeAll = function(opt_type) {\n  const typeStr = opt_type && opt_type.toString();\n  let count = 0;\n  for (const type in this.listeners) {\n    if (!typeStr || type == typeStr) {\n      const listenerArray = this.listeners[type];\n      for (let i = 0; i < listenerArray.length; i++) {\n        ++count;\n        listenerArray[i].markAsRemoved();\n      }\n      delete this.listeners[type];\n      this.typeCount_--;\n    }\n  }\n  return count;\n};\n\n\n/**\n * Gets all listeners that match the given type and capture mode. The\n * returned array is a copy (but the listener objects are not).\n * @param {string|!EventId} type The type of the listeners\n *     to retrieve.\n * @param {boolean} capture The capture mode of the listeners to retrieve.\n * @return {!Array<!ListenableKey>} An array of matching\n *     listeners.\n */\nListenerMap.prototype.getListeners = function(type, capture) {\n  const listenerArray = this.listeners[type.toString()];\n  const rv = [];\n  if (listenerArray) {\n    for (let i = 0; i < listenerArray.length; ++i) {\n      const listenerObj = listenerArray[i];\n      if (listenerObj.capture == capture) {\n        rv.push(listenerObj);\n      }\n    }\n  }\n  return rv;\n};\n\n\n/**\n * Gets the goog.events.ListenableKey for the event or null if no such\n * listener is in use.\n *\n * @param {string|!EventId} type The type of the listener\n *     to retrieve.\n * @param {!Function} listener The listener function to get.\n * @param {boolean} capture Whether the listener is a capturing listener.\n * @param {Object=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {ListenableKey} the found listener or null if not found.\n */\nListenerMap.prototype.getListener = function(\n    type, listener, capture, opt_listenerScope) {\n  const listenerArray = this.listeners[type.toString()];\n  let i = -1;\n  if (listenerArray) {\n    i = ListenerMap.findListenerIndex_(\n        listenerArray, listener, capture, opt_listenerScope);\n  }\n  return i > -1 ? listenerArray[i] : null;\n};\n\n\n/**\n * Whether there is a matching listener. If either the type or capture\n * parameters are unspecified, the function will match on the\n * remaining criteria.\n *\n * @param {string|!EventId=} opt_type The type of the listener.\n * @param {boolean=} opt_capture The capture mode of the listener.\n * @return {boolean} Whether there is an active listener matching\n *     the requested type and/or capture phase.\n */\nListenerMap.prototype.hasListener = function(opt_type, opt_capture) {\n  const hasType = (opt_type !== undefined);\n  const typeStr = hasType ? opt_type.toString() : '';\n  const hasCapture = (opt_capture !== undefined);\n\n  return object.some(this.listeners, function(listenerArray, type) {\n    for (let i = 0; i < listenerArray.length; ++i) {\n      if ((!hasType || listenerArray[i].type == typeStr) &&\n          (!hasCapture || listenerArray[i].capture == opt_capture)) {\n        return true;\n      }\n    }\n\n    return false;\n  });\n};\n\n\n/**\n * Finds the index of a matching goog.events.Listener in the given\n * listenerArray.\n * @param {!Array<!Listener>} listenerArray Array of listener.\n * @param {!Function} listener The listener function.\n * @param {boolean=} opt_useCapture The capture flag for the listener.\n * @param {Object=} opt_listenerScope The listener scope.\n * @return {number} The index of the matching listener within the\n *     listenerArray.\n * @private\n */\nListenerMap.findListenerIndex_ = function(\n    listenerArray, listener, opt_useCapture, opt_listenerScope) {\n  for (let i = 0; i < listenerArray.length; ++i) {\n    const listenerObj = listenerArray[i];\n    if (!listenerObj.removed && listenerObj.listener == listener &&\n        listenerObj.capture == !!opt_useCapture &&\n        listenerObj.handler == opt_listenerScope) {\n      return i;\n    }\n  }\n  return -1;\n};\n\nexports = ListenerMap;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview An event manager for both native browser event\n * targets and custom JavaScript event targets\n * (`goog.events.Listenable`). This provides an abstraction\n * over browsers' event systems.\n *\n * It also provides a simulation of W3C event model's capture phase in\n * Internet Explorer (IE 8 and below). Caveat: the simulation does not\n * interact well with listeners registered directly on the elements\n * (bypassing goog.events) or even with listeners registered via\n * goog.events in a separate JS binary. In these cases, we provide\n * no ordering guarantees.\n *\n * The listeners will receive a \"patched\" event object. Such event object\n * contains normalized values for certain event properties that differs in\n * different browsers.\n *\n * Example usage:\n * <pre>\n * goog.events.listen(myNode, 'click', function(e) { alert('woo') });\n * goog.events.listen(myNode, 'mouseover', mouseHandler, true);\n * goog.events.unlisten(myNode, 'mouseover', mouseHandler, true);\n * goog.events.removeAll(myNode);\n * </pre>\n *\n *                                            in IE and event object patching]\n */\n\n// IMPLEMENTATION NOTES:\n// goog.events stores an auxiliary data structure on each EventTarget\n// source being listened on. This allows us to take advantage of GC,\n// having the data structure GC'd when the EventTarget is GC'd. This\n// GC behavior is equivalent to using W3C DOM Events directly.\n\ngoog.provide('goog.events');\n\ngoog.require('goog.asserts');\ngoog.require('goog.debug.entryPointRegistry');\ngoog.require('goog.events.BrowserEvent');\ngoog.require('goog.events.BrowserFeature');\ngoog.require('goog.events.Listenable');\ngoog.require('goog.events.ListenerMap');\ngoog.requireType('goog.debug.ErrorHandler');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventLike');\ngoog.requireType('goog.events.EventWrapper');\ngoog.requireType('goog.events.ListenableKey');\ngoog.requireType('goog.events.Listener');\n\n\n/**\n * @typedef {number|goog.events.ListenableKey}\n */\ngoog.events.Key;\n\n\n/**\n * @typedef {EventTarget|goog.events.Listenable}\n */\ngoog.events.ListenableType;\n\n\n/**\n * Property name on a native event target for the listener map\n * associated with the event target.\n * @private @const {string}\n */\ngoog.events.LISTENER_MAP_PROP_ = 'closure_lm_' + ((Math.random() * 1e6) | 0);\n\n\n/**\n * String used to prepend to IE event types.\n * @const\n * @private\n */\ngoog.events.onString_ = 'on';\n\n\n/**\n * Map of computed \"on<eventname>\" strings for IE event types. Caching\n * this removes an extra object allocation in goog.events.listen which\n * improves IE6 performance.\n * @const\n * @dict\n * @private\n */\ngoog.events.onStringMap_ = {};\n\n\n/**\n * @enum {number} Different capture simulation mode for IE8-.\n */\ngoog.events.CaptureSimulationMode = {\n  /**\n   * Does not perform capture simulation. Will asserts in IE8- when you\n   * add capture listeners.\n   */\n  OFF_AND_FAIL: 0,\n\n  /**\n   * Does not perform capture simulation, silently ignore capture\n   * listeners.\n   */\n  OFF_AND_SILENT: 1,\n\n  /**\n   * Performs capture simulation.\n   */\n  ON: 2\n};\n\n\n/**\n * Estimated count of total native listeners.\n * @private {number}\n */\ngoog.events.listenerCountEstimate_ = 0;\n\n\n/**\n * Adds an event listener for a specific event on a native event\n * target (such as a DOM element) or an object that has implemented\n * {@link goog.events.Listenable}. A listener can only be added once\n * to an object and if it is added again the key for the listener is\n * returned. Note that if the existing listener is a one-off listener\n * (registered via listenOnce), it will no longer be a one-off\n * listener after a call to listen().\n *\n * @param {EventTarget|goog.events.Listenable} src The node to listen\n *     to events on.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(?):?}|null}\n *     listener Callback method, or an object with a handleEvent function.\n *     WARNING: passing an Object is now softly deprecated.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {T=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.Key} Unique key for the listener.\n * @template T,EVENTOBJ\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.listen = function(src, type, listener, opt_options, opt_handler) {\n  'use strict';\n  if (opt_options && opt_options.once) {\n    return goog.events.listenOnce(\n        src, type, listener, opt_options, opt_handler);\n  }\n  if (Array.isArray(type)) {\n    for (let i = 0; i < type.length; i++) {\n      goog.events.listen(src, type[i], listener, opt_options, opt_handler);\n    }\n    return null;\n  }\n\n  listener = goog.events.wrapListener(listener);\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    const capture =\n        goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n    return src.listen(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n  } else {\n    return goog.events.listen_(\n        /** @type {!EventTarget} */ (src), type, listener,\n        /* callOnce */ false, opt_options, opt_handler);\n  }\n};\n\n\n/**\n * Adds an event listener for a specific event on a native event\n * target. A listener can only be added once to an object and if it\n * is added again the key for the listener is returned.\n *\n * Note that a one-off listener will not change an existing listener,\n * if any. On the other hand a normal listener will change existing\n * one-off listener to become a normal listener.\n *\n * @param {EventTarget} src The node to listen to events on.\n * @param {string|?goog.events.EventId<EVENTOBJ>} type Event type.\n * @param {!Function} listener Callback function.\n * @param {boolean} callOnce Whether the listener is a one-off\n *     listener or otherwise.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.ListenableKey} Unique key for the listener.\n * @template EVENTOBJ\n * @private\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.listen_ = function(\n    src, type, listener, callOnce, opt_options, opt_handler) {\n  'use strict';\n  if (!type) {\n    throw new Error('Invalid event type');\n  }\n\n  const capture =\n      goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n\n  let listenerMap = goog.events.getListenerMap_(src);\n  if (!listenerMap) {\n    src[goog.events.LISTENER_MAP_PROP_] = listenerMap =\n        new goog.events.ListenerMap(src);\n  }\n\n  const listenerObj = /** @type {goog.events.Listener} */ (\n      listenerMap.add(type, listener, callOnce, capture, opt_handler));\n\n  // If the listenerObj already has a proxy, it has been set up\n  // previously. We simply return.\n  if (listenerObj.proxy) {\n    return listenerObj;\n  }\n\n  const proxy = goog.events.getProxy();\n  listenerObj.proxy = proxy;\n\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  proxy.src = src;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  proxy.listener = listenerObj;\n\n  // Attach the proxy through the browser's API\n  if (src.addEventListener) {\n    // Don't pass an object as `capture` if the browser doesn't support that.\n    if (!goog.events.BrowserFeature.PASSIVE_EVENTS) {\n      opt_options = capture;\n    }\n    // Don't break tests that expect a boolean.\n    if (opt_options === undefined) opt_options = false;\n    src.addEventListener(type.toString(), proxy, opt_options);\n  } else if (src.attachEvent) {\n    // The else if above used to be an unconditional else. It would call\n    // attachEvent come gws or high water. This would sometimes throw an\n    // exception on IE11, spoiling the day of some callers. The previous\n    // incarnation of this code, from 2007, indicates that it replaced an\n    // earlier still version that caused excess allocations on IE6.\n    src.attachEvent(goog.events.getOnString_(type.toString()), proxy);\n  } else if (src.addListener && src.removeListener) {\n    // In IE, MediaQueryList uses addListener() insteadd of addEventListener. In\n    // Safari, there is no global for the MediaQueryList constructor, so we just\n    // check whether the object \"looks like\" MediaQueryList.\n    goog.asserts.assert(\n        type === 'change', 'MediaQueryList only has a change event');\n    src.addListener(proxy);\n  } else {\n    throw new Error('addEventListener and attachEvent are unavailable.');\n  }\n\n  goog.events.listenerCountEstimate_++;\n  return listenerObj;\n};\n\n\n/**\n * Helper function for returning a proxy function.\n * @return {!Function} A new or reused function object.\n */\ngoog.events.getProxy = function() {\n  'use strict';\n  const proxyCallbackFunction = goog.events.handleBrowserEvent_;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  const f = function(eventObject) {\n    return proxyCallbackFunction.call(f.src, f.listener, eventObject);\n  };\n  return f;\n};\n\n\n/**\n * Adds an event listener for a specific event on a native event\n * target (such as a DOM element) or an object that has implemented\n * {@link goog.events.Listenable}. After the event has fired the event\n * listener is removed from the target.\n *\n * If an existing listener already exists, listenOnce will do\n * nothing. In particular, if the listener was previously registered\n * via listen(), listenOnce() will not turn the listener into a\n * one-off listener. Similarly, if there is already an existing\n * one-off listener, listenOnce does not modify the listeners (it is\n * still a once listener).\n *\n * @param {EventTarget|goog.events.Listenable} src The node to listen\n *     to events on.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types.\n * @param {function(this:T, EVENTOBJ):?|{handleEvent:function(?):?}|null}\n *     listener Callback method.\n * @param {(boolean|!AddEventListenerOptions)=} opt_options\n * @param {T=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.Key} Unique key for the listener.\n * @template T,EVENTOBJ\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.listenOnce = function(\n    src, type, listener, opt_options, opt_handler) {\n  'use strict';\n  if (Array.isArray(type)) {\n    for (let i = 0; i < type.length; i++) {\n      goog.events.listenOnce(src, type[i], listener, opt_options, opt_handler);\n    }\n    return null;\n  }\n\n  listener = goog.events.wrapListener(listener);\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    const capture =\n        goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n    return src.listenOnce(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n  } else {\n    return goog.events.listen_(\n        /** @type {!EventTarget} */ (src), type, listener,\n        /* callOnce */ true, opt_options, opt_handler);\n  }\n};\n\n\n/**\n * Adds an event listener with a specific event wrapper on a DOM Node or an\n * object that has implemented {@link goog.events.Listenable}. A listener can\n * only be added once to an object.\n *\n * @param {EventTarget|goog.events.Listenable} src The target to\n *     listen to events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(this:T, ?):?|{handleEvent:function(?):?}|null} listener\n *     Callback method, or an object with a handleEvent function.\n * @param {boolean=} opt_capt Whether to fire in capture phase (defaults to\n *     false).\n * @param {T=} opt_handler Element in whose scope to call the listener.\n * @template T\n */\ngoog.events.listenWithWrapper = function(\n    src, wrapper, listener, opt_capt, opt_handler) {\n  'use strict';\n  wrapper.listen(src, listener, opt_capt, opt_handler);\n};\n\n\n/**\n * Removes an event listener which was added with listen().\n *\n * @param {EventTarget|goog.events.Listenable} src The target to stop\n *     listening to events on.\n * @param {string|Array<string>|\n *     !goog.events.EventId<EVENTOBJ>|!Array<!goog.events.EventId<EVENTOBJ>>}\n *     type Event type or array of event types to unlisten to.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to remove.\n * @param {(boolean|!EventListenerOptions)=} opt_options\n *     whether the listener is fired during the capture or bubble phase of the\n *     event.\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n * @return {?boolean} indicating whether the listener was there to remove.\n * @template EVENTOBJ\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.unlisten = function(src, type, listener, opt_options, opt_handler) {\n  'use strict';\n  if (Array.isArray(type)) {\n    for (let i = 0; i < type.length; i++) {\n      goog.events.unlisten(src, type[i], listener, opt_options, opt_handler);\n    }\n    return null;\n  }\n  const capture =\n      goog.isObject(opt_options) ? !!opt_options.capture : !!opt_options;\n\n  listener = goog.events.wrapListener(listener);\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    return src.unlisten(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n  }\n\n  if (!src) {\n    // TODO(chrishenry): We should tighten the API to only accept\n    // non-null objects, or add an assertion here.\n    return false;\n  }\n\n  const listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (src));\n  if (listenerMap) {\n    const listenerObj = listenerMap.getListener(\n        /** @type {string|!goog.events.EventId} */ (type), listener, capture,\n        opt_handler);\n    if (listenerObj) {\n      return goog.events.unlistenByKey(listenerObj);\n    }\n  }\n\n  return false;\n};\n\n\n/**\n * Removes an event listener which was added with listen() by the key\n * returned by listen().\n *\n * @param {goog.events.Key} key The key returned by listen() for this\n *     event listener.\n * @return {boolean} indicating whether the listener was there to remove.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.unlistenByKey = function(key) {\n  'use strict';\n  // TODO(chrishenry): Remove this check when tests that rely on this\n  // are fixed.\n  if (typeof key === 'number') {\n    return false;\n  }\n\n  const listener = key;\n  if (!listener || listener.removed) {\n    return false;\n  }\n\n  const src = listener.src;\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    return /** @type {!goog.events.Listenable} */ (src).unlistenByKey(listener);\n  }\n\n  const type = listener.type;\n  /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n  const proxy = listener.proxy;\n  if (src.removeEventListener) {\n    src.removeEventListener(type, proxy, listener.capture);\n  } else if (src.detachEvent) {\n    src.detachEvent(goog.events.getOnString_(type), proxy);\n  } else if (src.addListener && src.removeListener) {\n    src.removeListener(proxy);\n  }\n  goog.events.listenerCountEstimate_--;\n\n  const listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (src));\n  // TODO(chrishenry): Try to remove this conditional and execute the\n  // first branch always. This should be safe.\n  if (listenerMap) {\n    listenerMap.removeByKey(listener);\n    if (listenerMap.getTypeCount() == 0) {\n      // Null the src, just because this is simple to do (and useful\n      // for IE <= 7).\n      listenerMap.src = null;\n      // We don't use delete here because IE does not allow delete\n      // on a window object.\n      src[goog.events.LISTENER_MAP_PROP_] = null;\n    }\n  } else {\n    /** @type {!goog.events.Listener} */ (listener).markAsRemoved();\n  }\n\n  return true;\n};\n\n\n/**\n * Removes an event listener which was added with listenWithWrapper().\n *\n * @param {EventTarget|goog.events.Listenable} src The target to stop\n *     listening to events on.\n * @param {goog.events.EventWrapper} wrapper Event wrapper to use.\n * @param {function(?):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to remove.\n * @param {boolean=} opt_capt In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase of the\n *     event.\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n */\ngoog.events.unlistenWithWrapper = function(\n    src, wrapper, listener, opt_capt, opt_handler) {\n  'use strict';\n  wrapper.unlisten(src, listener, opt_capt, opt_handler);\n};\n\n\n/**\n * Removes all listeners from an object. You can also optionally\n * remove listeners of a particular type.\n *\n * @param {Object|undefined} obj Object to remove listeners from. Must be an\n *     EventTarget or a goog.events.Listenable.\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove.\n *     Default is all types.\n * @return {number} Number of listeners removed.\n */\ngoog.events.removeAll = function(obj, opt_type) {\n  'use strict';\n  // TODO(chrishenry): Change the type of obj to\n  // (!EventTarget|!goog.events.Listenable).\n\n  if (!obj) {\n    return 0;\n  }\n\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return /** @type {?} */ (obj).removeAllListeners(opt_type);\n  }\n\n  const listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (obj));\n  if (!listenerMap) {\n    return 0;\n  }\n\n  let count = 0;\n  const typeStr = opt_type && opt_type.toString();\n  for (const type in listenerMap.listeners) {\n    if (!typeStr || type == typeStr) {\n      // Clone so that we don't need to worry about unlistenByKey\n      // changing the content of the ListenerMap.\n      const listeners = listenerMap.listeners[type].concat();\n      for (let i = 0; i < listeners.length; ++i) {\n        if (goog.events.unlistenByKey(listeners[i])) {\n          ++count;\n        }\n      }\n    }\n  }\n  return count;\n};\n\n\n/**\n * Gets the listeners for a given object, type and capture phase.\n *\n * @param {Object} obj Object to get listeners for.\n * @param {string|!goog.events.EventId} type Event type.\n * @param {boolean} capture Capture phase?.\n * @return {!Array<!goog.events.Listener>} Array of listener objects.\n */\ngoog.events.getListeners = function(obj, type, capture) {\n  'use strict';\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return /** @type {!goog.events.Listenable} */ (obj).getListeners(\n        type, capture);\n  } else {\n    if (!obj) {\n      // TODO(chrishenry): We should tighten the API to accept\n      // !EventTarget|goog.events.Listenable, and add an assertion here.\n      return [];\n    }\n\n    const listenerMap = goog.events.getListenerMap_(\n        /** @type {!EventTarget} */ (obj));\n    return listenerMap ? listenerMap.getListeners(type, capture) : [];\n  }\n};\n\n\n/**\n * Gets the goog.events.Listener for the event or null if no such listener is\n * in use.\n *\n * @param {EventTarget|goog.events.Listenable} src The target from\n *     which to get listeners.\n * @param {?string|!goog.events.EventId<EVENTOBJ>} type The type of the event.\n * @param {function(EVENTOBJ):?|{handleEvent:function(?):?}|null} listener The\n *     listener function to get.\n * @param {boolean=} opt_capt In DOM-compliant browsers, this determines\n *                            whether the listener is fired during the\n *                            capture or bubble phase of the event.\n * @param {Object=} opt_handler Element in whose scope to call the listener.\n * @return {goog.events.ListenableKey} the found listener or null if not found.\n * @template EVENTOBJ\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.getListener = function(src, type, listener, opt_capt, opt_handler) {\n  'use strict';\n  // TODO(chrishenry): Change type from ?string to string, or add assertion.\n  type = /** @type {string} */ (type);\n  listener = goog.events.wrapListener(listener);\n  const capture = !!opt_capt;\n  if (goog.events.Listenable.isImplementedBy(src)) {\n    return src.getListener(type, listener, capture, opt_handler);\n  }\n\n  if (!src) {\n    // TODO(chrishenry): We should tighten the API to only accept\n    // non-null objects, or add an assertion here.\n    return null;\n  }\n\n  const listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (src));\n  if (listenerMap) {\n    return listenerMap.getListener(type, listener, capture, opt_handler);\n  }\n  return null;\n};\n\n\n/**\n * Returns whether an event target has any active listeners matching the\n * specified signature. If either the type or capture parameters are\n * unspecified, the function will match on the remaining criteria.\n *\n * @param {EventTarget|goog.events.Listenable} obj Target to get\n *     listeners for.\n * @param {string|!goog.events.EventId=} opt_type Event type.\n * @param {boolean=} opt_capture Whether to check for capture or bubble-phase\n *     listeners.\n * @return {boolean} Whether an event target has one or more listeners matching\n *     the requested type and/or capture phase.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.hasListener = function(obj, opt_type, opt_capture) {\n  'use strict';\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return obj.hasListener(opt_type, opt_capture);\n  }\n\n  const listenerMap = goog.events.getListenerMap_(\n      /** @type {!EventTarget} */ (obj));\n  return !!listenerMap && listenerMap.hasListener(opt_type, opt_capture);\n};\n\n\n/**\n * Provides a nice string showing the normalized event objects public members\n * @param {Object} e Event Object.\n * @return {string} String of the public members of the normalized event object.\n */\ngoog.events.expose = function(e) {\n  'use strict';\n  const str = [];\n  for (const key in e) {\n    if (e[key] && e[key].id) {\n      str.push(key + ' = ' + e[key] + ' (' + e[key].id + ')');\n    } else {\n      str.push(key + ' = ' + e[key]);\n    }\n  }\n  return str.join('\\n');\n};\n\n\n/**\n * Returns a string with on prepended to the specified type. This is used for IE\n * which expects \"on\" to be prepended. This function caches the string in order\n * to avoid extra allocations in steady state.\n * @param {string} type Event type.\n * @return {string} The type string with 'on' prepended.\n * @private\n */\ngoog.events.getOnString_ = function(type) {\n  'use strict';\n  if (type in goog.events.onStringMap_) {\n    return goog.events.onStringMap_[type];\n  }\n  return goog.events.onStringMap_[type] = goog.events.onString_ + type;\n};\n\n\n/**\n * Fires an object's listeners of a particular type and phase\n *\n * @param {Object} obj Object whose listeners to call.\n * @param {string|!goog.events.EventId} type Event type.\n * @param {boolean} capture Which event phase.\n * @param {Object} eventObject Event object to be passed to listener.\n * @return {boolean} True if all listeners returned true else false.\n */\ngoog.events.fireListeners = function(obj, type, capture, eventObject) {\n  'use strict';\n  if (goog.events.Listenable.isImplementedBy(obj)) {\n    return /** @type {!goog.events.Listenable} */ (obj).fireListeners(\n        type, capture, eventObject);\n  }\n\n  return goog.events.fireListeners_(obj, type, capture, eventObject);\n};\n\n\n/**\n * Fires an object's listeners of a particular type and phase.\n * @param {Object} obj Object whose listeners to call.\n * @param {string|!goog.events.EventId} type Event type.\n * @param {boolean} capture Which event phase.\n * @param {Object} eventObject Event object to be passed to listener.\n * @return {boolean} True if all listeners returned true else false.\n * @private\n */\ngoog.events.fireListeners_ = function(obj, type, capture, eventObject) {\n  'use strict';\n  /** @type {boolean} */\n  let retval = true;\n\n  const listenerMap = goog.events.getListenerMap_(\n      /** @type {EventTarget} */ (obj));\n  if (listenerMap) {\n    // TODO(chrishenry): Original code avoids array creation when there\n    // is no listener, so we do the same. If this optimization turns\n    // out to be not required, we can replace this with\n    // listenerMap.getListeners(type, capture) instead, which is simpler.\n    let listenerArray = listenerMap.listeners[type.toString()];\n    if (listenerArray) {\n      listenerArray = listenerArray.concat();\n      for (let i = 0; i < listenerArray.length; i++) {\n        const listener = listenerArray[i];\n        // We might not have a listener if the listener was removed.\n        if (listener && listener.capture == capture && !listener.removed) {\n          const result = goog.events.fireListener(listener, eventObject);\n          retval = retval && (result !== false);\n        }\n      }\n    }\n  }\n  return retval;\n};\n\n\n/**\n * Fires a listener with a set of arguments\n *\n * @param {goog.events.Listener} listener The listener object to call.\n * @param {Object} eventObject The event object to pass to the listener.\n * @return {*} Result of listener.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.fireListener = function(listener, eventObject) {\n  'use strict';\n  const listenerFn = listener.listener;\n  const listenerHandler = listener.handler || listener.src;\n\n  if (listener.callOnce) {\n    goog.events.unlistenByKey(listener);\n  }\n  return listenerFn.call(listenerHandler, eventObject);\n};\n\n\n/**\n * Gets the total number of listeners currently in the system.\n * @return {number} Number of listeners.\n * @deprecated This returns estimated count, now that Closure no longer\n * stores a central listener registry. We still return an estimation\n * to keep existing listener-related tests passing. In the near future,\n * this function will be removed.\n */\ngoog.events.getTotalListenerCount = function() {\n  'use strict';\n  return goog.events.listenerCountEstimate_;\n};\n\n\n/**\n * Dispatches an event (or event like object) and calls all listeners\n * listening for events of this type. The type of the event is decided by the\n * type property on the event object.\n *\n * If any of the listeners returns false OR calls preventDefault then this\n * function will return false.  If one of the capture listeners calls\n * stopPropagation, then the bubble listeners won't fire.\n *\n * @param {goog.events.Listenable} src The event target.\n * @param {goog.events.EventLike} e Event object.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the handlers returns false) this will also return false.\n *     If there are no handlers, or if all handlers return true, this returns\n *     true.\n */\ngoog.events.dispatchEvent = function(src, e) {\n  'use strict';\n  goog.asserts.assert(\n      goog.events.Listenable.isImplementedBy(src),\n      'Can not use goog.events.dispatchEvent with ' +\n          'non-goog.events.Listenable instance.');\n  return src.dispatchEvent(e);\n};\n\n\n/**\n * Installs exception protection for the browser event entry point using the\n * given error handler.\n *\n * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to\n *     protect the entry point.\n */\ngoog.events.protectBrowserEventEntryPoint = function(errorHandler) {\n  'use strict';\n  goog.events.handleBrowserEvent_ =\n      errorHandler.protectEntryPoint(goog.events.handleBrowserEvent_);\n};\n\n\n/**\n * Handles an event and dispatches it to the correct listeners. This\n * function is a proxy for the real listener the user specified.\n *\n * @param {goog.events.Listener} listener The listener object.\n * @param {Event=} opt_evt Optional event object that gets passed in via the\n *     native event handlers.\n * @return {*} Result of the event handler.\n * @this {EventTarget} The object or Element that fired the event.\n * @private\n */\ngoog.events.handleBrowserEvent_ = function(listener, opt_evt) {\n  'use strict';\n  if (listener.removed) {\n    return true;\n  }\n\n  // Otherwise, simply fire the listener.\n  return goog.events.fireListener(\n      listener, new goog.events.BrowserEvent(opt_evt, this));\n};\n\n\n/**\n * This is used to mark the IE event object so we do not do the Closure pass\n * twice for a bubbling event.\n * @param {Event} e The IE browser event.\n * @private\n */\ngoog.events.markIeEvent_ = function(e) {\n  'use strict';\n  // Only the keyCode and the returnValue can be changed. We use keyCode for\n  // non keyboard events.\n  // event.returnValue is a bit more tricky. It is undefined by default. A\n  // boolean false prevents the default action. In a window.onbeforeunload and\n  // the returnValue is non undefined it will be alerted. However, we will only\n  // modify the returnValue for keyboard events. We can get a problem if non\n  // closure events sets the keyCode or the returnValue\n\n  let useReturnValue = false;\n\n  if (e.keyCode == 0) {\n    // We cannot change the keyCode in case that srcElement is input[type=file].\n    // We could test that that is the case but that would allocate 3 objects.\n    // If we use try/catch we will only allocate extra objects in the case of a\n    // failure.\n\n    try {\n      e.keyCode = -1;\n      return;\n    } catch (ex) {\n      useReturnValue = true;\n    }\n  }\n\n  if (useReturnValue ||\n      /** @type {boolean|undefined} */ (e.returnValue) == undefined) {\n    e.returnValue = true;\n  }\n};\n\n\n/**\n * This is used to check if an IE event has already been handled by the Closure\n * system so we do not do the Closure pass twice for a bubbling event.\n * @param {Event} e  The IE browser event.\n * @return {boolean} True if the event object has been marked.\n * @private\n */\ngoog.events.isMarkedIeEvent_ = function(e) {\n  'use strict';\n  return e.keyCode < 0 || e.returnValue != undefined;\n};\n\n\n/**\n * Counter to create unique event ids.\n * @private {number}\n */\ngoog.events.uniqueIdCounter_ = 0;\n\n\n/**\n * Creates a unique event id.\n *\n * @param {string} identifier The identifier.\n * @return {string} A unique identifier.\n * @idGenerator {unique}\n */\ngoog.events.getUniqueId = function(identifier) {\n  'use strict';\n  return identifier + '_' + goog.events.uniqueIdCounter_++;\n};\n\n\n/**\n * @param {EventTarget} src The source object.\n * @return {goog.events.ListenerMap} A listener map for the given\n *     source object, or null if none exists.\n * @private\n */\ngoog.events.getListenerMap_ = function(src) {\n  'use strict';\n  const listenerMap = src[goog.events.LISTENER_MAP_PROP_];\n  // IE serializes the property as well (e.g. when serializing outer\n  // HTML). So we must check that the value is of the correct type.\n  return listenerMap instanceof goog.events.ListenerMap ? listenerMap : null;\n};\n\n\n/**\n * Expando property for listener function wrapper for Object with\n * handleEvent.\n * @private @const {string}\n */\ngoog.events.LISTENER_WRAPPER_PROP_ =\n    '__closure_events_fn_' + ((Math.random() * 1e9) >>> 0);\n\n\n/**\n * @param {Object|Function} listener The listener function or an\n *     object that contains handleEvent method.\n * @return {!Function} Either the original function or a function that\n *     calls obj.handleEvent. If the same listener is passed to this\n *     function more than once, the same function is guaranteed to be\n *     returned.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.events.wrapListener = function(listener) {\n  'use strict';\n  goog.asserts.assert(listener, 'Listener can not be null.');\n\n  if (typeof listener === 'function') {\n    return listener;\n  }\n\n  goog.asserts.assert(\n      listener.handleEvent, 'An object listener must have handleEvent method.');\n  if (!listener[goog.events.LISTENER_WRAPPER_PROP_]) {\n    listener[goog.events.LISTENER_WRAPPER_PROP_] = function(e) {\n      'use strict';\n      return /** @type {?} */ (listener).handleEvent(e);\n    };\n  }\n  return listener[goog.events.LISTENER_WRAPPER_PROP_];\n};\n\n\n// Register the browser event handler as an entry point, so that\n// it can be monitored for exception handling, etc.\ngoog.debug.entryPointRegistry.register(\n    /**\n     * @param {function(!Function): !Function} transformer The transforming\n     *     function.\n     */\n    function(transformer) {\n      'use strict';\n      goog.events.handleBrowserEvent_ =\n          transformer(goog.events.handleBrowserEvent_);\n    });\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview A disposable implementation of a custom\n * listenable/event target. See also: documentation for\n * `goog.events.Listenable`.\n *\n * @see goog.events.Listenable\n */\n\ngoog.provide('goog.events.EventTarget');\n\ngoog.require('goog.Disposable');\ngoog.require('goog.asserts');\ngoog.require('goog.events');\ngoog.require('goog.events.Event');\ngoog.require('goog.events.Listenable');\ngoog.require('goog.events.ListenerMap');\ngoog.require('goog.object');\ngoog.requireType('goog.events.EventId');\ngoog.requireType('goog.events.EventLike');\ngoog.requireType('goog.events.ListenableKey');\n\n\n\n/**\n * An implementation of `goog.events.Listenable` with full W3C\n * EventTarget-like support (capture/bubble mechanism, stopping event\n * propagation, preventing default actions).\n *\n * You may subclass this class to turn your class into a Listenable.\n *\n * Unless propagation is stopped, an event dispatched by an\n * EventTarget will bubble to the parent returned by\n * `getParentEventTarget`. To set the parent, call\n * `setParentEventTarget`. Subclasses that don't support\n * changing the parent can override the setter to throw an error.\n *\n * Example usage:\n * <pre>\n *   var source = new goog.events.EventTarget();\n *   function handleEvent(e) {\n *     alert('Type: ' + e.type + '; Target: ' + e.target);\n *   }\n *   source.listen('foo', handleEvent);\n *   // Or: goog.events.listen(source, 'foo', handleEvent);\n *   ...\n *   source.dispatchEvent('foo');  // will call handleEvent\n *   ...\n *   source.unlisten('foo', handleEvent);\n *   // Or: goog.events.unlisten(source, 'foo', handleEvent);\n * </pre>\n *\n * @constructor\n * @extends {goog.Disposable}\n * @implements {goog.events.Listenable}\n */\ngoog.events.EventTarget = function() {\n  'use strict';\n  goog.Disposable.call(this);\n\n  /**\n   * Maps of event type to an array of listeners.\n   * @private {!goog.events.ListenerMap}\n   */\n  this.eventTargetListeners_ = new goog.events.ListenerMap(this);\n\n  /**\n   * The object to use for event.target. Useful when mixing in an\n   * EventTarget to another object.\n   * @private {!Object}\n   */\n  this.actualEventTarget_ = this;\n\n  /**\n   * Parent event target, used during event bubbling.\n   *\n   * TODO(chrishenry): Change this to goog.events.Listenable. This\n   * currently breaks people who expect getParentEventTarget to return\n   * goog.events.EventTarget.\n   *\n   * @private {?goog.events.EventTarget}\n   */\n  this.parentEventTarget_ = null;\n};\ngoog.inherits(goog.events.EventTarget, goog.Disposable);\ngoog.events.Listenable.addImplementation(goog.events.EventTarget);\n\n\n/**\n * An artificial cap on the number of ancestors you can have. This is mainly\n * for loop detection.\n * @const {number}\n * @private\n */\ngoog.events.EventTarget.MAX_ANCESTORS_ = 1000;\n\n\n/**\n * Returns the parent of this event target to use for bubbling.\n *\n * @return {goog.events.EventTarget} The parent EventTarget or null if\n *     there is no parent.\n * @override\n */\ngoog.events.EventTarget.prototype.getParentEventTarget = function() {\n  'use strict';\n  return this.parentEventTarget_;\n};\n\n\n/**\n * Sets the parent of this event target to use for capture/bubble\n * mechanism.\n * @param {goog.events.EventTarget} parent Parent listenable (null if none).\n */\ngoog.events.EventTarget.prototype.setParentEventTarget = function(parent) {\n  'use strict';\n  this.parentEventTarget_ = parent;\n};\n\n\n/**\n * Adds an event listener to the event target. The same handler can only be\n * added once per the type. Even if you add the same handler multiple times\n * using the same type then it will only be called once when the event is\n * dispatched.\n *\n * @param {string|!goog.events.EventId} type The type of the event to listen for\n * @param {function(?):?|{handleEvent:function(?):?}|null} handler The function\n *     to handle the event. The handler can also be an object that implements\n *     the handleEvent method which takes the event object as argument.\n * @param {boolean=} opt_capture In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase\n *     of the event.\n * @param {Object=} opt_handlerScope Object in whose scope to call\n *     the listener.\n * @deprecated Use `goog.events.EventTarget.prototype.listen` instead, when\n *     possible. Otherwise, use `goog.events.listen` if you are passing Object\n *     (instead of Function) as handler.\n */\ngoog.events.EventTarget.prototype.addEventListener = function(\n    type, handler, opt_capture, opt_handlerScope) {\n  'use strict';\n  goog.events.listen(this, type, handler, opt_capture, opt_handlerScope);\n};\n\n\n/**\n * Removes an event listener from the event target. The handler must be the\n * same object as the one added. If the handler has not been added then\n * nothing is done.\n *\n * @param {string|!goog.events.EventId} type The type of the event to listen for\n * @param {function(?):?|{handleEvent:function(?):?}|null} handler The function\n *     to handle the event. The handler can also be an object that implements\n *     the handleEvent method which takes the event object as argument.\n * @param {boolean=} opt_capture In DOM-compliant browsers, this determines\n *     whether the listener is fired during the capture or bubble phase\n *     of the event.\n * @param {Object=} opt_handlerScope Object in whose scope to call\n *     the listener.\n * @deprecated Use `#unlisten` instead, when possible. Otherwise, use\n *     `goog.events.unlisten` if you are passing Object\n *     (instead of Function) as handler.\n */\ngoog.events.EventTarget.prototype.removeEventListener = function(\n    type, handler, opt_capture, opt_handlerScope) {\n  'use strict';\n  goog.events.unlisten(this, type, handler, opt_capture, opt_handlerScope);\n};\n\n\n/**\n * @param {?goog.events.EventLike} e Event object.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the listeners returns false) this will also return false.\n * @override\n */\ngoog.events.EventTarget.prototype.dispatchEvent = function(e) {\n  'use strict';\n  this.assertInitialized_();\n\n  let ancestorsTree;\n  let ancestor = this.getParentEventTarget();\n  if (ancestor) {\n    ancestorsTree = [];\n    let ancestorCount = 1;\n    for (; ancestor; ancestor = ancestor.getParentEventTarget()) {\n      ancestorsTree.push(ancestor);\n      goog.asserts.assert(\n          (++ancestorCount < goog.events.EventTarget.MAX_ANCESTORS_),\n          'infinite loop');\n    }\n  }\n\n  return goog.events.EventTarget.dispatchEventInternal_(\n      this.actualEventTarget_, e, ancestorsTree);\n};\n\n\n/**\n * Removes listeners from this object.  Classes that extend EventTarget may\n * need to override this method in order to remove references to DOM Elements\n * and additional listeners.\n * @override\n * @protected\n */\ngoog.events.EventTarget.prototype.disposeInternal = function() {\n  'use strict';\n  goog.events.EventTarget.superClass_.disposeInternal.call(this);\n\n  this.removeAllListeners();\n  this.parentEventTarget_ = null;\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.listen = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  this.assertInitialized_();\n  return this.eventTargetListeners_.add(\n      String(type), listener, false /* callOnce */, opt_useCapture,\n      opt_listenerScope);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {!goog.events.ListenableKey} Unique key for the listener.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.listenOnce = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  return this.eventTargetListeners_.add(\n      String(type), listener, true /* callOnce */, opt_useCapture,\n      opt_listenerScope);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The event type id.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener Callback\n *     method.\n * @param {boolean=} opt_useCapture Whether to fire in capture phase\n *     (defaults to false).\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call\n *     the listener.\n * @return {boolean} Whether any listener was removed.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.unlisten = function(\n    type, listener, opt_useCapture, opt_listenerScope) {\n  'use strict';\n  return this.eventTargetListeners_.remove(\n      String(type), listener, opt_useCapture, opt_listenerScope);\n};\n\n\n/**\n * @param {!goog.events.ListenableKey} key The key returned by\n *     listen() or listenOnce().\n * @return {boolean} Whether any listener was removed.\n * @override\n */\ngoog.events.EventTarget.prototype.unlistenByKey = function(key) {\n  'use strict';\n  return this.eventTargetListeners_.removeByKey(key);\n};\n\n\n/**\n * @param {string|!goog.events.EventId=} opt_type Type of event to remove,\n *     default is to remove all types.\n * @return {number} Number of listeners removed.\n * @override\n */\ngoog.events.EventTarget.prototype.removeAllListeners = function(opt_type) {\n  'use strict';\n  // TODO(chrishenry): Previously, removeAllListeners can be called on\n  // uninitialized EventTarget, so we preserve that behavior. We\n  // should remove this when usages that rely on that fact are purged.\n  if (!this.eventTargetListeners_) {\n    return 0;\n  }\n  return this.eventTargetListeners_.removeAll(opt_type);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The type of the\n *     listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @param {EVENTOBJ} eventObject The event object to fire.\n * @return {boolean} Whether all listeners succeeded without\n *     attempting to prevent default behavior. If any listener returns\n *     false or called goog.events.Event#preventDefault, this returns\n *     false.\n * @template EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.fireListeners = function(\n    type, capture, eventObject) {\n  'use strict';\n  // TODO(chrishenry): Original code avoids array creation when there\n  // is no listener, so we do the same. If this optimization turns\n  // out to be not required, we can replace this with\n  // getListeners(type, capture) instead, which is simpler.\n  let listenerArray = this.eventTargetListeners_.listeners[String(type)];\n  if (!listenerArray) {\n    return true;\n  }\n  listenerArray = listenerArray.concat();\n\n  let rv = true;\n  for (let i = 0; i < listenerArray.length; ++i) {\n    const listener = listenerArray[i];\n    // We might not have a listener if the listener was removed.\n    if (listener && !listener.removed && listener.capture == capture) {\n      const listenerFn = listener.listener;\n      const listenerHandler = listener.handler || listener.src;\n\n      if (listener.callOnce) {\n        this.unlistenByKey(listener);\n      }\n      rv = listenerFn.call(listenerHandler, eventObject) !== false && rv;\n    }\n  }\n\n  return rv && !eventObject.defaultPrevented;\n};\n\n\n/**\n * @param {string|!goog.events.EventId} type The type of the listeners to fire.\n * @param {boolean} capture The capture mode of the listeners to fire.\n * @return {!Array<!goog.events.ListenableKey>} An array of registered\n *     listeners.\n * @template EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.getListeners = function(type, capture) {\n  'use strict';\n  return this.eventTargetListeners_.getListeners(String(type), capture);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>} type The name of the event\n *     without the 'on' prefix.\n * @param {function(this:SCOPE, EVENTOBJ):(boolean|undefined)} listener The\n *     listener function to get.\n * @param {boolean} capture Whether the listener is a capturing listener.\n * @param {SCOPE=} opt_listenerScope Object in whose scope to call the\n *     listener.\n * @return {?goog.events.ListenableKey} the found listener or null if not found.\n * @template SCOPE,EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.getListener = function(\n    type, listener, capture, opt_listenerScope) {\n  'use strict';\n  return this.eventTargetListeners_.getListener(\n      String(type), listener, capture, opt_listenerScope);\n};\n\n\n/**\n * @param {string|!goog.events.EventId<EVENTOBJ>=} opt_type Event type.\n * @param {boolean=} opt_capture Whether to check for capture or bubble\n *     listeners.\n * @return {boolean} Whether there is any active listeners matching\n *     the requested type and/or capture phase.\n * @template EVENTOBJ\n * @override\n */\ngoog.events.EventTarget.prototype.hasListener = function(\n    opt_type, opt_capture) {\n  'use strict';\n  const id = (opt_type !== undefined) ? String(opt_type) : undefined;\n  return this.eventTargetListeners_.hasListener(id, opt_capture);\n};\n\n\n/**\n * Sets the target to be used for `event.target` when firing\n * event. Mainly used for testing. For example, see\n * `goog.testing.events.mixinListenable`.\n * @param {!Object} target The target.\n */\ngoog.events.EventTarget.prototype.setTargetForTesting = function(target) {\n  'use strict';\n  this.actualEventTarget_ = target;\n};\n\n\n/**\n * Asserts that the event target instance is initialized properly.\n * @private\n */\ngoog.events.EventTarget.prototype.assertInitialized_ = function() {\n  'use strict';\n  goog.asserts.assert(\n      this.eventTargetListeners_,\n      'Event target is not initialized. Did you call the superclass ' +\n          '(goog.events.EventTarget) constructor?');\n};\n\n\n/**\n * Dispatches the given event on the ancestorsTree.\n *\n * @param {!Object} target The target to dispatch on.\n * @param {goog.events.Event|Object|string} e The event object.\n * @param {Array<goog.events.Listenable>=} opt_ancestorsTree The ancestors\n *     tree of the target, in reverse order from the closest ancestor\n *     to the root event target. May be null if the target has no ancestor.\n * @return {boolean} If anyone called preventDefault on the event object (or\n *     if any of the listeners returns false) this will also return false.\n * @private\n */\ngoog.events.EventTarget.dispatchEventInternal_ = function(\n    target, e, opt_ancestorsTree) {\n  'use strict';\n  /** @suppress {missingProperties} */\n  const type = e.type || /** @type {string} */ (e);\n\n  // If accepting a string or object, create a custom event object so that\n  // preventDefault and stopPropagation work with the event.\n  if (typeof e === 'string') {\n    e = new goog.events.Event(e, target);\n  } else if (!(e instanceof goog.events.Event)) {\n    const oldEvent = e;\n    e = new goog.events.Event(type, target);\n    goog.object.extend(e, oldEvent);\n  } else {\n    e.target = e.target || target;\n  }\n\n  let rv = true;\n  let currentTarget;\n\n  // Executes all capture listeners on the ancestors, if any.\n  let i;\n  if (opt_ancestorsTree) {\n    for (i = opt_ancestorsTree.length - 1; !e.hasPropagationStopped() && i >= 0;\n         i--) {\n      currentTarget = e.currentTarget = opt_ancestorsTree[i];\n      rv = currentTarget.fireListeners(type, true, e) && rv;\n    }\n  }\n\n  // Executes capture and bubble listeners on the target.\n  if (!e.hasPropagationStopped()) {\n    currentTarget = /** @type {?} */ (e.currentTarget = target);\n    rv = currentTarget.fireListeners(type, true, e) && rv;\n    if (!e.hasPropagationStopped()) {\n      rv = currentTarget.fireListeners(type, false, e) && rv;\n    }\n  }\n\n  // Executes all bubble listeners on the ancestors, if any.\n  if (opt_ancestorsTree) {\n    for (i = 0; !e.hasPropagationStopped() && i < opt_ancestorsTree.length;\n         i++) {\n      currentTarget = e.currentTarget = opt_ancestorsTree[i];\n      rv = currentTarget.fireListeners(type, false, e) && rv;\n    }\n  }\n\n  return rv;\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview JSON utility functions.\n */\ngoog.module('goog.json');\ngoog.module.declareLegacyNamespace();\n\n/**\n * @define {boolean} If true, use the native JSON parsing API.\n * NOTE: The default `parse` implementation is able to handle\n * invalid JSON. JSPB used to produce invalid JSON which is not the case\n * anymore so this is safe to enable for parsing JSPB. Using native JSON is\n * faster and safer than the default implementation using `eval`.\n */\nconst USE_NATIVE_JSON = goog.define('goog.json.USE_NATIVE_JSON', false);\n\n/**\n * Tests if a string is an invalid JSON string. This only ensures that we are\n * not using any invalid characters\n * @param {string} s The string to test.\n * @return {boolean} True if the input is a valid JSON string.\n */\nfunction isValid(s) {\n  // All empty whitespace is not valid.\n  if (/^\\s*$/.test(s)) {\n    return false;\n  }\n\n  // This is taken from http://www.json.org/json2.js which is released to the\n  // public domain.\n  // Changes: We dissallow \\u2028 Line separator and \\u2029 Paragraph separator\n  // inside strings.  We also treat \\u2028 and \\u2029 as whitespace which they\n  // are in the RFC but IE and Safari does not match \\s to these so we need to\n  // include them in the reg exps in all places where whitespace is allowed.\n  // We allowed \\x7f inside strings because some tools don't escape it,\n  // e.g. http://www.json.org/java/org/json/JSONObject.java\n\n  // Parsing happens in three stages. In the first stage, we run the text\n  // against regular expressions that look for non-JSON patterns. We are\n  // especially concerned with '()' and 'new' because they can cause invocation,\n  // and '=' because it can cause mutation. But just to be safe, we want to\n  // reject all unexpected forms.\n\n  // We split the first stage into 4 regexp operations in order to work around\n  // crippling inefficiencies in IE's and Safari's regexp engines. First we\n  // replace all backslash pairs with '@' (a non-JSON character). Second, we\n  // replace all simple value tokens with ']' characters, but only when followed\n  // by a colon, comma, closing bracket or end of string. Third, we delete all\n  // open brackets that follow a colon or comma or that begin the text. Finally,\n  // we look to see that the remaining characters are only whitespace or ']' or\n  // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.\n\n  // Don't make these static since they have the global flag.\n  const backslashesRe = /\\\\[\"\\\\\\/bfnrtu]/g;\n  const simpleValuesRe =\n      /(?:\"[^\"\\\\\\n\\r\\u2028\\u2029\\x00-\\x08\\x0a-\\x1f]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)[\\s\\u2028\\u2029]*(?=:|,|]|}|$)/g;\n  const openBracketsRe = /(?:^|:|,)(?:[\\s\\u2028\\u2029]*\\[)+/g;\n  const remainderRe = /^[\\],:{}\\s\\u2028\\u2029]*$/;\n\n  return remainderRe.test(\n      s.replace(backslashesRe, '@')\n          .replace(simpleValuesRe, ']')\n          .replace(openBracketsRe, ''));\n}\n\n/**\n * Logs a parsing error in `JSON.parse` solvable by using `eval`.\n * @type {function(string, !Error)} The first parameter is the error message,\n *     the second is the exception thrown by `JSON.parse`.\n */\nlet errorLoggerInternal = () => {};\n\n/**\n * Sets an error logger to use if there's a recoverable parsing error.\n * @param {function(string, !Error)} errorLogger The first parameter is the\n *     error message, the second is the exception thrown by `JSON.parse`.\n */\nfunction setErrorLogger(errorLogger) {\n  errorLoggerInternal = errorLogger;\n}\n\n/**\n * Parses a JSON string and returns the result. This throws an exception if\n * the string is an invalid JSON string.\n *\n * Note that this is very slow on large strings. Use JSON.parse if possible.\n *\n * @param {*} s The JSON string to parse.\n * @throws Error if s is invalid JSON.\n * @return {Object} The object generated from the JSON string, or null.\n * @deprecated Use JSON.parse.\n */\nconst parse = USE_NATIVE_JSON ?\n    /** @type {function(*):Object} */ (goog.global['JSON']['parse']) :\n    function(s) {\n      let error;\n      try {\n        return goog.global['JSON']['parse'](s);\n      } catch (ex) {\n        error = ex;\n      }\n      const o = String(s);\n      if (isValid(o)) {\n        try {\n          const result = /** @type {?Object} */ (eval('(' + o + ')'));\n          if (error) {\n            errorLoggerInternal('Invalid JSON: ' + o, error);\n          }\n          return result;\n        } catch (ex) {\n        }\n      }\n      throw new Error('Invalid JSON string: ' + o);\n    };\n\n/**\n * JSON replacer, as defined in Section 15.12.3 of the ES5 spec.\n * @see http://ecma-international.org/ecma-262/5.1/#sec-15.12.3\n *\n * TODO(nicksantos): Array should also be a valid replacer.\n *\n * @typedef {function(this:Object, string, *): *}\n */\nlet Replacer;\n\n/**\n * JSON reviver, as defined in Section 15.12.2 of the ES5 spec.\n * @see http://ecma-international.org/ecma-262/5.1/#sec-15.12.3\n *\n * @typedef {function(this:Object, string, *): *}\n */\nlet Reviver;\n\n/**\n * Serializes an object or a value to a JSON string.\n *\n * @param {*} object The object to serialize.\n * @param {?goog.json.Replacer=} opt_replacer A replacer function\n *     called for each (key, value) pair that determines how the value\n *     should be serialized. By defult, this just returns the value\n *     and allows default serialization to kick in.\n * @throws Error if there are loops in the object graph.\n * @return {string} A JSON string representation of the input.\n */\nconst serialize = USE_NATIVE_JSON ?\n    /** @type {function(*, ?goog.json.Replacer=):string} */\n    (goog.global['JSON']['stringify']) :\n    function(object, opt_replacer) {\n      // NOTE(nicksantos): Currently, we never use JSON.stringify.\n      //\n      // The last time I evaluated this, JSON.stringify had subtle bugs and\n      // behavior differences on all browsers, and the performance win was not\n      // large enough to justify all the issues. This may change in the future\n      // as browser implementations get better.\n      //\n      // assertSerialize in json_test contains if branches for the cases\n      // that fail.\n      return new Serializer(opt_replacer).serialize(object);\n    };\n\n/**\n * Class that is used to serialize JSON objects to a string.\n * @param {?goog.json.Replacer=} opt_replacer Replacer.\n * @constructor\n */\nfunction Serializer(opt_replacer) {\n  /**\n   * @type {goog.json.Replacer|null|undefined}\n   * @private\n   */\n  this.replacer_ = opt_replacer;\n}\n\n/**\n * Serializes an object or a value to a JSON string.\n *\n * @param {*} object The object to serialize.\n * @throws Error if there are loops in the object graph.\n * @return {string} A JSON string representation of the input.\n */\nSerializer.prototype.serialize = function(object) {\n  const sb = [];\n  this.serializeInternal(object, sb);\n  return sb.join('');\n};\n\n/**\n * Serializes a generic value to a JSON string\n * @protected\n * @param {*} object The object to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n * @throws Error if there are loops in the object graph.\n */\nSerializer.prototype.serializeInternal = function(object, sb) {\n  if (object == null) {\n    // undefined == null so this branch covers undefined as well as null\n    sb.push('null');\n    return;\n  }\n\n  if (typeof object == 'object') {\n    if (Array.isArray(object)) {\n      this.serializeArray(object, sb);\n      return;\n    } else if (\n        object instanceof String || object instanceof Number ||\n        object instanceof Boolean) {\n      object = object.valueOf();\n      // Fall through to switch below.\n    } else {\n      this.serializeObject_(/** @type {!Object} */ (object), sb);\n      return;\n    }\n  }\n\n  switch (typeof object) {\n    case 'string':\n      this.serializeString_(object, sb);\n      break;\n    case 'number':\n      this.serializeNumber_(object, sb);\n      break;\n    case 'boolean':\n      sb.push(String(object));\n      break;\n    case 'function':\n      sb.push('null');\n      break;\n    default:\n      throw new Error('Unknown type: ' + typeof object);\n  }\n};\n\n/**\n * Character mappings used internally for goog.string.quote\n * @private\n * @type {!Object}\n */\nSerializer.charToJsonCharCache_ = {\n  '\\\"': '\\\\\"',\n  '\\\\': '\\\\\\\\',\n  '/': '\\\\/',\n  '\\b': '\\\\b',\n  '\\f': '\\\\f',\n  '\\n': '\\\\n',\n  '\\r': '\\\\r',\n  '\\t': '\\\\t',\n\n  '\\x0B': '\\\\u000b'  // '\\v' is not supported in JScript\n};\n\n/**\n * Regular expression used to match characters that need to be replaced.\n * The S60 browser has a bug where unicode characters are not matched by\n * regular expressions. The condition below detects such behaviour and\n * adjusts the regular expression accordingly.\n * @private\n * @type {!RegExp}\n */\nSerializer.charsToReplace_ = /\\uffff/.test('\\uffff') ?\n    /[\\\\\\\"\\x00-\\x1f\\x7f-\\uffff]/g :\n    /[\\\\\\\"\\x00-\\x1f\\x7f-\\xff]/g;\n\n/**\n * Serializes a string to a JSON string\n * @private\n * @param {string} s The string to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n */\nSerializer.prototype.serializeString_ = function(s, sb) {\n  // The official JSON implementation does not work with international\n  // characters.\n  sb.push('\"', s.replace(Serializer.charsToReplace_, function(c) {\n    // caching the result improves performance by a factor 2-3\n    let rv = Serializer.charToJsonCharCache_[c];\n    if (!rv) {\n      rv = '\\\\u' + (c.charCodeAt(0) | 0x10000).toString(16).slice(1);\n      Serializer.charToJsonCharCache_[c] = rv;\n    }\n    return rv;\n  }), '\"');\n};\n\n/**\n * Serializes a number to a JSON string\n * @private\n * @param {number} n The number to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n */\nSerializer.prototype.serializeNumber_ = function(n, sb) {\n  sb.push(isFinite(n) && !isNaN(n) ? String(n) : 'null');\n};\n\n/**\n * Serializes an array to a JSON string\n * @param {Array<string>} arr The array to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n * @protected\n */\nSerializer.prototype.serializeArray = function(arr, sb) {\n  const l = arr.length;\n  sb.push('[');\n  let sep = '';\n  for (let i = 0; i < l; i++) {\n    sb.push(sep);\n\n    const value = arr[i];\n    this.serializeInternal(\n        this.replacer_ ? this.replacer_.call(arr, String(i), value) : value,\n        sb);\n\n    sep = ',';\n  }\n  sb.push(']');\n};\n\n/**\n * Serializes an object to a JSON string\n * @private\n * @param {!Object} obj The object to serialize.\n * @param {Array<string>} sb Array used as a string builder.\n */\nSerializer.prototype.serializeObject_ = function(obj, sb) {\n  sb.push('{');\n  let sep = '';\n  for (const key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) {\n      const value = obj[key];\n      // Skip functions.\n      if (typeof value != 'function') {\n        sb.push(sep);\n        this.serializeString_(key, sb);\n        sb.push(':');\n\n        this.serializeInternal(\n            this.replacer_ ? this.replacer_.call(obj, key, value) : value, sb);\n\n        sep = ',';\n      }\n    }\n  }\n  sb.push('}');\n};\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n\nexports.Replacer = Replacer;\nexports.Reviver = Reviver;\nexports.Serializer = Serializer;\nexports.USE_NATIVE_JSON = USE_NATIVE_JSON;\nexports.isValid = isValid;\nexports.parse = parse;\nexports.serialize = serialize;\nexports.setErrorLogger = setErrorLogger;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Simple utilities for dealing with URI strings.\n *\n * This package is deprecated in favour of the Closure URL package (goog.url)\n * when manipulating URIs for use by a browser. This package uses regular\n * expressions to parse a potential URI which can fall out of sync with how a\n * browser will actually interpret the URI. See\n * `goog.uri.utils.setUrlPackageSupportLoggingHandler` for one way to identify\n * URIs that should instead be parsed using the URL package.\n *\n * This is intended to be a lightweight alternative to constructing goog.Uri\n * objects.  Whereas goog.Uri adds several kilobytes to the binary regardless\n * of how much of its functionality you use, this is designed to be a set of\n * mostly-independent utilities so that the compiler includes only what is\n * necessary for the task.  Estimated savings of porting is 5k pre-gzip and\n * 1.5k post-gzip.  To ensure the savings remain, future developers should\n * avoid adding new functionality to existing functions, but instead create\n * new ones and factor out shared code.\n *\n * Many of these utilities have limited functionality, tailored to common\n * cases.  The query parameter utilities assume that the parameter keys are\n * already encoded, since most keys are compile-time alphanumeric strings.  The\n * query parameter mutation utilities also do not tolerate fragment identifiers.\n *\n * By design, these functions can be slower than goog.Uri equivalents.\n * Repeated calls to some of functions may be quadratic in behavior for IE,\n * although the effect is somewhat limited given the 2kb limit.\n *\n * One advantage of the limited functionality here is that this approach is\n * less sensitive to differences in URI encodings than goog.Uri, since these\n * functions operate on strings directly, rather than decoding them and\n * then re-encoding.\n *\n * Uses features of RFC 3986 for parsing/formatting URIs:\n *   http://www.ietf.org/rfc/rfc3986.txt\n */\n\ngoog.module('goog.uri.utils');\ngoog.module.declareLegacyNamespace();\n\nconst asserts = goog.require('goog.asserts');\nconst googString = goog.require('goog.string');\n\n/**\n * Character codes inlined to avoid object allocations due to charCode.\n * @enum {number}\n */\nconst CharCode = {\n  AMPERSAND: 38,\n  EQUAL: 61,\n  HASH: 35,\n  QUESTION: 63\n};\n\n/**\n * Builds a URI string from already-encoded parts.\n *\n * No encoding is performed.  Any component may be omitted as either null or\n * undefined.\n *\n * @param {?string=} opt_scheme The scheme such as 'http'.\n * @param {?string=} opt_userInfo The user name before the '@'.\n * @param {?string=} opt_domain The domain such as 'www.google.com', already\n *     URI-encoded.\n * @param {(string|number|null)=} opt_port The port number.\n * @param {?string=} opt_path The path, already URI-encoded.  If it is not\n *     empty, it must begin with a slash.\n * @param {?string=} opt_queryData The URI-encoded query data.\n * @param {?string=} opt_fragment The URI-encoded fragment identifier.\n * @return {string} The fully combined URI.\n */\nfunction buildFromEncodedParts(\n    opt_scheme, opt_userInfo, opt_domain, opt_port, opt_path, opt_queryData,\n    opt_fragment) {\n  let out = '';\n\n  if (opt_scheme) {\n    out += opt_scheme + ':';\n  }\n\n  if (opt_domain) {\n    out += '//';\n\n    if (opt_userInfo) {\n      out += opt_userInfo + '@';\n    }\n\n    out += opt_domain;\n\n    if (opt_port) {\n      out += ':' + opt_port;\n    }\n  }\n\n  if (opt_path) {\n    out += opt_path;\n  }\n\n  if (opt_queryData) {\n    out += '?' + opt_queryData;\n  }\n\n  if (opt_fragment) {\n    out += '#' + opt_fragment;\n  }\n\n  return out;\n}\n\n/**\n * A regular expression for breaking a URI into its component parts.\n * {@link http://www.ietf.org/rfc/rfc3986.txt} says in Appendix B\n * As the \"first-match-wins\" algorithm is identical to the \"greedy\"\n * disambiguation method used by POSIX regular expressions, it is natural and\n * commonplace to use a regular expression for parsing the potential five\n * components of a URI reference.\n * The following line is the regular expression for breaking-down a\n * well-formed URI reference into its components.\n * <pre>\n * ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?\n *  12            3  4          5       6  7        8 9\n * </pre>\n * The numbers in the second line above are only to assist readability; they\n * indicate the reference points for each subexpression (i.e., each paired\n * parenthesis). We refer to the value matched for subexpression <n> as $<n>.\n * For example, matching the above expression to\n * <pre>\n *     http://www.ics.uci.edu/pub/ietf/uri/#Related\n * </pre>\n * results in the following subexpression matches:\n * <pre>\n *    $1 = http:\n *    $2 = http\n *    $3 = //www.ics.uci.edu\n *    $4 = www.ics.uci.edu\n *    $5 = /pub/ietf/uri/\n *    $6 = <undefined>\n *    $7 = <undefined>\n *    $8 = #Related\n *    $9 = Related\n * </pre>\n * where <undefined> indicates that the component is not present, as is the\n * case for the query component in the above example. Therefore, we can\n * determine the value of the five components as\n * <pre>\n *    scheme    = $2\n *    authority = $4\n *    path      = $5\n *    query     = $7\n *    fragment  = $9\n * </pre>\n * The regular expression has been modified slightly to expose the\n * userInfo, domain, and port separately from the authority.\n * The modified version yields\n * <pre>\n *    $1 = http              scheme\n *    $2 = <undefined>       userInfo -\\\n *    $3 = www.ics.uci.edu   domain     | authority\n *    $4 = <undefined>       port     -/\n *    $5 = /pub/ietf/uri/    path\n *    $6 = <undefined>       query without ?\n *    $7 = Related           fragment without #\n * </pre>\n * TODO(jameswr): separate out the authority terminating characters once this\n * file is moved to ES6.\n * @type {!RegExp}\n */\nconst splitRe = new RegExp(\n    '^' +  // Anchor against the entire string.\n    '(?:' +\n    '([^:/?#.]+)' +  // scheme - ignore special characters\n                     // used by other URL parts such as :,\n                     // ?, /, #, and .\n    ':)?' +\n    '(?://' +\n    '(?:([^\\\\\\\\/?#]*)@)?' +  // userInfo\n    '([^\\\\\\\\/?#]*?)' +       // domain\n    '(?::([0-9]+))?' +       // port\n    '(?=[\\\\\\\\/?#]|$)' +      // authority-terminating character.\n    ')?' +\n    '([^?#]+)?' +          // path\n    '(?:\\\\?([^#]*))?' +    // query\n    '(?:#([\\\\s\\\\S]*))?' +  // fragment. Can't use '.*' with 's' flag as Firefox\n                           // doesn't support the flag, and can't use an\n                           // \"everything set\" ([^]) as IE10 doesn't match any\n                           // characters with it.\n    '$');\n\n/**\n * The index of each URI component in the return value of split.\n * @enum {number}\n */\nconst ComponentIndex = {\n  SCHEME: 1,\n  USER_INFO: 2,\n  DOMAIN: 3,\n  PORT: 4,\n  PATH: 5,\n  QUERY_DATA: 6,\n  FRAGMENT: 7\n};\n\n/** @type {?function(string)} */\nlet urlPackageSupportLoggingHandler = null;\n\n/**\n * @param {?function(string)} handler The handler function to call when a URI\n *     with a protocol that is better supported by the Closure URL package is\n *     detected.\n */\nfunction setUrlPackageSupportLoggingHandler(handler) {\n  urlPackageSupportLoggingHandler = handler;\n}\n\n/**\n * Splits a URI into its component parts.\n *\n * Each component can be accessed via the component indices; for example:\n * <pre>\n * split(someStr)[ComponentIndex.QUERY_DATA];\n * </pre>\n *\n * @param {string} uri The URI string to examine.\n * @return {!Array<string|undefined>} Each component still URI-encoded.\n *     Each component that is present will contain the encoded value, whereas\n *     components that are not present will be undefined or empty, depending\n *     on the browser's regular expression implementation.  Never null, since\n *     arbitrary strings may still look like path names.\n */\nfunction split(uri) {\n  // See @return comment -- never null.\n  const result = /** @type {!Array<string|undefined>} */ (uri.match(splitRe));\n  if (urlPackageSupportLoggingHandler &&\n      ['http', 'https', 'ws', 'wss',\n       'ftp'].indexOf(result[ComponentIndex.SCHEME]) >= 0) {\n    urlPackageSupportLoggingHandler(uri);\n  }\n  return result;\n}\n\n/**\n * @param {?string} uri A possibly null string.\n * @param {boolean=} opt_preserveReserved If true, percent-encoding of RFC-3986\n *     reserved characters will not be removed.\n * @return {?string} The string URI-decoded, or null if uri is null.\n */\nfunction decodeIfPossible(uri, opt_preserveReserved) {\n  if (!uri) {\n    return uri;\n  }\n\n  return opt_preserveReserved ? decodeURI(uri) : decodeURIComponent(uri);\n}\n\n/**\n * Gets a URI component by index.\n * It is preferred to use the getPathEncoded() variety of functions ahead,\n * since they are more readable.\n * @param {ComponentIndex} componentIndex The component index.\n * @param {string} uri The URI to examine.\n * @return {?string} The still-encoded component, or null if the component\n *     is not present.\n */\nfunction getComponentByIndex(componentIndex, uri) {\n  // Convert undefined, null, and empty string into null.\n  return split(uri)[componentIndex] || null;\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The protocol or scheme, or null if none.  Does not\n *     include trailing colons or slashes.\n */\nfunction getScheme(uri) {\n  return getComponentByIndex(ComponentIndex.SCHEME, uri);\n}\n\n/**\n * Gets the effective scheme for the URL.  If the URL is relative then the\n * scheme is derived from the page's location.\n * @param {string} uri The URI to examine.\n * @return {string} The protocol or scheme, always lower case.\n */\nfunction getEffectiveScheme(uri) {\n  let scheme = getScheme(uri);\n  if (!scheme && goog.global.self && goog.global.self.location) {\n    const protocol = goog.global.self.location.protocol;\n    scheme = protocol.slice(0, -1);\n  }\n  // NOTE: When called from a web worker in Firefox 3.5, location may be null.\n  // All other browsers with web workers support self.location from the worker.\n  return scheme ? scheme.toLowerCase() : '';\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The user name still encoded, or null if none.\n */\nfunction getUserInfoEncoded(uri) {\n  return getComponentByIndex(ComponentIndex.USER_INFO, uri);\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded user info, or null if none.\n */\nfunction getUserInfo(uri) {\n  return decodeIfPossible(getUserInfoEncoded(uri));\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The domain name still encoded, or null if none.\n */\nfunction getDomainEncoded(uri) {\n  return getComponentByIndex(ComponentIndex.DOMAIN, uri);\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded domain, or null if none.\n */\nfunction getDomain(uri) {\n  return decodeIfPossible(\n      getDomainEncoded(uri), true /* opt_preserveReserved */);\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?number} The port number, or null if none.\n */\nfunction getPort(uri) {\n  // Coerce to a number.  If the result of getComponentByIndex_ is null or\n  // non-numeric, the number coersion yields NaN.  This will then return\n  // null for all non-numeric cases (though also zero, which isn't a relevant\n  // port number).\n  return Number(getComponentByIndex(ComponentIndex.PORT, uri)) || null;\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The path still encoded, or null if none. Includes the\n *     leading slash, if any.\n */\nfunction getPathEncoded(uri) {\n  return getComponentByIndex(ComponentIndex.PATH, uri);\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded path, or null if none.  Includes the leading\n *     slash, if any.\n */\nfunction getPath(uri) {\n  return decodeIfPossible(getPathEncoded(uri), true /* opt_preserveReserved */);\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The query data still encoded, or null if none.  Does not\n *     include the question mark itself.\n */\nfunction getQueryData(uri) {\n  return getComponentByIndex(ComponentIndex.QUERY_DATA, uri);\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The fragment identifier, or null if none.  Does not\n *     include the hash mark itself.\n */\nfunction getFragmentEncoded(uri) {\n  // The hash mark may not appear in any other part of the URL.\n  const hashIndex = uri.indexOf('#');\n  return hashIndex < 0 ? null : uri.slice(hashIndex + 1);\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @param {?string} fragment The encoded fragment identifier, or null if none.\n *     Does not include the hash mark itself.\n * @return {string} The URI with the fragment set.\n */\nfunction setFragmentEncoded(uri, fragment) {\n  return removeFragment(uri) + (fragment ? '#' + fragment : '');\n}\n\n/**\n * @param {string} uri The URI to examine.\n * @return {?string} The decoded fragment identifier, or null if none.  Does\n *     not include the hash mark.\n */\nfunction getFragment(uri) {\n  return decodeIfPossible(getFragmentEncoded(uri));\n}\n\n/**\n * Extracts everything up to the port of the URI.\n * @param {string} uri The URI string.\n * @return {string} Everything up to and including the port.\n */\nfunction getHost(uri) {\n  const pieces = split(uri);\n  return buildFromEncodedParts(\n      pieces[ComponentIndex.SCHEME], pieces[ComponentIndex.USER_INFO],\n      pieces[ComponentIndex.DOMAIN], pieces[ComponentIndex.PORT]);\n}\n\n/**\n * Returns the origin for a given URL.\n * @param {string} uri The URI string.\n * @return {string} Everything up to and including the port.\n */\nfunction getOrigin(uri) {\n  const pieces = split(uri);\n  return buildFromEncodedParts(\n      pieces[ComponentIndex.SCHEME], null /* opt_userInfo */,\n      pieces[ComponentIndex.DOMAIN], pieces[ComponentIndex.PORT]);\n}\n\n/**\n * Extracts the path of the URL and everything after.\n * @param {string} uri The URI string.\n * @return {string} The URI, starting at the path and including the query\n *     parameters and fragment identifier.\n */\nfunction getPathAndAfter(uri) {\n  const pieces = split(uri);\n  return buildFromEncodedParts(\n      null, null, null, null, pieces[ComponentIndex.PATH],\n      pieces[ComponentIndex.QUERY_DATA], pieces[ComponentIndex.FRAGMENT]);\n}\n\n/**\n * Gets the URI with the fragment identifier removed.\n * @param {string} uri The URI to examine.\n * @return {string} Everything preceding the hash mark.\n */\nfunction removeFragment(uri) {\n  // The hash mark may not appear in any other part of the URL.\n  const hashIndex = uri.indexOf('#');\n  return hashIndex < 0 ? uri : uri.slice(0, hashIndex);\n}\n\n/**\n * Ensures that two URI's have the exact same domain, scheme, and port.\n *\n * Unlike the version in goog.Uri, this checks protocol, and therefore is\n * suitable for checking against the browser's same-origin policy.\n *\n * @param {string} uri1 The first URI.\n * @param {string} uri2 The second URI.\n * @return {boolean} Whether they have the same scheme, domain and port.\n */\nfunction haveSameDomain(uri1, uri2) {\n  const pieces1 = split(uri1);\n  const pieces2 = split(uri2);\n  return pieces1[ComponentIndex.DOMAIN] == pieces2[ComponentIndex.DOMAIN] &&\n      pieces1[ComponentIndex.SCHEME] == pieces2[ComponentIndex.SCHEME] &&\n      pieces1[ComponentIndex.PORT] == pieces2[ComponentIndex.PORT];\n}\n\n/**\n * Asserts that there are no fragment or query identifiers, only in uncompiled\n * mode.\n * @param {string} uri The URI to examine.\n */\nfunction assertNoFragmentsOrQueries(uri) {\n  asserts.assert(\n      uri.indexOf('#') < 0 && uri.indexOf('?') < 0,\n      'goog.uri.utils: Fragment or query identifiers are not supported: [%s]',\n      uri);\n}\n\n/**\n * Supported query parameter values by the parameter serializing utilities.\n *\n * If a value is null or undefined, the key-value pair is skipped, as an easy\n * way to omit parameters conditionally.  Non-array parameters are converted\n * to a string and URI encoded.  Array values are expanded into multiple\n * &key=value pairs, with each element stringized and URI-encoded.\n *\n * @typedef {*}\n */\nlet QueryValue;\n\n/**\n * An array representing a set of query parameters with alternating keys\n * and values.\n *\n * Keys are assumed to be URI encoded already and live at even indices.  See\n * goog.uri.utils.QueryValue for details on how parameter values are encoded.\n *\n * Example:\n * <pre>\n * var data = [\n *   // Simple param: ?name=BobBarker\n *   'name', 'BobBarker',\n *   // Conditional param -- may be omitted entirely.\n *   'specialDietaryNeeds', hasDietaryNeeds() ? getDietaryNeeds() : null,\n *   // Multi-valued param: &house=LosAngeles&house=NewYork&house=null\n *   'house', ['LosAngeles', 'NewYork', null]\n * ];\n * </pre>\n *\n * @typedef {!Array<string|goog.uri.utils.QueryValue>}\n */\nlet QueryArray;\n\n/**\n * Parses encoded query parameters and calls callback function for every\n * parameter found in the string.\n *\n * Missing value of parameter (e.g. \u201c\u2026&key&\u2026\u201d) is treated as if the value was an\n * empty string.  Keys may be empty strings (e.g. \u201c\u2026&=value&\u2026\u201d) which also means\n * that \u201c\u2026&=&\u2026\u201d and \u201c\u2026&&\u2026\u201d will result in an empty key and value.\n *\n * @param {string} encodedQuery Encoded query string excluding question mark at\n *     the beginning.\n * @param {function(string, string)} callback Function called for every\n *     parameter found in query string.  The first argument (name) will not be\n *     urldecoded (so the function is consistent with buildQueryData), but the\n *     second will.  If the parameter has no value (i.e. \u201c=\u201d was not present)\n *     the second argument (value) will be an empty string.\n */\nfunction parseQueryData(encodedQuery, callback) {\n  if (!encodedQuery) {\n    return;\n  }\n  const pairs = encodedQuery.split('&');\n  for (let i = 0; i < pairs.length; i++) {\n    const indexOfEquals = pairs[i].indexOf('=');\n    let name = null;\n    let value = null;\n    if (indexOfEquals >= 0) {\n      name = pairs[i].substring(0, indexOfEquals);\n      value = pairs[i].substring(indexOfEquals + 1);\n    } else {\n      name = pairs[i];\n    }\n    callback(name, value ? googString.urlDecode(value) : '');\n  }\n}\n\n/**\n * Split the URI into 3 parts where the [1] is the queryData without a leading\n * '?'. For example, the URI http://foo.com/bar?a=b#abc returns\n * ['http://foo.com/bar','a=b','#abc'].\n * @param {string} uri The URI to parse.\n * @return {!Array<string>} An array representation of uri of length 3 where the\n *     middle value is the queryData without a leading '?'.\n */\nfunction splitQueryData(uri) {\n  // Find the query data and hash.\n  let hashIndex = uri.indexOf('#');\n  if (hashIndex < 0) {\n    hashIndex = uri.length;\n  }\n  let questionIndex = uri.indexOf('?');\n  let queryData;\n  if (questionIndex < 0 || questionIndex > hashIndex) {\n    questionIndex = hashIndex;\n    queryData = '';\n  } else {\n    queryData = uri.substring(questionIndex + 1, hashIndex);\n  }\n  return [uri.slice(0, questionIndex), queryData, uri.slice(hashIndex)];\n}\n\n/**\n * Join an array created by splitQueryData back into a URI.\n * @param {!Array<string>} parts A URI in the form generated by splitQueryData.\n * @return {string} The joined URI.\n */\nfunction joinQueryData(parts) {\n  return parts[0] + (parts[1] ? '?' + parts[1] : '') + parts[2];\n}\n\n/**\n * @param {string} queryData\n * @param {string} newData\n * @return {string}\n */\nfunction appendQueryData(queryData, newData) {\n  if (!newData) {\n    return queryData;\n  }\n  return queryData ? queryData + '&' + newData : newData;\n}\n\n/**\n * @param {string} uri\n * @param {string} queryData\n * @return {string}\n */\nfunction appendQueryDataToUri(uri, queryData) {\n  if (!queryData) {\n    return uri;\n  }\n  const parts = splitQueryData(uri);\n  parts[1] = appendQueryData(parts[1], queryData);\n  return joinQueryData(parts);\n}\n\n/**\n * Appends key=value pairs to an array, supporting multi-valued objects.\n * @param {*} key The key prefix.\n * @param {goog.uri.utils.QueryValue} value The value to serialize.\n * @param {!Array<string>} pairs The array to which the 'key=value' strings\n *     should be appended.\n */\nfunction appendKeyValuePairs(key, value, pairs) {\n  asserts.assertString(key);\n  if (Array.isArray(value)) {\n    // Convince the compiler it's an array.\n    asserts.assertArray(value);\n    for (let j = 0; j < value.length; j++) {\n      // Convert to string explicitly, to short circuit the null and array\n      // logic in this function -- this ensures that null and undefined get\n      // written as literal 'null' and 'undefined', and arrays don't get\n      // expanded out but instead encoded in the default way.\n      appendKeyValuePairs(key, String(value[j]), pairs);\n    }\n  } else if (value != null) {\n    // Skip a top-level null or undefined entirely.\n    pairs.push(\n        key +\n        // Check for empty string. Zero gets encoded into the url as literal\n        // strings.  For empty string, skip the equal sign, to be consistent\n        // with UriBuilder.java.\n        (value === '' ? '' : '=' + googString.urlEncode(value)));\n  }\n}\n\n/**\n * Builds a query data string from a sequence of alternating keys and values.\n * Currently generates \"&key&\" for empty args.\n *\n * @param {!IArrayLike<string|goog.uri.utils.QueryValue>} keysAndValues\n *     Alternating keys and values. See the QueryArray typedef.\n * @param {number=} opt_startIndex A start offset into the arary, defaults to 0.\n * @return {string} The encoded query string, in the form 'a=1&b=2'.\n */\nfunction buildQueryData(keysAndValues, opt_startIndex) {\n  asserts.assert(\n      Math.max(keysAndValues.length - (opt_startIndex || 0), 0) % 2 == 0,\n      'goog.uri.utils: Key/value lists must be even in length.');\n\n  const params = [];\n  for (let i = opt_startIndex || 0; i < keysAndValues.length; i += 2) {\n    const key = /** @type {string} */ (keysAndValues[i]);\n    appendKeyValuePairs(key, keysAndValues[i + 1], params);\n  }\n  return params.join('&');\n}\n\n/**\n * Builds a query data string from a map.\n * Currently generates \"&key&\" for empty args.\n *\n * @param {!Object<string, goog.uri.utils.QueryValue>} map An object where keys\n *     are URI-encoded parameter keys, and the values are arbitrary types\n *     or arrays. Keys with a null value are dropped.\n * @return {string} The encoded query string, in the form 'a=1&b=2'.\n */\nfunction buildQueryDataFromMap(map) {\n  const params = [];\n  for (const key in map) {\n    appendKeyValuePairs(key, map[key], params);\n  }\n  return params.join('&');\n}\n\n/**\n * Appends URI parameters to an existing URI.\n *\n * The variable arguments may contain alternating keys and values.  Keys are\n * assumed to be already URI encoded.  The values should not be URI-encoded,\n * and will instead be encoded by this function.\n * <pre>\n * appendParams('http://www.foo.com?existing=true',\n *     'key1', 'value1',\n *     'key2', 'value?willBeEncoded',\n *     'key3', ['valueA', 'valueB', 'valueC'],\n *     'key4', null);\n * result: 'http://www.foo.com?existing=true&' +\n *     'key1=value1&' +\n *     'key2=value%3FwillBeEncoded&' +\n *     'key3=valueA&key3=valueB&key3=valueC'\n * </pre>\n *\n * A single call to this function will not exhibit quadratic behavior in IE,\n * whereas multiple repeated calls may, although the effect is limited by\n * fact that URL's generally can't exceed 2kb.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {...(goog.uri.utils.QueryArray|goog.uri.utils.QueryValue)}\n * var_args\n *     An array or argument list conforming to goog.uri.utils.QueryArray.\n * @return {string} The URI with all query parameters added.\n */\nfunction appendParams(uri, var_args) {\n  const queryData = arguments.length == 2 ? buildQueryData(arguments[1], 0) :\n                                            buildQueryData(arguments, 1);\n  return appendQueryDataToUri(uri, queryData);\n}\n\n/**\n * Appends query parameters from a map.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {!Object<goog.uri.utils.QueryValue>} map An object where keys are\n *     URI-encoded parameter keys, and the values are arbitrary types or arrays.\n *     Keys with a null value are dropped.\n * @return {string} The new parameters.\n */\nfunction appendParamsFromMap(uri, map) {\n  const queryData = buildQueryDataFromMap(map);\n  return appendQueryDataToUri(uri, queryData);\n}\n\n/**\n * Appends a single URI parameter.\n *\n * Repeated calls to this can exhibit quadratic behavior in IE6 due to the\n * way string append works, though it should be limited given the 2kb limit.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {string} key The key, which must already be URI encoded.\n * @param {*=} opt_value The value, which will be stringized and encoded\n *     (assumed not already to be encoded).  If omitted, undefined, or null, the\n *     key will be added as a valueless parameter.\n * @return {string} The URI with the query parameter added.\n */\nfunction appendParam(uri, key, opt_value) {\n  const value =\n      (opt_value != null) ? '=' + googString.urlEncode(opt_value) : '';\n  return appendQueryDataToUri(uri, key + value);\n}\n\n/**\n * Finds the next instance of a query parameter with the specified name.\n * Does not instantiate any objects.\n * @param {string} uri The URI to search.  May contain a fragment identifier\n *     if opt_hashIndex is specified.\n * @param {number} startIndex The index to begin searching for the key at.  A\n *     match may be found even if this is one character after the ampersand.\n * @param {string} keyEncoded The URI-encoded key.\n * @param {number} hashOrEndIndex Index to stop looking at.  If a hash\n *     mark is present, it should be its index, otherwise it should be the\n *     length of the string.\n * @return {number} The position of the first character in the key's name,\n *     immediately after either a question mark or a dot.\n */\nfunction findParam(uri, startIndex, keyEncoded, hashOrEndIndex) {\n  let index = startIndex;\n  const keyLength = keyEncoded.length;\n\n  // Search for the key itself and post-filter for surronuding punctuation,\n  // rather than expensively building a regexp.\n  while ((index = uri.indexOf(keyEncoded, index)) >= 0 &&\n         index < hashOrEndIndex) {\n    const precedingChar = uri.charCodeAt(index - 1);\n    // Ensure that the preceding character is '&' or '?'.\n    if (precedingChar == CharCode.AMPERSAND ||\n        precedingChar == CharCode.QUESTION) {\n      // Ensure the following character is '&', '=', '#', or NaN\n      // (end of string).\n      const followingChar = uri.charCodeAt(index + keyLength);\n      if (!followingChar || followingChar == CharCode.EQUAL ||\n          followingChar == CharCode.AMPERSAND ||\n          followingChar == CharCode.HASH) {\n        return index;\n      }\n    }\n    index += keyLength + 1;\n  }\n\n  return -1;\n}\n\n/**\n * Regular expression for finding a hash mark or end of string.\n * @type {RegExp}\n */\nconst hashOrEndRe = /#|$/;\n\n/**\n * Determines if the URI contains a specific key.\n *\n * Performs no object instantiations.\n *\n * @param {string} uri The URI to process.  May contain a fragment\n *     identifier.\n * @param {string} keyEncoded The URI-encoded key.  Case-sensitive.\n * @return {boolean} Whether the key is present.\n */\nfunction hasParam(uri, keyEncoded) {\n  return findParam(uri, 0, keyEncoded, uri.search(hashOrEndRe)) >= 0;\n}\n\n/**\n * Gets the first value of a query parameter.\n * @param {string} uri The URI to process.  May contain a fragment.\n * @param {string} keyEncoded The URI-encoded key.  Case-sensitive.\n * @return {?string} The first value of the parameter (URI-decoded), or null\n *     if the parameter is not found.\n */\nfunction getParamValue(uri, keyEncoded) {\n  const hashOrEndIndex = uri.search(hashOrEndRe);\n  let foundIndex = findParam(uri, 0, keyEncoded, hashOrEndIndex);\n\n  if (foundIndex < 0) {\n    return null;\n  } else {\n    let endPosition = uri.indexOf('&', foundIndex);\n    if (endPosition < 0 || endPosition > hashOrEndIndex) {\n      endPosition = hashOrEndIndex;\n    }\n    // Progress forth to the end of the \"key=\" or \"key&\" substring.\n    foundIndex += keyEncoded.length + 1;\n    return googString.urlDecode(\n        uri.slice(foundIndex, endPosition !== -1 ? endPosition : 0));\n  }\n}\n\n/**\n * Gets all values of a query parameter.\n * @param {string} uri The URI to process.  May contain a fragment.\n * @param {string} keyEncoded The URI-encoded key.  Case-sensitive.\n * @return {!Array<string>} All URI-decoded values with the given key.\n *     If the key is not found, this will have length 0, but never be null.\n */\nfunction getParamValues(uri, keyEncoded) {\n  const hashOrEndIndex = uri.search(hashOrEndRe);\n  let position = 0;\n  let foundIndex;\n  const result = [];\n\n  while ((foundIndex = findParam(uri, position, keyEncoded, hashOrEndIndex)) >=\n         0) {\n    // Find where this parameter ends, either the '&' or the end of the\n    // query parameters.\n    position = uri.indexOf('&', foundIndex);\n    if (position < 0 || position > hashOrEndIndex) {\n      position = hashOrEndIndex;\n    }\n\n    // Progress forth to the end of the \"key=\" or \"key&\" substring.\n    foundIndex += keyEncoded.length + 1;\n    result.push(\n        googString.urlDecode(uri.slice(foundIndex, Math.max(position, 0))));\n  }\n\n  return result;\n}\n\n/**\n * Regexp to find trailing question marks and ampersands.\n * @type {RegExp}\n */\nconst trailingQueryPunctuationRe = /[?&]($|#)/;\n\n/**\n * Removes all instances of a query parameter.\n * @param {string} uri The URI to process.  Must not contain a fragment.\n * @param {string} keyEncoded The URI-encoded key.\n * @return {string} The URI with all instances of the parameter removed.\n */\nfunction removeParam(uri, keyEncoded) {\n  const hashOrEndIndex = uri.search(hashOrEndRe);\n  let position = 0;\n  let foundIndex;\n  const buffer = [];\n\n  // Look for a query parameter.\n  while ((foundIndex = findParam(uri, position, keyEncoded, hashOrEndIndex)) >=\n         0) {\n    // Get the portion of the query string up to, but not including, the ?\n    // or & starting the parameter.\n    buffer.push(uri.substring(position, foundIndex));\n    // Progress to immediately after the '&'.  If not found, go to the end.\n    // Avoid including the hash mark.\n    position = Math.min(\n        (uri.indexOf('&', foundIndex) + 1) || hashOrEndIndex, hashOrEndIndex);\n  }\n\n  // Append everything that is remaining.\n  buffer.push(uri.slice(position));\n\n  // Join the buffer, and remove trailing punctuation that remains.\n  return buffer.join('').replace(trailingQueryPunctuationRe, '$1');\n}\n\n/**\n * Replaces all existing definitions of a parameter with a single definition.\n *\n * Repeated calls to this can exhibit quadratic behavior due to the need to\n * find existing instances and reconstruct the string, though it should be\n * limited given the 2kb limit.  Consider using appendParams or setParamsFromMap\n * to update multiple parameters in bulk.\n *\n * @param {string} uri The original URI, which may already have query data.\n * @param {string} keyEncoded The key, which must already be URI encoded.\n * @param {*} value The value, which will be stringized and encoded (assumed\n *     not already to be encoded).\n * @return {string} The URI with the query parameter added.\n */\nfunction setParam(uri, keyEncoded, value) {\n  return appendParam(removeParam(uri, keyEncoded), keyEncoded, value);\n}\n\n/**\n * Effeciently set or remove multiple query parameters in a URI. Order of\n * unchanged parameters will not be modified, all updated parameters will be\n * appended to the end of the query. Params with values of null or undefined are\n * removed.\n *\n * @param {string} uri The URI to process.\n * @param {!Object<string, goog.uri.utils.QueryValue>} params A list of\n *     parameters to update. If null or undefined, the param will be removed.\n * @return {string} An updated URI where the query data has been updated with\n *     the params.\n */\nfunction setParamsFromMap(uri, params) {\n  const parts = splitQueryData(uri);\n  const queryData = parts[1];\n  const buffer = [];\n  if (queryData) {\n    queryData.split('&').forEach(function(pair) {\n      const indexOfEquals = pair.indexOf('=');\n      const name = indexOfEquals >= 0 ? pair.slice(0, indexOfEquals) : pair;\n      if (!params.hasOwnProperty(name)) {\n        buffer.push(pair);\n      }\n    });\n  }\n  parts[1] = appendQueryData(buffer.join('&'), buildQueryDataFromMap(params));\n  return joinQueryData(parts);\n}\n\n/**\n * Generates a URI path using a given URI and a path with checks to\n * prevent consecutive \"//\". The baseUri passed in must not contain\n * query or fragment identifiers. The path to append may not contain query or\n * fragment identifiers.\n *\n * @param {string} baseUri URI to use as the base.\n * @param {string} path Path to append.\n * @return {string} Updated URI.\n */\nfunction appendPath(baseUri, path) {\n  assertNoFragmentsOrQueries(baseUri);\n\n  // Remove any trailing '/'\n  if (googString.endsWith(baseUri, '/')) {\n    baseUri = baseUri.slice(0, -1);\n  }\n  // Remove any leading '/'\n  if (googString.startsWith(path, '/')) {\n    path = path.slice(1);\n  }\n  return '' + baseUri + '/' + path;\n}\n\n/**\n * Replaces the path.\n * @param {string} uri URI to use as the base.\n * @param {string} path New path.\n * @return {string} Updated URI.\n */\nfunction setPath(uri, path) {\n  // Add any missing '/'.\n  if (!googString.startsWith(path, '/')) {\n    path = '/' + path;\n  }\n  const parts = split(uri);\n  return buildFromEncodedParts(\n      parts[ComponentIndex.SCHEME], parts[ComponentIndex.USER_INFO],\n      parts[ComponentIndex.DOMAIN], parts[ComponentIndex.PORT], path,\n      parts[ComponentIndex.QUERY_DATA], parts[ComponentIndex.FRAGMENT]);\n}\n\n/**\n * Standard supported query parameters.\n * @enum {string}\n */\nconst StandardQueryParam = {\n\n  /** Unused parameter for unique-ifying. */\n  RANDOM: 'zx'\n};\n\n/**\n * Sets the zx parameter of a URI to a random value.\n * @param {string} uri Any URI.\n * @return {string} That URI with the \"zx\" parameter added or replaced to\n *     contain a random string.\n */\nfunction makeUnique(uri) {\n  return setParam(uri, StandardQueryParam.RANDOM, googString.getRandomString());\n}\n\nexports = {\n  ComponentIndex,\n  StandardQueryParam,\n  QueryArray,\n  QueryValue,\n  appendParam,\n  appendParams,\n  appendParamsFromMap,\n  appendPath,\n  buildFromEncodedParts,\n  buildQueryData,\n  buildQueryDataFromMap,\n  getDomain,\n  getDomainEncoded,\n  getEffectiveScheme,\n  getFragment,\n  getFragmentEncoded,\n  getHost,\n  getOrigin,\n  getParamValue,\n  getParamValues,\n  getPath,\n  getPathAndAfter,\n  getPathEncoded,\n  getPort,\n  getQueryData,\n  getScheme,\n  getUserInfo,\n  getUserInfoEncoded,\n  hasParam,\n  haveSameDomain,\n  makeUnique,\n  parseQueryData,\n  removeFragment,\n  removeParam,\n  setFragmentEncoded,\n  setParam,\n  setParamsFromMap,\n  setPath,\n  setUrlPackageSupportLoggingHandler,\n  split,\n};\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Wrapper class for handling XmlHttpRequests.\n *\n * One off requests can be sent through goog.net.XhrIo.send() or an\n * instance can be created to send multiple requests.  Each request uses its\n * own XmlHttpRequest object and handles clearing of the event callback to\n * ensure no leaks.\n *\n * XhrIo is event based, it dispatches events on success, failure, finishing,\n * ready-state change, or progress (download and upload).\n *\n * The ready-state or timeout event fires first, followed by\n * a generic completed event. Then the abort, error, or success event\n * is fired as appropriate. Progress events are fired as they are\n * received. Lastly, the ready event will fire to indicate that the\n * object may be used to make another request.\n *\n * The error event may also be called before completed and\n * ready-state-change if the XmlHttpRequest.open() or .send() methods throw.\n *\n * This class does not support multiple requests, queuing, or prioritization.\n *\n * When progress events are supported by the browser, and progress is\n * enabled via .setProgressEventsEnabled(true), the\n * goog.net.EventType.PROGRESS event will be the re-dispatched browser\n * progress event. Additionally, a DOWNLOAD_PROGRESS or UPLOAD_PROGRESS event\n * will be fired for download and upload progress respectively.\n */\n\n\ngoog.provide('goog.net.XhrIo');\n\ngoog.require('goog.array');\ngoog.require('goog.asserts');\ngoog.require('goog.collections.maps');\ngoog.require('goog.debug.entryPointRegistry');\ngoog.require('goog.events.EventTarget');\ngoog.require('goog.json.hybrid');\ngoog.require('goog.log');\ngoog.require('goog.net.ErrorCode');\ngoog.require('goog.net.EventType');\ngoog.require('goog.net.HttpStatus');\ngoog.require('goog.net.XmlHttp');\ngoog.require('goog.object');\ngoog.require('goog.string');\ngoog.require('goog.uri.utils');\ngoog.require('google3.javascript.common.async.context.propagate');\ngoog.requireType('goog.Uri');\ngoog.requireType('goog.debug.ErrorHandler');\ngoog.requireType('goog.net.XhrLike');\ngoog.requireType('goog.net.XmlHttpFactory');\n\ngoog.scope(function() {\n\n'use strict';\n/**\n * Basic class for handling XMLHttpRequests.\n * @param {goog.net.XmlHttpFactory=} opt_xmlHttpFactory Factory to use when\n *     creating XMLHttpRequest objects.\n * @constructor\n * @extends {goog.events.EventTarget}\n */\ngoog.net.XhrIo = function(opt_xmlHttpFactory) {\n  'use strict';\n  XhrIo.base(this, 'constructor');\n\n  /**\n   * Map of default headers to add to every request, use:\n   * XhrIo.headers.set(name, value)\n   * @type {!Map<string,string>}\n   */\n  this.headers = new Map();\n\n  /**\n   * Optional XmlHttpFactory\n   * @private {goog.net.XmlHttpFactory}\n   */\n  this.xmlHttpFactory_ = opt_xmlHttpFactory || null;\n\n  /**\n   * Whether XMLHttpRequest is active.  A request is active from the time send()\n   * is called until onReadyStateChange() is complete, or error() or abort()\n   * is called.\n   * @private {boolean}\n   */\n  this.active_ = false;\n\n  /**\n   * The XMLHttpRequest object that is being used for the transfer.\n   * @private {?goog.net.XhrLike.OrNative}\n   */\n  this.xhr_ = null;\n\n  /**\n   * Last URL that was requested.\n   * @private {string|goog.Uri}\n   */\n  this.lastUri_ = '';\n\n  /**\n   * Method for the last request.\n   * @private {string}\n   */\n  this.lastMethod_ = '';\n\n  /**\n   * Last error code.\n   * @private {!goog.net.ErrorCode}\n   */\n  this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR;\n\n  /**\n   * Last error message.\n   * @private {Error|string}\n   */\n  this.lastError_ = '';\n\n  /**\n   * Used to ensure that we don't dispatch an multiple ERROR events. This can\n   * happen in IE when it does a synchronous load and one error is handled in\n   * the ready state change and one is handled due to send() throwing an\n   * exception.\n   * @private {boolean}\n   */\n  this.errorDispatched_ = false;\n\n  /**\n   * Used to make sure we don't fire the complete event from inside a send call.\n   * @private {boolean}\n   */\n  this.inSend_ = false;\n\n  /**\n   * Used in determining if a call to {@link #onReadyStateChange_} is from\n   * within a call to this.xhr_.open.\n   * @private {boolean}\n   */\n  this.inOpen_ = false;\n\n  /**\n   * Used in determining if a call to {@link #onReadyStateChange_} is from\n   * within a call to this.xhr_.abort.\n   * @private {boolean}\n   */\n  this.inAbort_ = false;\n\n  /**\n   * Number of milliseconds after which an incomplete request will be aborted\n   * and a {@link goog.net.EventType.TIMEOUT} event raised; 0 means no timeout\n   * is set.\n   * @private {number}\n   */\n  this.timeoutInterval_ = 0;\n\n  /**\n   * Timer to track request timeout.\n   * @private {?number}\n   */\n  this.timeoutId_ = null;\n\n  /**\n   * The requested type for the response. The empty string means use the default\n   * XHR behavior.\n   * @private {goog.net.XhrIo.ResponseType}\n   */\n  this.responseType_ = ResponseType.DEFAULT;\n\n  /**\n   * Whether a \"credentialed\" request is to be sent (one that is aware of\n   * cookies and authentication). This is applicable only for cross-domain\n   * requests and more recent browsers that support this part of the HTTP Access\n   * Control standard.\n   *\n   * @see http://www.w3.org/TR/XMLHttpRequest/#the-withcredentials-attribute\n   *\n   * @private {boolean}\n   */\n  this.withCredentials_ = false;\n\n  /**\n   * Whether progress events are enabled for this request. This is\n   * disabled by default because setting a progress event handler\n   * causes pre-flight OPTIONS requests to be sent for CORS requests,\n   * even in cases where a pre-flight request would not otherwise be\n   * sent.\n   *\n   * @see http://xhr.spec.whatwg.org/#security-considerations\n   *\n   * Note that this can cause problems for Firefox 22 and below, as an\n   * older \"LSProgressEvent\" will be dispatched by the browser. That\n   * progress event is no longer supported, and can lead to failures,\n   * including throwing exceptions.\n   *\n   * @see http://bugzilla.mozilla.org/show_bug.cgi?id=845631\n   * @see b/23469793\n   *\n   * @private {boolean}\n   */\n  this.progressEventsEnabled_ = false;\n\n  /**\n   * Specification for Trust Token operations (issuance, signing, and\n   * redemption).\n   * @private {?TrustTokenAttributeType}\n   */\n  this.trustToken_ = null;\n  // MOE:begin_strip\n\n  /**\n   * Options for attribution reporting (eventSourceEligible, triggerEligible).\n   * @private {?AttributionReportingRequestOptions}\n   */\n  this.attributionReportingOptions_ = null;\n  // MOE:end_strip\n};\ngoog.inherits(goog.net.XhrIo, goog.events.EventTarget);\n\nconst XhrIo = goog.net.XhrIo;\n\n/**\n * Response types that may be requested for XMLHttpRequests.\n * @enum {string}\n * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetype-attribute\n */\ngoog.net.XhrIo.ResponseType = {\n  DEFAULT: '',\n  TEXT: 'text',\n  DOCUMENT: 'document',\n  // Not supported as of Chrome 10.0.612.1 dev\n  BLOB: 'blob',\n  ARRAY_BUFFER: 'arraybuffer',\n};\n\nconst ResponseType = goog.net.XhrIo.ResponseType;\n\n\n/**\n * A reference to the XhrIo logger\n * @private {?goog.log.Logger}\n * @const\n */\ngoog.net.XhrIo.prototype.logger_ = goog.log.getLogger('goog.net.XhrIo');\n\n\n/**\n * The Content-Type HTTP header name\n * @type {string}\n */\ngoog.net.XhrIo.CONTENT_TYPE_HEADER = 'Content-Type';\n\n\n/**\n * The Content-Transfer-Encoding HTTP header name\n * @type {string}\n */\ngoog.net.XhrIo.CONTENT_TRANSFER_ENCODING = 'Content-Transfer-Encoding';\n\n\n/**\n * The pattern matching the 'http' and 'https' URI schemes\n * @type {!RegExp}\n */\ngoog.net.XhrIo.HTTP_SCHEME_PATTERN = /^https?$/i;\n\nconst HTTP_SCHEME_PATTERN = goog.net.XhrIo.HTTP_SCHEME_PATTERN;\n\n\n/**\n * The methods that typically come along with form data.  We set different\n * headers depending on whether the HTTP action is one of these.\n * @type {!Array<string>}\n */\ngoog.net.XhrIo.METHODS_WITH_FORM_DATA = ['POST', 'PUT'];\n\n\n/**\n * The Content-Type HTTP header value for a url-encoded form\n * @type {string}\n */\ngoog.net.XhrIo.FORM_CONTENT_TYPE =\n    'application/x-www-form-urlencoded;charset=utf-8';\n\n\n/**\n * All non-disposed instances of goog.net.XhrIo created\n * by {@link goog.net.XhrIo.send} are in this Array.\n * @see goog.net.XhrIo.cleanup\n * @private {!Array<!goog.net.XhrIo>}\n */\ngoog.net.XhrIo.sendInstances_ = [];\n\n\n/**\n * Static send that creates a short lived instance of XhrIo to send the\n * request.\n * @see goog.net.XhrIo.cleanup\n * @param {string|goog.Uri} url Uri to make request to.\n * @param {?function(this:goog.net.XhrIo, ?)=} opt_callback Callback function\n *     for when request is complete.\n * @param {string=} opt_method Send method, default: GET.\n * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=}\n *     opt_content Body data.\n * @param {(?Object|?goog.collections.maps.MapLike<string, string>)=}\n *     opt_headers Map of headers to add to the request.\n * @param {number=} opt_timeoutInterval Number of milliseconds after which an\n *     incomplete request will be aborted; 0 means no timeout is set.\n * @param {boolean=} opt_withCredentials Whether to send credentials with the\n *     request. Default to false. See {@link goog.net.XhrIo#setWithCredentials}.\n * @return {!goog.net.XhrIo} The sent XhrIo.\n */\ngoog.net.XhrIo.send = function(\n    url, opt_callback, opt_method, opt_content, opt_headers,\n    opt_timeoutInterval, opt_withCredentials) {\n  'use strict';\n  const x = new goog.net.XhrIo();\n  goog.net.XhrIo.sendInstances_.push(x);\n  if (opt_callback) {\n    x.listen(goog.net.EventType.COMPLETE, opt_callback);\n  }\n  x.listenOnce(goog.net.EventType.READY, x.cleanupSend_);\n  if (opt_timeoutInterval) {\n    x.setTimeoutInterval(opt_timeoutInterval);\n  }\n  if (opt_withCredentials) {\n    x.setWithCredentials(opt_withCredentials);\n  }\n  x.send(url, opt_method, opt_content, opt_headers);\n  return x;\n};\n\n\n/**\n * Disposes all non-disposed instances of goog.net.XhrIo created by\n * {@link goog.net.XhrIo.send}.\n * {@link goog.net.XhrIo.send} cleans up the goog.net.XhrIo instance\n * it creates when the request completes or fails.  However, if\n * the request never completes, then the goog.net.XhrIo is not disposed.\n * This can occur if the window is unloaded before the request completes.\n * We could have {@link goog.net.XhrIo.send} return the goog.net.XhrIo\n * it creates and make the client of {@link goog.net.XhrIo.send} be\n * responsible for disposing it in this case.  However, this makes things\n * significantly more complicated for the client, and the whole point\n * of {@link goog.net.XhrIo.send} is that it's simple and easy to use.\n * Clients of {@link goog.net.XhrIo.send} should call\n * {@link goog.net.XhrIo.cleanup} when doing final\n * cleanup on window unload.\n */\ngoog.net.XhrIo.cleanup = function() {\n  'use strict';\n  const instances = goog.net.XhrIo.sendInstances_;\n  while (instances.length) {\n    instances.pop().dispose();\n  }\n};\n\n\n/**\n * Null-safe wrapper around AsyncContext.Snapshot.wrap.\n * @const {function(?Function): ?Function}\n */\nconst propagateAsyncContext =\n    goog.module.get('google3.javascript.common.async.context.propagate')\n        .propagateAsyncContext;\n\n\n/**\n * Installs exception protection for all entry point introduced by\n * goog.net.XhrIo instances which are not protected by\n * {@link goog.debug.ErrorHandler#protectWindowSetTimeout},\n * {@link goog.debug.ErrorHandler#protectWindowSetInterval}, or\n * {@link goog.events.protectBrowserEventEntryPoint}.\n *\n * @param {goog.debug.ErrorHandler} errorHandler Error handler with which to\n *     protect the entry point(s).\n */\ngoog.net.XhrIo.protectEntryPoints = function(errorHandler) {\n  'use strict';\n  goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ =\n      errorHandler.protectEntryPoint(\n          goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_);\n};\n\n\n/**\n * Disposes of the specified goog.net.XhrIo created by\n * {@link goog.net.XhrIo.send} and removes it from\n * {@link goog.net.XhrIo.pendingStaticSendInstances_}.\n * @private\n */\ngoog.net.XhrIo.prototype.cleanupSend_ = function() {\n  'use strict';\n  this.dispose();\n  goog.array.remove(goog.net.XhrIo.sendInstances_, this);\n};\n\n\n/**\n * Returns the number of milliseconds after which an incomplete request will be\n * aborted, or 0 if no timeout is set.\n * @return {number} Timeout interval in milliseconds.\n */\ngoog.net.XhrIo.prototype.getTimeoutInterval = function() {\n  'use strict';\n  return this.timeoutInterval_;\n};\n\n\n/**\n * Sets the number of milliseconds after which an incomplete request will be\n * aborted and a {@link goog.net.EventType.TIMEOUT} event raised; 0 means no\n * timeout is set.\n * @param {number} ms Timeout interval in milliseconds; 0 means none.\n */\ngoog.net.XhrIo.prototype.setTimeoutInterval = function(ms) {\n  'use strict';\n  this.timeoutInterval_ = Math.max(0, ms);\n};\n\n\n/**\n * Sets the desired type for the response. At time of writing, this is only\n * supported in very recent versions of WebKit (10.0.612.1 dev and later).\n *\n * If this is used, the response may only be accessed via {@link #getResponse}.\n *\n * @param {goog.net.XhrIo.ResponseType} type The desired type for the response.\n */\ngoog.net.XhrIo.prototype.setResponseType = function(type) {\n  'use strict';\n  this.responseType_ = type;\n};\n\n\n/**\n * Gets the desired type for the response.\n * @return {goog.net.XhrIo.ResponseType} The desired type for the response.\n */\ngoog.net.XhrIo.prototype.getResponseType = function() {\n  'use strict';\n  return this.responseType_;\n};\n\n\n/**\n * Sets whether a \"credentialed\" request that is aware of cookie and\n * authentication information should be made. This option is only supported by\n * browsers that support HTTP Access Control. As of this writing, this option\n * is not supported in IE.\n *\n * @param {boolean} withCredentials Whether this should be a \"credentialed\"\n *     request.\n */\ngoog.net.XhrIo.prototype.setWithCredentials = function(withCredentials) {\n  'use strict';\n  this.withCredentials_ = withCredentials;\n};\n\n\n/**\n * Gets whether a \"credentialed\" request is to be sent.\n * @return {boolean} The desired type for the response.\n */\ngoog.net.XhrIo.prototype.getWithCredentials = function() {\n  'use strict';\n  return this.withCredentials_;\n};\n\n\n/**\n * Sets whether progress events are enabled for this request. Note\n * that progress events require pre-flight OPTIONS request handling\n * for CORS requests, and may cause trouble with older browsers. See\n * progressEventsEnabled_ for details.\n * @param {boolean} enabled Whether progress events should be enabled.\n */\ngoog.net.XhrIo.prototype.setProgressEventsEnabled = function(enabled) {\n  'use strict';\n  this.progressEventsEnabled_ = enabled;\n};\n\n\n/**\n * Gets whether progress events are enabled.\n * @return {boolean} Whether progress events are enabled for this request.\n */\ngoog.net.XhrIo.prototype.getProgressEventsEnabled = function() {\n  'use strict';\n  return this.progressEventsEnabled_;\n};\n\n/**\n * Specify a Trust Tokens operation to execute alongside the request.\n * @param {!TrustTokenAttributeType} trustToken a Trust Tokens operation to\n *     execute.\n */\ngoog.net.XhrIo.prototype.setTrustToken = function(trustToken) {\n  'use strict';\n  this.trustToken_ = trustToken;\n};\n\n// MOE:begin_strip\n/**\n * Specify the attribution reporting options for the request.\n * @param {!AttributionReportingRequestOptions} attributionReportingOptions\n */\ngoog.net.XhrIo.prototype.setAttributionReporting = function(\n    attributionReportingOptions) {\n  'use strict';\n  this.attributionReportingOptions_ = attributionReportingOptions;\n};\n\n/**\n * Get the response URL from the Xhr object. This is the final URL after any\n * redirects.\n * @return {string} The response URL, or an empty string if unavailable.\n */\ngoog.net.XhrIo.prototype.getResponseUrl = function() {\n  'use strict';\n  try {\n    return this.xhr_ ? this.xhr_.responseURL : '';\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get responseURL: ' + e.message);\n    return '';\n  }\n};\n\n\n// MOE:end_strip\n/**\n * Instance send that actually uses XMLHttpRequest to make a server call.\n * @param {string|goog.Uri} url Uri to make request to.\n * @param {string=} opt_method Send method, default: GET.\n * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=}\n *     opt_content Body data.\n * @param {(?Object|?goog.collections.maps.MapLike<string, string>)=}\n *     opt_headers Map of headers to add to the request.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n * @suppress {deprecated} Use deprecated goog.structs.forEach to allow different\n * types of parameters for opt_headers.\n */\ngoog.net.XhrIo.prototype.send = function(\n    url, opt_method, opt_content, opt_headers) {\n  'use strict';\n  if (this.xhr_) {\n    throw new Error(\n        '[goog.net.XhrIo] Object is active with another request=' +\n        this.lastUri_ + '; newUri=' + url);\n  }\n\n  const method = opt_method ? opt_method.toUpperCase() : 'GET';\n\n  this.lastUri_ = url;\n  this.lastError_ = '';\n  this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR;\n  this.lastMethod_ = method;\n  this.errorDispatched_ = false;\n  this.active_ = true;\n\n  // Use the factory to create the XHR object and options\n  this.xhr_ = this.createXhr();\n\n  // Set up the onreadystatechange callback\n  this.xhr_.onreadystatechange =\n      propagateAsyncContext(goog.bind(this.onReadyStateChange_, this));\n\n  // Set up upload/download progress events, if progress events are supported.\n  if (this.getProgressEventsEnabled() && 'onprogress' in this.xhr_) {\n    /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n    this.xhr_.onprogress = propagateAsyncContext(goog.bind(function(e) {\n      'use strict';\n      this.onProgressHandler_(e, true);\n    }, this));\n    if (this.xhr_.upload) {\n      /**\n       * @suppress {strictMissingProperties} Added to tighten compiler checks\n       */\n      this.xhr_.upload.onprogress =\n          propagateAsyncContext(goog.bind(this.onProgressHandler_, this));\n    }\n  }\n\n  /**\n   * Try to open the XMLHttpRequest (always async), if an error occurs here it\n   * is generally permission denied\n   */\n  try {\n    goog.log.fine(this.logger_, this.formatMsg_('Opening Xhr'));\n    this.inOpen_ = true;\n    this.xhr_.open(method, String(url), true);  // Always async!\n    this.inOpen_ = false;\n  } catch (err) {\n    goog.log.fine(\n        this.logger_, this.formatMsg_('Error opening Xhr: ' + err.message));\n    this.error_(goog.net.ErrorCode.EXCEPTION, err);\n    return;\n  }\n\n  // We can't use null since this won't allow requests with form data to have a\n  // content length specified which will cause some proxies to return a 411\n  // error.\n  const content = opt_content || '';\n\n  const headers = new Map(this.headers);\n\n  // Add headers specific to this request\n  if (opt_headers) {\n    if (Object.getPrototypeOf(opt_headers) === Object.prototype) {\n      for (let key in opt_headers) {\n        headers.set(key, opt_headers[key]);\n      }\n    } else if (\n        typeof opt_headers.keys === 'function' &&\n        typeof opt_headers.get === 'function') {\n      for (const key of opt_headers.keys()) {\n        headers.set(key, opt_headers.get(key));\n      }\n    } else {\n      throw new Error(\n          'Unknown input type for opt_headers: ' + String(opt_headers));\n    }\n  }\n\n  // Find whether a content type header is set, ignoring case.\n  // HTTP header names are case-insensitive.  See:\n  // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2\n  const contentTypeKey =\n      Array.from(headers.keys())\n          .find(\n              header => goog.string.caseInsensitiveEquals(\n                  goog.net.XhrIo.CONTENT_TYPE_HEADER, header));\n\n  const contentIsFormData =\n      (goog.global['FormData'] && (content instanceof goog.global['FormData']));\n  if (goog.array.contains(goog.net.XhrIo.METHODS_WITH_FORM_DATA, method) &&\n      !contentTypeKey && !contentIsFormData) {\n    // For requests typically with form data, default to the url-encoded form\n    // content type unless this is a FormData request.  For FormData,\n    // the browser will automatically add a multipart/form-data content type\n    // with an appropriate multipart boundary.\n    headers.set(\n        goog.net.XhrIo.CONTENT_TYPE_HEADER, goog.net.XhrIo.FORM_CONTENT_TYPE);\n  }\n\n  // Add the headers to the Xhr object\n  for (const [key, value] of headers) {\n    this.xhr_.setRequestHeader(key, value);\n  }\n\n  if (this.responseType_) {\n    this.xhr_.responseType = this.responseType_;\n  }\n  // Set xhr_.withCredentials only when the value is different, or else in\n  // synchronous XMLHtppRequest.open Firefox will throw an exception.\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=736340\n  if ('withCredentials' in this.xhr_ &&\n      this.xhr_.withCredentials !== this.withCredentials_) {\n    /** @suppress {strictMissingProperties} Added to tighten compiler checks */\n    this.xhr_.withCredentials = this.withCredentials_;\n  }\n\n  if ('setTrustToken' in this.xhr_ && this.trustToken_) {\n    try {\n      this.xhr_.setTrustToken(this.trustToken_);\n    } catch (err) {\n      goog.log.fine(\n          this.logger_, this.formatMsg_('Error SetTrustToken: ' + err.message));\n    }\n  }\n  // MOE:begin_strip\n\n  if ('setAttributionReporting' in this.xhr_ &&\n      this.attributionReportingOptions_) {\n    try {\n      this.xhr_.setAttributionReporting(this.attributionReportingOptions_);\n    } catch (err) {\n      goog.log.fine(\n          this.logger_,\n          this.formatMsg_('Error SetAttributionReporting: ' + err.message));\n    }\n  }\n  // MOE:end_strip\n  /**\n   * Try to send the request, or other wise report an error (404 not found).\n   */\n  try {\n    this.cleanUpTimeoutTimer_();  // Paranoid, should never be running.\n    if (this.timeoutInterval_ > 0) {\n      goog.log.fine(\n          this.logger_,\n          this.formatMsg_(\n              'Will abort after ' + this.timeoutInterval_ +\n              'ms if incomplete'));\n      this.timeoutId_ =\n          setTimeout(this.timeout_.bind(this), this.timeoutInterval_);\n    }\n    goog.log.fine(this.logger_, this.formatMsg_('Sending request'));\n    this.inSend_ = true;\n    this.xhr_.send(content);\n    this.inSend_ = false;\n\n  } catch (err) {\n    goog.log.fine(this.logger_, this.formatMsg_('Send error: ' + err.message));\n    this.error_(goog.net.ErrorCode.EXCEPTION, err);\n  }\n};\n\n\n/**\n * Creates a new XHR object.\n * @return {!goog.net.XhrLike.OrNative} The newly created XHR object.\n * @protected\n */\ngoog.net.XhrIo.prototype.createXhr = function() {\n  'use strict';\n  return this.xmlHttpFactory_ ? this.xmlHttpFactory_.createInstance() :\n                                goog.net.XmlHttp();\n};\n\n\n/**\n * The request didn't complete after {@link goog.net.XhrIo#timeoutInterval_}\n * milliseconds; raises a {@link goog.net.EventType.TIMEOUT} event and aborts\n * the request.\n * @private\n */\ngoog.net.XhrIo.prototype.timeout_ = function() {\n  'use strict';\n  if (typeof goog == 'undefined') {\n    // If goog is undefined then the callback has occurred as the application\n    // is unloading and will error.  Thus we let it silently fail.\n  } else if (this.xhr_) {\n    this.lastError_ =\n        'Timed out after ' + this.timeoutInterval_ + 'ms, aborting';\n    this.lastErrorCode_ = goog.net.ErrorCode.TIMEOUT;\n    goog.log.fine(this.logger_, this.formatMsg_(this.lastError_));\n    this.dispatchEvent(goog.net.EventType.TIMEOUT);\n    this.abort(goog.net.ErrorCode.TIMEOUT);\n  }\n};\n\n\n/**\n * Something errorred, so inactivate, fire error callback and clean up\n * @param {goog.net.ErrorCode} errorCode The error code.\n * @param {Error} err The error object.\n * @private\n */\ngoog.net.XhrIo.prototype.error_ = function(errorCode, err) {\n  'use strict';\n  this.active_ = false;\n  if (this.xhr_) {\n    this.inAbort_ = true;\n    this.xhr_.abort();  // Ensures XHR isn't hung (FF)\n    this.inAbort_ = false;\n  }\n  this.lastError_ = err;\n  this.lastErrorCode_ = errorCode;\n  this.dispatchErrors_();\n  this.cleanUpXhr_();\n};\n\n\n/**\n * Dispatches COMPLETE and ERROR in case of an error. This ensures that we do\n * not dispatch multiple error events.\n * @private\n */\ngoog.net.XhrIo.prototype.dispatchErrors_ = function() {\n  'use strict';\n  if (!this.errorDispatched_) {\n    this.errorDispatched_ = true;\n    this.dispatchEvent(goog.net.EventType.COMPLETE);\n    this.dispatchEvent(goog.net.EventType.ERROR);\n  }\n};\n\n\n/**\n * Abort the current XMLHttpRequest\n * @param {goog.net.ErrorCode=} opt_failureCode Optional error code to use -\n *     defaults to ABORT.\n */\ngoog.net.XhrIo.prototype.abort = function(opt_failureCode) {\n  'use strict';\n  if (this.xhr_ && this.active_) {\n    goog.log.fine(this.logger_, this.formatMsg_('Aborting'));\n    this.active_ = false;\n    this.inAbort_ = true;\n    this.xhr_.abort();\n    this.inAbort_ = false;\n    this.lastErrorCode_ = opt_failureCode || goog.net.ErrorCode.ABORT;\n    this.dispatchEvent(goog.net.EventType.COMPLETE);\n    this.dispatchEvent(goog.net.EventType.ABORT);\n    this.cleanUpXhr_();\n  }\n};\n\n\n/**\n * Nullifies all callbacks to reduce risks of leaks.\n * @override\n * @protected\n */\ngoog.net.XhrIo.prototype.disposeInternal = function() {\n  'use strict';\n  if (this.xhr_) {\n    // We explicitly do not call xhr_.abort() unless active_ is still true.\n    // This is to avoid unnecessarily aborting a successful request when\n    // dispose() is called in a callback triggered by a complete response, but\n    // in which browser cleanup has not yet finished.\n    // (See http://b/issue?id=1684217.)\n    if (this.active_) {\n      this.active_ = false;\n      this.inAbort_ = true;\n      this.xhr_.abort();\n      this.inAbort_ = false;\n    }\n    this.cleanUpXhr_(true);\n  }\n\n  XhrIo.base(this, 'disposeInternal');\n};\n\n\n/**\n * Internal handler for the XHR object's readystatechange event.  This method\n * checks the status and the readystate and fires the correct callbacks.\n * If the request has ended, the handlers are cleaned up and the XHR object is\n * nullified.\n * @private\n */\ngoog.net.XhrIo.prototype.onReadyStateChange_ = function() {\n  'use strict';\n  if (this.isDisposed()) {\n    // This method is the target of an untracked setTimeout().\n    return;\n  }\n  if (!this.inOpen_ && !this.inSend_ && !this.inAbort_) {\n    // Were not being called from within a call to this.xhr_.send\n    // this.xhr_.abort, or this.xhr_.open, so this is an entry point\n    this.onReadyStateChangeEntryPoint_();\n  } else {\n    this.onReadyStateChangeHelper_();\n  }\n};\n\n\n/**\n * Used to protect the onreadystatechange handler entry point.  Necessary\n * as {#onReadyStateChange_} maybe called from within send or abort, this\n * method is only called when {#onReadyStateChange_} is called as an\n * entry point.\n * {@see #protectEntryPoints}\n * @private\n */\ngoog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = function() {\n  'use strict';\n  this.onReadyStateChangeHelper_();\n};\n\n\n/**\n * Helper for {@link #onReadyStateChange_}.  This is used so that\n * entry point calls to {@link #onReadyStateChange_} can be routed through\n * {@link #onReadyStateChangeEntryPoint_}.\n * @private\n */\ngoog.net.XhrIo.prototype.onReadyStateChangeHelper_ = function() {\n  'use strict';\n  if (!this.active_) {\n    // can get called inside abort call\n    return;\n  }\n\n  if (typeof goog == 'undefined') {\n    // NOTE(pupius): If goog is undefined then the callback has occurred as the\n    // application is unloading and will error.  Thus we let it silently fail.\n  } else {\n    // In IE when the response has been cached we sometimes get the callback\n    // from inside the send call and this usually breaks code that assumes that\n    // XhrIo is asynchronous.  If that is the case we delay the callback\n    // using a timer.\n    if (this.inSend_ &&\n        this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE) {\n      setTimeout(this.onReadyStateChange_.bind(this), 0);\n      return;\n    }\n\n    this.dispatchEvent(goog.net.EventType.READY_STATE_CHANGE);\n\n    // readyState indicates the transfer has finished\n    if (this.isComplete()) {\n      goog.log.fine(this.logger_, this.formatMsg_('Request complete'));\n\n      this.active_ = false;\n\n      try {\n        // Call the specific callbacks for success or failure. Only call the\n        // success if the status is 200 (HTTP_OK) or 304 (HTTP_CACHED)\n        if (this.isSuccess()) {\n          this.dispatchEvent(goog.net.EventType.COMPLETE);\n          this.dispatchEvent(goog.net.EventType.SUCCESS);\n        } else {\n          this.lastErrorCode_ = goog.net.ErrorCode.HTTP_ERROR;\n          this.lastError_ =\n              this.getStatusText() + ' [' + this.getStatus() + ']';\n          this.dispatchErrors_();\n        }\n      } finally {\n        this.cleanUpXhr_();\n      }\n    }\n  }\n};\n\n\n/**\n * Internal handler for the XHR object's onprogress event. Fires both a generic\n * PROGRESS event and either a DOWNLOAD_PROGRESS or UPLOAD_PROGRESS event to\n * allow specific binding for each XHR progress event.\n * @param {!ProgressEvent} e XHR progress event.\n * @param {boolean=} opt_isDownload Whether the current progress event is from a\n *     download. Used to determine whether DOWNLOAD_PROGRESS or UPLOAD_PROGRESS\n *     event should be dispatched.\n * @private\n */\ngoog.net.XhrIo.prototype.onProgressHandler_ = function(e, opt_isDownload) {\n  'use strict';\n  goog.asserts.assert(\n      e.type === goog.net.EventType.PROGRESS,\n      'goog.net.EventType.PROGRESS is of the same type as raw XHR progress.');\n  this.dispatchEvent(\n      goog.net.XhrIo.buildProgressEvent_(e, goog.net.EventType.PROGRESS));\n  this.dispatchEvent(goog.net.XhrIo.buildProgressEvent_(\n      e,\n      opt_isDownload ? goog.net.EventType.DOWNLOAD_PROGRESS :\n                       goog.net.EventType.UPLOAD_PROGRESS));\n};\n\n\n/**\n * Creates a representation of the native ProgressEvent. IE doesn't support\n * constructing ProgressEvent via \"new\", and the alternatives (e.g.,\n * ProgressEvent.initProgressEvent) are non-standard or deprecated.\n * @param {!ProgressEvent} e XHR progress event.\n * @param {!goog.net.EventType} eventType The type of the event.\n * @return {!ProgressEvent} The progress event.\n * @private\n */\ngoog.net.XhrIo.buildProgressEvent_ = function(e, eventType) {\n  'use strict';\n  return /** @type {!ProgressEvent} */ ({\n    type: eventType,\n    lengthComputable: e.lengthComputable,\n    loaded: e.loaded,\n    total: e.total,\n  });\n};\n\n\n/**\n * Remove the listener to protect against leaks, and nullify the XMLHttpRequest\n * object.\n * @param {boolean=} opt_fromDispose If this is from the dispose (don't want to\n *     fire any events).\n * @private\n */\ngoog.net.XhrIo.prototype.cleanUpXhr_ = function(opt_fromDispose) {\n  'use strict';\n  if (this.xhr_) {\n    // Cancel any pending timeout event handler.\n    this.cleanUpTimeoutTimer_();\n\n    // Save reference so we can mark it as closed after the READY event.  The\n    // READY event may trigger another request, thus we must nullify this.xhr_\n    const xhr = this.xhr_;\n    const clearedOnReadyStateChange = null;\n    this.xhr_ = null;\n\n    if (!opt_fromDispose) {\n      this.dispatchEvent(goog.net.EventType.READY);\n    }\n\n    try {\n      // NOTE(pupius): Not nullifying in FireFox can still leak if the callbacks\n      // are defined in the same scope as the instance of XhrIo. But, IE doesn't\n      // allow you to set the onreadystatechange to NULL so nullFunction is\n      // used.\n      xhr.onreadystatechange = clearedOnReadyStateChange;\n    } catch (e) {\n      // This seems to occur with a Gears HTTP request. Delayed the setting of\n      // this onreadystatechange until after READY is sent out and catching the\n      // error to see if we can track down the problem.\n      goog.log.error(\n          this.logger_,\n          'Problem encountered resetting onreadystatechange: ' + e.message);\n    }\n  }\n};\n\n\n/**\n * Make sure the timeout timer isn't running.\n * @private\n */\ngoog.net.XhrIo.prototype.cleanUpTimeoutTimer_ = function() {\n  'use strict';\n  if (this.timeoutId_) {\n    clearTimeout(this.timeoutId_);\n    this.timeoutId_ = null;\n  }\n};\n\n\n/**\n * @return {boolean} Whether there is an active request.\n */\ngoog.net.XhrIo.prototype.isActive = function() {\n  'use strict';\n  return !!this.xhr_;\n};\n\n\n/**\n * @return {boolean} Whether the request has completed.\n */\ngoog.net.XhrIo.prototype.isComplete = function() {\n  'use strict';\n  return this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE;\n};\n\n\n/**\n * @return {boolean} Whether the request completed with a success.\n */\ngoog.net.XhrIo.prototype.isSuccess = function() {\n  'use strict';\n  const status = this.getStatus();\n  // A zero status code is considered successful for local files.\n  return goog.net.HttpStatus.isSuccess(status) ||\n      status === 0 && !this.isLastUriEffectiveSchemeHttp_();\n};\n\n\n/**\n * @return {boolean} whether the effective scheme of the last URI that was\n *     fetched was 'http' or 'https'.\n * @private\n */\ngoog.net.XhrIo.prototype.isLastUriEffectiveSchemeHttp_ = function() {\n  'use strict';\n  const scheme = goog.uri.utils.getEffectiveScheme(String(this.lastUri_));\n  return HTTP_SCHEME_PATTERN.test(scheme);\n};\n\n\n/**\n * Get the readystate from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @return {goog.net.XmlHttp.ReadyState} goog.net.XmlHttp.ReadyState.*.\n */\ngoog.net.XhrIo.prototype.getReadyState = function() {\n  'use strict';\n  return this.xhr_ ?\n      /** @type {goog.net.XmlHttp.ReadyState} */ (this.xhr_.readyState) :\n      goog.net.XmlHttp.ReadyState.UNINITIALIZED;\n};\n\n\n/**\n * Get the status from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @return {number} Http status.\n */\ngoog.net.XhrIo.prototype.getStatus = function() {\n  'use strict';\n  /**\n   * IE doesn't like you checking status until the readystate is greater than 2\n   * (i.e. it is receiving or complete).  The try/catch is used for when the\n   * page is unloading and an ERROR_NOT_AVAILABLE may occur when accessing xhr_.\n   */\n  try {\n    return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ?\n        this.xhr_.status :\n        -1;\n  } catch (e) {\n    return -1;\n  }\n};\n\n\n/**\n * Get the status text from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @return {string} Status text.\n */\ngoog.net.XhrIo.prototype.getStatusText = function() {\n  'use strict';\n  /**\n   * IE doesn't like you checking status until the readystate is greater than 2\n   * (i.e. it is receiving or complete).  The try/catch is used for when the\n   * page is unloading and an ERROR_NOT_AVAILABLE may occur when accessing xhr_.\n   */\n  try {\n    return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ?\n        this.xhr_.statusText :\n        '';\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get status: ' + e.message);\n    return '';\n  }\n};\n\n\n/**\n * Get the last Uri that was requested\n * @return {string} Last Uri.\n */\ngoog.net.XhrIo.prototype.getLastUri = function() {\n  'use strict';\n  return String(this.lastUri_);\n};\n\n\n/**\n * Get the response text from the Xhr object\n * Will only return correct result when called from the context of a callback.\n * @return {string} Result from the server, or '' if no result available.\n */\ngoog.net.XhrIo.prototype.getResponseText = function() {\n  'use strict';\n  try {\n    return this.xhr_ ? this.xhr_.responseText : '';\n  } catch (e) {\n    // http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute\n    // states that responseText should return '' (and responseXML null)\n    // when the state is not LOADING or DONE. Instead, IE can\n    // throw unexpected exceptions, for example when a request is aborted\n    // or no data is available yet.\n    goog.log.fine(this.logger_, 'Can not get responseText: ' + e.message);\n    return '';\n  }\n};\n\n\n/**\n * Get the response body from the Xhr object. This property is only available\n * in IE since version 7 according to MSDN:\n * http://msdn.microsoft.com/en-us/library/ie/ms534368(v=vs.85).aspx\n * Will only return correct result when called from the context of a callback.\n *\n * One option is to construct a VBArray from the returned object and convert\n * it to a JavaScript array using the toArray method:\n * `(new window['VBArray'](xhrIo.getResponseBody())).toArray()`\n * This will result in an array of numbers in the range of [0..255]\n *\n * Another option is to use the VBScript CStr method to convert it into a\n * string as outlined in http://stackoverflow.com/questions/1919972\n *\n * @return {Object} Binary result from the server or null if not available.\n */\ngoog.net.XhrIo.prototype.getResponseBody = function() {\n  'use strict';\n  try {\n    if (this.xhr_ && 'responseBody' in this.xhr_) {\n      return this.xhr_['responseBody'];\n    }\n  } catch (e) {\n    // IE can throw unexpected exceptions, for example when a request is aborted\n    // or no data is yet available.\n    goog.log.fine(this.logger_, 'Can not get responseBody: ' + e.message);\n  }\n  return null;\n};\n\n\n/**\n * Get the response XML from the Xhr object\n * Will only return correct result when called from the context of a callback.\n * @return {Document} The DOM Document representing the XML file, or null\n * if no result available.\n */\ngoog.net.XhrIo.prototype.getResponseXml = function() {\n  'use strict';\n  try {\n    return this.xhr_ ? this.xhr_.responseXML : null;\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get responseXML: ' + e.message);\n    return null;\n  }\n};\n\n\n/**\n * Get the response and evaluates it as JSON from the Xhr object\n * Will only return correct result when called from the context of a callback\n * @param {string=} opt_xssiPrefix Optional XSSI prefix string to use for\n *     stripping of the response before parsing. This needs to be set only if\n *     your backend server prepends the same prefix string to the JSON response.\n * @throws Error if the response text is invalid JSON.\n * @return {Object|undefined} JavaScript object.\n */\ngoog.net.XhrIo.prototype.getResponseJson = function(opt_xssiPrefix) {\n  'use strict';\n  if (!this.xhr_) {\n    return undefined;\n  }\n\n  let responseText = this.xhr_.responseText;\n  if (opt_xssiPrefix && responseText.indexOf(opt_xssiPrefix) == 0) {\n    responseText = responseText.substring(opt_xssiPrefix.length);\n  }\n\n  return goog.json.hybrid.parse(responseText);\n};\n\n\n/**\n * Get the response as the type specified by {@link #setResponseType}. At time\n * of writing, this is only directly supported in very recent versions of WebKit\n * (10.0.612.1 dev and later). If the field is not supported directly, we will\n * try to emulate it.\n *\n * Emulating the response means following the rules laid out at\n * http://www.w3.org/TR/XMLHttpRequest/#the-response-attribute\n *\n * On browsers with no support for this (Chrome < 10, Firefox < 4, etc), only\n * response types of DEFAULT or TEXT may be used, and the response returned will\n * be the text response.\n *\n * On browsers with Mozilla's draft support for array buffers (Firefox 4, 5),\n * only response types of DEFAULT, TEXT, and ARRAY_BUFFER may be used, and the\n * response returned will be either the text response or the Mozilla\n * implementation of the array buffer response.\n *\n * On browsers will full support, any valid response type supported by the\n * browser may be used, and the response provided by the browser will be\n * returned.\n *\n * @return {*} The response.\n * @suppress {strictMissingProperties} Added to tighten compiler checks\n */\ngoog.net.XhrIo.prototype.getResponse = function() {\n  'use strict';\n  try {\n    if (!this.xhr_) {\n      return null;\n    }\n    if ('response' in this.xhr_) {\n      return this.xhr_.response;\n    }\n    switch (this.responseType_) {\n      case ResponseType.DEFAULT:\n      case ResponseType.TEXT:\n        return this.xhr_.responseText;\n      // DOCUMENT and BLOB don't need to be handled here because they are\n      // introduced in the same spec that adds the .response field, and would\n      // have been caught above.\n      // ARRAY_BUFFER needs an implementation for Firefox 4, where it was\n      // implemented using a draft spec rather than the final spec.\n      case ResponseType.ARRAY_BUFFER:\n        if ('mozResponseArrayBuffer' in this.xhr_) {\n          return this.xhr_.mozResponseArrayBuffer;\n        }\n    }\n    // Fell through to a response type that is not supported on this browser.\n    goog.log.error(\n        this.logger_,\n        'Response type ' + this.responseType_ + ' is not ' +\n            'supported on this browser');\n    return null;\n  } catch (e) {\n    goog.log.fine(this.logger_, 'Can not get response: ' + e.message);\n    return null;\n  }\n};\n\n\n/**\n * Get the value of the response-header with the given name from the Xhr object\n * Will only return correct result when called from the context of a callback\n * and the request has completed\n * @param {string} key The name of the response-header to retrieve.\n * @return {string|undefined} The value of the response-header named key.\n */\ngoog.net.XhrIo.prototype.getResponseHeader = function(key) {\n  'use strict';\n  if (!this.xhr_ || !this.isComplete()) {\n    return undefined;\n  }\n\n  const value = this.xhr_.getResponseHeader(key);\n  return value === null ? undefined : value;\n};\n\n\n/**\n * Gets the text of all the headers in the response.\n * Will only return correct result after ready state reaches `LOADED` (i.e.\n * `HEADERS_RECEIVED` as per MDN).\n * @return {string} The value of the response headers or empty string.\n */\ngoog.net.XhrIo.prototype.getAllResponseHeaders = function() {\n  'use strict';\n  // getAllResponseHeaders can return null if no response has been received,\n  // ensure we always return an empty string.\n  return this.xhr_ &&\n          this.getReadyState() >= goog.net.XmlHttp.ReadyState.LOADED ?\n      (this.xhr_.getAllResponseHeaders() || '') :\n      '';\n};\n\n\n/**\n * Returns all response headers as a key-value map.\n * Multiple values for the same header key can be combined into one,\n * separated by a comma and a space.\n * Note that the native getResponseHeader method for retrieving a single header\n * does a case insensitive match on the header name. This method does not\n * include any case normalization logic, it will just return a key-value\n * representation of the headers.\n * See: http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method\n * @return {!Object<string, string>} An object with the header keys as keys\n *     and header values as values.\n */\ngoog.net.XhrIo.prototype.getResponseHeaders = function() {\n  'use strict';\n  // TODO(b/120371595): Make this function parse headers as per the spec\n  // (https://tools.ietf.org/html/rfc2616#section-4.2).\n\n  const headersObject = {};\n  const headersArray = this.getAllResponseHeaders().split('\\r\\n');\n  for (let i = 0; i < headersArray.length; i++) {\n    if (goog.string.isEmptyOrWhitespace(headersArray[i])) {\n      continue;\n    }\n    const keyValue =\n        goog.string.splitLimit(headersArray[i], ':', /* maxSplitCount= */ 1);\n    const key = keyValue[0];\n    let value = keyValue[1];\n\n    if (typeof value !== 'string') {\n      // There must be a value but it can be the empty string.\n      continue;\n    }\n\n    // Whitespace at the start and end of the value is meaningless.\n    value = value.trim();\n    // The key should not contain whitespace but we currently ignore that.\n\n    const values = headersObject[key] || [];\n    headersObject[key] = values;\n    values.push(value);\n  }\n\n  return goog.object.map(headersObject, function(values) {\n    'use strict';\n    return values.join(', ');\n  });\n};\n\n\n/**\n * Get the value of the response-header with the given name from the Xhr object.\n * As opposed to {@link #getResponseHeader}, this method does not require that\n * the request has completed.\n * @param {string} key The name of the response-header to retrieve.\n * @return {?string} The value of the response-header, or null if it is\n *     unavailable.\n */\ngoog.net.XhrIo.prototype.getStreamingResponseHeader = function(key) {\n  'use strict';\n  return this.xhr_ ? this.xhr_.getResponseHeader(key) : null;\n};\n\n\n/**\n * Gets the text of all the headers in the response. As opposed to\n * {@link #getAllResponseHeaders}, this method does not require that the request\n * has completed.\n * @return {string} The value of the response headers or empty string.\n */\ngoog.net.XhrIo.prototype.getAllStreamingResponseHeaders = function() {\n  'use strict';\n  return this.xhr_ ? this.xhr_.getAllResponseHeaders() : '';\n};\n\n\n/**\n * Get the last error message\n * @return {!goog.net.ErrorCode} Last error code.\n */\ngoog.net.XhrIo.prototype.getLastErrorCode = function() {\n  'use strict';\n  return this.lastErrorCode_;\n};\n\n\n/**\n * Get the last error message\n * @return {string} Last error message.\n */\ngoog.net.XhrIo.prototype.getLastError = function() {\n  'use strict';\n  return typeof this.lastError_ === 'string' ? this.lastError_ :\n                                               String(this.lastError_);\n};\n\n\n/**\n * Adds the last method, status and URI to the message.  This is used to add\n * this information to the logging calls.\n * @param {string} msg The message text that we want to add the extra text to.\n * @return {string} The message with the extra text appended.\n * @private\n */\ngoog.net.XhrIo.prototype.formatMsg_ = function(msg) {\n  'use strict';\n  return msg + ' [' + this.lastMethod_ + ' ' + this.lastUri_ + ' ' +\n      this.getStatus() + ']';\n};\n\n\n// Register the xhr handler as an entry point, so that\n// it can be monitored for exception handling, etc.\ngoog.debug.entryPointRegistry.register(\n    /**\n     * @param {function(!Function): !Function} transformer The transforming\n     *     function.\n     */\n    function(transformer) {\n      'use strict';\n      goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ =\n          transformer(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_);\n    });\n});  // goog.scope\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Common events for the network classes.\n */\n\n\ngoog.provide('goog.net.EventType');\n\n\n/**\n * Event names for network events\n * @enum {string}\n */\ngoog.net.EventType = {\n  COMPLETE: 'complete',\n  SUCCESS: 'success',\n  ERROR: 'error',\n  ABORT: 'abort',\n  READY: 'ready',\n  READY_STATE_CHANGE: 'readystatechange',\n  TIMEOUT: 'timeout',\n  INCREMENTAL_DATA: 'incrementaldata',\n  PROGRESS: 'progress',\n  // DOWNLOAD_PROGRESS and UPLOAD_PROGRESS are special events dispatched by\n  // goog.net.XhrIo to allow binding listeners specific to each type of\n  // progress.\n  DOWNLOAD_PROGRESS: 'downloadprogress',\n  UPLOAD_PROGRESS: 'uploadprogress',\n};\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n","/**\n * To fetch the values of the flags from the receiver action\n * AlohaLaunchAction.java It returns a proto with the flags.\n */\nimport {Message} from 'google3/javascript/apps/jspb/message';\nimport {asLegacyNullable} from 'google3/javascript/apps/jspb/types/legacy_nullable';\nimport {XhrIo} from 'google3/third_party/javascript/closure/net/xhrio';\nimport {AlohaFormPropertiesResponse} from 'google3/uservoice/common/flags/flag_service.proto';\nimport {\n  defaultAlohaFormProperties,\n  isTestDataRealm,\n} from 'google3/uservoice/feedback/client/web/shared/constants';\nimport {AlohaExperimentFlags} from 'google3/uservoice/feedback/client/web/shared/types';\n\nconst ALOHA_LAUNCH_PATH = 'aloha_form_properties';\nconst SERVER_URI = `https://www.google.com/tools/feedback`;\nconst FLAGS_REQUEST_TIMEOUT_MS = 2000;\nconst JSON_SAFETY_PREFIX = \")]}'\\n\";\n\n/**\n *  Calls Receiver to determine the Aloha form properties\n *  value.\n * @param productId string\n */\nexport async function getAlohaFormProperties(\n  productId: string,\n  serverUri?: string,\n): Promise<AlohaFormPropertiesResponse> {\n  return new Promise((resolve, reject) => {\n    // Only +ve integers are valid product ids.\n    if (!(Number.isInteger(Number(productId)) && Number(productId) > 0)) {\n      reject(new Error('Invalid product id: ' + productId));\n      return;\n    }\n\n    const uri =\n      sanitizeServerUri(serverUri ?? '') +\n      '/' +\n      ALOHA_LAUNCH_PATH +\n      '?productId=' +\n      productId;\n    XhrIo.send(\n      uri,\n      (event) => {\n        const xhr = event.target as XhrIo;\n        let serverData = null;\n        try {\n          serverData = Message.deserializeWithCtor(\n            AlohaFormPropertiesResponse,\n            JSON.stringify(xhr.getResponseJson(JSON_SAFETY_PREFIX)),\n          );\n        } catch (error: unknown) {\n          serverData = defaultAlohaFormProperties();\n        }\n        resolve(serverData);\n      },\n      'GET',\n      /*content=*/ '',\n      /*headers=*/ {},\n      FLAGS_REQUEST_TIMEOUT_MS,\n      /*withCredentials=*/ true,\n    );\n  });\n}\n\n/**\n * The experimentation will be switched off for local instances. We will\n * always render the Aloha form with the new screenshot engine.\n */\nexport function resetFlagsforTest(\n  alohaFormProperties: AlohaFormPropertiesResponse,\n  isLocalServer = false,\n): AlohaExperimentFlags | null {\n  const expFlags = asLegacyNullable(alohaFormProperties.getAlohaFlags());\n\n  if (isLocalServer && expFlags) {\n    expFlags\n      .setEnableSsEngine(true)\n      .setAlohaAutoGaRollout(true)\n      .setEnableMweb(true)\n      .setEnableCtlConsentCheckbox(true)\n      .setEnableIframe(true)\n      .setEnableScreenshotNudge(true)\n      .setEnableJunkNudge(true)\n      .setEnableConfiguratorLocale(true)\n      .setEnableTinyNoPointer(true)\n      .setEnableHelpSuggestions(true)\n      .setEnableSupportSessionLogging(true);\n  }\n\n  return expFlags;\n}\n\nfunction sanitizeServerUri(serverUri: string) {\n  return isTestDataRealm(serverUri) ? serverUri : SERVER_URI;\n}\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Low level handling of XMLHttpRequest.\n */\n\ngoog.provide('goog.net.DefaultXmlHttpFactory');\ngoog.provide('goog.net.XmlHttp');\ngoog.provide('goog.net.XmlHttp.ReadyState');\n\ngoog.require('goog.net.XmlHttpFactory');\ngoog.requireType('goog.net.XhrLike');\n\n\n/**\n * Static class for creating XMLHttpRequest objects.\n * @return {!goog.net.XhrLike.OrNative} A new XMLHttpRequest object.\n */\ngoog.net.XmlHttp = function() {\n  'use strict';\n  return goog.net.XmlHttp.factory_.createInstance();\n};\n\n\n\n/**\n * Status constants for XMLHTTP, matches:\n * https://msdn.microsoft.com/en-us/library/ms534361(v=vs.85).aspx\n * @enum {number}\n */\ngoog.net.XmlHttp.ReadyState = {\n  /**\n   * Constant for when xmlhttprequest.readyState is uninitialized\n   */\n  UNINITIALIZED: 0,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is loading.\n   */\n  LOADING: 1,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is loaded.\n   */\n  LOADED: 2,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is in an interactive state.\n   */\n  INTERACTIVE: 3,\n\n  /**\n   * Constant for when xmlhttprequest.readyState is completed\n   */\n  COMPLETE: 4,\n};\n\n\n/**\n * The global factory instance for creating XMLHttpRequest objects.\n * @type {goog.net.XmlHttpFactory}\n * @private\n */\ngoog.net.XmlHttp.factory_;\n\n\n/**\n * Sets the global factory object.\n * @param {!goog.net.XmlHttpFactory} factory New global factory object.\n */\ngoog.net.XmlHttp.setGlobalFactory = function(factory) {\n  'use strict';\n  goog.net.XmlHttp.factory_ = factory;\n};\n\n\n\n/**\n * Default factory to use when creating xhr objects.  You probably shouldn't be\n * instantiating this directly, but rather using it via goog.net.XmlHttp.\n * @extends {goog.net.XmlHttpFactory}\n * @constructor\n */\ngoog.net.DefaultXmlHttpFactory = function() {\n  'use strict';\n  goog.net.XmlHttpFactory.call(this);\n};\ngoog.inherits(goog.net.DefaultXmlHttpFactory, goog.net.XmlHttpFactory);\n\n\n/** @override */\ngoog.net.DefaultXmlHttpFactory.prototype.createInstance = function() {\n  'use strict';\n  return new XMLHttpRequest();\n};\n\n\n// Set the global factory to an instance of the default factory.\ngoog.net.XmlHttp.setGlobalFactory(new goog.net.DefaultXmlHttpFactory());\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Error codes shared between goog.net.IframeIo and\n * goog.net.XhrIo.\n */\ngoog.module('goog.net.ErrorCode');\ngoog.module.declareLegacyNamespace();\n\n/**\n * Error codes\n * @enum {number}\n */\nconst ErrorCode = {\n\n  /**\n   * There is no error condition.\n   */\n  NO_ERROR: 0,\n\n  /**\n   * The most common error from iframeio, unfortunately, is that the browser\n   * responded with an error page that is classed as a different domain. The\n   * situations, are when a browser error page  is shown -- 404, access denied,\n   * DNS failure, connection reset etc.)\n   *\n   */\n  ACCESS_DENIED: 1,\n\n  /**\n   * Currently the only case where file not found will be caused is when the\n   * code is running on the local file system and a non-IE browser makes a\n   * request to a file that doesn't exist.\n   */\n  FILE_NOT_FOUND: 2,\n\n  /**\n   * If Firefox shows a browser error page, such as a connection reset by\n   * server or access denied, then it will fail silently without the error or\n   * load handlers firing.\n   */\n  FF_SILENT_ERROR: 3,\n\n  /**\n   * Custom error provided by the client through the error check hook.\n   */\n  CUSTOM_ERROR: 4,\n\n  /**\n   * Exception was thrown while processing the request.\n   */\n  EXCEPTION: 5,\n\n  /**\n   * The Http response returned a non-successful http status code.\n   */\n  HTTP_ERROR: 6,\n\n  /**\n   * The request was aborted.\n   */\n  ABORT: 7,\n\n  /**\n   * The request timed out.\n   */\n  TIMEOUT: 8,\n\n  /**\n   * The resource is not available offline.\n   */\n  OFFLINE: 9,\n};\n\n/**\n * Returns a friendly error message for an error code. These messages are for\n * debugging and are not localized.\n * @param {!ErrorCode} errorCode An error code.\n * @return {string} A message for debugging.\n */\nErrorCode.getDebugMessage = function(errorCode) {\n  switch (errorCode) {\n    case ErrorCode.NO_ERROR:\n      return 'No Error';\n\n    case ErrorCode.ACCESS_DENIED:\n      return 'Access denied to content document';\n\n    case ErrorCode.FILE_NOT_FOUND:\n      return 'File not found';\n\n    case ErrorCode.FF_SILENT_ERROR:\n      return 'Firefox silently errored';\n\n    case ErrorCode.CUSTOM_ERROR:\n      return 'Application custom error';\n\n    case ErrorCode.EXCEPTION:\n      return 'An exception occurred';\n\n    case ErrorCode.HTTP_ERROR:\n      return 'Http response at 400 or 500 level';\n\n    case ErrorCode.ABORT:\n      return 'Request was aborted';\n\n    case ErrorCode.TIMEOUT:\n      return 'Request timed out';\n\n    case ErrorCode.OFFLINE:\n      return 'The resource is not available offline';\n\n    default:\n      return 'Unrecognized error code';\n  }\n};\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n\nexports = ErrorCode;\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Constants for HTTP status codes.\n */\n\ngoog.provide('goog.net.HttpStatus');\n\n\n/**\n * HTTP Status Codes defined in RFC 2616, RFC 6585, RFC 4918 and RFC 7538.\n * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\n * @see http://tools.ietf.org/html/rfc6585\n * @see https://tools.ietf.org/html/rfc4918\n * @see https://tools.ietf.org/html/rfc7538\n * @enum {number}\n */\ngoog.net.HttpStatus = {\n  // Informational 1xx\n  CONTINUE: 100,\n  SWITCHING_PROTOCOLS: 101,\n\n  // Successful 2xx\n  OK: 200,\n  CREATED: 201,\n  ACCEPTED: 202,\n  NON_AUTHORITATIVE_INFORMATION: 203,\n  NO_CONTENT: 204,\n  RESET_CONTENT: 205,\n  PARTIAL_CONTENT: 206,\n  MULTI_STATUS: 207,\n\n  // Redirection 3xx\n  MULTIPLE_CHOICES: 300,\n  MOVED_PERMANENTLY: 301,\n  FOUND: 302,\n  SEE_OTHER: 303,\n  NOT_MODIFIED: 304,\n  USE_PROXY: 305,\n  TEMPORARY_REDIRECT: 307,\n  PERMANENT_REDIRECT: 308,\n\n  // Client Error 4xx\n  BAD_REQUEST: 400,\n  UNAUTHORIZED: 401,\n  PAYMENT_REQUIRED: 402,\n  FORBIDDEN: 403,\n  NOT_FOUND: 404,\n  METHOD_NOT_ALLOWED: 405,\n  NOT_ACCEPTABLE: 406,\n  PROXY_AUTHENTICATION_REQUIRED: 407,\n  REQUEST_TIMEOUT: 408,\n  CONFLICT: 409,\n  GONE: 410,\n  LENGTH_REQUIRED: 411,\n  PRECONDITION_FAILED: 412,\n  REQUEST_ENTITY_TOO_LARGE: 413,\n  REQUEST_URI_TOO_LONG: 414,\n  UNSUPPORTED_MEDIA_TYPE: 415,\n  REQUEST_RANGE_NOT_SATISFIABLE: 416,\n  EXPECTATION_FAILED: 417,\n  UNPROCESSABLE_ENTITY: 422,\n  LOCKED: 423,\n  FAILED_DEPENDENCY: 424,\n  PRECONDITION_REQUIRED: 428,\n  TOO_MANY_REQUESTS: 429,\n  REQUEST_HEADER_FIELDS_TOO_LARGE: 431,\n  CLIENT_CLOSED_REQUEST: 499,  // Nonstandard, used by GRPC\n\n  // Server Error 5xx\n  INTERNAL_SERVER_ERROR: 500,\n  NOT_IMPLEMENTED: 501,\n  BAD_GATEWAY: 502,\n  SERVICE_UNAVAILABLE: 503,\n  GATEWAY_TIMEOUT: 504,\n  HTTP_VERSION_NOT_SUPPORTED: 505,\n  INSUFFICIENT_STORAGE: 507,\n  NETWORK_AUTHENTICATION_REQUIRED: 511,\n\n  /*\n   * IE returns this code for 204 due to its use of URLMon, which returns this\n   * code for 'Operation Aborted'. The status text is 'Unknown', the response\n   * headers are ''. Known to occur on IE 6 on XP through IE9 on Win7.\n   */\n  QUIRK_IE_NO_CONTENT: 1223,\n};\n\n\n/**\n * Returns whether the given status should be considered successful.\n *\n * Successful codes are OK (200), CREATED (201), ACCEPTED (202),\n * NO CONTENT (204), PARTIAL CONTENT (206), NOT MODIFIED (304),\n * and IE's no content code (1223).\n *\n * @param {number} status The status code to test.\n * @return {boolean} Whether the status code should be considered successful.\n */\ngoog.net.HttpStatus.isSuccess = function(status) {\n  'use strict';\n  switch (status) {\n    case goog.net.HttpStatus.OK:\n    case goog.net.HttpStatus.CREATED:\n    case goog.net.HttpStatus.ACCEPTED:\n    case goog.net.HttpStatus.NO_CONTENT:\n    case goog.net.HttpStatus.PARTIAL_CONTENT:\n    case goog.net.HttpStatus.NOT_MODIFIED:\n    case goog.net.HttpStatus.QUIRK_IE_NO_CONTENT:\n      return true;\n\n    default:\n      return false;\n  }\n};\n\n// MOE:begin_strip\n// Ensure ES2021 inputs. go/transpile-js\nnull?.(6_6);\n// MOE:end_strip\n","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utility to attempt native JSON processing, falling back to\n *     goog.json if not available.\n *\n *     This is intended as a drop-in for current users of goog.json who want\n *     to take advantage of native JSON if present.\n */\n\ngoog.module('goog.json.hybrid');\ngoog.module.declareLegacyNamespace();\n\nconst asserts = goog.require('goog.asserts');\nconst googJson = goog.require('goog.json');\n\n/**\n * Attempts to serialize the JSON string natively, falling back to\n * `googJson.serialize` if unsuccessful.\n * @param {!Object} obj JavaScript object to serialize to JSON.\n * @return {string} Resulting JSON string.\n */\nconst stringify = googJson.USE_NATIVE_JSON ?\n    goog.global['JSON']['stringify'] :\n    function(obj) {\n      if (goog.global.JSON) {\n        try {\n          return goog.global.JSON.stringify(obj);\n        } catch (e) {\n          // Native serialization failed.  Fall through to retry with\n          // goog.json.serialize.\n        }\n      }\n\n      return googJson.serialize(obj);\n    };\n\n/**\n * Attempts to parse the JSON string natively, falling back to\n * the supplied `fallbackParser` if unsuccessful.\n * @param {string} jsonString JSON string to parse.\n * @param {function(string):Object} fallbackParser Fallback JSON parser used\n *     if native\n * @return {?Object} Resulting JSON object.\n */\nfunction parseInternal(jsonString, fallbackParser) {\n  if (goog.global.JSON) {\n    try {\n      const obj = goog.global.JSON.parse(jsonString);\n      asserts.assert(typeof obj == 'object');\n      return /** @type {?Object} */ (obj);\n    } catch (e) {\n      // Native parse failed.  Fall through to retry with goog.json.parse.\n    }\n  }\n\n  return fallbackParser(jsonString);\n}\n\n/**\n * Attempts to parse the JSON string natively, falling back to\n * `googJson.parse` if unsuccessful.\n * @param {string} jsonString JSON string to parse.\n * @return {?Object} Resulting JSON object.\n */\nconst parse = googJson.USE_NATIVE_JSON ?\n    goog.global['JSON']['parse'] :\n    function(jsonString) {\n      return parseInternal(jsonString, googJson.parse);\n    };\n\nexports = {\n  parse,\n  stringify,\n};\n","// Copyright 2011 Google Inc. All Rights Reserved.\n\n/**\n * @fileoverview Bootstrap file for Google Feedback. Each product should include\n * this file on each page and call userfeedback.api.startFeedback method when\n * the user attempts to submit feedback. More info about integration at\n * http://go/feedback-web/api.\n *\n * @author esprehn@google.com (Elliott Sprehn)\n */\n\ngoog.provide('userfeedback');\ngoog.provide('userfeedback.api');\n\ngoog.require('goog.dom');\ngoog.require('goog.dom.TagName');\ngoog.require('goog.userAgent');\ngoog.require('google3.third_party.javascript.safevalues.dom.index');\ngoog.require('google3.third_party.javascript.safevalues.restricted.reviewed');\ngoog.require('google3.uservoice.feedback.client.web.loader.loader');\ngoog.require('google3.uservoice.feedback.client.web.service.properties_fetch_service');\ngoog.requireType('google3.uservoice.feedback.client.web.shared.types_export');\n\n// LINT.IfChange\n/**\n * Configuration option for setting the locale for the UI feedback displays.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.LOCALE = 'locale';\n\n/**\n * Configuration option to signify server environement.\n * Sample values - TEST, DEV, PROD.\n * defaults to PROD.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.SERVER_ENVIRONMENT = 'serverEnvironment';\n\n/**\n * Configuration option key for where to load the feedback JS and send reports.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.SERVER_URI = 'serverUri';\n\n/**\n * Configuration option key for where to load the feedback JS and send reports.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.FEEDBACK_SERVER_URI = 'feedbackServerUri';\n\n\n/**\n * The uri to contact gaia.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.GAIA_URI = 'gaiaUri';\n\n\n/**\n * Configuration option for specifying the id of the product starting feedback.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.PRODUCT_ID = 'productId';\n\n\n/**\n * Configuration option for specifying the active gaia session.\n *\n * This is the session index for multiple sign in.  The primary Gaia session has\n * index 0.\n * @type {string}\n * @const\n */\nuserfeedback.api.AUTH_USER = 'authuser';\n\n/**\n * Configuration option for specifying the effective user id for a plus page\n * in delegation mode.\n *\n * See java/com/google/apps/framework/auth/GaiaUrlConstants.java.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.PAGE_ID = 'pageId';\n\n\n/**\n * Configuration option for specifying which bucket the reports should be\n * clustered in.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.BUCKET = 'bucket';\n\n\n/**\n * Configuration option for specifying which feedback flow to use.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.FLOW = 'flow';\n\n\n/**\n * Configuration option for specifying if your product contains svg elements.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.SVG = 'svg';\n\n\n/**\n * Configuration option for specifying a custom z index for the\n * dialog, in case the current z-index isn't large enough..\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.CUSTOM_Z_INDEX = 'customZIndex';\n\n\n/**\n * Configuration option for disabling https support for countries that block it.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.HTTPS = 'https';\n\n\n/**\n * Custom config option only for 'submit' flow for flash based clients.  Used\n * for passing a feedback report directly.\n *\n * The report object should have keys 'description', 'screenshot' and\n * 'screenshotSize'.\n * screenshotSize should have a width and height value.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.REPORT = 'report';\n\n\n/**\n * Callback to call once flow is finished.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.CALLBACK = 'callback';\n\n\n/**\n * Function to call when the product is iframed.  Runs before the snapshot\n * is captured and allows the integrating product to make any updates necessary\n * for feedback to capture the snapshot.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.PREP_FRAMED_CONTENT_FUNCTION = 'prepFramedContentFunction';\n\n\n/**\n * Callback to call once the UI is ready.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.ON_LOAD_CALLBACK = 'onLoadCallback';\n\n\n/**\n * Default server address.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.SERVER_URI_DEFAULT = '//www.google.com/tools/feedback';\n\n/**\n * Configuration option key for where to send abuse reports. Should be a fully\n * qualified URL.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.ABUSE_LINK = 'abuseLink';\n\n\n/**\n * A custom field to submit the current product version with the feedback\n * report.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.PRODUCT_VERSION = 'productVersion';\n\n\n/**\n * The flag to use only anonymous feedback.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.ENABLE_ANONYMOUS_FEEDBACK = 'enableAnonymousFeedback';\n\n\n/**\n * The flag to allow feedback from non-logged in users.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.ALLOW_NON_LOGGED_IN_FEEDBACK = 'allowNonLoggedInFeedback';\n\n/**\n * The flag to enable a special tiny UI for apps without a mouse.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.TINY_NO_POINTER = 'tinyNoPointer';\n\n/**\n * The additional consent for the products who want consent for the\n * additional data that they are sending. It will be part of config.\n * More details in go/additional-data-consent-aloha. Data format is,\n * {\n *   defaultOptIn: boolean; // default : false\n *\n *   consentCheckBoxLabel : string; // string with {startDataLink}\n * and {endDataLink} for the link\n *\n *   dataPageTitle : string;\n *\n *   productData : Object, // PSDs to be added if checkbox is true\n *\n *   renderableData : string // HTML in plain string\n * }\n * @type {string}\n * @const\n */\nuserfeedback.api.ADDITIONAL_DATA_CONSENT = 'additionalDataConsent';\n\n\n// LINT.IfChange\n/**\n * Locales supported by feedback. If an unsupported locale is specified in the\n * configuration then 'en' is used instead.\n * @private {!Array<string>}\n * @const\n */\nuserfeedback.api.SUPPORTED_LOCALES_ = [\n  'af',     'am', 'ar', 'az',    'be',    'bg',    'bn',    'bs',    'ca',\n  'cs',     'cy', 'da', 'de',    'el',    'en',    'en-AU', 'en-GB', 'es',\n  'es-419', 'et', 'eu', 'fa',    'fi',    'fil',   'fr',    'fr-CA', 'gl',\n  'gu',     'hi', 'hr', 'hu',    'hy',    'id',    'is',    'it',    'iw',\n  'ja',     'ka', 'kk', 'km',    'ko',    'ky',    'lo',    'lt',    'lv',\n  'kn',     'mk', 'ml', 'mn',    'mr',    'ms',    'my',    'ne',    'nl',\n  'no',     'pa', 'pl', 'pt-BR', 'pt-PT', 'ro',    'ru',    'si',    'sk',\n  'sl',     'sq', 'sr', 'sv',    'sw',    'ta',    'te',    'th',    'tr',\n  'uk',     'ur', 'uz', 'vi',    'zh',    'zh-CN', 'zh-HK', 'zh-TW', 'zu',\n];\n// LINT.ThenChange(//depot/google3/java/com/google/userfeedback/receiver/common/Constants.java,\n// //depot/google3/java/com/google/support/asx/frontend/server/common/Constants.java,\n// //depot/google3/java/com/google/userfeedback/receiver/resources/javascript/locale_defs.bzl,\n// //depot/google3/java/com/google/support/asx/frontend/server/resources/javascript/locale_defs.bzl)\n\n/**\n * The element in the DOM to attach help.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.ANCHOR = 'anchor';\n\n\n/**\n * Name of the Help Center  associated with this product.  e.g. If the\n * helpcenter URL is http://support.google.com/adwords\n * syntax: \u2018helpCenterPath:\u2019/adwords\u2019.\n * (DO NOT  include the full URL http://support.google.com...)\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.HELP_CENTER_PATH = 'helpCenterPath';\n\n\n/**\n * The domain of the help center.  e.g. support.google.com\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.HELP_CENTER_DOMAIN = 'helpCenterDomain';\n\n\n/**\n * The flag to hide \u2018Send Feedback' link.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.ENABLE_SEND_FEEDBACK = 'enableSendFeedback';\n\n\n/**\n * Add this flag if you want to show Contact Us option in Help widget. At least\n * one contact option should be specified in Mojo.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.SHOW_CONTACT_LINK = 'showContactLink';\n\n\n/**\n * The context (URL or place in app) of where the user is. If you don\u2019t specify\n * this, we will use the current page\u2019s URL.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.HELP_CENTER_CONTEXT = 'helpCenterContext';\n\n\n/**\n * The id of a help article to show when the help dialog\n * opens.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.DEFAULT_HELP_ARTICLE_ID = 'defaultHelpArticleId';\n\n\n/**\n * If product wants to show the \u2018Explore Help\u2019 link in the bottom bar.\n * NOTE: This will only show the link if either paidProduct or\n * enableSendFeedback is false.\n *\n * TODO(macneil): This option is no longer used. Remove.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.SHOW_HELP_CENTER_LINK = 'showHelpCenterLink';\n\n\n/**\n * Maximum character limit for the optional product json object for help.\n *\n * @type {number}\n * @const\n */\nuserfeedback.api.MAX_PSD_JSON = 1200;\n\n/**\n * Maximum character limit for the page's href for help context.\n *\n * @type {number}\n * @const\n */\nuserfeedback.api.MAX_PAGE_HREF = 1200;\n\n/**\n * Whether to disable the submission or not. Defaults to false. This parameter\n * should be used as part of the 'submit' flow only, and callers should also\n * provide a [REPORT_DATA_CALLBACK].\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.DISABLE_SUBMIT = 'disableSubmit';\n\n/**\n * Whether to disable the feedback screenshotting or not.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.DISABLE_SCREENSHOTTING = 'disableScreenshotting';\n\n/**\n * Configuration Id of the config stored in configurator. It will be required\n * only if the product wants to show multiple form behaviours. The products\n * needs to configure the behaviour in the configurator tool.\n *\n * @const {string}\n * @deprecated use `userfeedback.api.TRIGGER_ID`\n * TODO(b/265776222): Remove this id.\n */\nuserfeedback.api.CONFIGURATOR_ID = 'configuratorId';\n\n/**\n * Trigger Id of the config stored in configurator. It will be required\n * only if the product wants to show multiple form behaviours. The products\n * needs to configure the behaviour in the configurator tool.\n *\n * @const {string}\n */\nuserfeedback.api.TRIGGER_ID = 'triggerId';\n\n/**\n * A callback function to call with the data that the feedback flow would\n * report when the DISABLE_SUBMIT parameter is set to true. Useful for when\n * a headless integration needs access to the data that feedback collects by\n * default.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.REPORT_DATA_CALLBACK = 'reportDataCallback';\n\n/**\n * Color scheme to use for feedback (Aloha only).\n * Currently the supported color schemes are\n * ColorSchemes.LIGHT and ColorSchemes.DARK.\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.COLOR_SCHEME = 'colorScheme';\n\nuserfeedback.api.reportDataKey = {};\n\n/**\n * Report data metadata keys. This will be useful if you need to\n * localize the account and system information keys. The properties on\n * [reportDataKey] are the keys used in the data object passed into the\n * [REPORT_DATA_CALLBACK].\n *\n * @type {string}\n * @const\n */\nuserfeedback.api.reportDataKey.ANNOTATIONS = 'annotations';\n\n/**\n * Report data metadata key for page information.\n * @type {string}\n * @const\n */\nuserfeedback.api.reportDataKey.PAGE_INFORMATION = 'pageInformation';\n\n/**\n * Report data metadata key for browser information.\n * @type {string}\n * @const\n */\nuserfeedback.api.reportDataKey.BROWSER_INFORMATION = 'browserInformation';\n\n/**\n * Report data metadata key for page structure.\n * @type {string}\n * @const\n */\nuserfeedback.api.reportDataKey.PAGE_STRUCTURE = 'pageStructure';\n\n/**\n * Report data metadata key for product information.\n * @type {string}\n * @const\n */\nuserfeedback.api.reportDataKey.PRODUCT_INFORMATION = 'productInformation';\n// LINT.ThenChange(//depot/google3/userfeedback/javascript/client/api_params.js)\n\ngoog.scope(function() {\nconst alohaLoader =\n    goog.module.get('google3.uservoice.feedback.client.web.loader.loader');\nconst AlohaTypes = goog.module.get(\n    'google3.uservoice.feedback.client.web.shared.types_export');\nconst flagService = goog.module.get(\n    'google3.uservoice.feedback.client.web.service.properties_fetch_service');\n\n/**\n * Loads main feedback script and initiates feedback gathering.\n *\n * @param {!Object} configuration Product configuration.\n * @param {?Object=} productData Data about the product.\n * @param {?Window=} productWindow The indicated window to be used to grab\n *     feedback for. Defaults to the script window.\n * @export\n */\nuserfeedback.api.startFeedback = function(\n    configuration, productData = undefined, productWindow = undefined) {\n  try {\n    if (configuration[userfeedback.api.FLOW] === 'help') {\n      const helpCenterPath =\n          configuration[userfeedback.api.HELP_CENTER_PATH].replace(/^\\//, '');\n      goog.module.get('google3.third_party.javascript.safevalues.dom.index')\n          .windowOpen(\n              productWindow || window,\n              `https://support.google.com/${helpCenterPath}`);\n      return;\n    }\n    // TODO(b/201610825): Migrate headless to Aloha with mendel flag later.\n    if (configuration[userfeedback.api.FLOW] === 'submit') {\n      startFeedbackClassic(configuration, productData, productWindow);\n      return;\n    }\n\n    const flagsPromise = flagService.getAlohaFormProperties(\n        configuration[userfeedback.api.PRODUCT_ID],\n        configuration[userfeedback.api.FEEDBACK_SERVER_URI]);\n    flagsPromise.then(\n        (flagResponse) => {\n          const flags = flagResponse.getAlohaFlags();\n          const enableAlohaForMweb =\n              !goog.userAgent.MOBILE || flags?.getEnableMweb();\n          const enableAlohaForTinyNoPointer =\n              !configuration[userfeedback.api.TINY_NO_POINTER] ||\n              flags?.getEnableTinyNoPointer();\n          if (!flags ||\n              (flags.getAlohaAutoGaRollout() && enableAlohaForMweb &&\n               enableAlohaForTinyNoPointer)) {\n            startFeedbackAloha(configuration, productData, productWindow, flags)\n                .catch(\n                    (err) => handleRejectedPromiseFromAlohaLoader(\n                        err, configuration, productData, productWindow));\n          } else {\n            startFeedbackClassic(configuration, productData, productWindow);\n          }\n        },\n        (err) => {\n          handleRejectedPromiseFromAlohaLoader(\n              err, configuration, productData, productWindow);\n        });\n  } catch (err) {\n    // Load Aloha if exception was thrown while fetching experiment flags\n    startFeedbackAloha(configuration, productData, productWindow, null)\n        .catch(\n            (err) => handleRejectedPromiseFromAlohaLoader(\n                err, configuration, productData, productWindow));\n  }\n};\n\nasync function startFeedbackAloha(configuration, productData, window, flags) {\n  const win = window || goog.global;\n  const /* !AlohaTypes.FeedbackClientConfig */\n      feedbackClientConfig =\n          getAlohaConfigFromClassicConfig(configuration, productData, window);\n  await alohaLoader.loadAndInitializeFeedbackClient(\n      feedbackClientConfig, flags, win, /*useAsyncApi=*/ true);\n}\n\nfunction handleRejectedPromiseFromAlohaLoader(\n    err, configuration, productData, window) {\n  // TODO(aalhadkulkarni): Use shared constants\n  if (err && !(err instanceof alohaLoader.DuplicateFormError)) {\n    startFeedbackClassic(configuration, productData, window);\n  }\n}\n\n// TODO(b/218849991): Merge with startFeedback once aloha launch stabilizes.\nuserfeedback.api.startFeedbackAsync =\n    async function(configuration, productData = undefined, window = undefined) {\n  if (\n      // TODO(b/201610825): Migrate headless to Aloha with mendel flag later.\n      configuration[userfeedback.api.FLOW] === 'submit' ||\n      configuration[userfeedback.api.FLOW] === 'help') {\n    startFeedbackClassic(configuration, productData, window);\n    return;\n  }\n\n  try {\n    const flagResponse = await flagService.getAlohaFormProperties(\n        configuration[userfeedback.api.PRODUCT_ID],\n        configuration[userfeedback.api.FEEDBACK_SERVER_URI]);\n    const flags = flagResponse.getAlohaFlags();\n    const enableAlohaForMweb = !goog.userAgent.MOBILE || flags?.getEnableMweb();\n    const enableAlohaForTinyNoPointer =\n        !configuration[userfeedback.api.TINY_NO_POINTER] ||\n        flags?.getEnableTinyNoPointer();\n    if (!flags ||\n        (flags.getAlohaAutoGaRollout() && enableAlohaForMweb &&\n         enableAlohaForTinyNoPointer)) {\n      await startFeedbackAloha(configuration, productData, window, flags);\n    } else {\n      startFeedbackClassic(configuration, productData, window);\n    }\n  } catch (err) {\n    handleRejectedPromiseFromAlohaLoader(\n        err, configuration, productData, window);\n  }\n};\n\n// TODO(akshaybindal): move this method to a separate file.\n/**\n * Loads main feedback script and initiates feedback gathering.\n *\n * @param {!Object} configuration Product configuration.\n * @param {?Object=} productData Data about the product.\n * @param {?Window=} window The indicated window to be used to grab feedback\n *     for. Defaults to the script window.\n * @return {!AlohaTypes.FeedbackClientConfig}\n *     Client config for Aloha\n */\nfunction getAlohaConfigFromClassicConfig(\n    configuration, productData = undefined, window = undefined) {\n  const isLocalServer =\n      configuration[userfeedback.api.SERVER_ENVIRONMENT] === 'DEV';\n  let win = window || goog.global;\n  const nonce = configuration['nonce'] ||\n      goog.module.get('google3.third_party.javascript.safevalues.dom.index')\n          .getScriptNonce(win.document);\n\n  const config = /** @type {!AlohaTypes.FeedbackClientConfig} */ ({\n    integrationKeys: {\n      productId: configuration[userfeedback.api.PRODUCT_ID],\n      feedbackBucket: configuration[userfeedback.api.BUCKET],\n      triggerId: configuration[userfeedback.api.TRIGGER_ID],\n    },\n    callbacks: {\n      onClose: configuration[userfeedback.api.CALLBACK],\n      onLoad: configuration[userfeedback.api.ON_LOAD_CALLBACK],\n    },\n    formContent: {\n      locale: configuration[userfeedback.api.LOCALE],\n      disableScreenshot: configuration[userfeedback.api.DISABLE_SCREENSHOTTING],\n      productDisplayName: undefined,\n      announcement: undefined,\n      issueCategories: undefined,\n      includeSeveritySelection: undefined,\n      customImageSrc: undefined,\n      thankYouMessage: undefined,\n      userEmail: undefined,\n      defaultFormInputValues: undefined,\n      defaultFormInputValuesString: undefined,\n      abuseLink: configuration[userfeedback.api.ABUSE_LINK],\n      additionalDataConsent:\n          configuration[userfeedback.api.ADDITIONAL_DATA_CONSENT]\n    },\n    initializationData: {\n      isLocalServer,\n      nonce,\n      useNightlyRelease: isLocalServer,\n      feedbackJsUrl: undefined,\n      feedbackCssUrl: undefined,\n      feedbackJsUrlSerialized: undefined,\n      feedbackCssUrlSerialized: undefined,\n      submissionServerUri: configuration[userfeedback.api.FEEDBACK_SERVER_URI],\n      colorScheme: configuration[userfeedback.api.COLOR_SCHEME],\n    },\n    extraData: {\n      productVersion: configuration[userfeedback.api.PRODUCT_VERSION],\n      authUser: configuration[userfeedback.api.AUTH_USER],\n      configuratorId: configuration[userfeedback.api.CONFIGURATOR_ID],\n      customZIndex: configuration[userfeedback.api.CUSTOM_Z_INDEX],\n      tinyNoPointer: configuration[userfeedback.api.TINY_NO_POINTER],\n      allowNonLoggedInFeedback:\n          configuration[userfeedback.api.ALLOW_NON_LOGGED_IN_FEEDBACK],\n      enableAnonymousFeedback:\n          configuration[userfeedback.api.ENABLE_ANONYMOUS_FEEDBACK],\n    },\n  });\n  if (productData) {\n    const productSpecificData = /** @type {!Map<string, string>} */ (\n        new Map(Object.entries(productData)));\n    config.extraData.productSpecificData = productSpecificData;\n  }\n  return config;\n}\n\n/**\n * Loads main feedback script and initiates feedback gathering.\n *\n * @param {!Object} configuration Product configuration.\n * @param {?Object=} productData Data about the product.\n * @param {?Window=} window The indicated window to be used to grab feedback\n *     for. Defaults to the script window.\n */\nfunction startFeedbackClassic(\n    configuration, productData = undefined, window = undefined) {\n  // Record the start time for csi metrics.\n  configuration['timeOfStartCall'] = new Date().getTime();\n\n  let win = window || goog.global;\n  const doc = win.document;\n\n  // Get CSP nonce, s.t. server-side GXP can add the nonce to script tags.\n  // Prefer to get it from configuration['nonce'], but use getScriptNonce()\n  // otherwise.\n  const nonce = configuration['nonce'] ||\n      goog.module.get('google3.third_party.javascript.safevalues.dom.index')\n          .getScriptNonce(win.document);\n  if (nonce && !configuration['nonce']) {\n    configuration['nonce'] = nonce;\n  }\n\n  // TODO(dgupta): move help-specific bootstrap out.\n  if (configuration[userfeedback.api.FLOW] == 'help') {\n    const helpContext = userfeedback.api.HELP_CENTER_CONTEXT;\n    const href = goog.getObjectByName('document.location.href', win);\n    if (!configuration[helpContext] && href) {\n      configuration[helpContext] =\n          href.substring(0, userfeedback.api.MAX_PAGE_HREF);\n    }\n    let isValidPsd = true;\n    // Add optional product data to the config.\n    if (productData && JSON && JSON.stringify) {\n      const psdJson = JSON.stringify(productData);\n      isValidPsd = psdJson.length <= userfeedback.api.MAX_PSD_JSON;\n      if (isValidPsd) {\n        configuration['psdJson'] = psdJson;\n      }\n    }\n    if (!isValidPsd) {\n      productData = {\n        'invalidPsd': true,\n      };\n    }\n  }\n\n  const argArray = [configuration, productData, window];\n\n  win['GOOGLE_FEEDBACK_START_ARGUMENTS'] = argArray;\n\n  const serverUri = configuration[userfeedback.api.FEEDBACK_SERVER_URI] ||\n      userfeedback.api.SERVER_URI_DEFAULT;\n  const startFeedback = win['GOOGLE_FEEDBACK_START'];\n\n  if (startFeedback) {\n    startFeedback.apply(win, argArray);\n  } else {\n    let src = serverUri + '/load.js?';\n    for (const key in configuration) {\n      const value = configuration[key];\n      if (value != null && !goog.isObject(value)) {\n        src += encodeURIComponent(key) + '=' + encodeURIComponent(value) + '&';\n      }\n    }\n    const script =\n        goog.dom.getDomHelper(doc).createElement(goog.dom.TagName.SCRIPT);\n    if (nonce) {\n      script.setAttribute('nonce', nonce);\n    }\n    goog.module.get('google3.third_party.javascript.safevalues.dom.index')\n        .setScriptSrc(\n            script,\n            goog.module\n                .get(\n                    'google3.third_party.javascript.safevalues.restricted.reviewed')\n                .resourceUrlSafeByReview(src, {\n                  justification: 'serverUri is the endpoint of our own Help API'\n                }));\n    /** @type {!HTMLDocument} */ (doc).body.appendChild(script);\n  }\n}\n});\n","/**\n * @license\n * Copyright Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {DEV_MODE} from '../environment/dev';\nimport {createHtmlInternal, SafeHtml} from '../internals/html_impl';\nimport {\n  createResourceUrlInternal,\n  TrustedResourceUrl,\n} from '../internals/resource_url_impl';\nimport {createScriptInternal, SafeScript} from '../internals/script_impl';\nimport {\n  createStyleSheetInternal,\n  SafeStyleSheet,\n} from '../internals/style_sheet_impl';\nimport {createUrlInternal, SafeUrl} from '../internals/url_impl'; // LINE-INTERNAL\n\n// BEGIN-INTERNAL\ngoog.tsMigrationNamedExportsShim('safevalues.restricted.reviewed');\ngoog.tsMigrationExportsShimDeclareLegacyNamespace();\n// END-INTERNAL\n\n/**\n * Utilities to convert arbitrary strings to values of the various\n * Safe HTML types, subject to security review. These are also referred to as\n * \"reviewed conversions\".\n *\n * These functions are intended for use-cases that cannot be expressed using an\n * existing safe API (such as a type's builder) and instead require custom code\n * to produce values of a Safe HTML type. A security review is required to\n * verify that the custom code is indeed guaranteed to produce values that\n * satisfy the target type's security contract.\n *\n * Code using restricted conversions should be structured such that this\n * property is straightforward to establish. In particular, correctness should\n * only depend on the code immediately surrounding the reviewed conversion, and\n * not on assumptions about values received from outside the enclosing function\n * (or, at the most, the enclosing file).\n */\n\n// BEGIN-INTERNAL\n/**\n * You can only use these functions after adding yourself to the exemption list\n * in javascript/typescript/security_allowlists/unchecked-conversions.bzl. Write\n * your code to meet the guidelines described here, and send the code that uses\n * the reviewed conversion, together with the security_allowlists changes\n * in one CL to ise-hardening-reviews (should be added automatically as a\n * reviewer).\n *\n * The full guidelines can be found at go/safehtml-unchecked.\n */\n// END-INTERNAL\n\n/**\n * Asserts that the provided justification is valid (non-empty). Throws an\n * exception if that is not the case.\n */\nfunction assertValidJustification(justification: string) {\n  if (typeof justification !== 'string' || justification.trim() === '') {\n    let errMsg =\n      'Calls to uncheckedconversion functions must go through security review.';\n    errMsg +=\n      ' A justification must be provided to capture what security' +\n      ' assumptions are being made.';\n    // BEGIN-INTERNAL\n    errMsg += ' See go/unchecked-conversions';\n    // END-INTERNAL\n    throw new Error(errMsg);\n  }\n}\n\n/**\n * Performs a \"reviewed conversion\" to SafeHtml from a plain string that is\n * known to satisfy the SafeHtml type contract.\n *\n * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure\n * that the value of `html` satisfies the SafeHtml type contract in all\n * possible program states. An appropriate `justification` must be provided\n * explaining why this particular use of the function is safe.\n */\nexport function htmlSafeByReview(\n  html: string,\n  options: {justification: string},\n): SafeHtml {\n  if (DEV_MODE) {\n    assertValidJustification(options.justification);\n  }\n  return createHtmlInternal(html);\n}\n\n/**\n * Performs a \"reviewed conversion\" to SafeScript from a plain string that\n * is known to satisfy the SafeScript type contract.\n *\n * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure\n * that the value of `script` satisfies the SafeScript type contract in\n * all possible program states. An appropriate `justification` must be provided\n * explaining why this particular use of the function is safe.\n */\nexport function scriptSafeByReview(\n  script: string,\n  options: {justification: string},\n): SafeScript {\n  if (DEV_MODE) {\n    assertValidJustification(options.justification);\n  }\n  return createScriptInternal(script);\n}\n\n/**\n * Performs a \"reviewed conversion\" to TrustedResourceUrl from a plain string\n * that is known to satisfy the SafeUrl type contract.\n *\n * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure\n * that the value of `url` satisfies the TrustedResourceUrl type\n * contract in all possible program states. An appropriate `justification` must\n * be provided explaining why this particular use of the function is safe.\n */\nexport function resourceUrlSafeByReview(\n  url: string,\n  options: {justification: string},\n): TrustedResourceUrl {\n  if (DEV_MODE) {\n    assertValidJustification(options.justification);\n  }\n  return createResourceUrlInternal(url);\n}\n\n/**\n * Performs a \"reviewed conversion\" to SafeStyleSheet from a plain string that\n * is known to satisfy the SafeStyleSheet type contract.\n *\n * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure\n * that the value of `stylesheet` satisfies the SafeStyleSheet type\n * contract in all possible program states. An appropriate `justification` must\n * be provided explaining why this particular use of the function is safe; this\n * may include a security review ticket number.\n */\nexport function styleSheetSafeByReview(\n  stylesheet: string,\n  options: {justification: string},\n): SafeStyleSheet {\n  if (DEV_MODE) {\n    assertValidJustification(options.justification);\n  }\n  return createStyleSheetInternal(stylesheet);\n}\n\n// BEGIN-INTERNAL\n/**\n * Performs a \"reviewed conversion\" to SafeUrl from a plain string that is\n * known to satisfy the SafeUrl type contract.\n *\n * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure\n * that the value of `url` satisfies the SafeUrl type contract in all\n * possible program states. An appropriate `justification` must be provided\n * explaining why this particular use of the function is safe.\n */\nexport function urlSafeByReview(\n  url: string,\n  options: {justification: string},\n): SafeUrl {\n  if (DEV_MODE) {\n    assertValidJustification(options.justification);\n  }\n  return createUrlInternal(url);\n}\n// END-INTERNAL\n","/**\n * @fileoverview\n * Hand-modified Closure version of tslib.js.\n * These use the literal space optimized code from TypeScript for\n * compatibility.\n *\n * @suppress {undefinedVars}\n */\n\n// Do not use @license\n\n/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n\ngoog.module('google3.third_party.javascript.tslib.tslib');\n\n/** @suppress {missingPolyfill} the code below intentionally feature-tests. */\nvar extendStatics = Object.setPrototypeOf ||\n    // LOCAL MODIFICATION: b/241217304. Remove usages of __proto__.\n    function(d, b) {\n      for (var p in b)\n        if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n    };\n\n/**\n * @param {?} d\n * @param {?} b\n */\nexports.__extends = function(d, b) {\n  // LOCAL MODIFICATION: In Cobalt 11 `typeof Event` is 'object' not 'function'.\n  // In addition, YouTube Mobile JavaScript bans usage of `Event` via a\n  // conformance test so we check it via goog.global. We first verify that the\n  // parent class, b, is not undefined (i.e. when `Event` is not present).\n  if (typeof b !== 'function' && b !== null && (b === undefined || b !== goog.global['Event']))\n    throw new TypeError(\n        'Class extends value ' + String(b) + ' is not a constructor or null');\n  extendStatics(d, b);\n  /** @constructor */\n  function __() {\n    /** @type {?} */ (this).constructor = d;\n  }\n  d.prototype =\n      b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n\n/** @type {typeof Object.assign} */\nexports.__assign = Object.assign || /** @return {?} */ function(/** ? */ t) {\n  for (var s, i = 1, n = arguments.length; i < n; i++) {\n    s = arguments[i];\n    for (var p in s)\n      if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n  }\n  return t;\n};\n\n/**\n * @param {?} s\n * @param {?} e\n * @return {?}\n */\nexports.__rest = function(s, e) {\n  var t = {};\n  for (var p in s)\n    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n      t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === 'function')\n    for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n      if (e.indexOf(p[i]) < 0 &&\n          Object.prototype.propertyIsEnumerable.call(s, p[i]))\n        t[p[i]] = s[p[i]];\n    }\n  return t;\n};\n\n/**\n * @param {?} decorators\n * @param {T} target\n * @param {?=} key\n * @param {?=} desc\n * @return {T}\n * @template T\n */\nexports.__decorate = function(decorators, target, key, desc) {\n  var c = arguments.length,\n      r = c < 3     ? target :\n      desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) :\n                      desc,\n      d;\n  // LOCAL MODIFICATION: use quoted property access to work around b/77140019.\n  if (Reflect && typeof Reflect === 'object' &&\n      typeof Reflect['decorate'] === 'function')\n    r = Reflect['decorate'](decorators, target, key, desc);\n  else\n    for (var i = decorators.length - 1; i >= 0; i--)\n      if (d = decorators[i])\n        r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n  return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n\n/**\n * @param {?} paramIndex\n * @param {?} decorator\n * @return {?}\n */\nexports.__param = function(paramIndex, decorator) {\n  return function(target, key) {\n    decorator(target, key, paramIndex);\n  };\n};\n\n// LOCAL MODIFICATION: Exclude the following functions:\n// __esDecorate\n// __runInitializers\n// __propKey\n\nexports.__setFunctionName = function(f, name, prefix) {\n  if (typeof name === 'symbol')\n    name = name.description ? '['.concat(name.description, ']') : '';\n  return Object.defineProperty(f, 'name', {\n    configurable: true,\n    value: prefix ? ''.concat(prefix, ' ', name) : name\n  });\n};\n\n/**\n * @param {?} metadataKey\n * @param {?} metadataValue\n * @return {?}\n */\nexports.__metadata = function(metadataKey, metadataValue) {\n  // LOCAL MODIFICATION: use quoted property access to work around b/77140019.\n  if (Reflect && typeof Reflect === 'object' &&\n      typeof Reflect['metadata'] === 'function')\n    return Reflect['metadata'](metadataKey, metadataValue);\n};\n\n/**\n * @template T\n * @param {T} thisArg\n * @param {?} _arguments\n * @param {?} P\n * @param {function(this:T)} generator\n * @return {?}\n */\nexports.__awaiter = function(thisArg, _arguments, P, generator) {\n  function adopt(value) {\n    return value instanceof P ? value : new P(function(resolve) {\n      resolve(value);\n    });\n  }\n  return new (P || (P = Promise))(function(resolve, reject) {\n    function fulfilled(value) {\n      try {\n        // LOCAL MODIFICATION: Cannot express the function + keys pattern in the\n        // Closure Compiler, so we escape generator.next with the `?` type.\n        step(/** @type {?} */ (generator).next(value));\n      } catch (e) {\n        reject(e);\n      }\n    }\n    function rejected(value) {\n      try {\n        step(generator['throw'](value));\n      } catch (e) {\n        reject(e);\n      }\n    }\n    function step(result) {\n      result.done ? resolve(result.value) :\n                    adopt(result.value).then(fulfilled, rejected);\n    }\n    step((generator = generator.apply(thisArg, _arguments || [])).next());\n  });\n};\n\n/**\n * @param {?} thisArg\n * @param {?} body\n * @return {?}\n */\nexports.__generator = function(thisArg, body) {\n  var _ = {\n    label: 0,\n    sent: function() {\n      if (t[0] & 1) throw /** @type {!Error} */ (t[1]);\n      return t[1];\n    },\n    trys: [],\n    ops: []\n  },\n      f, y, t,\n      g = Object.create(\n          (typeof Iterator === 'function' ? Iterator : Object).prototype);\n  // LOCAL MODIFICATION: access property quoted to compile and prevent renaming.\n  return g['next'] = verb(0), g['throw'] = verb(1), g['return'] = verb(2),\n         typeof Symbol === 'function' && (g[Symbol.iterator] = function() {\n           return /** @type {?} */ (this);\n         }), g;\n  function verb(n) {\n    return function(v) {\n      return step([n, v]);\n    };\n  }\n  /**\n   * @suppress {strictMissingProperties} TODO(b/214874268): Remove\n   * strictMissingProperties suppression after b/214427036 is fixed\n   */\n  function step(op) {\n    if (f) throw new TypeError('Generator is already executing.');\n    while (g && (g = 0, op[0] && (_ = 0)), _) try {\n        if (f = 1,\n            y &&\n                (t = op[0] & 2 ? y['return'] :\n                     op[0] ? y['throw'] || ((t = y['return']) && t.call(y), 0) :\n                             y.next) &&\n                !(t = t.call(y, op[1])).done)\n          return t;\n        if (y = 0, t) op = [op[0] & 2, t.value];\n        switch (op[0]) {\n          case 0:\n          case 1:\n            t = op;\n            break;\n          case 4:\n            _.label++;\n            return {value: op[1], done: false};\n          case 5:\n            _.label++;\n            y = op[1];\n            op = [0];\n            continue;\n          case 7:\n            op = _.ops.pop();\n            _.trys.pop();\n            continue;\n          default:\n            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) &&\n                (op[0] === 6 || op[0] === 2)) {\n              _ = 0;\n              continue;\n            }\n            if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n              _.label = op[1];\n              break;\n            }\n            if (op[0] === 6 && _.label < t[1]) {\n              _.label = t[1];\n              t = op;\n              break;\n            }\n            if (t && _.label < t[2]) {\n              _.label = t[2];\n              _.ops.push(op);\n              break;\n            }\n            if (t[2]) _.ops.pop();\n            _.trys.pop();\n            continue;\n        }\n        op = body.call(thisArg, _);\n      } catch (e) {\n        op = [6, e];\n        y = 0;\n      } finally {\n        f = t = 0;\n      }\n    if (op[0] & 5) throw /** @type {!Error} */ (op[1]);\n    return {value: op[0] ? op[1] : void 0, done: true};\n  }\n};\n\n/**\n * @param {?} m\n * @param {?} o\n */\nexports.__exportStar = function(m, o) {\n  for (var p in m)\n    if (p !== 'default' && !Object.prototype.hasOwnProperty.call(o, p))\n      // LOCAL MODIFICATION: Using __createBinding makes o[p] non-settable which\n      // breaks code like the following (valid for ESM modules):\n      // # file1.ts\n      //   export const foo = 'foo';\n      //   export const bar = 'bar';\n      // # file2.ts\n      //   export * as m from './file1';\n      //   export const foo = 'a new foo value';\n      o[p] = m[p];\n};\n\n// LOCAL MODIFICATION: Exclude the following function:\n// __createBinding\n\n/**\n * @param {?} o\n * @return {?}\n */\nexports.__values = function(o) {\n  var s = typeof Symbol === 'function' && Symbol.iterator, m = s && o[/** @type {symbol} */ (s)], i = 0;\n  if (m) return m.call(o);\n  if (o && typeof o.length === 'number')\n    return {\n      next: function() {\n        if (o && i >= o.length) o = void 0;\n        return {value: o && o[i++], done: !o};\n      }\n    };\n  throw new TypeError(\n      s ? 'Object is not iterable.' : 'Symbol.iterator is not defined.');\n};\n\n/**\n * @param {?} o\n * @param {?=} n\n * @return {?}\n */\nexports.__read = function(o, n) {\n  var m = typeof Symbol === 'function' && o[Symbol.iterator];\n  if (!m) return o;\n  var i = m.call(o), r, ar = [], e;\n  try {\n    while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n  } catch (error) {\n    e = {error: error};\n  } finally {\n    try {\n      if (r && !r.done && (m = i['return'])) m.call(i);\n    } finally {\n      if (e) throw /** @type {!Error} */ (e.error);\n    }\n  }\n  return ar;\n};\n\n/** @deprecated */\nexports.__spread = function() {\n  for (var ar = [], i = 0; i < arguments.length; i++)\n    ar = ar.concat(exports.__read(arguments[i]));\n  return ar;\n};\n\n/** @deprecated */\nexports.__spreadArrays = function() {\n  for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n    s += arguments[i].length;\n  for (var r = Array(s), k = 0, i = 0; i < il; i++)\n    for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n      r[k] = a[j];\n  return r;\n};\n\n/**\n * @param {!Array<?>} to\n * @param {!Array<?>} from\n * @param {!Array<?>} pack\n * @return {!Array<?>}\n */\nexports.__spreadArray = function(to, from, pack) {\n  if (pack || arguments.length === 2)\n    for (var i = 0, l = from.length, ar; i < l; i++) {\n      if (ar || !(i in from)) {\n        if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n        ar[i] = from[i];\n      }\n    }\n  return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n/**\n * @constructor\n * @this {?}\n * @param {?} v\n * @return {?}\n */\nexports.__await = function(v) {\n  return this instanceof exports.__await ? (this.v = v, this) :\n                                           new exports.__await(v);\n};\n\n/**\n * @template T\n * @param {T} thisArg\n * @param {?} _arguments\n * @param {function(this:T)} generator\n * @return {?}\n */\nexports.__asyncGenerator = function(thisArg, _arguments, generator) {\n  if (!Symbol.asyncIterator)\n    throw new TypeError('Symbol.asyncIterator is not defined.');\n  var g = generator.apply(thisArg, _arguments || []), i, q = [];\n  return i = Object.create(\n             (typeof AsyncIterator === 'function' ? AsyncIterator : Object)\n                 .prototype),\n         verb('next'), verb('throw'), verb('return', awaitReturn),\n         i[Symbol.asyncIterator] = function() {\n           return /** @type {?} */ (this);\n         }, i;\n  function awaitReturn(f) {\n    return function(v) {\n      return Promise.resolve(v).then(f, reject);\n    };\n  }\n  /**\n   * @param {?} n\n   * @param {?=} f\n   * @return {?}\n   */\n  function verb(n, f) {\n    if (g[n]) {\n      i[n] = function(v) {\n        return new Promise(function(a, b) {\n          q.push([n, v, a, b]) > 1 || resume(n, v);\n        });\n      };\n      if (f) i[n] = f(i[n]);\n    }\n  }\n  function resume(n, v) {\n    try {\n      step(g[n](v));\n    } catch (e) {\n      settle(q[0][3], e);\n    }\n  }\n  function step(r) {\n    r.value instanceof exports.__await ?\n        Promise.resolve(/** @type {?} */ (r.value).v).then(fulfill, reject) :\n        settle(q[0][2], r);\n  }\n  function fulfill(value) {\n    resume('next', value);\n  }\n  function reject(value) {\n    resume('throw', value);\n  }\n  function settle(f, v) {\n    if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);\n  }\n};\n\n/**\n * @param {?} o\n * @return {?}\n */\nexports.__asyncDelegator = function(o) {\n  var i, p;\n  return i = {}, verb('next'), verb('throw', function(e) {\n           throw e;\n         }), verb('return'), i[Symbol.iterator] = function() {\n    return /** @type {?} */ (this);\n  }, i;\n  /**\n   * @param {?} n\n   * @param {?=} f\n   * @return {?}\n   */\n  function verb(n, f) {\n    i[n] = o[n] ? function(v) {\n      // LOCAL MODIFICATION: If __await is called without new, it calls itself\n      // again with new. We mark __await as a constructor above so need to\n      // directly call new to appease the compiler. Same behavior though.\n      return (p = !p) ? {value: new exports.__await(o[n](v)), done: false} : f ? f(v) : v;\n    } : f;\n  }\n};\n\n/**\n * @param {?} o\n * @return {?}\n */\nexports.__asyncValues = function(o) {\n  if (!Symbol.asyncIterator)\n    throw new TypeError('Symbol.asyncIterator is not defined.');\n  var m = o[Symbol.asyncIterator], i;\n  return m ?\n      m.call(o) :\n      (o = typeof __values === 'function' ? __values(o) : o[Symbol.iterator](),\n       i = {}, verb('next'), verb('throw'), verb('return'),\n       i[Symbol.asyncIterator] = function() {\n         return /** @type {?} */ (this);\n       }, i);\n  function verb(n) {\n    i[n] = o[n] && function(v) {\n      return new Promise(function(resolve, reject) {\n        v = o[n](v), settle(resolve, reject, v.done, v.value);\n      });\n    };\n  }\n  function settle(resolve, reject, d, v) {\n    Promise.resolve(v).then(function(v) {\n      resolve({value: v, done: d});\n    }, reject);\n  }\n};\n\n/**\n * @param {?=} cooked\n * @param {?=} raw\n * @return {?}\n */\nexports.__makeTemplateObject = function(cooked, raw) {\n  if (Object.defineProperty) {\n    Object.defineProperty(cooked, 'raw', {value: raw});\n  } else {\n    cooked.raw = raw;\n  }\n  return cooked;\n};\n\n// LOCAL MODIFICATION: Exclude the following functions:\n// __importStar\n// __importDefault\n\n/**\n * @param {?} receiver\n * @param {?} state\n * @param {?} kind\n * @param {?} f\n * @return {?}\n */\nexports.__classPrivateFieldGet = function(receiver, state, kind, f) {\n  if (kind === 'a' && !f)\n    throw new TypeError('Private accessor was defined without a getter');\n  if (typeof state === 'function' ? receiver !== state || !f :\n                                    !state.has(receiver))\n    throw new TypeError(\n        'Cannot read private member from an object whose class did not declare it');\n  return kind === 'm' ? f :\n      kind === 'a'    ? f.call(receiver) :\n      f               ? f.value :\n                        state.get(receiver);\n};\n\n/**\n * @param {?} receiver\n * @param {?} state\n * @param {?} value\n * @param {?} kind\n * @param {?} f\n * @return {?}\n */\nexports.__classPrivateFieldSet = function(receiver, state, value, kind, f) {\n  if (kind === 'm') throw new TypeError('Private method is not writable');\n  if (kind === 'a' && !f)\n    throw new TypeError('Private accessor was defined without a setter');\n  if (typeof state === 'function' ? receiver !== state || !f :\n                                    !state.has(receiver))\n    throw new TypeError(\n        'Cannot write private member to an object whose class did not declare it');\n  return (kind === 'a' ? f.call(receiver, value) :\n              f        ? f.value = value :\n                         state.set(receiver, value)),\n         value;\n};\n\n/**\n * @param {?} state\n * @param {?} receiver\n * @return {?}\n */\nexports.__classPrivateFieldIn = function(state, receiver) {\n  if (receiver === null ||\n      (typeof receiver !== 'object' && typeof receiver !== 'function'))\n    throw new TypeError('Cannot use \\'in\\' operator on non-object');\n  return typeof state === 'function' ? receiver === state : state.has(receiver);\n};\n\n/**\n * @param {?} env\n * @param {?} value\n * @param {?} async\n * @return {?}\n */\nexports.__addDisposableResource = function(env, value, async) {\n  if (value !== null && value !== void 0) {\n    if (typeof value !== 'object' && typeof value !== 'function')\n      throw new TypeError('Object expected.');\n    var dispose, inner;\n    // LOCAL MODIFICATION: Cast to `valueObject` to explain to the Closure\n    // Compiler that `value` can't be `null` nor `undefined` here.\n    var valueObject = /** @type {!Object} */ (value);\n    if (async) {\n      if (!Symbol.asyncDispose)\n        throw new TypeError('Symbol.asyncDispose is not defined.');\n      dispose = valueObject[Symbol.asyncDispose];\n    }\n    if (dispose === void 0) {\n      if (!Symbol.dispose)\n        throw new TypeError('Symbol.dispose is not defined.');\n      dispose = valueObject[Symbol.dispose];\n      if (async) inner = dispose;\n    }\n    if (typeof dispose !== 'function')\n      throw new TypeError('Object not disposable.');\n    if (inner)\n      dispose = function() {\n        try {\n          inner.call(/** @type {?} */ (this));\n        } catch (e) {\n          return Promise.reject(e);\n        }\n      };\n    env.stack.push({value: value, dispose: dispose, async: async});\n  } else if (async) {\n    env.stack.push({async: true});\n  }\n  return value;\n};\n\n// LOCAL MODIFICATION: Not polyfilling SuppressedError here. It's polyfilled at\n// google3/third_party/java_src/jscomp/java/com/google/javascript/jscomp/js/es6/dispose.js\n\n/**\n * @param {?} env\n * @return {?}\n */\nexports.__disposeResources = function(env) {\n  function fail(e) {\n    env.error = env.hasError ?\n        // LOCAL MODIFICATION: Use SuppressedError instead of _SuppressedError.\n        new SuppressedError(\n            e, env.error, 'An error was suppressed during disposal.') :\n        e;\n    env.hasError = true;\n  }\n  var r, s = 0;\n  function next() {\n    while (r = env.stack.pop()) {\n      try {\n        if (!r.async && s === 1)\n          return s = 0, env.stack.push(r), Promise.resolve().then(next);\n        if (r.dispose) {\n          var result = r.dispose.call(r.value);\n          if (r.async)\n            return s |= 2, Promise.resolve(result).then(next, function(e) {\n              fail(e);\n              return next();\n            });\n        } else\n          s |= 1;\n      } catch (e) {\n        fail(e);\n      }\n    }\n    if (s === 1)\n      return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n    if (env.hasError) throw env.error;\n  }\n  return next();\n};\n\n// LOCAL MODIFICATION: Not including __rewriteRelativeImportExtension\n","import 'google3/third_party/javascript/polygerrit/api/gerrit';\n\nimport {PluginApi} from 'google3/third_party/javascript/polygerrit/api/plugin';\nimport {api} from 'google3/userfeedback/javascript/api/bootstrap';\nimport {css, CSSResult, html, LitElement, TemplateResult} from 'lit';\nimport {customElement} from 'lit/decorators';\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'gr-feedback-button': GrFeedbackButton;\n    'gr-icon': HTMLElement; // Known to exist from main Gerrit app\n  }\n}\n\n/**\n * Custom feedback button that will trigger the Listnr feedback flow.\n */\n@customElement('gr-feedback-button')\nexport class GrFeedbackButton extends LitElement {\n  static override get styles(): CSSResult {\n    return css`\n      a {\n        cursor: pointer;\n      }\n      gr-icon {\n        font-size: 20px;\n        color: var(--header-text-color);\n      }\n    `;\n  }\n  private clicked(): void {\n    api.startFeedback({\n      'productId': '5163239',\n      'bucket': 'gerrit-feedback',\n      'productVersion': window.VERSION_INFO ?? 'Unknown Version',\n    });\n  }\n\n  override render(): TemplateResult {\n    return html`\n      <a\n        title=\"File a bug\"\n        aria-label=\"File a bug\"\n        role=\"button\"\n        @click=${this.clicked}>\n        <gr-icon icon=\"feedback\" filled></gr-icon>\n      </a>\n    `;\n  }\n}\n\nwindow.Gerrit.install(async (pluginApi: PluginApi) => {\n  // Non-googlers will see the default feedback button instead.\n  if ((await pluginApi.restApi().getAccount())?.tags?.includes('GOOGLER')) {\n    pluginApi.registerCustomComponent('header-feedback', 'gr-feedback-button', {\n      replace: true,\n    });\n  }\n});\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\n\nimport type {Constructor} from './base.js';\n\n/**\n * Allow for custom element classes with private constructors\n */\ntype CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nexport type CustomElementDecorator = {\n  // legacy\n  (cls: CustomElementClass): void;\n\n  // standard\n  (\n    target: CustomElementClass,\n    context: ClassDecoratorContext<Constructor<HTMLElement>>\n  ): void;\n};\n\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * ```js\n * @customElement('my-element')\n * class MyElement extends LitElement {\n *   render() {\n *     return html``;\n *   }\n * }\n * ```\n * @category Decorator\n * @param tagName The tag name of the custom element to define.\n */\nexport const customElement =\n  (tagName: string): CustomElementDecorator =>\n  (\n    classOrTarget: CustomElementClass | Constructor<HTMLElement>,\n    context?: ClassDecoratorContext<Constructor<HTMLElement>>\n  ) => {\n    if (context !== undefined) {\n      context.addInitializer(() => {\n        customElements.define(\n          tagName,\n          classOrTarget as CustomElementConstructor\n        );\n      });\n    } else {\n      customElements.define(tagName, classOrTarget as CustomElementConstructor);\n    }\n  };\n"],
"names":["$jscomp.defineProperty","$jscomp.global","$jscomp.getGlobal","$jscomp.polyfill","goog","goog.global","self","goog.getObjectByName","name","opt_obj","parts","split","cur","i","length","goog.typeOf","value","s","Array","isArray","goog.isArrayLike","val","type","goog.isObject","goog.bindNative_","fn","selfObj","var_args","call","apply","bind","arguments","goog.bindJs_","Error","boundArgs","prototype","slice","newArgs","unshift","goog.bind","Function","toString","indexOf","goog.bindapply","goog.weakUsage","goog.inherits","childCtor","parentCtor","tempCtor","superClass_","constructor","base","childCtor.base","me","methodName","args","shimNotNeeded","module$exports$google3$javascript$polymer$detect_transpilation$detect_transpilation.wasTranspiledToEs5","test","servingRawClasses","HTMLElement","goog.globalReflect","Reflect","undefined","goog.globalcustomElements","customElements","patchedHTMLElement","module$exports$webcomponentsjs$custom_elements$es5_shim_implementation.getHTMLElement","exports.getHTMLElement","reflect","construct","BuiltInHTMLElement","shim","es5Shimmed","Object","setPrototypeOf","applied","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.supportsAdoptingStyleSheets","goog.globalShadowRoot","ShadowRoot","goog.globalShadyCSS","ShadyCSS","goog.globalShadyCSSnativeShadow","nativeShadow","Document","CSSStyleSheet","constructionToken","Symbol","cssTagCache","WeakMap","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.CSSResult","cssText","strings","_strings","styleSheet","_styleSheet","cacheable","get","replaceSync","set","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.css","values","exports.css","valueOf","reduce","acc","v","idx","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.adoptStyles","renderRoot","styles","exports.adoptStyles","adoptedStyleSheets","map","style","document","createElement","nonce","setAttribute","textContent","appendChild","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$css$2dtag.getCompatibleStyle","rule","sheet","cssRules","String","polyfillSupport","ReactiveElement","globalThis","ApplyShim","elementProto","ShadyDOM","inUse","noPatch","patchElementProto","createRenderRoot","elementProto.createRenderRoot","localName","hasOwnProperty","SCOPED","css","elementStyles","from","a","r","ScopingShim","prepareAdoptedCssText","_$handlesPrepareStyles","prepareTemplateStyles","shadowRoot","attachShadow","shadowRootOptions","connectedCallback","elementProto.connectedCallback","hasUpdated","styleElement","didUpdate","_$didUpdate","elementProto._$didUpdate","changedProperties","reactiveElementPolyfillSupport","is","defineProperty","getOwnPropertyDescriptor","getOwnPropertyNames","getOwnPropertySymbols","getPrototypeOf","trustedTypes","goog.globaltrustedTypes","emptyStringForBooleanAttribute","emptyScript","goog.globalreactiveElementPolyfillSupport","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.defaultConverter","toAttribute","Boolean","JSON","stringify","fromAttribute","fromValue","Number","parse","e","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.notEqual","old","exports.notEqual","defaultPropertyDeclaration","attribute","converter","useDefault","hasChanged","metadata","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.litPropertyMetadata","getPropertyDescriptor","options","key","oldValue","requestUpdate","configurable","enumerable","createProperty","state","__prepare","create","wrapped","elementProperties","noAccessor","descriptor","ctor","newValue","getPropertyOptions","__defaultValues","hasAttribute","__attributeNameForProperty","_$changeProperty","isUpdatePending","__updatePromise","__enqueueUpdate","performUpdate","__instanceProperties","p__tsickle_destructured_5","value__tsickle_destructured_6","size","p__tsickle_destructured_7","options__tsickle_destructured_8","p","_$changedProperties","has","shouldUpdate","__controllers","forEach","c","hostUpdate","update","__markUpdated","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.ReactiveElement","addInitializer","initializer","_initializers","push","finalize","__attributeToPropertyMap","keys","superCtor","Map","oneTimeWork","finalized","props","properties","propKeys","symbolMetadata","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.litPropertyMetadataget","p__tsickle_destructured_1","options__tsickle_destructured_2","p__tsickle_destructured_3","options__tsickle_destructured_4","attr","Set","flat","Infinity","reverse","toLowerCase","__reflectingProperty","__initialize","Promise","res","enableUpdating","__saveInstanceProperties","instanceProperties","hostConnected","disconnectedCallback","hostDisconnected","attributeChangedCallback","_old","_$attributeToProperty","__propertyToAttribute","attrValue","removeAttribute","propName","converterResult","initializeValue","__reflectingProperties","add","squelchUpdateErrorsDuringLit2Migration","reject","result","scheduleUpdate","hostUpdated","updated","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.ReactiveElementelementStyles","module$exports$google3$third_party$javascript$lit$packages$reactive$2delement$src$reactive$2delement.ReactiveElementshadowRootOptions","mode","reactiveElementVersions","goog.globalreactiveElementVersions","styledScopes","scopeCssStore","Template","ChildPart","wrap","node","needsPrepareStyles","cssForScope","scopeCss","prepareStyles","template","hasScopeCss","join","content","delete","querySelector","scopedTemplateCache","originalCreateElement","Template.createElement","html","element","scope","prepareTemplateDom","querySelectorAll","parentNode","removeChild","renderContainer","createDocumentFragment","renderContainerMarker","createComment","childPartProto","setValue","_$setValue","childPartProto._$setValue","directiveParent","container","_$startNode","startNode","endNode","_$endNode","_$committedValue","_$template","el","cloneNode","insertBefore","_$getTemplate","childPartProto._$getTemplate","templateCache","litHtmlPolyfillSupport","symbolKey","needsSymbolSupport","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$polyfill$2dsupport.isPolyfilledSymbol","for","globalThis.Symbol.for","LitElement","litElementProto","litElementProto.createRenderRoot","renderOptions","litElementPolyfillSupport","module$exports$google3$third_party$javascript$safevalues$internals$trusted_types.trustedTypes","trustedTypesInternal","policy","createPolicy","identity","x","configuredPolicyName","createHTML","createScript","createScriptURL","module$exports$google3$third_party$javascript$safevalues$internals$html_impl.SafeHtml","privateDoNotAccessOrElseWrappedHtml","module$exports$google3$third_party$javascript$safevalues$internals$trusted_types.trustedTypesemptyHTML","emptyHTML","unwrapHtml","message","module$exports$google3$third_party$javascript$safevalues$internals$resource_url_impl.TrustedResourceUrl","privateDoNotAccessOrElseWrappedResourceUrl","createResourceUrlInternal","noinlineValue","unwrapResourceUrl","module$exports$google3$third_party$javascript$safevalues$builders$url_builders.IS_NOT_JAVASCRIPT_URL_PATTERN","trustedResourceUrl","templateObj","rest","url","encodeURIComponent","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$internal$2dsecurity.sanitizerFactory","realSanitizerFactory","rawName","nodeType","allowAnything","module$exports$google3$third_party$javascript$safevalues$internals$html_impl.EMPTY_HTML","contract","securityContracts","tagName","baseToCheck","includes","BLOCK_JAVASCRIPT_URL_PATTERN","fallbackTrustedUrl","onlyForbidJavascriptUrls","forbidEverythingBecauseFieldIsUnsupported","requireTrustedResourceUrl","maybeResourceUrl","maybeSafeHtml","requireSafeHtml","goog.globalShadyDOM","goog.globalShadyDOMwrap","identityFunction","noopSanitizer","marker","Math","random","toFixed","markerMatch","nodeMarker","d","isPrimitive","textEndRegex","commentEndRegex","comment2EndRegex","tagEndRegex","RegExp","singleQuoteAttrEndRegex","doubleQuoteAttrEndRegex","rawTextElement","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.html","exports.html","HTML_RESULT","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.noChange","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.nothing","walker","createTreeWalker","trustFromTemplateString","tsa","stringFromTSA","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.Template","nodeIndex","attrNameIndex","partCount","l","attrNames","SVG_RESULT","MATHML_RESULT","rawTextEndRegex","regex","attrNameEndIndex","attrName","lastIndex","match","exec","COMMENT_START","TAG_NAME","DYNAMIC_TAG_NAME","ENTIRE_MATCH","ATTRIBUTE_NAME","SPACES_AND_EQUALS","QUOTE_CHAR","end","startsWith","boundAttributeSuffix","html__tsickle_destructured_1","attrNames__tsickle_destructured_2","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.TemplatecreateElement","currentNode","wrapper","firstChild","replaceWith","childNodes","nextNode","hasAttributes","getAttributeNames","endsWith","realName","statics","getAttribute","m","ATTRIBUTE_PART","index","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.PropertyPart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.BooleanAttributePart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.EventPart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.AttributePart","ELEMENT_PART","append","CHILD_PART","data","COMMENT_PART","innerHTML","resolveDirective","part","parent","attributeIndex","__directives","currentDirective","__directive","nextDirectiveConstructor","_$initialize","_$resolve","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.TemplateInstance","_$parts","_$disconnectableChildren","_$parent","_$isConnected","_clone","creationScope","fragment","importNode","partIndex","templatePart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.ChildPart","nextSibling","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.ElementPart","_update","setConnected","isConnected","__isConnected","_$notifyConnectionChanged","_textSanitizer","_$clear","_commitText","_commitTemplateResult","_commitNode","iterator","_commitIterable","_insert","parentNodeName","nodeName","textNode","createTextNode","h","instance","itemParts","itemPart","item","start","n","remove","fill","_sanitizer","valueIndex","noCommit","change","_commitValue","PROPERTY_PART","BOOLEAN_ATTRIBUTE_PART","toggleAttribute","EVENT_PART","newListener","oldListener","shouldRemoveListener","capture","once","passive","shouldAddListener","removeEventListener","addEventListener","handleEvent","event","host","litHtmlVersions","goog.globallitHtmlVersions","render","renderBefore","partOwnerNode","module$exports$google3$third_party$javascript$lit$packages$lit$2delement$src$lit$2delement.LitElement","__childPart","module$exports$google3$third_party$javascript$lit$packages$lit$2dhtml$src$lit$2dhtml.render","goog.globallitElementPolyfillSupport","litElementVersions","goog.globallitElementVersions","arr","obj","opt_fromIndex","fromIndex","f","arr2","rv","splice","toArray","object","some","PROTOTYPE_FIELDS","extend","target","source","j","windowOpen","win","module$exports$google3$third_party$javascript$safevalues$builders$url_builders.IS_NOT_JAVASCRIPT_URL_PATTERNtest","hasJavascriptUrlScheme","sanitizedUrl","open","features","getNonceFor","doc","setScriptSrc","script","src","ownerDocument","goog.FLAGS_OBJECT_","googFlagId","defaultValue","getNativeUserAgentString","navigator","goog.globalnavigator","userAgent","goog.userAgent.WEBKIT","str","subString","goog.userAgent.MOBILE","goog.dom.DIRECT_ATTRIBUTE_MAP_","goog.dom.append_","childHandler","child","startIndex","arg","goog.dom.createElement_","contentType","goog.dom.DomHelper","opt_document","document_","goog.globaldocument","goog.dom.DomHelper.prototype","getElement","goog.dom.DomHelper.prototype.getElement","getElementById","$","getElementsByTagName","goog.dom.DomHelper.prototype.getElementsByTagName","opt_parent","getElementsByTagNameAndClass","goog.dom.DomHelper.prototype.getElementsByTagNameAndClass","opt_tag","opt_class","opt_el","toUpperCase","$$","setProperties","goog.dom.setProperties","className","htmlFor","goog.dom.DIRECT_ATTRIBUTE_MAP_hasOwnProperty","lastIndexOf","prefix","goog.dom.DomHelper.prototype.createElement","goog.dom.DomHelper.prototype.createTextNode","goog.dom.appendChild","goog.dom.append","DOCUMENT","canHaveChildren","goog.dom.canHaveChildren","ELEMENT","removeNode","goog.dom.removeNode","contains","goog.dom.contains","descendant","compareDocumentPosition","throwException","exception","goog.globalsetTimeout","setTimeout","module$exports$google3$javascript$common$bigint$platform.NATIVE_BIGINT_AVAILABLE","goog.globalBigInt","BigInt","MIN_SAFE_INT52_STR","MIN_SAFE_INTEGER","MIN_SAFE_INT52_BIGINT","MAX_SAFE_INT52_STR","MAX_SAFE_INTEGER","MAX_SAFE_INT52_BIGINT","isInRange","boundary","valueChar","boundaryChar","module$exports$jspb$internal_symbols.HAS_NATIVE_SYMBOL","createSymbolInternal","fallbackValue","useSymbolFor","symbol","module$exports$jspb$internal_symbols.ARRAY_STATE_SYMBOL","module$exports$jspb$internal_symbols.UNKNOWN_BINARY_FIELDS_SYMBOL","module$exports$jspb$internal_symbols.UNKNOWN_BINARY_THROTTLE_KEY","module$exports$jspb$internal_symbols.UNKNOWN_BINARY_FIELD_IN_JSPB_SERIALIZE_THROTTLE_KEY","module$exports$jspb$internal_symbols.ALREADY_CONSTRUCTED_THROTTLE_KEY","module$exports$jspb$internal_symbols.MESSAGE_PROTOTYPE_MARKER","module$exports$jspb$internal_symbols.VALID_PIVOT_SELECTOR","module$exports$jspb$internal_symbols.LAZILY_PARSE_LATE_LOADED_EXTENSIONS_SYMBOL","ZERO_ARRAY_STATE_PROPERTY","internalArrayState","writable","OBJECT_DEFINE_PROPERTIES","defineProperties","ARRAY_STATE_PROPERTY","addFlags","flags","setArrayState","module$exports$jspb$internal.MESSAGE_PROTOTYPE_MARKER_VALUE","isImmutableMessage","msg","arrayState","copyOnWrite","PRIVATE_OPTION_TOKEN","IS_IMMUTABLE_ARRAY","internalArrayDoNotAccessOrElseMightBeUndefinedWhoKnows","module$exports$jspb$internal.DO_NOT_FREEZE__LEGACY_OPTION","freeze","globalThrottles","throttledAsyncThrowWarning","throttleKey","limit","throttleHandle","count","error","contextValue","asyncThrow","VALID_PIVOT_SELECTOR_VALUE","noChangePivotSelector","currentPivot","LAZY_REVIVAL_OPTIONS","reviveIntoImmutable","maybeReviveUnknownField","fieldNumber","lazyParse","messageArray","unknownBinaryFields","revive","reviveUnknownFields","recordUnknownFieldAccessOnArray","unknownBinaryFieldsSymbol","recordUnknownFieldDroppedInSerialize","unknownFields","cloneJspbArray","array","convertLeaf","isOwned","inClone","forEachUnknownField","clonedArray","sparseObject","pivotIndex","NO_PIVOT","movableSparseObject","isConstructed","CONSTRUCTED","arrayIndexOffset","HAS_MESSAGE_ID","IS_REPEATED_FIELD","currentPivotSelector","pivotSelector","maybeCtorInDebug","newSparseObject","isNaN","convertToJsonFormat","isFinite","toJsonValueInternal","toJsonValue","internalArr","constructMessageArray","suggestedPivot","messageId","arrayStateToAdd","MUTABLE_REFERENCES_ARE_OWNED","PIVOT_MASK","PIVOT_OFFSET","goog.flags.JSPB_THROW_IN_ARRAY_CONSTRUCTOR_IF_ARRAY_IS_ALREADY_CONSTRUCTED","HAS_WRAPPER","maybeThrowAlreadyConstructedError","FROZEN_ARRAY","msgLength","pivot","module$exports$jspb$internal_array_state.PIVOT_LIMIT","k","max","copyImmutableFieldValue","parentIsOwned","MUTABLE_SUBSTRUCTURES","UNFROZEN_SHARED","copyArrayWithImmutableFields","addArrayStateFlags","IS_API_FORMATTED","tryZeroCopyImmutable","wrapImmutableArray","mutable","noLegacyNull","markImmutable","flag","newArray","flagsToAdd","flagsToKeep","maybeCopyOnWrite","ensureMutable","leakedMutableSubstructures","messageArrayState","exports.getFieldNullableInternal","hasMessageId","coerceFn","NO_SUCH_FIELD","arrayIndex","last","lastValue","inSparseObject","coerced","setFieldIgnoringImmutabilityInternal","module$exports$jspb$internal_array_state.NO_PIVOT","getReadonlyWrapperFieldOrUndefinedInternal","isNewlyConstructed","submsg","jspb_internal_adapters.getFieldNullableInternal","originalArrState","arrState","exports.getWrapperFieldOrUndefined","submessage","jspb$uservoice$common$flags$MutableAlohaFlags","immutable","mutableSubmessage","exports.getBooleanFieldWithDefault","exports.setProto3BooleanField","module$exports$jspb.Message","toJSON","serialize","getExtension","fieldInfo","fieldIndex","isRepeated","getExtensionFn","UNFROZEN","FROZEN_UNLESS_SHARED","hasExtension","clone","Message.prototype.toString","getEnableSsEngine","jspb_internal_adapters.getBooleanFieldWithDefault","getEnableAwr","getAlohaAutoGaRollout","getEnableConfigurator","getEnableMweb","getEnableCtlConsentCheckbox","getEnableIframe","getEnableScreenshotNudge","getEnableWebStartupConfigEndpoint","getEnableJunkNudge","getEnableConfiguratorLocale","getEnableTinyNoPointer","getEnableSupportSessionLogging","getEnableFileUploadForScreenshot","getEnableDirectDeflectionForSingleCategory","getEnableImageSanitization","getEnableAlohaBinarySplit","getEnableDbFeedbackIntents","getEnableMarkMandatoryFieldsWithRequired","getEnableFeedbackCategoryCustomUi","getEnableRealtimeCtl","jspb$uservoice$common$flags$MutableAlohaFormPropertiesResponse","isTestDataRealm","TEST_DATA_SUBMISSION_URLS","SUPPORTED_LANGUAGES","getFeedbackJsUrl","config","expFlags","formContent","locale","language","replaceAll","module$exports$google3$uservoice$feedback$client$web$shared$constants.DEFAULT_FORM_LANGUAGE","initializationData","env","useNightlyRelease","module$exports$google3$uservoice$feedback$client$web$loader$loader.DuplicateFormError","loadFeedbackScriptPromise","loadFeedbackScriptPromisUsingMainLightBinary","lastFeedbackWindow","lastFeedbackWindowForMainLightBinary","getFeedbackClientInitializerAsync","feedbackWindow","dom","scriptSrc","feedbackV2GlobalObject","resolve","scriptEl","goog.dom.TagName.SCRIPT","onload","scriptEl.onload","onerror","scriptEl.onerror","body","getFeedbackClientInitializerAsyncUsingMainLightBinary","load","binaryLoadStartTime","Date","now","feedbackClient","initializeFeedbackClientAsync","clientInitializer","initiateAloha","loadMainLightBinary","window","loadAndInitializeFeedbackClient","isFormOpened","callbacks","existingOnClose","onClose","formCloseData","config.callbacks.onClose","module$exports$google3$javascript$common$async$context$propagate.propagateAsyncContext","AsyncContext","Snapshot","goog.Disposable","disposed_","onDisposeCallbacks_","dispose","goog.Disposable.prototype.dispose","disposeInternal","goog.Disposable.prototype.disposeInternal","shift","goog.events.Event","opt_target","currentTarget","defaultPrevented","propagationStopped_","stopPropagation","goog.events.Event.prototype.stopPropagation","preventDefault","goog.events.Event.prototype.preventDefault","PASSIVE_EVENTS","goog.globaladdEventListener","nullFunction","goog.globalremoveEventListener","goog.events.BrowserEvent","opt_e","opt_currentTarget","goog.events.Eventcall","goog.events.BrowserEvent.base","relatedTarget","button","screenY","screenX","clientY","clientX","offsetY","offsetX","charCode","keyCode","metaKey","shiftKey","altKey","ctrlKey","pointerId","pointerType","timeStamp","event_","init","goog.events.BrowserEvent.prototype.init","relevantTouch","changedTouches","srcElement","MOUSEOVER","fromElement","MOUSEOUT","toElement","pageX","pageY","layerX","layerY","goog.events.BrowserEventsuperClass_preventDefaultcall","goog.events.BrowserEvent.prototype.stopPropagation","goog.events.BrowserEventsuperClass_stopPropagationcall","cancelBubble","goog.events.BrowserEvent.prototype.preventDefault","be","returnValue","goog.events.Listenable.IMPLEMENTED_BY_PROP","module$contents$goog$events$ListenableKey_ListenableKey.counter_","Listener","listener","opt_handler","proxy","handler","removed","callOnce","Listener.prototype.markAsRemoved","ListenerMap","listeners","typeCount_","ListenerMap.prototype.add","opt_useCapture","opt_listenerScope","typeStr","listenerArray","module$contents$goog$events$ListenerMap_ListenerMap.findListenerIndex_","listenerObj","ListenerMap.prototype.remove","markAsRemoved","ListenerMap.prototype.removeByKey","getListener","ListenerMap.prototype.getListener","hasListener","ListenerMap.prototype.hasListener","opt_type","opt_capture","hasType","hasCapture","ListenerMap.findListenerIndex_","goog.events.LISTENER_MAP_PROP_","goog.events.onStringMap_","goog.events.listenerCountEstimate_","goog.events.listen","opt_options","goog.events.listenOnce","goog.events.wrapListener","listen","goog.events.listen_","listenerMap","goog.events.getListenerMap_","goog.events.getProxy","goog.events.BrowserFeature.PASSIVE_EVENTS","attachEvent","goog.events.getOnString_","addListener","removeListener","eventObject","proxyCallbackFunction","goog.events.handleBrowserEvent_","eventTargetListeners_","goog.events.unlisten","unlisten","goog.events.unlistenByKey","removeByKey","detachEvent","goog.events.onString_","opt_evt","listenerFn","listenerHandler","goog.events.LISTENER_WRAPPER_PROP_","goog.events.EventTarget","goog.Disposablecall","actualEventTarget_","parentEventTarget_","goog.events.EventTarget.prototype","goog.events.EventTarget.prototype.addEventListener","opt_handlerScope","goog.events.EventTarget.prototype.removeEventListener","dispatchEvent","goog.events.EventTarget.prototype.dispatchEvent","ancestorsTree","ancestor","getParentEventTarget","oldEvent","opt_ancestorsTree","fireListeners","goog.events.EventTarget.prototype.disposeInternal","goog.events.EventTargetsuperClass_disposeInternalcall","removeAllListeners","goog.events.EventTarget.prototype.listen","goog.events.EventTarget.prototype.unlisten","goog.events.EventTarget.prototype.fireListeners","concat","unlistenByKey","goog.events.EventTarget.prototype.getListener","goog.events.EventTarget.prototype.hasListener","id","ex","o","remainderRe","replace","backslashesRe","simpleValuesRe","openBracketsRe","eval","splitRe","goog.net.XhrIo","goog.events.EventTargetcall","goog.net.XhrIo.base","headers","active_","xhr_","lastUri_","inAbort_","inOpen_","inSend_","errorDispatched_","timeoutInterval_","timeoutId_","responseType_","DEFAULT","withCredentials_","attributionReportingOptions_","trustToken_","goog.net.XhrIo.HTTP_SCHEME_PATTERN","goog.net.XhrIo.METHODS_WITH_FORM_DATA","goog.net.XhrIo.sendInstances_","goog.net.XhrIo.send","opt_callback","goog.net.XhrIo.sendInstances_push","COMPLETE","cleanupSend_","opt_withCredentials","send","opt_method","opt_content","opt_headers","goog.net.XhrIo.prototype","goog.net.XhrIo.prototype.cleanupSend_","setTrustToken","goog.net.XhrIo.prototype.setTrustToken","trustToken","setAttributionReporting","goog.net.XhrIo.prototype.setAttributionReporting","attributionReportingOptions","goog.net.XhrIo.prototype.send","method","XMLHttpRequest","onreadystatechange","onReadyStateChange_","err","error_","contentTypeKey","find","header","contentIsFormData","goog.net.XhrIo.CONTENT_TYPE_HEADER","goog.net.XhrIo.FORM_CONTENT_TYPE","setRequestHeader","responseType","withCredentials","cleanUpTimeoutTimer_","clearTimeout","timeout_","goog.net.XhrIo.prototype.timeout_","TIMEOUT","abort","goog.net.XhrIo.prototype.error_","dispatchErrors_","cleanUpXhr_","goog.net.XhrIo.prototype.dispatchErrors_","ERROR","goog.net.XhrIo.prototype.abort","ABORT","goog.net.XhrIo.prototype.disposeInternal","goog.net.XhrIosuperClass_disposeInternalcall","goog.net.XhrIo.prototype.disposeInternal.base","goog.net.XhrIo.prototype.onReadyStateChange_","isDisposed","onReadyStateChangeHelper_","onReadyStateChangeEntryPoint_","goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_","goog.net.XhrIo.prototype.onReadyStateChangeHelper_","getReadyState","READY_STATE_CHANGE","isComplete","isSuccess","LOADED","status","OK","CREATED","ACCEPTED","NO_CONTENT","PARTIAL_CONTENT","NOT_MODIFIED","QUIRK_IE_NO_CONTENT","scheme","uri","SCHEME","goog.globalself","goog.globalselflocation","location","goog.globalselflocationprotocol","protocol","goog.net.XhrIo.HTTP_SCHEME_PATTERNtest","SUCCESS","goog.net.XhrIo.prototype.cleanUpXhr_","opt_fromDispose","xhr","READY","clearedOnReadyStateChange","isActive","goog.net.XhrIo.prototype.isActive","goog.net.XhrIo.prototype.getReadyState","readyState","UNINITIALIZED","getResponseHeader","goog.net.XhrIo.prototype.getResponseHeader","getAllResponseHeaders","goog.net.XhrIo.prototype.getAllResponseHeaders","getAlohaFormProperties","productId","serverUri","isInteger","sanitizeServerUri","serverData","responseText","JSON_SAFETY_PREFIX","substring","goog.globalJSON","goog.globalJSONparse","jsonString","AlohaFormPropertiesResponse","setAlohaFlags","setAlohaAutoGaRollout","AlohaFlags","jspb_internal_adapters.setProto3BooleanField","SERVER_URI","startFeedbackClassic","configuration","productData","getTime","href","userfeedback.api.MAX_PAGE_HREF","isValidPsd","psdJson","userfeedback.api.MAX_PSD_JSON","argArray","userfeedback.api.SERVER_URI_DEFAULT","startFeedback","goog.dom.defaultDomHelper_","startFeedbackAloha","isLocalServer","getAlohaConfigFromClassicConfig","integrationKeys","feedbackBucket","triggerId","onLoad","disableScreenshot","productDisplayName","announcement","issueCategories","includeSeveritySelection","customImageSrc","thankYouMessage","userEmail","defaultFormInputValues","defaultFormInputValuesString","abuseLink","additionalDataConsent","feedbackJsUrl","feedbackCssUrl","feedbackJsUrlSerialized","feedbackCssUrlSerialized","submissionServerUri","colorScheme","extraData","productVersion","authUser","configuratorId","customZIndex","tinyNoPointer","allowNonLoggedInFeedback","enableAnonymousFeedback","productSpecificData","entries","userfeedback.api.startFeedback","productWindow","helpCenterPath","flagsPromise","then","flagResponse","jspb_internal_adapters.getWrapperFieldOrUndefined","enableAlohaForMweb","enableAlohaForTinyNoPointer","catch","handleRejectedPromiseFromAlohaLoader","publicPath","exports.__decorate","decorators","desc","exports.customElement","classOrTarget","context","define","module$exports$google3$devtools$gerritcodereview$plugins$feedback$feedback.GrFeedbackButton","clicked","VERSION_INFO","Gerrit","install","pluginApi","tags","restApi","getAccount","registerCustomComponent"]
}
