@p4ulcristian/iris-layout 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cljs-runtime/cljs.core.js +38746 -0
- package/dist/cljs-runtime/cljs.core.js.map +1 -0
- package/dist/cljs-runtime/cljs.pprint.js +8400 -0
- package/dist/cljs-runtime/cljs.pprint.js.map +1 -0
- package/dist/cljs-runtime/cljs.stacktrace.js +561 -0
- package/dist/cljs-runtime/cljs.stacktrace.js.map +1 -0
- package/dist/cljs-runtime/cljs_env.js +1286 -0
- package/dist/cljs-runtime/clojure.data.js +295 -0
- package/dist/cljs-runtime/clojure.data.js.map +1 -0
- package/dist/cljs-runtime/clojure.set.js +382 -0
- package/dist/cljs-runtime/clojure.set.js.map +1 -0
- package/dist/cljs-runtime/clojure.string.js +480 -0
- package/dist/cljs-runtime/clojure.string.js.map +1 -0
- package/dist/cljs-runtime/clojure.walk.js +132 -0
- package/dist/cljs-runtime/clojure.walk.js.map +1 -0
- package/dist/cljs-runtime/devtools.async.js +90 -0
- package/dist/cljs-runtime/devtools.async.js.map +1 -0
- package/dist/cljs-runtime/devtools.context.js +11 -0
- package/dist/cljs-runtime/devtools.context.js.map +1 -0
- package/dist/cljs-runtime/devtools.core.js +175 -0
- package/dist/cljs-runtime/devtools.core.js.map +1 -0
- package/dist/cljs-runtime/devtools.defaults.js +20 -0
- package/dist/cljs-runtime/devtools.defaults.js.map +1 -0
- package/dist/cljs-runtime/devtools.format.js +631 -0
- package/dist/cljs-runtime/devtools.format.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.budgeting.js +182 -0
- package/dist/cljs-runtime/devtools.formatters.budgeting.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.core.js +220 -0
- package/dist/cljs-runtime/devtools.formatters.core.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.helpers.js +228 -0
- package/dist/cljs-runtime/devtools.formatters.helpers.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.js +261 -0
- package/dist/cljs-runtime/devtools.formatters.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.markup.js +1174 -0
- package/dist/cljs-runtime/devtools.formatters.markup.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.printing.js +313 -0
- package/dist/cljs-runtime/devtools.formatters.printing.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.state.js +325 -0
- package/dist/cljs-runtime/devtools.formatters.state.js.map +1 -0
- package/dist/cljs-runtime/devtools.formatters.templating.js +666 -0
- package/dist/cljs-runtime/devtools.formatters.templating.js.map +1 -0
- package/dist/cljs-runtime/devtools.hints.js +193 -0
- package/dist/cljs-runtime/devtools.hints.js.map +1 -0
- package/dist/cljs-runtime/devtools.munging.js +1058 -0
- package/dist/cljs-runtime/devtools.munging.js.map +1 -0
- package/dist/cljs-runtime/devtools.prefs.js +87 -0
- package/dist/cljs-runtime/devtools.prefs.js.map +1 -0
- package/dist/cljs-runtime/devtools.preload.js +11 -0
- package/dist/cljs-runtime/devtools.preload.js.map +1 -0
- package/dist/cljs-runtime/devtools.protocols.js +98 -0
- package/dist/cljs-runtime/devtools.protocols.js.map +1 -0
- package/dist/cljs-runtime/devtools.reporter.js +81 -0
- package/dist/cljs-runtime/devtools.reporter.js.map +1 -0
- package/dist/cljs-runtime/devtools.toolbox.js +141 -0
- package/dist/cljs-runtime/devtools.toolbox.js.map +1 -0
- package/dist/cljs-runtime/devtools.util.js +517 -0
- package/dist/cljs-runtime/devtools.util.js.map +1 -0
- package/dist/cljs-runtime/devtools.version.js +9 -0
- package/dist/cljs-runtime/devtools.version.js.map +1 -0
- package/dist/cljs-runtime/goog.array.array.js +659 -0
- package/dist/cljs-runtime/goog.array.array.js.map +9 -0
- package/dist/cljs-runtime/goog.asserts.asserts.js +133 -0
- package/dist/cljs-runtime/goog.asserts.asserts.js.map +9 -0
- package/dist/cljs-runtime/goog.asserts.dom.js +90 -0
- package/dist/cljs-runtime/goog.asserts.dom.js.map +9 -0
- package/dist/cljs-runtime/goog.async.nexttick.js +93 -0
- package/dist/cljs-runtime/goog.async.nexttick.js.map +9 -0
- package/dist/cljs-runtime/goog.base.js +1261 -0
- package/dist/cljs-runtime/goog.base.js.map +9 -0
- package/dist/cljs-runtime/goog.collections.maps.js +82 -0
- package/dist/cljs-runtime/goog.collections.maps.js.map +9 -0
- package/dist/cljs-runtime/goog.debug.entrypointregistry.js +44 -0
- package/dist/cljs-runtime/goog.debug.entrypointregistry.js.map +9 -0
- package/dist/cljs-runtime/goog.debug.error.js +30 -0
- package/dist/cljs-runtime/goog.debug.error.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.asserts.js +40 -0
- package/dist/cljs-runtime/goog.dom.asserts.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.browserfeature.js +21 -0
- package/dist/cljs-runtime/goog.dom.browserfeature.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.dom.js +1087 -0
- package/dist/cljs-runtime/goog.dom.dom.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.element.js +69 -0
- package/dist/cljs-runtime/goog.dom.element.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.htmlelement.js +7 -0
- package/dist/cljs-runtime/goog.dom.htmlelement.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.nodetype.js +6 -0
- package/dist/cljs-runtime/goog.dom.nodetype.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.safe.js +277 -0
- package/dist/cljs-runtime/goog.dom.safe.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.tagname.js +147 -0
- package/dist/cljs-runtime/goog.dom.tagname.js.map +9 -0
- package/dist/cljs-runtime/goog.dom.tags.js +10 -0
- package/dist/cljs-runtime/goog.dom.tags.js.map +9 -0
- package/dist/cljs-runtime/goog.flags.flags.js +12 -0
- package/dist/cljs-runtime/goog.flags.flags.js.map +9 -0
- package/dist/cljs-runtime/goog.fs.blob.js +38 -0
- package/dist/cljs-runtime/goog.fs.blob.js.map +9 -0
- package/dist/cljs-runtime/goog.fs.url.js +37 -0
- package/dist/cljs-runtime/goog.fs.url.js.map +9 -0
- package/dist/cljs-runtime/goog.functions.functions.js +211 -0
- package/dist/cljs-runtime/goog.functions.functions.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safehtml.js +321 -0
- package/dist/cljs-runtime/goog.html.safehtml.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safescript.js +65 -0
- package/dist/cljs-runtime/goog.html.safescript.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safestyle.js +175 -0
- package/dist/cljs-runtime/goog.html.safestyle.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safestylesheet.js +99 -0
- package/dist/cljs-runtime/goog.html.safestylesheet.js.map +9 -0
- package/dist/cljs-runtime/goog.html.safeurl.js +231 -0
- package/dist/cljs-runtime/goog.html.safeurl.js.map +9 -0
- package/dist/cljs-runtime/goog.html.trustedresourceurl.js +123 -0
- package/dist/cljs-runtime/goog.html.trustedresourceurl.js.map +9 -0
- package/dist/cljs-runtime/goog.html.trustedtypes.js +16 -0
- package/dist/cljs-runtime/goog.html.trustedtypes.js.map +9 -0
- package/dist/cljs-runtime/goog.html.uncheckedconversions.js +52 -0
- package/dist/cljs-runtime/goog.html.uncheckedconversions.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.browser.js +352 -0
- package/dist/cljs-runtime/goog.labs.useragent.browser.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.engine.js +73 -0
- package/dist/cljs-runtime/goog.labs.useragent.engine.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js +14 -0
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js +74 -0
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.platform.js +147 -0
- package/dist/cljs-runtime/goog.labs.useragent.platform.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.useragent.js +21 -0
- package/dist/cljs-runtime/goog.labs.useragent.useragent.js.map +9 -0
- package/dist/cljs-runtime/goog.labs.useragent.util.js +81 -0
- package/dist/cljs-runtime/goog.labs.useragent.util.js.map +9 -0
- package/dist/cljs-runtime/goog.math.coordinate.js +97 -0
- package/dist/cljs-runtime/goog.math.coordinate.js.map +9 -0
- package/dist/cljs-runtime/goog.math.integer.js +445 -0
- package/dist/cljs-runtime/goog.math.integer.js.map +9 -0
- package/dist/cljs-runtime/goog.math.long.js +437 -0
- package/dist/cljs-runtime/goog.math.long.js.map +9 -0
- package/dist/cljs-runtime/goog.math.math.js +158 -0
- package/dist/cljs-runtime/goog.math.math.js.map +9 -0
- package/dist/cljs-runtime/goog.math.size.js +76 -0
- package/dist/cljs-runtime/goog.math.size.js.map +9 -0
- package/dist/cljs-runtime/goog.object.object.js +284 -0
- package/dist/cljs-runtime/goog.object.object.js.map +9 -0
- package/dist/cljs-runtime/goog.reflect.reflect.js +32 -0
- package/dist/cljs-runtime/goog.reflect.reflect.js.map +9 -0
- package/dist/cljs-runtime/goog.string.const.js +35 -0
- package/dist/cljs-runtime/goog.string.const.js.map +9 -0
- package/dist/cljs-runtime/goog.string.internal.js +119 -0
- package/dist/cljs-runtime/goog.string.internal.js.map +9 -0
- package/dist/cljs-runtime/goog.string.string.js +462 -0
- package/dist/cljs-runtime/goog.string.string.js.map +9 -0
- package/dist/cljs-runtime/goog.string.stringbuffer.js +32 -0
- package/dist/cljs-runtime/goog.string.stringbuffer.js.map +9 -0
- package/dist/cljs-runtime/goog.string.typedstring.js +9 -0
- package/dist/cljs-runtime/goog.string.typedstring.js.map +9 -0
- package/dist/cljs-runtime/goog.structs.structs.js +199 -0
- package/dist/cljs-runtime/goog.structs.structs.js.map +9 -0
- package/dist/cljs-runtime/goog.uri.uri.js +628 -0
- package/dist/cljs-runtime/goog.uri.uri.js.map +9 -0
- package/dist/cljs-runtime/goog.uri.utils.js +326 -0
- package/dist/cljs-runtime/goog.uri.utils.js.map +9 -0
- package/dist/cljs-runtime/goog.useragent.useragent.js +139 -0
- package/dist/cljs-runtime/goog.useragent.useragent.js.map +9 -0
- package/dist/cljs-runtime/iris_layout.components.entity_card_group.js +202 -0
- package/dist/cljs-runtime/iris_layout.components.entity_card_group.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.components.entity_tile.js +295 -0
- package/dist/cljs-runtime/iris_layout.components.entity_tile.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js +33 -0
- package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.components.resizer.js +91 -0
- package/dist/cljs-runtime/iris_layout.components.resizer.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.components.touch_drag.js +399 -0
- package/dist/cljs-runtime/iris_layout.components.touch_drag.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.core.js +1372 -0
- package/dist/cljs-runtime/iris_layout.core.js.map +1 -0
- package/dist/cljs-runtime/iris_layout.layout.js +328 -0
- package/dist/cljs-runtime/iris_layout.layout.js.map +1 -0
- package/dist/cljs-runtime/reagent.core.js +993 -0
- package/dist/cljs-runtime/reagent.core.js.map +1 -0
- package/dist/cljs-runtime/reagent.debug.js +75 -0
- package/dist/cljs-runtime/reagent.debug.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.batching.js +270 -0
- package/dist/cljs-runtime/reagent.impl.batching.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.component.js +758 -0
- package/dist/cljs-runtime/reagent.impl.component.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.input.js +175 -0
- package/dist/cljs-runtime/reagent.impl.input.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.protocols.js +99 -0
- package/dist/cljs-runtime/reagent.impl.protocols.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.template.js +660 -0
- package/dist/cljs-runtime/reagent.impl.template.js.map +1 -0
- package/dist/cljs-runtime/reagent.impl.util.js +748 -0
- package/dist/cljs-runtime/reagent.impl.util.js.map +1 -0
- package/dist/cljs-runtime/reagent.ratom.js +1668 -0
- package/dist/cljs-runtime/reagent.ratom.js.map +1 -0
- package/dist/cljs-runtime/shadow.esm.esm_import$react.js +5 -0
- package/dist/cljs-runtime/shadow.module.iris-layout.append.js +2 -0
- package/dist/cljs-runtime/shadow.module.iris-layout.prepend.js +2 -0
- package/dist/iris-layout.js +375 -355
- package/dist/styles.css +287 -9
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version":3,
|
|
3
|
+
"file":"goog.array.array.js",
|
|
4
|
+
"lineCount":656,
|
|
5
|
+
"mappings":"AAAA,IAAA,CAAA,UAAA,CAAA,QAAA,CAAA,OAAA,CAAA;AAqDAA,UAASA,KAAI,CAACC,KAAD,CAAQ;AACnB,WAAOA,KAAA,CAAMA,KAAMC,CAAAA,MAAZ,GAAqB,CAArB,CAAP;AADmB;AA2JrBC,UAASA,aAAY,CAACC,GAAD,EAAMC,CAAN,EAASC,OAAT,CAAkB;AACrC,UAAMC,IAAIH,GAAIF,CAAAA,MAAd;AACA,UAAMM,OAAQ,MAAOJ,IAAR,KAAgB,QAAhB,GAA4BA,GAAIK,CAAAA,KAAJ,CAAU,EAAV,CAA5B,GAA4CL,GAAzD;AACA,SAAK,IAAIM,IAAIH,CAAJG,GAAQ,CAAjB,EAAoBA,CAApB,IAAyB,CAAzB,EAA4B,EAAEA,CAA9B;AACE,UAAIA,CAAJ,IAASF,IAAT;AACEH,SAAEM,CAAAA,IAAF,CAAyBL,OAAzB,EAAmCE,IAAA,CAAKE,CAAL,CAAnC,EAA4CA,CAA5C,EAA+CN,GAA/C,CAAA;AADF;AADF;AAHqC;AA+QvCQ,UAASA,MAAK,CAACR,GAAD,EAAMC,CAAN,EAASC,OAAT,CAAkB;AAC9B,QAAIM,QAAQ,CAAZ;AACAC,WAAA,CAA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kD,SAAQ/C,CAAAA,WAAR,GAAsBA,WAAtB;AA2BA+C,SAAQ3C,CAAAA,QAAR,GAAmBA,QAAnB;AA0BA2C,SAAQxC,CAAAA,KAAR,GAAgBA,KAAhB;AAiDAwC,SAAQtC,CAAAA,KAAR,GAAgBA,KAAhB;AAkBAsC,SAAQjC,CAAAA,MAAR,GAAiBA,MAAjB;AA8BAiC,SAAQ/B,CAAAA,OAAR,GAAkBA,OAAlB;AA8BA+B,SAAQzB,CAAAA,MAAR,GAAiBA,MAAjB;AAuBAyB,SAAQvB,CAAAA,QAAR,GAAmBA,QAAnB;AAoCAuB,SAAQnB,CAAAA,GAAR,GAAcA,GAAd;AA6BAmB,SAAQjB,CAAAA,OAAR,GAAkBA,OAAlB;AAoBAiB,SAAQX,CAAAA,WAAR,GAAsBA,WAAtB;AAqBAW,SAAQT,CAAAA,SAAR,GAAoBA,SAApB;AArvDA,SAAA,OAAA;AAAA,CAAA,CAAA;;",
|
|
6
|
+
"sources":["goog/array/array.js"],
|
|
7
|
+
"sourcesContent":["/**\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.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.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_hashFn 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_hashFn) {\n const returnArray = opt_rv || arr;\n const defaultHashFn = 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 hashFn = opt_hashFn || defaultHashFn;\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 = hashFn(current);\n if (!Object.prototype.hasOwnProperty.call(seen, key)) {\n seen[key] = true;\n returnArray[cursorInsert++] = current;\n }\n }\n returnArray.length = cursorInsert;\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), goog.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/**\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 */\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"],
|
|
8
|
+
"names":["peek","array","length","forEachRight","arr","f","opt_obj","l","arr2","split","i","call","count","forEach","element","index","find","findIndex","charAt","findRight","findIndexRight","contains","obj","indexOf","isEmpty","clear","Array","isArray","insert","push","insertAt","opt_i","splice","insertArrayAt","elementsToAdd","goog","partial","apply","insertBefore","opt_obj2","arguments","remove","rv","removeAt","removeLast","lastIndexOf","asserts","assert","prototype","removeIf","removeAllIf","removedCount","val","concat","var_args","join","toArray","object","extend","arr1","isArrayLike","len1","len2","j","howMany","slice","start","opt_end","removeDuplicates","opt_rv","opt_hashFn","returnArray","defaultHashFn","item","isObject","getUid","hashFn","cursorInsert","cursorRead","seen","current","key","Object","hasOwnProperty","binarySearch","target","opt_compareFn","binarySearch_","defaultCompare","binarySelect","evaluator","undefined","compareFn","isEvaluator","opt_target","opt_selfObj","left","right","found","middle","compareResult","sort","stableSort","stableCompareFn","obj1","obj2","valueCompareFn","value","compArr","sortByKey","keyFn","keyCompareFn","a","b","sortObjectsByKey","isSorted","opt_strict","compare","equals","opt_equalsFn","equalsFn","defaultCompareEquality","compare3","Math","min","result","inverseDefaultCompare","binaryInsert","binaryRemove","bucket","sorter","buckets","bucketToMap","Map","get","set","toObject","keyFunc","ret","toMap","map","range","startOrEnd","opt_step","end","step","repeat","n","flatten","CHUNK_SIZE","c","chunk","recurseResult","r","rotate","unshift","moveItem","fromIndex","toIndex","removedItems","zip","minLen","shuffle","opt_randFn","randFn","random","floor","tmp","copyByIndex","index_arr","concatMap","module","declareLegacyNamespace","require","NATIVE_ARRAY_PROTOTYPES","define","TRUSTED_SITE","ASSUME_NATIVE_FUNCTIONS","FEATURESET_YEAR","exports","last","opt_fromIndex","max","filter","res","resLength","reduce","bind","rval","reduceRight","some","every","clone"]
|
|
9
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import "./cljs_env.js";
|
|
2
|
+
import "./goog.debug.error.js";
|
|
3
|
+
import "./goog.dom.nodetype.js";
|
|
4
|
+
goog.loadModule(function(exports) {
|
|
5
|
+
function AssertionError(messagePattern, messageArgs) {
|
|
6
|
+
DebugError.call(this, subs(messagePattern, messageArgs));
|
|
7
|
+
this.messagePattern = messagePattern;
|
|
8
|
+
}
|
|
9
|
+
function subs(pattern, subs) {
|
|
10
|
+
const splitParts = pattern.split("%s");
|
|
11
|
+
let returnString = "";
|
|
12
|
+
const subLast = splitParts.length - 1;
|
|
13
|
+
for (let i = 0; i < subLast; i++) {
|
|
14
|
+
const sub = i < subs.length ? subs[i] : "%s";
|
|
15
|
+
returnString = returnString + (splitParts[i] + sub);
|
|
16
|
+
}
|
|
17
|
+
return returnString + splitParts[subLast];
|
|
18
|
+
}
|
|
19
|
+
function doAssertFailure(defaultMessage, defaultArgs, givenMessage, givenArgs) {
|
|
20
|
+
let message = "Assertion failed";
|
|
21
|
+
let args;
|
|
22
|
+
if (givenMessage) {
|
|
23
|
+
message = message + (": " + givenMessage);
|
|
24
|
+
args = givenArgs;
|
|
25
|
+
} else if (defaultMessage) {
|
|
26
|
+
message = message + (": " + defaultMessage);
|
|
27
|
+
args = defaultArgs;
|
|
28
|
+
}
|
|
29
|
+
const e = new AssertionError("" + message, args || []);
|
|
30
|
+
errorHandler_(e);
|
|
31
|
+
}
|
|
32
|
+
function getType(value) {
|
|
33
|
+
if (value instanceof Function) {
|
|
34
|
+
return value.displayName || value.name || "unknown type name";
|
|
35
|
+
} else if (value instanceof Object) {
|
|
36
|
+
return value.constructor.displayName || value.constructor.name || Object.prototype.toString.call(value);
|
|
37
|
+
} else {
|
|
38
|
+
return value === null ? "null" : typeof value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
"use strict";
|
|
42
|
+
goog.module("goog.asserts");
|
|
43
|
+
goog.module.declareLegacyNamespace();
|
|
44
|
+
const DebugError = goog.require("goog.debug.Error");
|
|
45
|
+
const NodeType = goog.require("goog.dom.NodeType");
|
|
46
|
+
exports.ENABLE_ASSERTS = goog.define("goog.asserts.ENABLE_ASSERTS", goog.DEBUG);
|
|
47
|
+
goog.inherits(AssertionError, DebugError);
|
|
48
|
+
exports.AssertionError = AssertionError;
|
|
49
|
+
AssertionError.prototype.name = "AssertionError";
|
|
50
|
+
exports.DEFAULT_ERROR_HANDLER = function(e) {
|
|
51
|
+
throw e;
|
|
52
|
+
};
|
|
53
|
+
let errorHandler_ = exports.DEFAULT_ERROR_HANDLER;
|
|
54
|
+
exports.setErrorHandler = function(errorHandler) {
|
|
55
|
+
if (exports.ENABLE_ASSERTS) {
|
|
56
|
+
errorHandler_ = errorHandler;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.assert = function(condition, opt_message, var_args) {
|
|
60
|
+
if (exports.ENABLE_ASSERTS && !condition) {
|
|
61
|
+
doAssertFailure("", null, opt_message, Array.prototype.slice.call(arguments, 2));
|
|
62
|
+
}
|
|
63
|
+
return condition;
|
|
64
|
+
};
|
|
65
|
+
exports.assertExists = function(value, opt_message, var_args) {
|
|
66
|
+
if (exports.ENABLE_ASSERTS && value == null) {
|
|
67
|
+
doAssertFailure("Expected to exist: %s.", [value], opt_message, Array.prototype.slice.call(arguments, 2));
|
|
68
|
+
}
|
|
69
|
+
return value;
|
|
70
|
+
};
|
|
71
|
+
exports.fail = function(opt_message, var_args) {
|
|
72
|
+
if (exports.ENABLE_ASSERTS) {
|
|
73
|
+
errorHandler_(new AssertionError("Failure" + (opt_message ? ": " + opt_message : ""), Array.prototype.slice.call(arguments, 1)));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
exports.assertNumber = function(value, opt_message, var_args) {
|
|
77
|
+
if (exports.ENABLE_ASSERTS && typeof value !== "number") {
|
|
78
|
+
doAssertFailure("Expected number but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
|
|
79
|
+
}
|
|
80
|
+
return value;
|
|
81
|
+
};
|
|
82
|
+
exports.assertString = function(value, opt_message, var_args) {
|
|
83
|
+
if (exports.ENABLE_ASSERTS && typeof value !== "string") {
|
|
84
|
+
doAssertFailure("Expected string but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
|
|
85
|
+
}
|
|
86
|
+
return value;
|
|
87
|
+
};
|
|
88
|
+
exports.assertFunction = function(value, opt_message, var_args) {
|
|
89
|
+
if (exports.ENABLE_ASSERTS && typeof value !== "function") {
|
|
90
|
+
doAssertFailure("Expected function but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
|
|
91
|
+
}
|
|
92
|
+
return value;
|
|
93
|
+
};
|
|
94
|
+
exports.assertObject = function(value, opt_message, var_args) {
|
|
95
|
+
if (exports.ENABLE_ASSERTS && !goog.isObject(value)) {
|
|
96
|
+
doAssertFailure("Expected object but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
|
|
97
|
+
}
|
|
98
|
+
return value;
|
|
99
|
+
};
|
|
100
|
+
exports.assertArray = function(value, opt_message, var_args) {
|
|
101
|
+
if (exports.ENABLE_ASSERTS && !Array.isArray(value)) {
|
|
102
|
+
doAssertFailure("Expected array but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
|
|
103
|
+
}
|
|
104
|
+
return value;
|
|
105
|
+
};
|
|
106
|
+
exports.assertBoolean = function(value, opt_message, var_args) {
|
|
107
|
+
if (exports.ENABLE_ASSERTS && typeof value !== "boolean") {
|
|
108
|
+
doAssertFailure("Expected boolean but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
};
|
|
112
|
+
exports.assertElement = function(value, opt_message, var_args) {
|
|
113
|
+
if (exports.ENABLE_ASSERTS && (!goog.isObject(value) || value.nodeType != NodeType.ELEMENT)) {
|
|
114
|
+
doAssertFailure("Expected Element but got %s: %s.", [goog.typeOf(value), value], opt_message, Array.prototype.slice.call(arguments, 2));
|
|
115
|
+
}
|
|
116
|
+
return value;
|
|
117
|
+
};
|
|
118
|
+
exports.assertInstanceof = function(value, type, opt_message, var_args) {
|
|
119
|
+
if (exports.ENABLE_ASSERTS && !(value instanceof type)) {
|
|
120
|
+
doAssertFailure("Expected instanceof %s but got %s.", [getType(type), getType(value)], opt_message, Array.prototype.slice.call(arguments, 3));
|
|
121
|
+
}
|
|
122
|
+
return value;
|
|
123
|
+
};
|
|
124
|
+
exports.assertFinite = function(value, opt_message, var_args) {
|
|
125
|
+
if (exports.ENABLE_ASSERTS && (typeof value != "number" || !isFinite(value))) {
|
|
126
|
+
doAssertFailure("Expected %s to be a finite number but it is not.", [value], opt_message, Array.prototype.slice.call(arguments, 2));
|
|
127
|
+
}
|
|
128
|
+
return value;
|
|
129
|
+
};
|
|
130
|
+
return exports;
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=goog.asserts.asserts.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version":3,
|
|
3
|
+
"file":"goog.asserts.asserts.js",
|
|
4
|
+
"lineCount":129,
|
|
5
|
+
"mappings":"AAAA,IAAA,CAAA,UAAA,CAAA,QAAA,CAAA,OAAA,CAAA;AA8DAA,UAASA,eAAc,CAACC,cAAD,EAAiBC,WAAjB,CAA8B;AACnDC,cAAWC,CAAAA,IAAX,CAAgB,IAAhB,EAAsBC,IAAA,CAAKJ,cAAL,EAAqBC,WAArB,CAAtB,CAAA;AAOA,QAAKD,CAAAA,cAAL,GAAsBA,cAAtB;AARmD;AA0CrDI,UAASA,KAAI,CAACC,OAAD,EAAUD,IAAV,CAAgB;AAC3B,UAAME,aAAaD,OAAQE,CAAAA,KAAR,CAAc,IAAd,CAAnB;AACA,QAAIC,eAAe,EAAnB;AAIA,UAAMC,UAAUH,UAAWI,CAAAA,MAArBD,GAA8B,CAApC;AACA,SAAK,IAAIE,IAAI,CAAb,EAAgBA,CAAhB,GAAoBF,OAApB,EAA6BE,CAAA,EAA7B,CAAkC;AAEhC,YAAMC,MAAOD,CA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AAsC,CAAtC,CAFjB,CAAA;AAHF;AAOA,WAAgC9B,KAAhC;AAR6D,GAA/D;AAiCAa,SAAQyC,CAAAA,gBAAR,GAA2BC,QAAQ,CAACvD,KAAD,EAAQwD,IAAR,EAAc9B,WAAd,EAA2BC,QAA3B,CAAqC;AACtE,QAAId,OAAQC,CAAAA,cAAZ,IAA8B,EAAEd,KAAF,YAAmBwD,IAAnB,CAA9B;AACElE,qBAAA,CACI,oCADJ,EAC0C,CAACS,OAAA,CAAQyD,IAAR,CAAD,EAAgBzD,OAAA,CAAQC,KAAR,CAAhB,CAD1C,EAEI0B,WAFJ,EAEiBE,KAAMtB,CAAAA,SAAUuB,CAAAA,KAAMjD,CAAAA,IAAtB,CAA2BkD,SAA3B,EAAsC,CAAtC,CAFjB,CAAA;AADF;AAKA,WAAO9B,KAAP;AANsE,GAAxE;AAqBAa,SAAQ4C,CAAAA,YAAR,GAAuBC,QAAQ,CAAC1D,KAAD,EAAQ0B,WAAR,EAAqBC,QAArB,CAA+B;AAC5D,QAAId,OAAQC,CAAAA,cAAZ,KACK,MAAOd,MADZ,IACqB,QADrB,IACiC,CAAC2D,QAAA,CAAS3D,KAAT,CADlC;AAEEV,qBAAA,CACI,kDADJ,EACwD,CAACU,KAAD,CADxD,EAEI0B,WAFJ,EAEiBE,KAAMtB,CAAAA,SAAUuB,CAAAA,KAAMjD,CAAAA,IAAtB,CAA2BkD,SAA3B,EAAsC,CAAtC,CAFjB,CAAA;AAFF;AAMA,WAA8B9B,KAA9B;AAP4D,GAA9D;AAxaA,SAAA,OAAA;AAAA,CAAA,CAAA;;",
|
|
6
|
+
"sources":["goog/asserts/asserts.js"],
|
|
7
|
+
"sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Utilities to check the preconditions, postconditions and\n * invariants runtime.\n *\n * Methods in this package are given special treatment by the compiler\n * for type-inference. For example, <code>goog.asserts.assert(foo)</code>\n * will make the compiler treat <code>foo</code> as non-nullable. Similarly,\n * <code>goog.asserts.assertNumber(foo)</code> informs the compiler about the\n * type of <code>foo</code>. Where applicable, such assertions are preferable to\n * casts by jsdoc with <code>@type</code>.\n *\n * The compiler has an option to disable asserts. So code like:\n * <code>\n * var x = goog.asserts.assert(foo());\n * goog.asserts.assert(bar());\n * </code>\n * will be transformed into:\n * <code>\n * var x = foo();\n * </code>\n * The compiler will leave in foo() (because its return value is used),\n * but it will remove bar() because it assumes it does not have side-effects.\n *\n * Additionally, note the compiler will consider the type to be \"tightened\" for\n * all statements <em>after</em> the assertion. For example:\n * <code>\n * const /** ?Object &#ast;/ value = foo();\n * goog.asserts.assert(value);\n * // \"value\" is of type {!Object} at this point.\n * </code>\n */\n\ngoog.module('goog.asserts');\ngoog.module.declareLegacyNamespace();\n\nconst DebugError = goog.require('goog.debug.Error');\nconst NodeType = goog.require('goog.dom.NodeType');\n\n\n// NOTE: this needs to be exported directly and referenced via the exports\n// object because unit tests stub it out.\n/**\n * @define {boolean} Whether to strip out asserts or to leave them in.\n */\nexports.ENABLE_ASSERTS = goog.define('goog.asserts.ENABLE_ASSERTS', goog.DEBUG);\n\n\n\n/**\n * Error object for failed assertions.\n * @param {string} messagePattern The pattern that was used to form message.\n * @param {!Array<*>} messageArgs The items to substitute into the pattern.\n * @constructor\n * @extends {DebugError}\n * @final\n */\nfunction AssertionError(messagePattern, messageArgs) {\n DebugError.call(this, subs(messagePattern, messageArgs));\n\n /**\n * The message pattern used to format the error message. Error handlers can\n * use this to uniquely identify the assertion.\n * @type {string}\n */\n this.messagePattern = messagePattern;\n}\ngoog.inherits(AssertionError, DebugError);\nexports.AssertionError = AssertionError;\n\n/** @override @type {string} */\nAssertionError.prototype.name = 'AssertionError';\n\n\n/**\n * The default error handler.\n * @param {!AssertionError} e The exception to be handled.\n * @return {void}\n */\nexports.DEFAULT_ERROR_HANDLER = function(e) {\n throw e;\n};\n\n\n/**\n * The handler responsible for throwing or logging assertion errors.\n * @type {function(!AssertionError)}\n */\nlet errorHandler_ = exports.DEFAULT_ERROR_HANDLER;\n\n\n/**\n * Does simple python-style string substitution.\n * subs(\"foo%s hot%s\", \"bar\", \"dog\") becomes \"foobar hotdog\".\n * @param {string} pattern The string containing the pattern.\n * @param {!Array<*>} subs The items to substitute into the pattern.\n * @return {string} A copy of `str` in which each occurrence of\n * `%s` has been replaced an argument from `var_args`.\n */\nfunction subs(pattern, subs) {\n const splitParts = pattern.split('%s');\n let returnString = '';\n\n // Replace up to the last split part. We are inserting in the\n // positions between split parts.\n const subLast = splitParts.length - 1;\n for (let i = 0; i < subLast; i++) {\n // keep unsupplied as '%s'\n const sub = (i < subs.length) ? subs[i] : '%s';\n returnString += splitParts[i] + sub;\n }\n return returnString + splitParts[subLast];\n}\n\n\n/**\n * Throws an exception with the given message and \"Assertion failed\" prefixed\n * onto it.\n * @param {string} defaultMessage The message to use if givenMessage is empty.\n * @param {?Array<*>} defaultArgs The substitution arguments for defaultMessage.\n * @param {string|undefined} givenMessage Message supplied by the caller.\n * @param {!Array<*>} givenArgs The substitution arguments for givenMessage.\n * @throws {AssertionError} When the value is not a number.\n */\nfunction doAssertFailure(defaultMessage, defaultArgs, givenMessage, givenArgs) {\n let message = 'Assertion failed';\n let args;\n if (givenMessage) {\n message += ': ' + givenMessage;\n args = givenArgs;\n } else if (defaultMessage) {\n message += ': ' + defaultMessage;\n args = defaultArgs;\n }\n // The '' + works around an Opera 10 bug in the unit tests. Without it,\n // a stack trace is added to var message above. With this, a stack trace is\n // not added until this line (it causes the extra garbage to be added after\n // the assertion message instead of in the middle of it).\n const e = new AssertionError('' + message, args || []);\n errorHandler_(e);\n}\n\n\n/**\n * Sets a custom error handler that can be used to customize the behavior of\n * assertion failures, for example by turning all assertion failures into log\n * messages.\n * @param {function(!AssertionError)} errorHandler\n * @return {void}\n */\nexports.setErrorHandler = function(errorHandler) {\n if (exports.ENABLE_ASSERTS) {\n errorHandler_ = errorHandler;\n }\n};\n\n\n/**\n * Checks if the condition evaluates to true if ENABLE_ASSERTS is\n * true.\n * @template T\n * @param {T} condition The condition to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {T} The value of the condition.\n * @throws {AssertionError} When the condition evaluates to false.\n * @closurePrimitive {asserts.truthy}\n */\nexports.assert = function(condition, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS && !condition) {\n doAssertFailure(\n '', null, opt_message, Array.prototype.slice.call(arguments, 2));\n }\n return condition;\n};\n\n\n/**\n * Checks if `value` is `null` or `undefined` if goog.asserts.ENABLE_ASSERTS is\n * true.\n *\n * @param {T} value The value to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {R} `value` with its type narrowed to exclude `null` and `undefined`.\n *\n * @template T\n * @template R :=\n * mapunion(T, (V) =>\n * cond(eq(V, 'null'),\n * none(),\n * cond(eq(V, 'undefined'),\n * none(),\n * V)))\n * =:\n *\n * @throws {!AssertionError} When `value` is `null` or `undefined`.\n * @closurePrimitive {asserts.matchesReturn}\n */\nexports.assertExists = function(value, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS && value == null) {\n doAssertFailure(\n 'Expected to exist: %s.', [value], opt_message,\n Array.prototype.slice.call(arguments, 2));\n }\n return value;\n};\n\n\n/**\n * Fails if goog.asserts.ENABLE_ASSERTS is true. This function is useful in case\n * when we want to add a check in the unreachable area like switch-case\n * statement:\n *\n * <pre>\n * switch(type) {\n * case FOO: doSomething(); break;\n * case BAR: doSomethingElse(); break;\n * default: goog.asserts.fail('Unrecognized type: ' + type);\n * // We have only 2 types - \"default:\" section is unreachable code.\n * }\n * </pre>\n *\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {void}\n * @throws {AssertionError} Failure.\n * @closurePrimitive {asserts.fail}\n */\nexports.fail = function(opt_message, var_args) {\n if (exports.ENABLE_ASSERTS) {\n errorHandler_(new AssertionError(\n 'Failure' + (opt_message ? ': ' + opt_message : ''),\n Array.prototype.slice.call(arguments, 1)));\n }\n};\n\n\n/**\n * Checks if the value is a number if goog.asserts.ENABLE_ASSERTS is true.\n * @param {*} value The value to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {number} The value, guaranteed to be a number when asserts enabled.\n * @throws {AssertionError} When the value is not a number.\n * @closurePrimitive {asserts.matchesReturn}\n */\nexports.assertNumber = function(value, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS && typeof value !== 'number') {\n doAssertFailure(\n 'Expected number but got %s: %s.', [goog.typeOf(value), value],\n opt_message, Array.prototype.slice.call(arguments, 2));\n }\n return /** @type {number} */ (value);\n};\n\n\n/**\n * Checks if the value is a string if goog.asserts.ENABLE_ASSERTS is true.\n * @param {*} value The value to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {string} The value, guaranteed to be a string when asserts enabled.\n * @throws {AssertionError} When the value is not a string.\n * @closurePrimitive {asserts.matchesReturn}\n */\nexports.assertString = function(value, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS && typeof value !== 'string') {\n doAssertFailure(\n 'Expected string but got %s: %s.', [goog.typeOf(value), value],\n opt_message, Array.prototype.slice.call(arguments, 2));\n }\n return /** @type {string} */ (value);\n};\n\n\n/**\n * Checks if the value is a function if goog.asserts.ENABLE_ASSERTS is true.\n * @param {*} value The value to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {!Function} The value, guaranteed to be a function when asserts\n * enabled.\n * @throws {AssertionError} When the value is not a function.\n * @closurePrimitive {asserts.matchesReturn}\n */\nexports.assertFunction = function(value, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS && typeof value !== 'function') {\n doAssertFailure(\n 'Expected function but got %s: %s.', [goog.typeOf(value), value],\n opt_message, Array.prototype.slice.call(arguments, 2));\n }\n return /** @type {!Function} */ (value);\n};\n\n\n/**\n * Checks if the value is an Object if goog.asserts.ENABLE_ASSERTS is true.\n * @param {*} value The value to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {!Object} The value, guaranteed to be a non-null object.\n * @throws {AssertionError} When the value is not an object.\n * @closurePrimitive {asserts.matchesReturn}\n */\nexports.assertObject = function(value, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS && !goog.isObject(value)) {\n doAssertFailure(\n 'Expected object but got %s: %s.', [goog.typeOf(value), value],\n opt_message, Array.prototype.slice.call(arguments, 2));\n }\n return /** @type {!Object} */ (value);\n};\n\n\n/**\n * Checks if the value is an Array if ENABLE_ASSERTS is true.\n * @param {*} value The value to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {!Array<?>} The value, guaranteed to be a non-null array.\n * @throws {AssertionError} When the value is not an array.\n * @closurePrimitive {asserts.matchesReturn}\n */\nexports.assertArray = function(value, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS && !Array.isArray(value)) {\n doAssertFailure(\n 'Expected array but got %s: %s.', [goog.typeOf(value), value],\n opt_message, Array.prototype.slice.call(arguments, 2));\n }\n return /** @type {!Array<?>} */ (value);\n};\n\n\n/**\n * Checks if the value is a boolean if goog.asserts.ENABLE_ASSERTS is true.\n * @param {*} value The value to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {boolean} The value, guaranteed to be a boolean when asserts are\n * enabled.\n * @throws {AssertionError} When the value is not a boolean.\n * @closurePrimitive {asserts.matchesReturn}\n */\nexports.assertBoolean = function(value, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS && typeof value !== 'boolean') {\n doAssertFailure(\n 'Expected boolean but got %s: %s.', [goog.typeOf(value), value],\n opt_message, Array.prototype.slice.call(arguments, 2));\n }\n return /** @type {boolean} */ (value);\n};\n\n\n/**\n * Checks if the value is a DOM Element if goog.asserts.ENABLE_ASSERTS is true.\n * @param {*} value The value to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @return {!Element} The value, likely to be a DOM Element when asserts are\n * enabled.\n * @throws {AssertionError} When the value is not an Element.\n * @closurePrimitive {asserts.matchesReturn}\n * @deprecated Use goog.asserts.dom.assertIsElement instead.\n */\nexports.assertElement = function(value, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS &&\n (!goog.isObject(value) ||\n /** @type {!Node} */ (value).nodeType != NodeType.ELEMENT)) {\n doAssertFailure(\n 'Expected Element but got %s: %s.', [goog.typeOf(value), value],\n opt_message, Array.prototype.slice.call(arguments, 2));\n }\n return /** @type {!Element} */ (value);\n};\n\n\n/**\n * Checks if the value is an instance of the user-defined type if\n * goog.asserts.ENABLE_ASSERTS is true.\n *\n * The compiler may tighten the type returned by this function.\n *\n * Do not use this to ensure a value is an HTMLElement or a subclass! Cross-\n * document DOM inherits from separate - though identical - browser classes, and\n * such a check will unexpectedly fail. Please use the methods in\n * goog.asserts.dom for these purposes.\n *\n * @param {?} value The value to check.\n * @param {function(new: T, ...)} type A user-defined constructor.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @throws {AssertionError} When the value is not an instance of\n * type.\n * @return {T}\n * @template T\n * @closurePrimitive {asserts.matchesReturn}\n */\nexports.assertInstanceof = function(value, type, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS && !(value instanceof type)) {\n doAssertFailure(\n 'Expected instanceof %s but got %s.', [getType(type), getType(value)],\n opt_message, Array.prototype.slice.call(arguments, 3));\n }\n return value;\n};\n\n\n/**\n * Checks whether the value is a finite number, if ENABLE_ASSERTS\n * is true.\n *\n * @param {*} value The value to check.\n * @param {string=} opt_message Error message in case of failure.\n * @param {...*} var_args The items to substitute into the failure message.\n * @throws {AssertionError} When the value is not a number, or is\n * a non-finite number such as NaN, Infinity or -Infinity.\n * @return {number} The value initially passed in.\n */\nexports.assertFinite = function(value, opt_message, var_args) {\n if (exports.ENABLE_ASSERTS &&\n (typeof value != 'number' || !isFinite(value))) {\n doAssertFailure(\n 'Expected %s to be a finite number but it is not.', [value],\n opt_message, Array.prototype.slice.call(arguments, 2));\n }\n return /** @type {number} */ (value);\n};\n\n/**\n * Returns the type of a value. If a constructor is passed, and a suitable\n * string cannot be found, 'unknown type name' will be returned.\n * @param {*} value A constructor, object, or primitive.\n * @return {string} The best display name for the value, or 'unknown type name'.\n */\nfunction getType(value) {\n if (value instanceof Function) {\n return value.displayName || value.name || 'unknown type name';\n } else if (value instanceof Object) {\n return /** @type {string} */ (value.constructor.displayName) ||\n value.constructor.name || Object.prototype.toString.call(value);\n } else {\n return value === null ? 'null' : typeof value;\n }\n}\n"],
|
|
8
|
+
"names":["AssertionError","messagePattern","messageArgs","DebugError","call","subs","pattern","splitParts","split","returnString","subLast","length","i","sub","doAssertFailure","defaultMessage","defaultArgs","givenMessage","givenArgs","message","args","e","errorHandler_","getType","value","Function","displayName","name","Object","constructor","prototype","toString","goog","module","declareLegacyNamespace","require","NodeType","exports","ENABLE_ASSERTS","define","DEBUG","inherits","DEFAULT_ERROR_HANDLER","exports.DEFAULT_ERROR_HANDLER","setErrorHandler","exports.setErrorHandler","errorHandler","assert","exports.assert","condition","opt_message","var_args","Array","slice","arguments","assertExists","exports.assertExists","fail","exports.fail","assertNumber","exports.assertNumber","typeOf","assertString","exports.assertString","assertFunction","exports.assertFunction","assertObject","exports.assertObject","isObject","assertArray","exports.assertArray","isArray","assertBoolean","exports.assertBoolean","assertElement","exports.assertElement","nodeType","ELEMENT","assertInstanceof","exports.assertInstanceof","type","assertFinite","exports.assertFinite","isFinite"]
|
|
9
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import "./cljs_env.js";
|
|
2
|
+
import "./goog.dom.tagname.js";
|
|
3
|
+
import "./goog.asserts.asserts.js";
|
|
4
|
+
import "./goog.dom.element.js";
|
|
5
|
+
goog.loadModule(function(exports) {
|
|
6
|
+
"use strict";
|
|
7
|
+
goog.module("goog.asserts.dom");
|
|
8
|
+
goog.module.declareLegacyNamespace();
|
|
9
|
+
const TagName = goog.require("goog.dom.TagName");
|
|
10
|
+
const asserts = goog.require("goog.asserts");
|
|
11
|
+
const element = goog.require("goog.dom.element");
|
|
12
|
+
const assertIsElement = value => {
|
|
13
|
+
if (asserts.ENABLE_ASSERTS && !element.isElement(value)) {
|
|
14
|
+
asserts.fail(`Argument is not an Element; got: ${debugStringForType(value)}`);
|
|
15
|
+
}
|
|
16
|
+
return value;
|
|
17
|
+
};
|
|
18
|
+
const assertIsHtmlElement = value => {
|
|
19
|
+
if (asserts.ENABLE_ASSERTS && !element.isHtmlElement(value)) {
|
|
20
|
+
asserts.fail(`Argument is not an HTML Element; got: ${debugStringForType(value)}`);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
const assertIsHtmlElementOfType = (value, tagName) => {
|
|
25
|
+
if (asserts.ENABLE_ASSERTS && !element.isHtmlElementOfType(value, tagName)) {
|
|
26
|
+
asserts.fail(`Argument is not an HTML Element with tag name ` + `${tagName.toString()}; got: ${debugStringForType(value)}`);
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
};
|
|
30
|
+
const assertIsHtmlAnchorElement = value => {
|
|
31
|
+
return assertIsHtmlElementOfType(value, TagName.A);
|
|
32
|
+
};
|
|
33
|
+
const assertIsHtmlButtonElement = value => {
|
|
34
|
+
return assertIsHtmlElementOfType(value, TagName.BUTTON);
|
|
35
|
+
};
|
|
36
|
+
const assertIsHtmlLinkElement = value => {
|
|
37
|
+
return assertIsHtmlElementOfType(value, TagName.LINK);
|
|
38
|
+
};
|
|
39
|
+
const assertIsHtmlImageElement = value => {
|
|
40
|
+
return assertIsHtmlElementOfType(value, TagName.IMG);
|
|
41
|
+
};
|
|
42
|
+
const assertIsHtmlAudioElement = value => {
|
|
43
|
+
return assertIsHtmlElementOfType(value, TagName.AUDIO);
|
|
44
|
+
};
|
|
45
|
+
const assertIsHtmlVideoElement = value => {
|
|
46
|
+
return assertIsHtmlElementOfType(value, TagName.VIDEO);
|
|
47
|
+
};
|
|
48
|
+
const assertIsHtmlInputElement = value => {
|
|
49
|
+
return assertIsHtmlElementOfType(value, TagName.INPUT);
|
|
50
|
+
};
|
|
51
|
+
const assertIsHtmlTextAreaElement = value => {
|
|
52
|
+
return assertIsHtmlElementOfType(value, TagName.TEXTAREA);
|
|
53
|
+
};
|
|
54
|
+
const assertIsHtmlCanvasElement = value => {
|
|
55
|
+
return assertIsHtmlElementOfType(value, TagName.CANVAS);
|
|
56
|
+
};
|
|
57
|
+
const assertIsHtmlEmbedElement = value => {
|
|
58
|
+
return assertIsHtmlElementOfType(value, TagName.EMBED);
|
|
59
|
+
};
|
|
60
|
+
const assertIsHtmlFormElement = value => {
|
|
61
|
+
return assertIsHtmlElementOfType(value, TagName.FORM);
|
|
62
|
+
};
|
|
63
|
+
const assertIsHtmlFrameElement = value => {
|
|
64
|
+
return assertIsHtmlElementOfType(value, TagName.FRAME);
|
|
65
|
+
};
|
|
66
|
+
const assertIsHtmlIFrameElement = value => {
|
|
67
|
+
return assertIsHtmlElementOfType(value, TagName.IFRAME);
|
|
68
|
+
};
|
|
69
|
+
const assertIsHtmlObjectElement = value => {
|
|
70
|
+
return assertIsHtmlElementOfType(value, TagName.OBJECT);
|
|
71
|
+
};
|
|
72
|
+
const assertIsHtmlScriptElement = value => {
|
|
73
|
+
return assertIsHtmlElementOfType(value, TagName.SCRIPT);
|
|
74
|
+
};
|
|
75
|
+
const debugStringForType = value => {
|
|
76
|
+
if (goog.isObject(value)) {
|
|
77
|
+
try {
|
|
78
|
+
return value.constructor.displayName || value.constructor.name || Object.prototype.toString.call(value);
|
|
79
|
+
} catch (e) {
|
|
80
|
+
return "\x3cobject could not be stringified\x3e";
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
return value === undefined ? "undefined" : value === null ? "null" : typeof value;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
exports = {assertIsElement, assertIsHtmlElement, assertIsHtmlElementOfType, assertIsHtmlAnchorElement, assertIsHtmlButtonElement, assertIsHtmlLinkElement, assertIsHtmlImageElement, assertIsHtmlAudioElement, assertIsHtmlVideoElement, assertIsHtmlInputElement, assertIsHtmlTextAreaElement, assertIsHtmlCanvasElement, assertIsHtmlEmbedElement, assertIsHtmlFormElement, assertIsHtmlFrameElement, assertIsHtmlIFrameElement, assertIsHtmlObjectElement, assertIsHtmlScriptElement};
|
|
87
|
+
return exports;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=goog.asserts.dom.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version":3,
|
|
3
|
+
"file":"goog.asserts.dom.js",
|
|
4
|
+
"lineCount":85,
|
|
5
|
+
"mappings":"AAAA,IAAA,CAAA,UAAA,CAAA,QAAA,CAAA,OAAA,CAAA;AAAA,cAAA;AAMAA,MAAKC,CAAAA,MAAL,CAAY,kBAAZ,CAAA;AACAD,MAAKC,CAAAA,MAAOC,CAAAA,sBAAZ,EAAA;AAEA,QAAMC,UAAUH,IAAKI,CAAAA,OAAL,CAAa,kBAAb,CAAhB;AACA,QAAMC,UAAUL,IAAKI,CAAAA,OAAL,CAAa,cAAb,CAAhB;AACA,QAAME,UAAUN,IAAKI,CAAAA,OAAL,CAAa,kBAAb,CAAhB;AAUA,QAAMG,kBAAmBC,KAADD,IAAW;AACjC,QAAIF,OAAQI,CAAAA,cAAZ,IAA8B,CAACH,OAAQI,CAAAA,SAAR,CAAkBF,KAAlB,CAA/B;AACEH,aAAQM,CAAAA,IAAR,CACK,oCAAmCC,kBAAA,CAAmBJ,KAAnB,CAAnC,EADL,CAAA;AADF;AAIA,WAAgCA,KAAhC;AALiC,GAAnC;AAiBA,QAAMK,sBAAuBL,KAADK,IAAW;AACrC,QAAIR,OAAQI,CAAAA,cAAZ,IAA8B,CAACH,OAAQQ,CAAAA,aAAR,CAAsBN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C,KAAd,CAAJ;AACE,SAAI;AACF,eAAwCA,KAAM0C,CAAAA,WAAYC,CAAAA,WAA1D,IACI3C,KAAM0C,CAAAA,WAAYE,CAAAA,IADtB,IAEIC,MAAOC,CAAAA,SAAUpC,CAAAA,QAASqC,CAAAA,IAA1B,CAA+B/C,KAA/B,CAFJ;AADE,OAIF,QAAOgD,CAAP,CAAU;AACV,eAAO,yCAAP;AADU;AALd;AASE,aAAOhD,KAAA,KAAUiD,SAAV,GAAsB,WAAtB,GACsBjD,KAAA,KAAU,IAAV,GAAiB,MAAjB,GAA0B,MAAOA,MAD9D;AATF;AADoC,GAAtC;AAeAkD,SAAA,GAAU,CACRnD,eADQ,EAERM,mBAFQ,EAGRE,yBAHQ,EAIRI,yBAJQ,EAKRE,yBALQ,EAMRE,uBANQ,EAORE,wBAPQ,EAQRE,wBARQ,EASRE,wBATQ,EAURE,wBAVQ,EAWRE,2BAXQ,EAYRE,yBAZQ,EAaRE,wBAbQ,EAcRE,uBAdQ,EAeRE,wBAfQ,EAgBRE,yBAhBQ,EAiBRE,yBAjBQ,EAkBRE,yBAlBQ,CAAV;AA5QA,SAAA,OAAA;AAAA,CAAA,CAAA;;",
|
|
6
|
+
"sources":["goog/asserts/dom.js"],
|
|
7
|
+
"sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\ngoog.module('goog.asserts.dom');\ngoog.module.declareLegacyNamespace();\n\nconst TagName = goog.require('goog.dom.TagName');\nconst asserts = goog.require('goog.asserts');\nconst element = goog.require('goog.dom.element');\n\n/**\n * Checks if the value is a DOM Element if goog.asserts.ENABLE_ASSERTS is true.\n * @param {*} value The value to check.\n * @return {!Element} The value, likely to be a DOM Element when asserts are\n * enabled.\n * @throws {!asserts.AssertionError} When the value is not an Element.\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsElement = (value) => {\n if (asserts.ENABLE_ASSERTS && !element.isElement(value)) {\n asserts.fail(\n `Argument is not an Element; got: ${debugStringForType(value)}`);\n }\n return /** @type {!Element} */ (value);\n};\n\n/**\n * Checks if the value is a DOM HTMLElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value The value to check.\n * @return {!HTMLElement} The value, likely to be a DOM HTMLElement when asserts\n * are enabled.\n * @throws {!asserts.AssertionError} When the value is not an HTMLElement.\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlElement = (value) => {\n if (asserts.ENABLE_ASSERTS && !element.isHtmlElement(value)) {\n asserts.fail(\n `Argument is not an HTML Element; got: ${debugStringForType(value)}`);\n }\n return /** @type {!HTMLElement} */ (value);\n};\n\n/**\n * Checks if the value is a DOM HTMLElement of the specified tag name / subclass\n * if goog.asserts.ENABLE_ASSERTS is true.\n * @param {*} value The value to check.\n * @param {!TagName<T>} tagName The element tagName to verify the value against.\n * @return {T} The value, likely to be a DOM HTMLElement when asserts are\n * enabled. The exact return type will match the parameterized type\n * of the tagName as specified in goog.dom.TagName.\n * @throws {!asserts.AssertionError} When the value is not an HTMLElement with\n * the appropriate tagName.\n * @template T\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlElementOfType = (value, tagName) => {\n if (asserts.ENABLE_ASSERTS && !element.isHtmlElementOfType(value, tagName)) {\n asserts.fail(\n `Argument is not an HTML Element with tag name ` +\n `${tagName.toString()}; got: ${debugStringForType(value)}`);\n }\n return /** @type {T} */ (value);\n};\n\n/**\n * Checks if the value is an HTMLAnchorElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLAnchorElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlAnchorElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.A);\n};\n\n/**\n * Checks if the value is an HTMLButtonElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLButtonElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlButtonElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.BUTTON);\n};\n\n/**\n * Checks if the value is an HTMLLinkElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLLinkElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlLinkElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.LINK);\n};\n\n/**\n * Checks if the value is an HTMLImageElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLImageElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlImageElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.IMG);\n};\n\n/**\n * Checks if the value is an HTMLAudioElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLAudioElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlAudioElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.AUDIO);\n};\n\n/**\n * Checks if the value is an HTMLVideoElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLVideoElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlVideoElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.VIDEO);\n};\n\n/**\n * Checks if the value is an HTMLInputElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLInputElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlInputElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.INPUT);\n};\n\n/**\n * Checks if the value is an HTMLTextAreaElement if goog.asserts.ENABLE_ASSERTS\n * is true.\n * @param {*} value\n * @return {!HTMLTextAreaElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlTextAreaElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.TEXTAREA);\n};\n\n/**\n * Checks if the value is an HTMLCanvasElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLCanvasElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlCanvasElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.CANVAS);\n};\n\n/**\n * Checks if the value is an HTMLEmbedElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLEmbedElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlEmbedElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.EMBED);\n};\n\n/**\n * Checks if the value is an HTMLFormElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLFormElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlFormElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.FORM);\n};\n\n/**\n * Checks if the value is an HTMLFrameElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLFrameElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlFrameElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.FRAME);\n};\n\n/**\n * Checks if the value is an HTMLIFrameElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLIFrameElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlIFrameElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.IFRAME);\n};\n\n/**\n * Checks if the value is an HTMLObjectElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLObjectElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlObjectElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.OBJECT);\n};\n\n/**\n * Checks if the value is an HTMLScriptElement if goog.asserts.ENABLE_ASSERTS is\n * true.\n * @param {*} value\n * @return {!HTMLScriptElement}\n * @throws {!asserts.AssertionError}\n * @closurePrimitive {asserts.matchesReturn}\n */\nconst assertIsHtmlScriptElement = (value) => {\n return assertIsHtmlElementOfType(value, TagName.SCRIPT);\n};\n\n/**\n * Returns a string representation of a value's type.\n * @param {*} value An object, or primitive.\n * @return {string} The best display name for the value.\n */\nconst debugStringForType = (value) => {\n if (goog.isObject(value)) {\n try {\n return /** @type {string|undefined} */ (value.constructor.displayName) ||\n value.constructor.name ||\n Object.prototype.toString.call(value);\n } catch (e) {\n return '<object could not be stringified>';\n }\n } else {\n return value === undefined ? 'undefined' :\n value === null ? 'null' : typeof value;\n }\n};\n\nexports = {\n assertIsElement,\n assertIsHtmlElement,\n assertIsHtmlElementOfType,\n assertIsHtmlAnchorElement,\n assertIsHtmlButtonElement,\n assertIsHtmlLinkElement,\n assertIsHtmlImageElement,\n assertIsHtmlAudioElement,\n assertIsHtmlVideoElement,\n assertIsHtmlInputElement,\n assertIsHtmlTextAreaElement,\n assertIsHtmlCanvasElement,\n assertIsHtmlEmbedElement,\n assertIsHtmlFormElement,\n assertIsHtmlFrameElement,\n assertIsHtmlIFrameElement,\n assertIsHtmlObjectElement,\n assertIsHtmlScriptElement,\n};\n"],
|
|
8
|
+
"names":["goog","module","declareLegacyNamespace","TagName","require","asserts","element","assertIsElement","value","ENABLE_ASSERTS","isElement","fail","debugStringForType","assertIsHtmlElement","isHtmlElement","assertIsHtmlElementOfType","tagName","isHtmlElementOfType","toString","assertIsHtmlAnchorElement","A","assertIsHtmlButtonElement","BUTTON","assertIsHtmlLinkElement","LINK","assertIsHtmlImageElement","IMG","assertIsHtmlAudioElement","AUDIO","assertIsHtmlVideoElement","VIDEO","assertIsHtmlInputElement","INPUT","assertIsHtmlTextAreaElement","TEXTAREA","assertIsHtmlCanvasElement","CANVAS","assertIsHtmlEmbedElement","EMBED","assertIsHtmlFormElement","FORM","assertIsHtmlFrameElement","FRAME","assertIsHtmlIFrameElement","IFRAME","assertIsHtmlObjectElement","OBJECT","assertIsHtmlScriptElement","SCRIPT","isObject","constructor","displayName","name","Object","prototype","call","e","undefined","exports"]
|
|
9
|
+
}
|