tslib.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. /*! *****************************************************************************
  2. Copyright (c) Microsoft Corporation.
  3. Permission to use, copy, modify, and/or distribute this software for any
  4. purpose with or without fee is hereby granted.
  5. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  6. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  7. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  8. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  9. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  10. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  11. PERFORMANCE OF THIS SOFTWARE.
  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 __spreadArray;
  28. var __await;
  29. var __asyncGenerator;
  30. var __asyncDelegator;
  31. var __asyncValues;
  32. var __makeTemplateObject;
  33. var __importStar;
  34. var __importDefault;
  35. var __classPrivateFieldGet;
  36. var __classPrivateFieldSet;
  37. var __createBinding;
  38. (function (factory) {
  39. var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
  40. if (typeof define === "function" && define.amd) {
  41. define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
  42. }
  43. else if (typeof module === "object" && typeof module.exports === "object") {
  44. factory(createExporter(root, createExporter(module.exports)));
  45. }
  46. else {
  47. factory(createExporter(root));
  48. }
  49. function createExporter(exports, previous) {
  50. if (exports !== root) {
  51. if (typeof Object.create === "function") {
  52. Object.defineProperty(exports, "__esModule", { value: true });
  53. }
  54. else {
  55. exports.__esModule = true;
  56. }
  57. }
  58. return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
  59. }
  60. })
  61. (function (exporter) {
  62. var extendStatics = Object.setPrototypeOf ||
  63. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  64. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  65. __extends = function (d, b) {
  66. if (typeof b !== "function" && b !== null)
  67. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  68. extendStatics(d, b);
  69. function __() { this.constructor = d; }
  70. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  71. };
  72. __assign = Object.assign || function (t) {
  73. for (var s, i = 1, n = arguments.length; i < n; i++) {
  74. s = arguments[i];
  75. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  76. }
  77. return t;
  78. };
  79. __rest = function (s, e) {
  80. var t = {};
  81. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  82. t[p] = s[p];
  83. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  84. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  85. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  86. t[p[i]] = s[p[i]];
  87. }
  88. return t;
  89. };
  90. __decorate = function (decorators, target, key, desc) {
  91. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  92. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  93. 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;
  94. return c > 3 && r && Object.defineProperty(target, key, r), r;
  95. };
  96. __param = function (paramIndex, decorator) {
  97. return function (target, key) { decorator(target, key, paramIndex); }
  98. };
  99. __metadata = function (metadataKey, metadataValue) {
  100. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  101. };
  102. __awaiter = function (thisArg, _arguments, P, generator) {
  103. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  104. return new (P || (P = Promise))(function (resolve, reject) {
  105. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  106. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  107. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  108. step((generator = generator.apply(thisArg, _arguments || [])).next());
  109. });
  110. };
  111. __generator = function (thisArg, body) {
  112. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  113. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  114. function verb(n) { return function (v) { return step([n, v]); }; }
  115. function step(op) {
  116. if (f) throw new TypeError("Generator is already executing.");
  117. while (_) try {
  118. 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;
  119. if (y = 0, t) op = [op[0] & 2, t.value];
  120. switch (op[0]) {
  121. case 0: case 1: t = op; break;
  122. case 4: _.label++; return { value: op[1], done: false };
  123. case 5: _.label++; y = op[1]; op = [0]; continue;
  124. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  125. default:
  126. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  127. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  128. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  129. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  130. if (t[2]) _.ops.pop();
  131. _.trys.pop(); continue;
  132. }
  133. op = body.call(thisArg, _);
  134. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  135. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  136. }
  137. };
  138. __exportStar = function(m, o) {
  139. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
  140. };
  141. __createBinding = Object.create ? (function(o, m, k, k2) {
  142. if (k2 === undefined) k2 = k;
  143. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  144. }) : (function(o, m, k, k2) {
  145. if (k2 === undefined) k2 = k;
  146. o[k2] = m[k];
  147. });
  148. __values = function (o) {
  149. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  150. if (m) return m.call(o);
  151. if (o && typeof o.length === "number") return {
  152. next: function () {
  153. if (o && i >= o.length) o = void 0;
  154. return { value: o && o[i++], done: !o };
  155. }
  156. };
  157. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  158. };
  159. __read = function (o, n) {
  160. var m = typeof Symbol === "function" && o[Symbol.iterator];
  161. if (!m) return o;
  162. var i = m.call(o), r, ar = [], e;
  163. try {
  164. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  165. }
  166. catch (error) { e = { error: error }; }
  167. finally {
  168. try {
  169. if (r && !r.done && (m = i["return"])) m.call(i);
  170. }
  171. finally { if (e) throw e.error; }
  172. }
  173. return ar;
  174. };
  175. /** @deprecated */
  176. __spread = function () {
  177. for (var ar = [], i = 0; i < arguments.length; i++)
  178. ar = ar.concat(__read(arguments[i]));
  179. return ar;
  180. };
  181. /** @deprecated */
  182. __spreadArrays = function () {
  183. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  184. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  185. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  186. r[k] = a[j];
  187. return r;
  188. };
  189. __spreadArray = function (to, from, pack) {
  190. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  191. if (ar || !(i in from)) {
  192. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  193. ar[i] = from[i];
  194. }
  195. }
  196. return to.concat(ar || Array.prototype.slice.call(from));
  197. };
  198. __await = function (v) {
  199. return this instanceof __await ? (this.v = v, this) : new __await(v);
  200. };
  201. __asyncGenerator = function (thisArg, _arguments, generator) {
  202. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  203. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  204. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  205. 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); }); }; }
  206. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  207. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  208. function fulfill(value) { resume("next", value); }
  209. function reject(value) { resume("throw", value); }
  210. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  211. };
  212. __asyncDelegator = function (o) {
  213. var i, p;
  214. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  215. 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; }
  216. };
  217. __asyncValues = function (o) {
  218. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  219. var m = o[Symbol.asyncIterator], i;
  220. 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);
  221. 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); }); }; }
  222. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  223. };
  224. __makeTemplateObject = function (cooked, raw) {
  225. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  226. return cooked;
  227. };
  228. var __setModuleDefault = Object.create ? (function(o, v) {
  229. Object.defineProperty(o, "default", { enumerable: true, value: v });
  230. }) : function(o, v) {
  231. o["default"] = v;
  232. };
  233. __importStar = function (mod) {
  234. if (mod && mod.__esModule) return mod;
  235. var result = {};
  236. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  237. __setModuleDefault(result, mod);
  238. return result;
  239. };
  240. __importDefault = function (mod) {
  241. return (mod && mod.__esModule) ? mod : { "default": mod };
  242. };
  243. __classPrivateFieldGet = function (receiver, state, kind, f) {
  244. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  245. if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  246. return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
  247. };
  248. __classPrivateFieldSet = function (receiver, state, value, kind, f) {
  249. if (kind === "m") throw new TypeError("Private method is not writable");
  250. if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  251. if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  252. return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
  253. };
  254. exporter("__extends", __extends);
  255. exporter("__assign", __assign);
  256. exporter("__rest", __rest);
  257. exporter("__decorate", __decorate);
  258. exporter("__param", __param);
  259. exporter("__metadata", __metadata);
  260. exporter("__awaiter", __awaiter);
  261. exporter("__generator", __generator);
  262. exporter("__exportStar", __exportStar);
  263. exporter("__createBinding", __createBinding);
  264. exporter("__values", __values);
  265. exporter("__read", __read);
  266. exporter("__spread", __spread);
  267. exporter("__spreadArrays", __spreadArrays);
  268. exporter("__spreadArray", __spreadArray);
  269. exporter("__await", __await);
  270. exporter("__asyncGenerator", __asyncGenerator);
  271. exporter("__asyncDelegator", __asyncDelegator);
  272. exporter("__asyncValues", __asyncValues);
  273. exporter("__makeTemplateObject", __makeTemplateObject);
  274. exporter("__importStar", __importStar);
  275. exporter("__importDefault", __importDefault);
  276. exporter("__classPrivateFieldGet", __classPrivateFieldGet);
  277. exporter("__classPrivateFieldSet", __classPrivateFieldSet);
  278. });