@reveldigital/player-client 0.0.6 → 0.0.10

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.
@@ -0,0 +1,678 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs')) :
3
+ typeof define === 'function' && define.amd ? define('@reveldigital/player-client', ['exports', '@angular/core', 'rxjs'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.reveldigital = global.reveldigital || {}, global.reveldigital['player-client'] = {}), global.ng.core, global.rxjs));
5
+ }(this, (function (exports, i0, rxjs) { 'use strict';
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () {
17
+ return e[k];
18
+ }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n['default'] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
+
29
+ /*! *****************************************************************************
30
+ Copyright (c) Microsoft Corporation.
31
+
32
+ Permission to use, copy, modify, and/or distribute this software for any
33
+ purpose with or without fee is hereby granted.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
38
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
40
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41
+ PERFORMANCE OF THIS SOFTWARE.
42
+ ***************************************************************************** */
43
+ /* global Reflect, Promise */
44
+ var extendStatics = function (d, b) {
45
+ extendStatics = Object.setPrototypeOf ||
46
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47
+ function (d, b) { for (var p in b)
48
+ if (Object.prototype.hasOwnProperty.call(b, p))
49
+ d[p] = b[p]; };
50
+ return extendStatics(d, b);
51
+ };
52
+ function __extends(d, b) {
53
+ if (typeof b !== "function" && b !== null)
54
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
55
+ extendStatics(d, b);
56
+ function __() { this.constructor = d; }
57
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
58
+ }
59
+ var __assign = function () {
60
+ __assign = Object.assign || function __assign(t) {
61
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
62
+ s = arguments[i];
63
+ for (var p in s)
64
+ if (Object.prototype.hasOwnProperty.call(s, p))
65
+ t[p] = s[p];
66
+ }
67
+ return t;
68
+ };
69
+ return __assign.apply(this, arguments);
70
+ };
71
+ function __rest(s, e) {
72
+ var t = {};
73
+ for (var p in s)
74
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75
+ t[p] = s[p];
76
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
77
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79
+ t[p[i]] = s[p[i]];
80
+ }
81
+ return t;
82
+ }
83
+ function __decorate(decorators, target, key, desc) {
84
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
85
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
86
+ r = Reflect.decorate(decorators, target, key, desc);
87
+ else
88
+ for (var i = decorators.length - 1; i >= 0; i--)
89
+ if (d = decorators[i])
90
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
91
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
92
+ }
93
+ function __param(paramIndex, decorator) {
94
+ return function (target, key) { decorator(target, key, paramIndex); };
95
+ }
96
+ function __metadata(metadataKey, metadataValue) {
97
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
98
+ return Reflect.metadata(metadataKey, metadataValue);
99
+ }
100
+ function __awaiter(thisArg, _arguments, P, generator) {
101
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
102
+ return new (P || (P = Promise))(function (resolve, reject) {
103
+ function fulfilled(value) { try {
104
+ step(generator.next(value));
105
+ }
106
+ catch (e) {
107
+ reject(e);
108
+ } }
109
+ function rejected(value) { try {
110
+ step(generator["throw"](value));
111
+ }
112
+ catch (e) {
113
+ reject(e);
114
+ } }
115
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
116
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
117
+ });
118
+ }
119
+ function __generator(thisArg, body) {
120
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
121
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
122
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
123
+ function verb(n) { return function (v) { return step([n, v]); }; }
124
+ function step(op) {
125
+ if (f)
126
+ throw new TypeError("Generator is already executing.");
127
+ while (_)
128
+ try {
129
+ 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)
130
+ return t;
131
+ if (y = 0, t)
132
+ op = [op[0] & 2, t.value];
133
+ switch (op[0]) {
134
+ case 0:
135
+ case 1:
136
+ t = op;
137
+ break;
138
+ case 4:
139
+ _.label++;
140
+ return { value: op[1], done: false };
141
+ case 5:
142
+ _.label++;
143
+ y = op[1];
144
+ op = [0];
145
+ continue;
146
+ case 7:
147
+ op = _.ops.pop();
148
+ _.trys.pop();
149
+ continue;
150
+ default:
151
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
152
+ _ = 0;
153
+ continue;
154
+ }
155
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
156
+ _.label = op[1];
157
+ break;
158
+ }
159
+ if (op[0] === 6 && _.label < t[1]) {
160
+ _.label = t[1];
161
+ t = op;
162
+ break;
163
+ }
164
+ if (t && _.label < t[2]) {
165
+ _.label = t[2];
166
+ _.ops.push(op);
167
+ break;
168
+ }
169
+ if (t[2])
170
+ _.ops.pop();
171
+ _.trys.pop();
172
+ continue;
173
+ }
174
+ op = body.call(thisArg, _);
175
+ }
176
+ catch (e) {
177
+ op = [6, e];
178
+ y = 0;
179
+ }
180
+ finally {
181
+ f = t = 0;
182
+ }
183
+ if (op[0] & 5)
184
+ throw op[1];
185
+ return { value: op[0] ? op[1] : void 0, done: true };
186
+ }
187
+ }
188
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
189
+ if (k2 === undefined)
190
+ k2 = k;
191
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
192
+ }) : (function (o, m, k, k2) {
193
+ if (k2 === undefined)
194
+ k2 = k;
195
+ o[k2] = m[k];
196
+ });
197
+ function __exportStar(m, o) {
198
+ for (var p in m)
199
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
200
+ __createBinding(o, m, p);
201
+ }
202
+ function __values(o) {
203
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
204
+ if (m)
205
+ return m.call(o);
206
+ if (o && typeof o.length === "number")
207
+ return {
208
+ next: function () {
209
+ if (o && i >= o.length)
210
+ o = void 0;
211
+ return { value: o && o[i++], done: !o };
212
+ }
213
+ };
214
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
215
+ }
216
+ function __read(o, n) {
217
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
218
+ if (!m)
219
+ return o;
220
+ var i = m.call(o), r, ar = [], e;
221
+ try {
222
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
223
+ ar.push(r.value);
224
+ }
225
+ catch (error) {
226
+ e = { error: error };
227
+ }
228
+ finally {
229
+ try {
230
+ if (r && !r.done && (m = i["return"]))
231
+ m.call(i);
232
+ }
233
+ finally {
234
+ if (e)
235
+ throw e.error;
236
+ }
237
+ }
238
+ return ar;
239
+ }
240
+ /** @deprecated */
241
+ function __spread() {
242
+ for (var ar = [], i = 0; i < arguments.length; i++)
243
+ ar = ar.concat(__read(arguments[i]));
244
+ return ar;
245
+ }
246
+ /** @deprecated */
247
+ function __spreadArrays() {
248
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
249
+ s += arguments[i].length;
250
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
251
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
252
+ r[k] = a[j];
253
+ return r;
254
+ }
255
+ function __spreadArray(to, from) {
256
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
257
+ to[j] = from[i];
258
+ return to;
259
+ }
260
+ function __await(v) {
261
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
262
+ }
263
+ function __asyncGenerator(thisArg, _arguments, generator) {
264
+ if (!Symbol.asyncIterator)
265
+ throw new TypeError("Symbol.asyncIterator is not defined.");
266
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
267
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
268
+ function verb(n) { if (g[n])
269
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
270
+ function resume(n, v) { try {
271
+ step(g[n](v));
272
+ }
273
+ catch (e) {
274
+ settle(q[0][3], e);
275
+ } }
276
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
277
+ function fulfill(value) { resume("next", value); }
278
+ function reject(value) { resume("throw", value); }
279
+ function settle(f, v) { if (f(v), q.shift(), q.length)
280
+ resume(q[0][0], q[0][1]); }
281
+ }
282
+ function __asyncDelegator(o) {
283
+ var i, p;
284
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
285
+ 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; }
286
+ }
287
+ function __asyncValues(o) {
288
+ if (!Symbol.asyncIterator)
289
+ throw new TypeError("Symbol.asyncIterator is not defined.");
290
+ var m = o[Symbol.asyncIterator], i;
291
+ 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);
292
+ 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); }); }; }
293
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
294
+ }
295
+ function __makeTemplateObject(cooked, raw) {
296
+ if (Object.defineProperty) {
297
+ Object.defineProperty(cooked, "raw", { value: raw });
298
+ }
299
+ else {
300
+ cooked.raw = raw;
301
+ }
302
+ return cooked;
303
+ }
304
+ ;
305
+ var __setModuleDefault = Object.create ? (function (o, v) {
306
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
307
+ }) : function (o, v) {
308
+ o["default"] = v;
309
+ };
310
+ function __importStar(mod) {
311
+ if (mod && mod.__esModule)
312
+ return mod;
313
+ var result = {};
314
+ if (mod != null)
315
+ for (var k in mod)
316
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
317
+ __createBinding(result, mod, k);
318
+ __setModuleDefault(result, mod);
319
+ return result;
320
+ }
321
+ function __importDefault(mod) {
322
+ return (mod && mod.__esModule) ? mod : { default: mod };
323
+ }
324
+ function __classPrivateFieldGet(receiver, state, kind, f) {
325
+ if (kind === "a" && !f)
326
+ throw new TypeError("Private accessor was defined without a getter");
327
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
328
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
329
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
330
+ }
331
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
332
+ if (kind === "m")
333
+ throw new TypeError("Private method is not writable");
334
+ if (kind === "a" && !f)
335
+ throw new TypeError("Private accessor was defined without a setter");
336
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
337
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
338
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
339
+ }
340
+
341
+ var PlayerClientService = /** @class */ (function () {
342
+ function PlayerClientService() {
343
+ this.onCommand$ = new rxjs.Subject();
344
+ var self = this;
345
+ window.RevelDigital = {
346
+ Controller: {
347
+ onCommand: function (name, arg) {
348
+ self.onCommand$.next({ name: name, arg: arg });
349
+ }
350
+ }
351
+ };
352
+ this.clientPromise = null;
353
+ }
354
+ PlayerClientService.prototype.callback = function () {
355
+ var args = [];
356
+ for (var _i = 0; _i < arguments.length; _i++) {
357
+ args[_i] = arguments[_i];
358
+ }
359
+ this.getClient().then(function (client) {
360
+ switch (args.length) {
361
+ case 0:
362
+ client.callback();
363
+ break;
364
+ case 1:
365
+ client.callback(args[0]);
366
+ break;
367
+ case 2:
368
+ client.callback(args[1]);
369
+ break;
370
+ case 3:
371
+ client.callback(args[2]);
372
+ break;
373
+ case 4:
374
+ client.callback(args[3]);
375
+ break;
376
+ case 5:
377
+ client.callback(args[4]);
378
+ break;
379
+ }
380
+ });
381
+ };
382
+ PlayerClientService.prototype.getDeviceTime = function (date) {
383
+ return __awaiter(this, void 0, void 0, function () {
384
+ var client;
385
+ return __generator(this, function (_a) {
386
+ switch (_a.label) {
387
+ case 0: return [4 /*yield*/, this.getClient()];
388
+ case 1:
389
+ client = _a.sent();
390
+ if (date !== undefined) {
391
+ return [2 /*return*/, client.getDeviceTime(date)];
392
+ }
393
+ return [2 /*return*/, client.getDeviceTime()];
394
+ }
395
+ });
396
+ });
397
+ };
398
+ PlayerClientService.prototype.getDeviceTimeZoneName = function () {
399
+ return __awaiter(this, void 0, void 0, function () {
400
+ var client;
401
+ return __generator(this, function (_a) {
402
+ switch (_a.label) {
403
+ case 0: return [4 /*yield*/, this.getClient()];
404
+ case 1:
405
+ client = _a.sent();
406
+ return [2 /*return*/, client.getDeviceTimeZoneName()];
407
+ }
408
+ });
409
+ });
410
+ };
411
+ PlayerClientService.prototype.getDeviceTimeZoneID = function () {
412
+ return __awaiter(this, void 0, void 0, function () {
413
+ var client;
414
+ return __generator(this, function (_a) {
415
+ switch (_a.label) {
416
+ case 0: return [4 /*yield*/, this.getClient()];
417
+ case 1:
418
+ client = _a.sent();
419
+ return [2 /*return*/, client.getDeviceTimeZoneID()];
420
+ }
421
+ });
422
+ });
423
+ };
424
+ PlayerClientService.prototype.getDeviceTimeZoneOffset = function () {
425
+ return __awaiter(this, void 0, void 0, function () {
426
+ var client;
427
+ return __generator(this, function (_a) {
428
+ switch (_a.label) {
429
+ case 0: return [4 /*yield*/, this.getClient()];
430
+ case 1:
431
+ client = _a.sent();
432
+ return [2 /*return*/, client.getDeviceTimeZoneOffset()];
433
+ }
434
+ });
435
+ });
436
+ };
437
+ PlayerClientService.prototype.getLanguageCode = function () {
438
+ return __awaiter(this, void 0, void 0, function () {
439
+ var client;
440
+ return __generator(this, function (_a) {
441
+ switch (_a.label) {
442
+ case 0: return [4 /*yield*/, this.getClient()];
443
+ case 1:
444
+ client = _a.sent();
445
+ return [2 /*return*/, client.getLanguageCode()];
446
+ }
447
+ });
448
+ });
449
+ };
450
+ PlayerClientService.prototype.getDeviceKey = function () {
451
+ return __awaiter(this, void 0, void 0, function () {
452
+ var client;
453
+ return __generator(this, function (_a) {
454
+ switch (_a.label) {
455
+ case 0: return [4 /*yield*/, this.getClient()];
456
+ case 1:
457
+ client = _a.sent();
458
+ return [2 /*return*/, client.getDeviceKey()];
459
+ }
460
+ });
461
+ });
462
+ };
463
+ PlayerClientService.prototype.sendCommand = function (name, arg) {
464
+ this.getClient().then(function (client) {
465
+ client.sendCommand(name, arg);
466
+ });
467
+ };
468
+ PlayerClientService.prototype.sendRemoteCommand = function (deviceKeys, name, arg) {
469
+ this.getClient().then(function (client) {
470
+ client.sendRemoteCommand(deviceKeys, name, arg);
471
+ });
472
+ };
473
+ PlayerClientService.prototype.track = function (eventName, properties) {
474
+ this.getClient().then(function (client) {
475
+ client.track(eventName, JSON.stringify(properties));
476
+ });
477
+ };
478
+ PlayerClientService.prototype.timeEvent = function (eventName) {
479
+ this.getClient().then(function (client) {
480
+ client.timeEvent(eventName);
481
+ });
482
+ };
483
+ PlayerClientService.prototype.newEventSession = function (id) {
484
+ this.getClient().then(function (client) {
485
+ if (id !== undefined) {
486
+ client.newEventSession();
487
+ }
488
+ else {
489
+ client.newEventSession(id);
490
+ }
491
+ });
492
+ };
493
+ PlayerClientService.prototype.getRevelRoot = function () {
494
+ return __awaiter(this, void 0, void 0, function () {
495
+ var client;
496
+ return __generator(this, function (_a) {
497
+ switch (_a.label) {
498
+ case 0: return [4 /*yield*/, this.getClient()];
499
+ case 1:
500
+ client = _a.sent();
501
+ return [2 /*return*/, client.getRevelRoot()];
502
+ }
503
+ });
504
+ });
505
+ };
506
+ PlayerClientService.prototype.getCommandMap = function () {
507
+ return __awaiter(this, void 0, void 0, function () {
508
+ var client, _a, _b;
509
+ return __generator(this, function (_c) {
510
+ switch (_c.label) {
511
+ case 0: return [4 /*yield*/, this.getClient()];
512
+ case 1:
513
+ client = _c.sent();
514
+ _b = (_a = JSON).parse;
515
+ return [4 /*yield*/, client.getCommandMap()];
516
+ case 2: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
517
+ }
518
+ });
519
+ });
520
+ };
521
+ // ---
522
+ // PRIVATE METHODS.
523
+ // ---
524
+ // I return a Promise that resolves with a Tracker API (which may be the 3rd-party
525
+ // library or a mock API representation).
526
+ PlayerClientService.prototype.getClient = function () {
527
+ if (this.clientPromise) {
528
+ return (this.clientPromise);
529
+ }
530
+ if (window.Client) {
531
+ return (this.clientPromise = Promise.resolve(window.Client));
532
+ }
533
+ // A "complete" status indicates that the "load" event has been fired on the
534
+ // window; and, that all sub-resources such as Scripts, Images, and Frames have
535
+ // been loaded.
536
+ if (window.document.readyState === "complete") {
537
+ // If this event has fired AND the 3rd-party script isn't available (see IF-
538
+ // condition BEFORE this one), it means that the 3rd-party script either
539
+ // failed on the network or was BLOCKED by an ad-blocker. As such, we have to
540
+ // fall-back to using a mock API.
541
+ return (this.clientPromise = Promise.resolve(new NoopClient()));
542
+ }
543
+ // ASSERT: If we made it this far, the document has not completed loading (but it
544
+ // may be in an "interactive" state which is when I believe that the Angular app
545
+ // gets bootstrapped). As such, we need bind to the LOAD event to wait for our
546
+ // third-party scripts to load (or fail to load, or be blocked).
547
+ this.clientPromise = new Promise(function (resolve) {
548
+ window.addEventListener("load", function handleWindowLoad() {
549
+ // At this point, the 3rd-party library is either available or
550
+ // it's not - there's no further loading to do. If it's not
551
+ // present on the global scope, we're going to fall-back to using
552
+ // a mock API.
553
+ resolve(window.Client || new NoopClient());
554
+ });
555
+ });
556
+ return (this.clientPromise);
557
+ };
558
+ return PlayerClientService;
559
+ }());
560
+ PlayerClientService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PlayerClientService_Factory() { return new PlayerClientService(); }, token: PlayerClientService, providedIn: "root" });
561
+ PlayerClientService.decorators = [
562
+ { type: i0.Injectable, args: [{
563
+ providedIn: 'root'
564
+ },] }
565
+ ];
566
+ PlayerClientService.ctorParameters = function () { return []; };
567
+ // ----------------------------------------------------------------------------------- //
568
+ // ----------------------------------------------------------------------------------- //
569
+ // I provide a mock API for the 3rd-party script. This just allows the consuming code to
570
+ // act as though the library is available even if it failed to load (example, it was
571
+ // blocked by an ad-blocker).
572
+ var NoopClient = /** @class */ (function () {
573
+ function NoopClient() {
574
+ console.warn("Client API not available, falling back to mock API.");
575
+ }
576
+ NoopClient.prototype.callback = function () {
577
+ var args = [];
578
+ for (var _i = 0; _i < arguments.length; _i++) {
579
+ args[_i] = arguments[_i];
580
+ }
581
+ // NOOP implement, nothing to do....
582
+ };
583
+ NoopClient.prototype.getDeviceTime = function (date) {
584
+ return Promise.resolve(null);
585
+ };
586
+ NoopClient.prototype.getDeviceTimeZoneName = function () {
587
+ return __awaiter(this, void 0, void 0, function () {
588
+ return __generator(this, function (_a) {
589
+ return [2 /*return*/, Promise.resolve(null)];
590
+ });
591
+ });
592
+ };
593
+ NoopClient.prototype.getDeviceTimeZoneID = function () {
594
+ return __awaiter(this, void 0, void 0, function () {
595
+ return __generator(this, function (_a) {
596
+ return [2 /*return*/, Promise.resolve(null)];
597
+ });
598
+ });
599
+ };
600
+ NoopClient.prototype.getDeviceTimeZoneOffset = function () {
601
+ return __awaiter(this, void 0, void 0, function () {
602
+ return __generator(this, function (_a) {
603
+ return [2 /*return*/, Promise.resolve(null)];
604
+ });
605
+ });
606
+ };
607
+ NoopClient.prototype.getLanguageCode = function () {
608
+ return __awaiter(this, void 0, void 0, function () {
609
+ return __generator(this, function (_a) {
610
+ return [2 /*return*/, Promise.resolve(null)];
611
+ });
612
+ });
613
+ };
614
+ NoopClient.prototype.getDeviceKey = function () {
615
+ return __awaiter(this, void 0, void 0, function () {
616
+ return __generator(this, function (_a) {
617
+ return [2 /*return*/, Promise.resolve(null)];
618
+ });
619
+ });
620
+ };
621
+ NoopClient.prototype.sendCommand = function (name, arg) {
622
+ // NOOP implement, nothing to do....
623
+ };
624
+ NoopClient.prototype.sendRemoteCommand = function (deviceKeys, name, arg) {
625
+ // NOOP implement, nothing to do....
626
+ };
627
+ NoopClient.prototype.track = function (eventName, properties) {
628
+ // NOOP implement, nothing to do....
629
+ };
630
+ NoopClient.prototype.timeEvent = function (eventName) {
631
+ // NOOP implement, nothing to do....
632
+ };
633
+ NoopClient.prototype.newEventSession = function (id) {
634
+ // NOOP implement, nothing to do....
635
+ };
636
+ NoopClient.prototype.getRevelRoot = function () {
637
+ return __awaiter(this, void 0, void 0, function () {
638
+ return __generator(this, function (_a) {
639
+ return [2 /*return*/, Promise.resolve(null)];
640
+ });
641
+ });
642
+ };
643
+ NoopClient.prototype.getCommandMap = function () {
644
+ return __awaiter(this, void 0, void 0, function () {
645
+ return __generator(this, function (_a) {
646
+ return [2 /*return*/, Promise.resolve('{ "test": "this" }')];
647
+ });
648
+ });
649
+ };
650
+ return NoopClient;
651
+ }());
652
+
653
+ var PlayerClientModule = /** @class */ (function () {
654
+ function PlayerClientModule() {
655
+ }
656
+ return PlayerClientModule;
657
+ }());
658
+ PlayerClientModule.decorators = [
659
+ { type: i0.NgModule, args: [{
660
+ imports: [],
661
+ },] }
662
+ ];
663
+
664
+ /*
665
+ * Public API Surface of player-client
666
+ */
667
+
668
+ /**
669
+ * Generated bundle index. Do not edit.
670
+ */
671
+
672
+ exports.PlayerClientModule = PlayerClientModule;
673
+ exports.PlayerClientService = PlayerClientService;
674
+
675
+ Object.defineProperty(exports, '__esModule', { value: true });
676
+
677
+ })));
678
+ //# sourceMappingURL=reveldigital-player-client.umd.js.map