tslib.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. /*! *****************************************************************************
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  4. this file except in compliance with the License. You may obtain a copy of the
  5. License at http://www.apache.org/licenses/LICENSE-2.0
  6. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  7. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  8. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  9. MERCHANTABLITY OR NON-INFRINGEMENT.
  10. See the Apache Version 2.0 License for specific language governing permissions
  11. and limitations under the License.
  12. ***************************************************************************** */
  13. /* global global, define, System, Reflect, Promise */
  14. var __extends;
  15. var __assign;
  16. var __rest;
  17. var __decorate;
  18. var __param;
  19. var __metadata;
  20. var __awaiter;
  21. var __generator;
  22. var __exportStar;
  23. var __values;
  24. var __read;
  25. var __spread;
  26. var __spreadArrays;
  27. var __await;
  28. var __asyncGenerator;
  29. var __asyncDelegator;
  30. var __asyncValues;
  31. var __makeTemplateObject;
  32. var __importStar;
  33. var __importDefault;
  34. var __classPrivateFieldGet;
  35. var __classPrivateFieldSet;
  36. (function (factory) {
  37. var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
  38. if (typeof define === "function" && define.amd) {
  39. define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
  40. }
  41. else if (typeof module === "object" && typeof module.exports === "object") {
  42. factory(createExporter(root, createExporter(module.exports)));
  43. }
  44. else {
  45. factory(createExporter(root));
  46. }
  47. function createExporter(exports, previous) {
  48. if (exports !== root) {
  49. if (typeof Object.create === "function") {
  50. Object.defineProperty(exports, "__esModule", { value: true });
  51. }
  52. else {
  53. exports.__esModule = true;
  54. }
  55. }
  56. return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
  57. }
  58. })
  59. (function (exporter) {
  60. var extendStatics = Object.setPrototypeOf ||
  61. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  62. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  63. __extends = function (d, b) {
  64. extendStatics(d, b);
  65. function __() { this.constructor = d; }
  66. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  67. };
  68. __assign = Object.assign || function (t) {
  69. for (var s, i = 1, n = arguments.length; i < n; i++) {
  70. s = arguments[i];
  71. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  72. }
  73. return t;
  74. };
  75. __rest = function (s, e) {
  76. var t = {};
  77. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  78. t[p] = s[p];
  79. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  80. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  81. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  82. t[p[i]] = s[p[i]];
  83. }
  84. return t;
  85. };
  86. __decorate = function (decorators, target, key, desc) {
  87. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  88. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  89. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  90. return c > 3 && r && Object.defineProperty(target, key, r), r;
  91. };
  92. __param = function (paramIndex, decorator) {
  93. return function (target, key) { decorator(target, key, paramIndex); }
  94. };
  95. __metadata = function (metadataKey, metadataValue) {
  96. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  97. };
  98. __awaiter = function (thisArg, _arguments, P, generator) {
  99. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  100. return new (P || (P = Promise))(function (resolve, reject) {
  101. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  102. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  103. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  104. step((generator = generator.apply(thisArg, _arguments || [])).next());
  105. });
  106. };
  107. __generator = function (thisArg, body) {
  108. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  109. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  110. function verb(n) { return function (v) { return step([n, v]); }; }
  111. function step(op) {
  112. if (f) throw new TypeError("Generator is already executing.");
  113. while (_) try {
  114. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  115. if (y = 0, t) op = [op[0] & 2, t.value];
  116. switch (op[0]) {
  117. case 0: case 1: t = op; break;
  118. case 4: _.label++; return { value: op[1], done: false };
  119. case 5: _.label++; y = op[1]; op = [0]; continue;
  120. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  121. default:
  122. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  123. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  124. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  125. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  126. if (t[2]) _.ops.pop();
  127. _.trys.pop(); continue;
  128. }
  129. op = body.call(thisArg, _);
  130. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  131. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  132. }
  133. };
  134. __exportStar = function (m, exports) {
  135. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  136. };
  137. __values = function (o) {
  138. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  139. if (m) return m.call(o);
  140. if (o && typeof o.length === "number") return {
  141. next: function () {
  142. if (o && i >= o.length) o = void 0;
  143. return { value: o && o[i++], done: !o };
  144. }
  145. };
  146. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  147. };
  148. __read = function (o, n) {
  149. var m = typeof Symbol === "function" && o[Symbol.iterator];
  150. if (!m) return o;
  151. var i = m.call(o), r, ar = [], e;
  152. try {
  153. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  154. }
  155. catch (error) { e = { error: error }; }
  156. finally {
  157. try {
  158. if (r && !r.done && (m = i["return"])) m.call(i);
  159. }
  160. finally { if (e) throw e.error; }
  161. }
  162. return ar;
  163. };
  164. __spread = function () {
  165. for (var ar = [], i = 0; i < arguments.length; i++)
  166. ar = ar.concat(__read(arguments[i]));
  167. return ar;
  168. };
  169. __spreadArrays = function () {
  170. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  171. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  172. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  173. r[k] = a[j];
  174. return r;
  175. };
  176. __await = function (v) {
  177. return this instanceof __await ? (this.v = v, this) : new __await(v);
  178. };
  179. __asyncGenerator = function (thisArg, _arguments, generator) {
  180. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  181. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  182. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  183. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  184. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  185. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  186. function fulfill(value) { resume("next", value); }
  187. function reject(value) { resume("throw", value); }
  188. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  189. };
  190. __asyncDelegator = function (o) {
  191. var i, p;
  192. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  193. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  194. };
  195. __asyncValues = function (o) {
  196. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  197. var m = o[Symbol.asyncIterator], i;
  198. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  199. function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  200. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  201. };
  202. __makeTemplateObject = function (cooked, raw) {
  203. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  204. return cooked;
  205. };
  206. __importStar = function (mod) {
  207. if (mod && mod.__esModule) return mod;
  208. var result = {};
  209. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  210. result["default"] = mod;
  211. return result;
  212. };
  213. __importDefault = function (mod) {
  214. return (mod && mod.__esModule) ? mod : { "default": mod };
  215. };
  216. __classPrivateFieldGet = function (receiver, privateMap) {
  217. if (!privateMap.has(receiver)) {
  218. throw new TypeError("attempted to get private field on non-instance");
  219. }
  220. return privateMap.get(receiver);
  221. };
  222. __classPrivateFieldSet = function (receiver, privateMap, value) {
  223. if (!privateMap.has(receiver)) {
  224. throw new TypeError("attempted to set private field on non-instance");
  225. }
  226. privateMap.set(receiver, value);
  227. return value;
  228. }
  229. exporter("__extends", __extends);
  230. exporter("__assign", __assign);
  231. exporter("__rest", __rest);
  232. exporter("__decorate", __decorate);
  233. exporter("__param", __param);
  234. exporter("__metadata", __metadata);
  235. exporter("__awaiter", __awaiter);
  236. exporter("__generator", __generator);
  237. exporter("__exportStar", __exportStar);
  238. exporter("__values", __values);
  239. exporter("__read", __read);
  240. exporter("__spread", __spread);
  241. exporter("__spreadArrays", __spreadArrays);
  242. exporter("__await", __await);
  243. exporter("__asyncGenerator", __asyncGenerator);
  244. exporter("__asyncDelegator", __asyncDelegator);
  245. exporter("__asyncValues", __asyncValues);
  246. exporter("__makeTemplateObject", __makeTemplateObject);
  247. exporter("__importStar", __importStar);
  248. exporter("__importDefault", __importDefault);
  249. exporter("__classPrivateFieldGet", __classPrivateFieldGet);
  250. exporter("__classPrivateFieldSet", __classPrivateFieldSet);
  251. });