@iotize/device-com-nfc.cordova 3.9.3 → 3.10.0

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.
Files changed (33) hide show
  1. package/bundles/iotize-device-com-nfc.cordova.umd.js +1150 -1103
  2. package/bundles/iotize-device-com-nfc.cordova.umd.js.map +1 -1
  3. package/bundles/iotize-device-com-nfc.cordova.umd.min.js +1 -1
  4. package/bundles/iotize-device-com-nfc.cordova.umd.min.js.map +1 -1
  5. package/esm2015/iotize-device-com-nfc.cordova.ngsummary.json +1 -1
  6. package/esm2015/public_api.ngsummary.json +1 -1
  7. package/esm2015/www/cordova-interface.js +15 -1
  8. package/esm2015/www/cordova-interface.js.map +1 -1
  9. package/esm2015/www/cordova-interface.metadata.json +1 -1
  10. package/esm2015/www/cordova-interface.ngsummary.json +1 -1
  11. package/esm2015/www/index.ngsummary.json +1 -1
  12. package/esm2015/www/ndef/parse-ndef-message.js +7 -6
  13. package/esm2015/www/ndef/parse-ndef-message.js.map +1 -1
  14. package/esm2015/www/nfc-com-protocol.js +25 -2
  15. package/esm2015/www/nfc-com-protocol.js.map +1 -1
  16. package/esm2015/www/nfc-com-protocol.metadata.json +1 -1
  17. package/fesm2015/iotize-device-com-nfc.cordova.js +48 -9
  18. package/fesm2015/iotize-device-com-nfc.cordova.js.map +1 -1
  19. package/iotize-device-com-nfc.cordova.metadata.json +1 -1
  20. package/package.json +1 -1
  21. package/plugin.xml +7 -4
  22. package/src/android/.gradle/4.10.1/fileHashes/fileHashes.bin +0 -0
  23. package/src/android/.gradle/4.10.1/fileHashes/fileHashes.lock +0 -0
  24. package/src/android/build.gradle +3 -0
  25. package/src/android/src/com/chariotsolutions/nfc/plugin/NFC4Protocol.java +78 -0
  26. package/src/android/src/com/chariotsolutions/nfc/plugin/NFC5Protocol.java +513 -0
  27. package/src/android/src/com/chariotsolutions/nfc/plugin/NFCIntentParser.java +186 -0
  28. package/src/android/src/com/chariotsolutions/nfc/plugin/NFCProtocol.java +104 -0
  29. package/src/android/src/com/chariotsolutions/nfc/plugin/NFCProtocolFactory.java +64 -0
  30. package/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java +72 -19
  31. package/src/ios/NFCPlugin-Bridging-Header.h +1 -1
  32. package/www/cordova-interface.d.ts +15 -0
  33. package/www/phonegap-nfc.js +12 -0
@@ -1,1121 +1,1168 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('buffer'), require('@iotize/common/byte-converter'), require('@iotize/tap/protocol/api'), require('@iotize/tap/protocol/core'), require('rxjs'), require('@iotize/common/debug')) :
3
- typeof define === 'function' && define.amd ? define('@iotize/device-com-nfc.cordova', ['exports', 'buffer', '@iotize/common/byte-converter', '@iotize/tap/protocol/api', '@iotize/tap/protocol/core', 'rxjs', '@iotize/common/debug'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.iotize = global.iotize || {}, global.iotize["device-com-nfc"] = global.iotize["device-com-nfc"] || {}, global.iotize["device-com-nfc"].cordova = {}), global.buffer, global.byteConverter, global.api, global.core, global.rxjs, global.debug$1));
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('buffer'), require('@iotize/common/byte-converter'), require('@iotize/tap/protocol/api'), require('@iotize/tap/protocol/core'), require('rxjs'), require('@iotize/common/debug')) :
3
+ typeof define === 'function' && define.amd ? define('@iotize/device-com-nfc.cordova', ['exports', 'buffer', '@iotize/common/byte-converter', '@iotize/tap/protocol/api', '@iotize/tap/protocol/core', 'rxjs', '@iotize/common/debug'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.iotize = global.iotize || {}, global.iotize["device-com-nfc"] = global.iotize["device-com-nfc"] || {}, global.iotize["device-com-nfc"].cordova = {}), global.buffer, global.byteConverter, global.api, global.core, global.rxjs, global.debug$1));
5
5
  })(this, (function (exports, buffer, byteConverter, api, core, rxjs, debug$1) { 'use strict';
6
6
 
7
- /******************************************************************************
8
- Copyright (c) Microsoft Corporation.
7
+ exports.CheckTapConnectionResult = void 0;
8
+ (function (CheckTapConnectionResult) {
9
+ /**
10
+ * Tag is still in range, connection is not required
11
+ */
12
+ CheckTapConnectionResult[CheckTapConnectionResult["IN_RANGE_READY"] = 0] = "IN_RANGE_READY";
13
+ /**
14
+ * Tag in range but it has left NFC field, we need to connect again
15
+ */
16
+ CheckTapConnectionResult[CheckTapConnectionResult["IN_RANGE_BUT_LEFT_FIELD"] = 1] = "IN_RANGE_BUT_LEFT_FIELD";
17
+ /**
18
+ * Tag not in range anymore, a new connection is required
19
+ */
20
+ CheckTapConnectionResult[CheckTapConnectionResult["NOT_IN_RANGE"] = 2] = "NOT_IN_RANGE";
21
+ })(exports.CheckTapConnectionResult || (exports.CheckTapConnectionResult = {}));
22
+
23
+ /******************************************************************************
24
+ Copyright (c) Microsoft Corporation.
9
25
 
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
26
+ Permission to use, copy, modify, and/or distribute this software for any
27
+ purpose with or without fee is hereby granted.
12
28
 
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise, SuppressedError, Symbol */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (Object.prototype.hasOwnProperty.call(b, p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- if (typeof b !== "function" && b !== null)
32
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- }
37
- var __assign = function () {
38
- __assign = Object.assign || function __assign(t) {
39
- for (var s, i = 1, n = arguments.length; i < n; i++) {
40
- s = arguments[i];
41
- for (var p in s)
42
- if (Object.prototype.hasOwnProperty.call(s, p))
43
- t[p] = s[p];
44
- }
45
- return t;
46
- };
47
- return __assign.apply(this, arguments);
48
- };
49
- function __rest(s, e) {
50
- var t = {};
51
- for (var p in s)
52
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
53
- t[p] = s[p];
54
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
55
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
56
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
57
- t[p[i]] = s[p[i]];
58
- }
59
- return t;
60
- }
61
- function __decorate(decorators, target, key, desc) {
62
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
64
- r = Reflect.decorate(decorators, target, key, desc);
65
- else
66
- for (var i = decorators.length - 1; i >= 0; i--)
67
- if (d = decorators[i])
68
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
69
- return c > 3 && r && Object.defineProperty(target, key, r), r;
70
- }
71
- function __param(paramIndex, decorator) {
72
- return function (target, key) { decorator(target, key, paramIndex); };
73
- }
74
- function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
75
- function accept(f) { if (f !== void 0 && typeof f !== "function")
76
- throw new TypeError("Function expected"); return f; }
77
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
78
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
79
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
80
- var _, done = false;
81
- for (var i = decorators.length - 1; i >= 0; i--) {
82
- var context = {};
83
- for (var p in contextIn)
84
- context[p] = p === "access" ? {} : contextIn[p];
85
- for (var p in contextIn.access)
86
- context.access[p] = contextIn.access[p];
87
- context.addInitializer = function (f) { if (done)
88
- throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
89
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
90
- if (kind === "accessor") {
91
- if (result === void 0)
92
- continue;
93
- if (result === null || typeof result !== "object")
94
- throw new TypeError("Object expected");
95
- if (_ = accept(result.get))
96
- descriptor.get = _;
97
- if (_ = accept(result.set))
98
- descriptor.set = _;
99
- if (_ = accept(result.init))
100
- initializers.unshift(_);
101
- }
102
- else if (_ = accept(result)) {
103
- if (kind === "field")
104
- initializers.unshift(_);
105
- else
106
- descriptor[key] = _;
107
- }
108
- }
109
- if (target)
110
- Object.defineProperty(target, contextIn.name, descriptor);
111
- done = true;
112
- }
113
- ;
114
- function __runInitializers(thisArg, initializers, value) {
115
- var useValue = arguments.length > 2;
116
- for (var i = 0; i < initializers.length; i++) {
117
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
118
- }
119
- return useValue ? value : void 0;
120
- }
121
- ;
122
- function __propKey(x) {
123
- return typeof x === "symbol" ? x : "".concat(x);
124
- }
125
- ;
126
- function __setFunctionName(f, name, prefix) {
127
- if (typeof name === "symbol")
128
- name = name.description ? "[".concat(name.description, "]") : "";
129
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
130
- }
131
- ;
132
- function __metadata(metadataKey, metadataValue) {
133
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
134
- return Reflect.metadata(metadataKey, metadataValue);
135
- }
136
- function __awaiter$1(thisArg, _arguments, P, generator) {
137
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
138
- return new (P || (P = Promise))(function (resolve, reject) {
139
- function fulfilled(value) { try {
140
- step(generator.next(value));
141
- }
142
- catch (e) {
143
- reject(e);
144
- } }
145
- function rejected(value) { try {
146
- step(generator["throw"](value));
147
- }
148
- catch (e) {
149
- reject(e);
150
- } }
151
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
152
- step((generator = generator.apply(thisArg, _arguments || [])).next());
153
- });
154
- }
155
- function __generator(thisArg, body) {
156
- var _ = { label: 0, sent: function () { if (t[0] & 1)
157
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
158
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
159
- function verb(n) { return function (v) { return step([n, v]); }; }
160
- function step(op) {
161
- if (f)
162
- throw new TypeError("Generator is already executing.");
163
- while (g && (g = 0, op[0] && (_ = 0)), _)
164
- try {
165
- 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)
166
- return t;
167
- if (y = 0, t)
168
- op = [op[0] & 2, t.value];
169
- switch (op[0]) {
170
- case 0:
171
- case 1:
172
- t = op;
173
- break;
174
- case 4:
175
- _.label++;
176
- return { value: op[1], done: false };
177
- case 5:
178
- _.label++;
179
- y = op[1];
180
- op = [0];
181
- continue;
182
- case 7:
183
- op = _.ops.pop();
184
- _.trys.pop();
185
- continue;
186
- default:
187
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
188
- _ = 0;
189
- continue;
190
- }
191
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
192
- _.label = op[1];
193
- break;
194
- }
195
- if (op[0] === 6 && _.label < t[1]) {
196
- _.label = t[1];
197
- t = op;
198
- break;
199
- }
200
- if (t && _.label < t[2]) {
201
- _.label = t[2];
202
- _.ops.push(op);
203
- break;
204
- }
205
- if (t[2])
206
- _.ops.pop();
207
- _.trys.pop();
208
- continue;
209
- }
210
- op = body.call(thisArg, _);
211
- }
212
- catch (e) {
213
- op = [6, e];
214
- y = 0;
215
- }
216
- finally {
217
- f = t = 0;
218
- }
219
- if (op[0] & 5)
220
- throw op[1];
221
- return { value: op[0] ? op[1] : void 0, done: true };
222
- }
223
- }
224
- var __createBinding = Object.create ? (function (o, m, k, k2) {
225
- if (k2 === undefined)
226
- k2 = k;
227
- var desc = Object.getOwnPropertyDescriptor(m, k);
228
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
229
- desc = { enumerable: true, get: function () { return m[k]; } };
230
- }
231
- Object.defineProperty(o, k2, desc);
232
- }) : (function (o, m, k, k2) {
233
- if (k2 === undefined)
234
- k2 = k;
235
- o[k2] = m[k];
236
- });
237
- function __exportStar(m, o) {
238
- for (var p in m)
239
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
240
- __createBinding(o, m, p);
241
- }
242
- function __values(o) {
243
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
244
- if (m)
245
- return m.call(o);
246
- if (o && typeof o.length === "number")
247
- return {
248
- next: function () {
249
- if (o && i >= o.length)
250
- o = void 0;
251
- return { value: o && o[i++], done: !o };
252
- }
253
- };
254
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
255
- }
256
- function __read(o, n) {
257
- var m = typeof Symbol === "function" && o[Symbol.iterator];
258
- if (!m)
259
- return o;
260
- var i = m.call(o), r, ar = [], e;
261
- try {
262
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
263
- ar.push(r.value);
264
- }
265
- catch (error) {
266
- e = { error: error };
267
- }
268
- finally {
269
- try {
270
- if (r && !r.done && (m = i["return"]))
271
- m.call(i);
272
- }
273
- finally {
274
- if (e)
275
- throw e.error;
276
- }
277
- }
278
- return ar;
279
- }
280
- /** @deprecated */
281
- function __spread() {
282
- for (var ar = [], i = 0; i < arguments.length; i++)
283
- ar = ar.concat(__read(arguments[i]));
284
- return ar;
285
- }
286
- /** @deprecated */
287
- function __spreadArrays() {
288
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
289
- s += arguments[i].length;
290
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
291
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
292
- r[k] = a[j];
293
- return r;
294
- }
295
- function __spreadArray(to, from, pack) {
296
- if (pack || arguments.length === 2)
297
- for (var i = 0, l = from.length, ar; i < l; i++) {
298
- if (ar || !(i in from)) {
299
- if (!ar)
300
- ar = Array.prototype.slice.call(from, 0, i);
301
- ar[i] = from[i];
302
- }
303
- }
304
- return to.concat(ar || Array.prototype.slice.call(from));
305
- }
306
- function __await(v) {
307
- return this instanceof __await ? (this.v = v, this) : new __await(v);
308
- }
309
- function __asyncGenerator(thisArg, _arguments, generator) {
310
- if (!Symbol.asyncIterator)
311
- throw new TypeError("Symbol.asyncIterator is not defined.");
312
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
313
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
314
- function verb(n) { if (g[n])
315
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
316
- function resume(n, v) { try {
317
- step(g[n](v));
318
- }
319
- catch (e) {
320
- settle(q[0][3], e);
321
- } }
322
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
323
- function fulfill(value) { resume("next", value); }
324
- function reject(value) { resume("throw", value); }
325
- function settle(f, v) { if (f(v), q.shift(), q.length)
326
- resume(q[0][0], q[0][1]); }
327
- }
328
- function __asyncDelegator(o) {
329
- var i, p;
330
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
331
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
332
- }
333
- function __asyncValues(o) {
334
- if (!Symbol.asyncIterator)
335
- throw new TypeError("Symbol.asyncIterator is not defined.");
336
- var m = o[Symbol.asyncIterator], i;
337
- 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);
338
- 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); }); }; }
339
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
340
- }
341
- function __makeTemplateObject(cooked, raw) {
342
- if (Object.defineProperty) {
343
- Object.defineProperty(cooked, "raw", { value: raw });
344
- }
345
- else {
346
- cooked.raw = raw;
347
- }
348
- return cooked;
349
- }
350
- ;
351
- var __setModuleDefault = Object.create ? (function (o, v) {
352
- Object.defineProperty(o, "default", { enumerable: true, value: v });
353
- }) : function (o, v) {
354
- o["default"] = v;
355
- };
356
- function __importStar(mod) {
357
- if (mod && mod.__esModule)
358
- return mod;
359
- var result = {};
360
- if (mod != null)
361
- for (var k in mod)
362
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
363
- __createBinding(result, mod, k);
364
- __setModuleDefault(result, mod);
365
- return result;
366
- }
367
- function __importDefault(mod) {
368
- return (mod && mod.__esModule) ? mod : { default: mod };
369
- }
370
- function __classPrivateFieldGet(receiver, state, kind, f) {
371
- if (kind === "a" && !f)
372
- throw new TypeError("Private accessor was defined without a getter");
373
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
374
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
375
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
376
- }
377
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
378
- if (kind === "m")
379
- throw new TypeError("Private method is not writable");
380
- if (kind === "a" && !f)
381
- throw new TypeError("Private accessor was defined without a setter");
382
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
383
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
384
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
385
- }
386
- function __classPrivateFieldIn(state, receiver) {
387
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
388
- throw new TypeError("Cannot use 'in' operator on non-object");
389
- return typeof state === "function" ? receiver === state : state.has(receiver);
390
- }
391
- function __addDisposableResource(env, value, async) {
392
- if (value !== null && value !== void 0) {
393
- if (typeof value !== "object" && typeof value !== "function")
394
- throw new TypeError("Object expected.");
395
- var dispose;
396
- if (async) {
397
- if (!Symbol.asyncDispose)
398
- throw new TypeError("Symbol.asyncDispose is not defined.");
399
- dispose = value[Symbol.asyncDispose];
400
- }
401
- if (dispose === void 0) {
402
- if (!Symbol.dispose)
403
- throw new TypeError("Symbol.dispose is not defined.");
404
- dispose = value[Symbol.dispose];
405
- }
406
- if (typeof dispose !== "function")
407
- throw new TypeError("Object not disposable.");
408
- env.stack.push({ value: value, dispose: dispose, async: async });
409
- }
410
- else if (async) {
411
- env.stack.push({ async: true });
412
- }
413
- return value;
414
- }
415
- var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
416
- var e = new Error(message);
417
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
418
- };
419
- function __disposeResources(env) {
420
- function fail(e) {
421
- env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
422
- env.hasError = true;
423
- }
424
- function next() {
425
- while (env.stack.length) {
426
- var rec = env.stack.pop();
427
- try {
428
- var result = rec.dispose && rec.dispose.call(rec.value);
429
- if (rec.async)
430
- return Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
431
- }
432
- catch (e) {
433
- fail(e);
434
- }
435
- }
436
- if (env.hasError)
437
- throw env.error;
438
- }
439
- return next();
440
- }
441
- var tslib_es6 = {
442
- __extends: __extends,
443
- __assign: __assign,
444
- __rest: __rest,
445
- __decorate: __decorate,
446
- __param: __param,
447
- __metadata: __metadata,
448
- __awaiter: __awaiter$1,
449
- __generator: __generator,
450
- __createBinding: __createBinding,
451
- __exportStar: __exportStar,
452
- __values: __values,
453
- __read: __read,
454
- __spread: __spread,
455
- __spreadArrays: __spreadArrays,
456
- __spreadArray: __spreadArray,
457
- __await: __await,
458
- __asyncGenerator: __asyncGenerator,
459
- __asyncDelegator: __asyncDelegator,
460
- __asyncValues: __asyncValues,
461
- __makeTemplateObject: __makeTemplateObject,
462
- __importStar: __importStar,
463
- __importDefault: __importDefault,
464
- __classPrivateFieldGet: __classPrivateFieldGet,
465
- __classPrivateFieldSet: __classPrivateFieldSet,
466
- __classPrivateFieldIn: __classPrivateFieldIn,
467
- __addDisposableResource: __addDisposableResource,
468
- __disposeResources: __disposeResources,
469
- };
29
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
30
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
31
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
32
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
33
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
34
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
35
+ PERFORMANCE OF THIS SOFTWARE.
36
+ ***************************************************************************** */
37
+ /* global Reflect, Promise, SuppressedError, Symbol */
38
+ var extendStatics = function (d, b) {
39
+ extendStatics = Object.setPrototypeOf ||
40
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
41
+ function (d, b) { for (var p in b)
42
+ if (Object.prototype.hasOwnProperty.call(b, p))
43
+ d[p] = b[p]; };
44
+ return extendStatics(d, b);
45
+ };
46
+ function __extends(d, b) {
47
+ if (typeof b !== "function" && b !== null)
48
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
49
+ extendStatics(d, b);
50
+ function __() { this.constructor = d; }
51
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
52
+ }
53
+ var __assign = function () {
54
+ __assign = Object.assign || function __assign(t) {
55
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
56
+ s = arguments[i];
57
+ for (var p in s)
58
+ if (Object.prototype.hasOwnProperty.call(s, p))
59
+ t[p] = s[p];
60
+ }
61
+ return t;
62
+ };
63
+ return __assign.apply(this, arguments);
64
+ };
65
+ function __rest(s, e) {
66
+ var t = {};
67
+ for (var p in s)
68
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
69
+ t[p] = s[p];
70
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
71
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
72
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
73
+ t[p[i]] = s[p[i]];
74
+ }
75
+ return t;
76
+ }
77
+ function __decorate(decorators, target, key, desc) {
78
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
79
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
80
+ r = Reflect.decorate(decorators, target, key, desc);
81
+ else
82
+ for (var i = decorators.length - 1; i >= 0; i--)
83
+ if (d = decorators[i])
84
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
85
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
86
+ }
87
+ function __param(paramIndex, decorator) {
88
+ return function (target, key) { decorator(target, key, paramIndex); };
89
+ }
90
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
91
+ function accept(f) { if (f !== void 0 && typeof f !== "function")
92
+ throw new TypeError("Function expected"); return f; }
93
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
94
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
95
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
96
+ var _, done = false;
97
+ for (var i = decorators.length - 1; i >= 0; i--) {
98
+ var context = {};
99
+ for (var p in contextIn)
100
+ context[p] = p === "access" ? {} : contextIn[p];
101
+ for (var p in contextIn.access)
102
+ context.access[p] = contextIn.access[p];
103
+ context.addInitializer = function (f) { if (done)
104
+ throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
105
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
106
+ if (kind === "accessor") {
107
+ if (result === void 0)
108
+ continue;
109
+ if (result === null || typeof result !== "object")
110
+ throw new TypeError("Object expected");
111
+ if (_ = accept(result.get))
112
+ descriptor.get = _;
113
+ if (_ = accept(result.set))
114
+ descriptor.set = _;
115
+ if (_ = accept(result.init))
116
+ initializers.unshift(_);
117
+ }
118
+ else if (_ = accept(result)) {
119
+ if (kind === "field")
120
+ initializers.unshift(_);
121
+ else
122
+ descriptor[key] = _;
123
+ }
124
+ }
125
+ if (target)
126
+ Object.defineProperty(target, contextIn.name, descriptor);
127
+ done = true;
128
+ }
129
+ ;
130
+ function __runInitializers(thisArg, initializers, value) {
131
+ var useValue = arguments.length > 2;
132
+ for (var i = 0; i < initializers.length; i++) {
133
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
134
+ }
135
+ return useValue ? value : void 0;
136
+ }
137
+ ;
138
+ function __propKey(x) {
139
+ return typeof x === "symbol" ? x : "".concat(x);
140
+ }
141
+ ;
142
+ function __setFunctionName(f, name, prefix) {
143
+ if (typeof name === "symbol")
144
+ name = name.description ? "[".concat(name.description, "]") : "";
145
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
146
+ }
147
+ ;
148
+ function __metadata(metadataKey, metadataValue) {
149
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
150
+ return Reflect.metadata(metadataKey, metadataValue);
151
+ }
152
+ function __awaiter$1(thisArg, _arguments, P, generator) {
153
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
154
+ return new (P || (P = Promise))(function (resolve, reject) {
155
+ function fulfilled(value) { try {
156
+ step(generator.next(value));
157
+ }
158
+ catch (e) {
159
+ reject(e);
160
+ } }
161
+ function rejected(value) { try {
162
+ step(generator["throw"](value));
163
+ }
164
+ catch (e) {
165
+ reject(e);
166
+ } }
167
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
168
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
169
+ });
170
+ }
171
+ function __generator(thisArg, body) {
172
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
173
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
174
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
175
+ function verb(n) { return function (v) { return step([n, v]); }; }
176
+ function step(op) {
177
+ if (f)
178
+ throw new TypeError("Generator is already executing.");
179
+ while (g && (g = 0, op[0] && (_ = 0)), _)
180
+ try {
181
+ 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)
182
+ return t;
183
+ if (y = 0, t)
184
+ op = [op[0] & 2, t.value];
185
+ switch (op[0]) {
186
+ case 0:
187
+ case 1:
188
+ t = op;
189
+ break;
190
+ case 4:
191
+ _.label++;
192
+ return { value: op[1], done: false };
193
+ case 5:
194
+ _.label++;
195
+ y = op[1];
196
+ op = [0];
197
+ continue;
198
+ case 7:
199
+ op = _.ops.pop();
200
+ _.trys.pop();
201
+ continue;
202
+ default:
203
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
204
+ _ = 0;
205
+ continue;
206
+ }
207
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
208
+ _.label = op[1];
209
+ break;
210
+ }
211
+ if (op[0] === 6 && _.label < t[1]) {
212
+ _.label = t[1];
213
+ t = op;
214
+ break;
215
+ }
216
+ if (t && _.label < t[2]) {
217
+ _.label = t[2];
218
+ _.ops.push(op);
219
+ break;
220
+ }
221
+ if (t[2])
222
+ _.ops.pop();
223
+ _.trys.pop();
224
+ continue;
225
+ }
226
+ op = body.call(thisArg, _);
227
+ }
228
+ catch (e) {
229
+ op = [6, e];
230
+ y = 0;
231
+ }
232
+ finally {
233
+ f = t = 0;
234
+ }
235
+ if (op[0] & 5)
236
+ throw op[1];
237
+ return { value: op[0] ? op[1] : void 0, done: true };
238
+ }
239
+ }
240
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
241
+ if (k2 === undefined)
242
+ k2 = k;
243
+ var desc = Object.getOwnPropertyDescriptor(m, k);
244
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
245
+ desc = { enumerable: true, get: function () { return m[k]; } };
246
+ }
247
+ Object.defineProperty(o, k2, desc);
248
+ }) : (function (o, m, k, k2) {
249
+ if (k2 === undefined)
250
+ k2 = k;
251
+ o[k2] = m[k];
252
+ });
253
+ function __exportStar(m, o) {
254
+ for (var p in m)
255
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
256
+ __createBinding(o, m, p);
257
+ }
258
+ function __values(o) {
259
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
260
+ if (m)
261
+ return m.call(o);
262
+ if (o && typeof o.length === "number")
263
+ return {
264
+ next: function () {
265
+ if (o && i >= o.length)
266
+ o = void 0;
267
+ return { value: o && o[i++], done: !o };
268
+ }
269
+ };
270
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
271
+ }
272
+ function __read(o, n) {
273
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
274
+ if (!m)
275
+ return o;
276
+ var i = m.call(o), r, ar = [], e;
277
+ try {
278
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
279
+ ar.push(r.value);
280
+ }
281
+ catch (error) {
282
+ e = { error: error };
283
+ }
284
+ finally {
285
+ try {
286
+ if (r && !r.done && (m = i["return"]))
287
+ m.call(i);
288
+ }
289
+ finally {
290
+ if (e)
291
+ throw e.error;
292
+ }
293
+ }
294
+ return ar;
295
+ }
296
+ /** @deprecated */
297
+ function __spread() {
298
+ for (var ar = [], i = 0; i < arguments.length; i++)
299
+ ar = ar.concat(__read(arguments[i]));
300
+ return ar;
301
+ }
302
+ /** @deprecated */
303
+ function __spreadArrays() {
304
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
305
+ s += arguments[i].length;
306
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
307
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
308
+ r[k] = a[j];
309
+ return r;
310
+ }
311
+ function __spreadArray(to, from, pack) {
312
+ if (pack || arguments.length === 2)
313
+ for (var i = 0, l = from.length, ar; i < l; i++) {
314
+ if (ar || !(i in from)) {
315
+ if (!ar)
316
+ ar = Array.prototype.slice.call(from, 0, i);
317
+ ar[i] = from[i];
318
+ }
319
+ }
320
+ return to.concat(ar || Array.prototype.slice.call(from));
321
+ }
322
+ function __await(v) {
323
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
324
+ }
325
+ function __asyncGenerator(thisArg, _arguments, generator) {
326
+ if (!Symbol.asyncIterator)
327
+ throw new TypeError("Symbol.asyncIterator is not defined.");
328
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
329
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
330
+ function verb(n) { if (g[n])
331
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
332
+ function resume(n, v) { try {
333
+ step(g[n](v));
334
+ }
335
+ catch (e) {
336
+ settle(q[0][3], e);
337
+ } }
338
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
339
+ function fulfill(value) { resume("next", value); }
340
+ function reject(value) { resume("throw", value); }
341
+ function settle(f, v) { if (f(v), q.shift(), q.length)
342
+ resume(q[0][0], q[0][1]); }
343
+ }
344
+ function __asyncDelegator(o) {
345
+ var i, p;
346
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
347
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
348
+ }
349
+ function __asyncValues(o) {
350
+ if (!Symbol.asyncIterator)
351
+ throw new TypeError("Symbol.asyncIterator is not defined.");
352
+ var m = o[Symbol.asyncIterator], i;
353
+ 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);
354
+ 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); }); }; }
355
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
356
+ }
357
+ function __makeTemplateObject(cooked, raw) {
358
+ if (Object.defineProperty) {
359
+ Object.defineProperty(cooked, "raw", { value: raw });
360
+ }
361
+ else {
362
+ cooked.raw = raw;
363
+ }
364
+ return cooked;
365
+ }
366
+ ;
367
+ var __setModuleDefault = Object.create ? (function (o, v) {
368
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
369
+ }) : function (o, v) {
370
+ o["default"] = v;
371
+ };
372
+ function __importStar(mod) {
373
+ if (mod && mod.__esModule)
374
+ return mod;
375
+ var result = {};
376
+ if (mod != null)
377
+ for (var k in mod)
378
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
379
+ __createBinding(result, mod, k);
380
+ __setModuleDefault(result, mod);
381
+ return result;
382
+ }
383
+ function __importDefault(mod) {
384
+ return (mod && mod.__esModule) ? mod : { default: mod };
385
+ }
386
+ function __classPrivateFieldGet(receiver, state, kind, f) {
387
+ if (kind === "a" && !f)
388
+ throw new TypeError("Private accessor was defined without a getter");
389
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
390
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
391
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
392
+ }
393
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
394
+ if (kind === "m")
395
+ throw new TypeError("Private method is not writable");
396
+ if (kind === "a" && !f)
397
+ throw new TypeError("Private accessor was defined without a setter");
398
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
399
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
400
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
401
+ }
402
+ function __classPrivateFieldIn(state, receiver) {
403
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
404
+ throw new TypeError("Cannot use 'in' operator on non-object");
405
+ return typeof state === "function" ? receiver === state : state.has(receiver);
406
+ }
407
+ function __addDisposableResource(env, value, async) {
408
+ if (value !== null && value !== void 0) {
409
+ if (typeof value !== "object" && typeof value !== "function")
410
+ throw new TypeError("Object expected.");
411
+ var dispose;
412
+ if (async) {
413
+ if (!Symbol.asyncDispose)
414
+ throw new TypeError("Symbol.asyncDispose is not defined.");
415
+ dispose = value[Symbol.asyncDispose];
416
+ }
417
+ if (dispose === void 0) {
418
+ if (!Symbol.dispose)
419
+ throw new TypeError("Symbol.dispose is not defined.");
420
+ dispose = value[Symbol.dispose];
421
+ }
422
+ if (typeof dispose !== "function")
423
+ throw new TypeError("Object not disposable.");
424
+ env.stack.push({ value: value, dispose: dispose, async: async });
425
+ }
426
+ else if (async) {
427
+ env.stack.push({ async: true });
428
+ }
429
+ return value;
430
+ }
431
+ var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
432
+ var e = new Error(message);
433
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
434
+ };
435
+ function __disposeResources(env) {
436
+ function fail(e) {
437
+ env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
438
+ env.hasError = true;
439
+ }
440
+ function next() {
441
+ while (env.stack.length) {
442
+ var rec = env.stack.pop();
443
+ try {
444
+ var result = rec.dispose && rec.dispose.call(rec.value);
445
+ if (rec.async)
446
+ return Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
447
+ }
448
+ catch (e) {
449
+ fail(e);
450
+ }
451
+ }
452
+ if (env.hasError)
453
+ throw env.error;
454
+ }
455
+ return next();
456
+ }
457
+ var tslib_es6 = {
458
+ __extends: __extends,
459
+ __assign: __assign,
460
+ __rest: __rest,
461
+ __decorate: __decorate,
462
+ __param: __param,
463
+ __metadata: __metadata,
464
+ __awaiter: __awaiter$1,
465
+ __generator: __generator,
466
+ __createBinding: __createBinding,
467
+ __exportStar: __exportStar,
468
+ __values: __values,
469
+ __read: __read,
470
+ __spread: __spread,
471
+ __spreadArrays: __spreadArrays,
472
+ __spreadArray: __spreadArray,
473
+ __await: __await,
474
+ __asyncGenerator: __asyncGenerator,
475
+ __asyncDelegator: __asyncDelegator,
476
+ __asyncValues: __asyncValues,
477
+ __makeTemplateObject: __makeTemplateObject,
478
+ __importStar: __importStar,
479
+ __importDefault: __importDefault,
480
+ __classPrivateFieldGet: __classPrivateFieldGet,
481
+ __classPrivateFieldSet: __classPrivateFieldSet,
482
+ __classPrivateFieldIn: __classPrivateFieldIn,
483
+ __addDisposableResource: __addDisposableResource,
484
+ __disposeResources: __disposeResources,
485
+ };
470
486
 
471
- exports.NfcError = /** @class */ (function (_super) {
472
- __extends(NfcError, _super);
473
- function NfcError(code, message) {
474
- var _this = _super.call(this, message) || this;
475
- _this.code = code;
476
- return _this;
477
- }
478
- NfcError.tagLostError = function () {
479
- return new NfcError(NfcError.ErrorCode.TagLostError, 'NFC tag lost');
480
- };
481
- NfcError.notConnectedError = function () {
482
- return new NfcError(NfcError.ErrorCode.NotConnectedError, 'NFC tag is not connected');
483
- };
484
- NfcError.unknownError = function (errString) {
485
- throw new NfcError(NfcError.ErrorCode.Unknown, errString);
486
- };
487
- NfcError.tagConnectionFailed = function () {
488
- throw new NfcError(NfcError.ErrorCode.NotConnectedError, "Tag connection failed");
489
- };
490
- NfcError.internalError = function (message) {
491
- throw new NfcError(NfcError.ErrorCode.InternalError, message);
492
- };
493
- return NfcError;
494
- }(Error));
495
- (function (NfcError) {
496
- var ErrorCode;
497
- (function (ErrorCode) {
498
- ErrorCode["Unknown"] = "NfcUnknownError";
499
- ErrorCode["InternalError"] = "NfcInternalError";
500
- ErrorCode["TagLostError"] = "NfcTagLostError";
501
- ErrorCode["NotConnectedError"] = "NfcNotConnectedError";
502
- })(ErrorCode = NfcError.ErrorCode || (NfcError.ErrorCode = {}));
503
- })(exports.NfcError || (exports.NfcError = {}));
487
+ exports.NfcError = /** @class */ (function (_super) {
488
+ __extends(NfcError, _super);
489
+ function NfcError(code, message) {
490
+ var _this = _super.call(this, message) || this;
491
+ _this.code = code;
492
+ return _this;
493
+ }
494
+ NfcError.tagLostError = function () {
495
+ return new NfcError(NfcError.ErrorCode.TagLostError, 'NFC tag lost');
496
+ };
497
+ NfcError.notConnectedError = function () {
498
+ return new NfcError(NfcError.ErrorCode.NotConnectedError, 'NFC tag is not connected');
499
+ };
500
+ NfcError.unknownError = function (errString) {
501
+ throw new NfcError(NfcError.ErrorCode.Unknown, errString);
502
+ };
503
+ NfcError.tagConnectionFailed = function () {
504
+ throw new NfcError(NfcError.ErrorCode.NotConnectedError, "Tag connection failed");
505
+ };
506
+ NfcError.internalError = function (message) {
507
+ throw new NfcError(NfcError.ErrorCode.InternalError, message);
508
+ };
509
+ return NfcError;
510
+ }(Error));
511
+ (function (NfcError) {
512
+ var ErrorCode;
513
+ (function (ErrorCode) {
514
+ ErrorCode["Unknown"] = "NfcUnknownError";
515
+ ErrorCode["InternalError"] = "NfcInternalError";
516
+ ErrorCode["TagLostError"] = "NfcTagLostError";
517
+ ErrorCode["NotConnectedError"] = "NfcNotConnectedError";
518
+ })(ErrorCode = NfcError.ErrorCode || (NfcError.ErrorCode = {}));
519
+ })(exports.NfcError || (exports.NfcError = {}));
504
520
 
505
- exports.TNF = void 0;
506
- (function (TNF) {
507
- TNF[TNF["EMPTY"] = 0] = "EMPTY";
508
- TNF[TNF["WELL_KNOWN_TYPE"] = 1] = "WELL_KNOWN_TYPE";
509
- TNF[TNF["MIME_TYPE"] = 2] = "MIME_TYPE";
510
- TNF[TNF["ABSOLUTE_URI"] = 3] = "ABSOLUTE_URI";
511
- TNF[TNF["EXTERNAL"] = 4] = "EXTERNAL";
512
- TNF[TNF["UNKNOWN"] = 5] = "UNKNOWN";
513
- TNF[TNF["UNCHANGED"] = 6] = "UNCHANGED";
514
- TNF[TNF["RFU"] = 7] = "RFU";
515
- })(exports.TNF || (exports.TNF = {}));
516
- var WellKnownType = {
517
- URI: [0x55],
518
- TEXT: [0x54],
519
- SMPART_POSTER: [0x53, 0x70],
520
- };
521
+ exports.TNF = void 0;
522
+ (function (TNF) {
523
+ TNF[TNF["EMPTY"] = 0] = "EMPTY";
524
+ TNF[TNF["WELL_KNOWN_TYPE"] = 1] = "WELL_KNOWN_TYPE";
525
+ TNF[TNF["MIME_TYPE"] = 2] = "MIME_TYPE";
526
+ TNF[TNF["ABSOLUTE_URI"] = 3] = "ABSOLUTE_URI";
527
+ TNF[TNF["EXTERNAL"] = 4] = "EXTERNAL";
528
+ TNF[TNF["UNKNOWN"] = 5] = "UNKNOWN";
529
+ TNF[TNF["UNCHANGED"] = 6] = "UNCHANGED";
530
+ TNF[TNF["RFU"] = 7] = "RFU";
531
+ })(exports.TNF || (exports.TNF = {}));
532
+ var WellKnownType = {
533
+ URI: [0x55],
534
+ TEXT: [0x54],
535
+ SMPART_POSTER: [0x53, 0x70],
536
+ };
521
537
 
522
- function toAsciiString(payload) {
523
- if (payload.length > 0 && payload[0] === 0) {
524
- payload = payload.slice(1);
525
- }
526
- return byteConverter.bufferToAsciiString(payload);
527
- }
528
- function arrayEquals(a1, a2) {
529
- return (a1.length === a2.length && a1.every(function (a1Item, index) { return a1Item === a2[index]; }));
530
- }
538
+ function toAsciiString(payload) {
539
+ if (payload.length > 0 && payload[0] === 0) {
540
+ payload = payload.slice(1);
541
+ }
542
+ return byteConverter.bufferToAsciiString(payload);
543
+ }
544
+ function arrayEquals(a1, a2) {
545
+ return (a1.length === a2.length && a1.every(function (a1Item, index) { return a1Item === a2[index]; }));
546
+ }
531
547
 
532
- function parseNdefMessages(messages) {
533
- return (messages || []).map(parseNdefMessage);
534
- }
535
- function parseNdefMessage(message) {
536
- switch (message.tnf) {
537
- case exports.TNF.ABSOLUTE_URI:
538
- return {
539
- id: message.id,
540
- type: message.type,
541
- tnf: 'uri',
542
- value: toAsciiString(message.payload),
543
- };
544
- case exports.TNF.WELL_KNOWN_TYPE:
545
- return {
546
- id: message.id,
547
- type: message.type,
548
- tnf: 'wkt',
549
- value: parseWellKnownType(message),
550
- };
551
- case exports.TNF.EMPTY:
552
- return {
553
- id: message.id,
554
- type: message.type,
555
- tnf: 'empty',
556
- value: {
557
- type: message.type,
558
- payload: message.payload,
559
- },
560
- };
561
- case exports.TNF.EXTERNAL:
562
- return {
563
- id: message.id,
564
- type: message.type,
565
- tnf: 'external',
566
- value: paseExternalType(message),
567
- };
568
- case exports.TNF.MIME_TYPE:
569
- return {
570
- id: message.id,
571
- type: message.type,
572
- tnf: 'mimetype',
573
- value: parseMimeType(message),
574
- };
575
- case exports.TNF.RFU:
576
- return {
577
- id: message.id,
578
- type: message.type,
579
- tnf: 'rfu',
580
- value: {
581
- type: message.type,
582
- payload: message.payload,
583
- },
584
- };
585
- case exports.TNF.UNCHANGED:
586
- return {
587
- id: message.id,
588
- type: message.type,
589
- tnf: 'unchanged',
590
- value: {
591
- type: message.type,
592
- payload: message.payload,
593
- },
594
- };
595
- case exports.TNF.UNKNOWN:
596
- return {
597
- id: message.id,
598
- type: message.type,
599
- tnf: 'unknown',
600
- value: {
601
- type: message.type,
602
- payload: message.payload,
603
- },
604
- };
605
- default:
606
- return {
607
- id: message.id,
608
- type: message.type,
609
- tnf: message.tnf,
610
- value: {
611
- type: message.type,
612
- payload: message.payload,
613
- },
614
- };
615
- }
616
- }
617
- function parseWellKnownType(message) {
618
- if (arrayEquals(message.type.slice(), WellKnownType.URI)) {
619
- var prefixCode = message.payload[0];
620
- var prefix = WELL_KNOWN_TYPE_URI_PREFIX[prefixCode] || '';
621
- return {
622
- type: 'uri',
623
- value: prefix + toAsciiString(message.payload.slice(1)),
624
- };
625
- }
626
- else if (arrayEquals(message.type.slice(), WellKnownType.TEXT)) {
627
- var encodingNumber = message.payload[0];
628
- var encoding = 'utf8';
629
- var languageSizeInBytes = 0;
630
- if (typeof encodingNumber === 'number') {
631
- // b0: encodage utf8 s’il vaut 0 et utf16 s’il vaut 1.
632
- // b1: RFU (set to 0)
633
- // b2-b7: la taille en octets de la langue (n)
634
- // B8-B8+n-1: language
635
- // Bn: message
636
- var b0 = encodingNumber & 128;
637
- encoding = b0 ? 'utf16le' : 'utf8';
638
- languageSizeInBytes = encodingNumber & 63;
639
- }
640
- var text = message.payload.slice(languageSizeInBytes + 1);
641
- var language = message.payload.slice(8, languageSizeInBytes + 1);
642
- return {
643
- type: 'text',
644
- value: buffer.Buffer.from(text).toString(encoding),
645
- encoding: encoding,
646
- language: buffer.Buffer.from(language).toString(encoding)
647
- };
648
- }
649
- // else if (arrayEquals(message.type.slice(), WellKnownType.SMPART_POSTER)) {
650
- // return {
651
- // type: 'sp',
652
- // // TODO implement
653
- // payload: message.payload,
654
- // };
655
- // }
656
- else {
657
- return {
658
- type: 'unknown',
659
- value: {
660
- type: message.type.slice(),
661
- payload: message.payload,
662
- },
663
- };
664
- }
665
- }
666
- function paseExternalType(message) {
667
- var value = buffer.Buffer.from(message.payload).toString('utf8');
668
- var domain = buffer.Buffer.from(message.type).toString('utf8');
669
- return {
670
- domain: domain,
671
- value: value,
672
- };
673
- }
674
- var WELL_KNOWN_TYPE_URI_PREFIX = {
675
- 0x0: '',
676
- 0x1: 'http://www.',
677
- 0x2: 'http://www.',
678
- 0x3: 'http://',
679
- 0x4: 'https://',
680
- 0x5: 'tel:',
681
- 0x6: 'mailto:',
682
- 0x07: 'ftp://anonymous:anonymous@',
683
- 0x1d: 'file://',
684
- 0x08: 'ftp://ftp.',
685
- 0x09: 'ftps://',
686
- 0x0a: 'sftp://',
687
- 0x0b: 'smb://',
688
- 0x0c: 'nfs://',
689
- 0x0d: 'ftp://',
690
- 0x0e: 'dav://',
691
- 0x0f: 'news:',
692
- 0x10: 'telnet://',
693
- 0x11: 'imap:',
694
- 0x12: 'rtsp://',
695
- 0x13: 'urn:',
696
- 0x14: 'pop:',
697
- 0x15: 'sip:',
698
- 0x16: 'sips:',
699
- 0x17: 'tftp:',
700
- 0x18: 'btspp://',
701
- 0x19: 'btl2cap://',
702
- 0x1a: 'btgoep://',
703
- 0x1b: 'tcpobex://',
704
- 0x1c: 'irdaobex://',
705
- 0x1e: 'urn:epc:id:',
706
- 0x1f: 'urn:epc:tag:',
707
- 0x20: 'urn:epc:pat:',
708
- 0x21: 'urn:epc:raw:',
709
- 0x22: 'urn:epc:',
710
- };
711
- function parseMimeType(message) {
712
- return buffer.Buffer.from(message.payload).toString('utf8');
713
- }
714
- function encodeWellKnownType(message) {
715
- var e_1, _a;
716
- if (message.value.type == 'uri') {
717
- //identify the prefix
718
- var prefixesEntries = Object.entries(WELL_KNOWN_TYPE_URI_PREFIX);
719
- var prefixByte = 0;
720
- try {
721
- for (var prefixesEntries_1 = __values(prefixesEntries), prefixesEntries_1_1 = prefixesEntries_1.next(); !prefixesEntries_1_1.done; prefixesEntries_1_1 = prefixesEntries_1.next()) {
722
- var _b = __read(prefixesEntries_1_1.value, 2), id = _b[0], prefix = _b[1];
723
- if (id == '0x0') // Skip first as it is always recognized. (what about 0x1 vs 0x2?)
724
- continue;
725
- if (message.value.value.startsWith(prefix)) {
726
- prefixByte = parseInt(id, 16);
727
- break;
728
- }
729
- }
730
- }
731
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
732
- finally {
733
- try {
734
- if (prefixesEntries_1_1 && !prefixesEntries_1_1.done && (_a = prefixesEntries_1.return)) _a.call(prefixesEntries_1);
735
- }
736
- finally { if (e_1) throw e_1.error; }
737
- }
738
- var lengthToSlice = WELL_KNOWN_TYPE_URI_PREFIX[prefixByte].length;
739
- var slicedString = message.value.value.slice(lengthToSlice);
740
- return __spreadArray([prefixByte], __read((byteConverter.asciiStringToByteBuffer(slicedString))));
741
- }
742
- else if (message.value.type === 'text') {
743
- // b1: RFU (set to 0)
744
- // b2-b7: la taille en octets de la langue (n)
745
- // B8-B8+n-1: language
746
- // Bn: message
747
- var firstByte = message.value.encoding == 'utf16le' ? 128 : 0;
748
- firstByte &= (message.value.language & 63);
749
- var languageBytes = buffer.Buffer.from(message.value.language, message.value.encoding);
750
- var textBytes = buffer.Buffer.from(message.value.value, message.value.encoding);
751
- return __spreadArray(__spreadArray([firstByte], __read(languageBytes)), __read(textBytes));
752
- }
753
- else
754
- return __spreadArray(__spreadArray([], __read(message.value.type)), __read(message.value.payload));
755
- }
756
- function encodeExternalType(message) {
757
- return Array.from(buffer.Buffer.from(message.value.value, 'utf8'));
758
- }
759
- function encodeMimeType(message) {
760
- return Array.from(buffer.Buffer.from(message.value, 'utf8'));
761
- }
762
- function encodeNDEFMessages(ndefRecords) {
763
- return (ndefRecords || []).map(encodeNDEFMessage);
764
- }
765
- function encodeNDEFMessage(ndefRecord) {
766
- switch (ndefRecord.tnf) {
767
- case 'uri':
768
- return {
769
- id: ndefRecord.id,
770
- type: ndefRecord.type,
771
- tnf: exports.TNF.ABSOLUTE_URI,
772
- payload: Array.from(byteConverter.asciiStringToByteBuffer(ndefRecord.value))
773
- };
774
- case 'wkt':
775
- return {
776
- id: ndefRecord.id,
777
- type: ndefRecord.type,
778
- tnf: exports.TNF.WELL_KNOWN_TYPE,
779
- payload: encodeWellKnownType(ndefRecord),
780
- };
781
- case 'empty':
782
- return {
783
- id: ndefRecord.id,
784
- type: ndefRecord.type,
785
- tnf: exports.TNF.EMPTY,
786
- payload: ndefRecord.payload,
787
- };
788
- case 'external':
789
- return {
790
- id: ndefRecord.id,
791
- type: ndefRecord.type,
792
- tnf: exports.TNF.EXTERNAL,
793
- payload: encodeExternalType(ndefRecord),
794
- };
795
- case 'mimetype':
796
- return {
797
- id: ndefRecord.id,
798
- type: ndefRecord.type,
799
- tnf: exports.TNF.MIME_TYPE,
800
- payload: encodeMimeType(ndefRecord),
801
- };
802
- case 'rfu':
803
- return {
804
- id: ndefRecord.id,
805
- type: ndefRecord.type,
806
- tnf: exports.TNF.RFU,
807
- payload: ndefRecord.payload
808
- };
809
- case 'unchanged':
810
- return {
811
- id: ndefRecord.id,
812
- type: ndefRecord.type,
813
- tnf: exports.TNF.UNCHANGED,
814
- payload: ndefRecord.payload,
815
- };
816
- case 'unknown':
817
- return {
818
- id: ndefRecord.id,
819
- type: ndefRecord.type,
820
- tnf: exports.TNF.UNKNOWN,
821
- payload: ndefRecord.payload,
822
- };
823
- default:
824
- return {
825
- id: ndefRecord.id,
826
- type: ndefRecord.type,
827
- tnf: Number(ndefRecord.tnf),
828
- payload: ndefRecord.payload,
829
- };
830
- }
831
- }
548
+ function parseNdefMessages(messages) {
549
+ return (messages || []).map(parseNdefMessage);
550
+ }
551
+ function parseNdefMessage(message) {
552
+ switch (message.tnf) {
553
+ case exports.TNF.ABSOLUTE_URI:
554
+ return {
555
+ id: message.id,
556
+ type: message.type,
557
+ tnf: 'uri',
558
+ value: toAsciiString(message.payload),
559
+ };
560
+ case exports.TNF.WELL_KNOWN_TYPE:
561
+ return {
562
+ id: message.id,
563
+ type: message.type,
564
+ tnf: 'wkt',
565
+ value: parseWellKnownType(message),
566
+ };
567
+ case exports.TNF.EMPTY:
568
+ return {
569
+ id: message.id,
570
+ type: message.type,
571
+ tnf: 'empty',
572
+ value: {
573
+ type: message.type,
574
+ payload: message.payload,
575
+ },
576
+ };
577
+ case exports.TNF.EXTERNAL:
578
+ return {
579
+ id: message.id,
580
+ type: message.type,
581
+ tnf: 'external',
582
+ value: paseExternalType(message),
583
+ };
584
+ case exports.TNF.MIME_TYPE:
585
+ return {
586
+ id: message.id,
587
+ type: message.type,
588
+ tnf: 'mimetype',
589
+ value: parseMimeType(message),
590
+ };
591
+ case exports.TNF.RFU:
592
+ return {
593
+ id: message.id,
594
+ type: message.type,
595
+ tnf: 'rfu',
596
+ value: {
597
+ type: message.type,
598
+ payload: message.payload,
599
+ },
600
+ };
601
+ case exports.TNF.UNCHANGED:
602
+ return {
603
+ id: message.id,
604
+ type: message.type,
605
+ tnf: 'unchanged',
606
+ value: {
607
+ type: message.type,
608
+ payload: message.payload,
609
+ },
610
+ };
611
+ case exports.TNF.UNKNOWN:
612
+ return {
613
+ id: message.id,
614
+ type: message.type,
615
+ tnf: 'unknown',
616
+ value: {
617
+ type: message.type,
618
+ payload: message.payload,
619
+ },
620
+ };
621
+ default:
622
+ return {
623
+ id: message.id,
624
+ type: message.type,
625
+ tnf: message.tnf,
626
+ value: {
627
+ type: message.type,
628
+ payload: message.payload,
629
+ },
630
+ };
631
+ }
632
+ }
633
+ function parseWellKnownType(message) {
634
+ if (arrayEquals(message.type.slice(), WellKnownType.URI)) {
635
+ var prefixCode = message.payload[0];
636
+ var prefix = WELL_KNOWN_TYPE_URI_PREFIX[prefixCode] || '';
637
+ return {
638
+ type: 'uri',
639
+ value: prefix + toAsciiString(message.payload.slice(1)),
640
+ };
641
+ }
642
+ else if (arrayEquals(message.type.slice(), WellKnownType.TEXT)) {
643
+ var encodingNumber = message.payload[0];
644
+ var encoding = 'utf8';
645
+ var languageSizeInBytes = 0;
646
+ if (typeof encodingNumber === 'number') {
647
+ // b0: encodage utf8 s’il vaut 0 et utf16 s’il vaut 1.
648
+ // b1: RFU (set to 0)
649
+ // b2-b7: la taille en octets de la langue (n)
650
+ // B8-B8+n-1: language
651
+ // Bn: message
652
+ var b0 = encodingNumber & 128;
653
+ encoding = b0 ? 'utf16le' : 'utf8';
654
+ languageSizeInBytes = encodingNumber & 63;
655
+ }
656
+ var text = message.payload.slice(languageSizeInBytes + 1);
657
+ var language = message.payload.slice(8, languageSizeInBytes + 1);
658
+ return {
659
+ type: 'text',
660
+ value: buffer.Buffer.from(text).toString(encoding),
661
+ encoding: encoding,
662
+ language: buffer.Buffer.from(language).toString(encoding),
663
+ };
664
+ }
665
+ // else if (arrayEquals(message.type.slice(), WellKnownType.SMPART_POSTER)) {
666
+ // return {
667
+ // type: 'sp',
668
+ // // TODO implement
669
+ // payload: message.payload,
670
+ // };
671
+ // }
672
+ else {
673
+ return {
674
+ type: 'unknown',
675
+ value: {
676
+ type: message.type.slice(),
677
+ payload: message.payload,
678
+ },
679
+ };
680
+ }
681
+ }
682
+ function paseExternalType(message) {
683
+ var value = buffer.Buffer.from(message.payload).toString('utf8');
684
+ var domain = buffer.Buffer.from(message.type).toString('utf8');
685
+ return {
686
+ domain: domain,
687
+ value: value,
688
+ };
689
+ }
690
+ var WELL_KNOWN_TYPE_URI_PREFIX = {
691
+ 0x0: '',
692
+ 0x1: 'http://www.',
693
+ 0x2: 'http://www.',
694
+ 0x3: 'http://',
695
+ 0x4: 'https://',
696
+ 0x5: 'tel:',
697
+ 0x6: 'mailto:',
698
+ 0x07: 'ftp://anonymous:anonymous@',
699
+ 0x1d: 'file://',
700
+ 0x08: 'ftp://ftp.',
701
+ 0x09: 'ftps://',
702
+ 0x0a: 'sftp://',
703
+ 0x0b: 'smb://',
704
+ 0x0c: 'nfs://',
705
+ 0x0d: 'ftp://',
706
+ 0x0e: 'dav://',
707
+ 0x0f: 'news:',
708
+ 0x10: 'telnet://',
709
+ 0x11: 'imap:',
710
+ 0x12: 'rtsp://',
711
+ 0x13: 'urn:',
712
+ 0x14: 'pop:',
713
+ 0x15: 'sip:',
714
+ 0x16: 'sips:',
715
+ 0x17: 'tftp:',
716
+ 0x18: 'btspp://',
717
+ 0x19: 'btl2cap://',
718
+ 0x1a: 'btgoep://',
719
+ 0x1b: 'tcpobex://',
720
+ 0x1c: 'irdaobex://',
721
+ 0x1e: 'urn:epc:id:',
722
+ 0x1f: 'urn:epc:tag:',
723
+ 0x20: 'urn:epc:pat:',
724
+ 0x21: 'urn:epc:raw:',
725
+ 0x22: 'urn:epc:',
726
+ };
727
+ function parseMimeType(message) {
728
+ return buffer.Buffer.from(message.payload).toString('utf8');
729
+ }
730
+ function encodeWellKnownType(message) {
731
+ var e_1, _a;
732
+ if (message.value.type == 'uri') {
733
+ //identify the prefix
734
+ var prefixesEntries = Object.entries(WELL_KNOWN_TYPE_URI_PREFIX);
735
+ var prefixByte = 0;
736
+ try {
737
+ for (var prefixesEntries_1 = __values(prefixesEntries), prefixesEntries_1_1 = prefixesEntries_1.next(); !prefixesEntries_1_1.done; prefixesEntries_1_1 = prefixesEntries_1.next()) {
738
+ var _b = __read(prefixesEntries_1_1.value, 2), id = _b[0], prefix = _b[1];
739
+ if (id == '0x0')
740
+ // Skip first as it is always recognized. (what about 0x1 vs 0x2?)
741
+ continue;
742
+ if (message.value.value.startsWith(prefix)) {
743
+ prefixByte = parseInt(id, 16);
744
+ break;
745
+ }
746
+ }
747
+ }
748
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
749
+ finally {
750
+ try {
751
+ if (prefixesEntries_1_1 && !prefixesEntries_1_1.done && (_a = prefixesEntries_1.return)) _a.call(prefixesEntries_1);
752
+ }
753
+ finally { if (e_1) throw e_1.error; }
754
+ }
755
+ var lengthToSlice = WELL_KNOWN_TYPE_URI_PREFIX[prefixByte].length;
756
+ var slicedString = message.value.value.slice(lengthToSlice);
757
+ return __spreadArray([prefixByte], __read(byteConverter.asciiStringToByteBuffer(slicedString)));
758
+ }
759
+ else if (message.value.type === 'text') {
760
+ // b1: RFU (set to 0)
761
+ // b2-b7: la taille en octets de la langue (n)
762
+ // B8-B8+n-1: language
763
+ // Bn: message
764
+ var firstByte = message.value.encoding == 'utf16le' ? 128 : 0;
765
+ firstByte &= message.value.language & 63;
766
+ var languageBytes = buffer.Buffer.from(message.value.language, message.value.encoding);
767
+ var textBytes = buffer.Buffer.from(message.value.value, message.value.encoding);
768
+ return __spreadArray(__spreadArray([firstByte], __read(languageBytes)), __read(textBytes));
769
+ }
770
+ else
771
+ return __spreadArray(__spreadArray([], __read(message.value.type)), __read(message.value.payload));
772
+ }
773
+ function encodeExternalType(message) {
774
+ return Array.from(buffer.Buffer.from(message.value.value, 'utf8'));
775
+ }
776
+ function encodeMimeType(message) {
777
+ return Array.from(buffer.Buffer.from(message.value, 'utf8'));
778
+ }
779
+ function encodeNDEFMessages(ndefRecords) {
780
+ return (ndefRecords || []).map(encodeNDEFMessage);
781
+ }
782
+ function encodeNDEFMessage(ndefRecord) {
783
+ switch (ndefRecord.tnf) {
784
+ case 'uri':
785
+ return {
786
+ id: ndefRecord.id,
787
+ type: ndefRecord.type,
788
+ tnf: exports.TNF.ABSOLUTE_URI,
789
+ payload: Array.from(byteConverter.asciiStringToByteBuffer(ndefRecord.value)),
790
+ };
791
+ case 'wkt':
792
+ return {
793
+ id: ndefRecord.id,
794
+ type: ndefRecord.type,
795
+ tnf: exports.TNF.WELL_KNOWN_TYPE,
796
+ payload: encodeWellKnownType(ndefRecord),
797
+ };
798
+ case 'empty':
799
+ return {
800
+ id: ndefRecord.id,
801
+ type: ndefRecord.type,
802
+ tnf: exports.TNF.EMPTY,
803
+ payload: ndefRecord.payload,
804
+ };
805
+ case 'external':
806
+ return {
807
+ id: ndefRecord.id,
808
+ type: ndefRecord.type,
809
+ tnf: exports.TNF.EXTERNAL,
810
+ payload: encodeExternalType(ndefRecord),
811
+ };
812
+ case 'mimetype':
813
+ return {
814
+ id: ndefRecord.id,
815
+ type: ndefRecord.type,
816
+ tnf: exports.TNF.MIME_TYPE,
817
+ payload: encodeMimeType(ndefRecord),
818
+ };
819
+ case 'rfu':
820
+ return {
821
+ id: ndefRecord.id,
822
+ type: ndefRecord.type,
823
+ tnf: exports.TNF.RFU,
824
+ payload: ndefRecord.payload,
825
+ };
826
+ case 'unchanged':
827
+ return {
828
+ id: ndefRecord.id,
829
+ type: ndefRecord.type,
830
+ tnf: exports.TNF.UNCHANGED,
831
+ payload: ndefRecord.payload,
832
+ };
833
+ case 'unknown':
834
+ return {
835
+ id: ndefRecord.id,
836
+ type: ndefRecord.type,
837
+ tnf: exports.TNF.UNKNOWN,
838
+ payload: ndefRecord.payload,
839
+ };
840
+ default:
841
+ return {
842
+ id: ndefRecord.id,
843
+ type: ndefRecord.type,
844
+ tnf: Number(ndefRecord.tnf),
845
+ payload: ndefRecord.payload,
846
+ };
847
+ }
848
+ }
832
849
 
833
- var debug = debug$1.createDebugger("@iotize/device-com-nfc.cordova");
850
+ var debug = debug$1.createDebugger("@iotize/device-com-nfc.cordova");
834
851
 
835
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
836
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
837
- return new (P || (P = Promise))(function (resolve, reject) {
838
- function fulfilled(value) { try {
839
- step(generator.next(value));
840
- }
841
- catch (e) {
842
- reject(e);
843
- } }
844
- function rejected(value) { try {
845
- step(generator["throw"](value));
846
- }
847
- catch (e) {
848
- reject(e);
849
- } }
850
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
851
- step((generator = generator.apply(thisArg, _arguments || [])).next());
852
- });
853
- };
854
- var PromiseQueue = /** @class */ (function () {
855
- function PromiseQueue() {
856
- this.queue = Promise.resolve(true);
857
- }
858
- PromiseQueue.prototype.add = function (operation) {
859
- var _this = this;
860
- return new Promise(function (resolve, reject) {
861
- _this.queue = _this.queue.then(operation).then(resolve).catch(reject);
862
- });
863
- };
864
- return PromiseQueue;
865
- }());
866
- var NFCComProtocol = /** @class */ (function (_super) {
867
- __extends(NFCComProtocol, _super);
868
- function NFCComProtocol(options) {
869
- if (options === void 0) { options = {
870
- connect: {
871
- timeout: 2000,
872
- },
873
- disconnect: {
874
- timeout: 1000,
875
- },
876
- send: {
877
- timeout: 1000,
878
- },
879
- }; }
880
- var _this = _super.call(this) || this;
881
- _this._sendQueue = new PromiseQueue();
882
- _this.options = options;
883
- if (typeof nfc == undefined) {
884
- console.warn('NFC plugin has not been setup properly. Global variable NFC does not exist');
885
- }
886
- return _this;
887
- }
888
- NFCComProtocol.iOSProtocol = function () {
889
- return new NFCComProtocol({
890
- connect: {
891
- timeout: 10000, // bigger timer on connect as connect launches a reading session
892
- },
893
- disconnect: {
894
- timeout: 1000,
895
- },
896
- send: {
897
- timeout: 1000,
898
- },
899
- });
900
- };
901
- /**
902
- * We force tag connection with nfc as we need to refresh tag
903
- * @param options
904
- * @returns
905
- */
906
- NFCComProtocol.prototype.connect = function (options) {
907
- this.connectionState = api.ConnectionState.CONNECTING; // Hack to force NFC tag connect call even if we are already connected
908
- return _super.prototype.connect.call(this, options);
909
- };
910
- /**
911
- * Not used as we have rewrote "connect()" function
912
- * @param options
913
- * @returns
914
- */
915
- NFCComProtocol.prototype._connect = function (options) {
916
- var _this = this;
917
- return rxjs.defer(function () { return __awaiter(_this, void 0, void 0, function () {
918
- var err_1;
919
- return __generator(this, function (_a) {
920
- switch (_a.label) {
921
- case 0:
922
- debug('_connect', options);
923
- _a.label = 1;
924
- case 1:
925
- _a.trys.push([1, 3, , 4]);
926
- return [4 /*yield*/, nfc.connect('android.nfc.tech.NfcV', this.options.connect.timeout)];
927
- case 2:
928
- _a.sent();
929
- return [3 /*break*/, 4];
930
- case 3:
931
- err_1 = _a.sent();
932
- if (typeof err_1 === 'string') {
933
- if (err_1 === 'Tag connection failed') {
934
- throw exports.NfcError.tagConnectionFailed();
935
- }
936
- else {
937
- throw exports.NfcError.unknownError(err_1);
938
- }
939
- }
940
- throw err_1;
941
- case 4: return [2 /*return*/];
942
- }
943
- });
944
- }); });
945
- };
946
- NFCComProtocol.prototype._disconnect = function (options) {
947
- var _this = this;
948
- return rxjs.defer(function () { return __awaiter(_this, void 0, void 0, function () {
949
- return __generator(this, function (_a) {
950
- switch (_a.label) {
951
- case 0: return [4 /*yield*/, nfc.close()];
952
- case 1:
953
- _a.sent();
954
- this._sendQueue = new PromiseQueue();
955
- return [2 /*return*/];
956
- }
957
- });
958
- }); });
959
- };
960
- /**
961
- * Not used
962
- * @param options
963
- * @returns
964
- */
965
- NFCComProtocol.prototype.write = function (data) {
966
- return __awaiter(this, void 0, void 0, function () {
967
- return __generator(this, function (_a) {
968
- throw new Error('Method not implemented.');
969
- });
970
- });
971
- };
972
- /**
973
- * Not used
974
- * @param options
975
- * @returns
976
- */
977
- NFCComProtocol.prototype.read = function () {
978
- return __awaiter(this, void 0, void 0, function () {
979
- return __generator(this, function (_a) {
980
- throw new Error('Method not implemented.');
981
- });
982
- });
983
- };
984
- NFCComProtocol.prototype.send = function (data, options) {
985
- var _this = this;
986
- return rxjs.defer(function () { return __awaiter(_this, void 0, void 0, function () {
987
- var _this = this;
988
- return __generator(this, function (_a) {
989
- switch (_a.label) {
990
- case 0: return [4 /*yield*/, this._sendQueue.add(function () { return __awaiter(_this, void 0, void 0, function () {
991
- var response, errString_1, error;
992
- return __generator(this, function (_a) {
993
- switch (_a.label) {
994
- case 0:
995
- _a.trys.push([0, 2, , 3]);
996
- return [4 /*yield*/, nfc.transceiveTap(byteConverter.bufferToHexString(data))];
997
- case 1:
998
- response = _a.sent();
999
- if (typeof response != 'string') {
1000
- throw exports.NfcError.internalError("Internal error. Plugin should respond a hexadecimal string");
1001
- }
1002
- debug('NFC plugin response: ', response);
1003
- return [2 /*return*/, byteConverter.hexStringToBuffer(response)];
1004
- case 2:
1005
- errString_1 = _a.sent();
1006
- if (typeof errString_1 === 'string') {
1007
- error = stringToError(errString_1);
1008
- if (error.code === exports.NfcError.ErrorCode.NotConnectedError ||
1009
- error.code === exports.NfcError.ErrorCode.TagLostError) {
1010
- this._onConnectionLost(error);
1011
- }
1012
- throw error;
1013
- }
1014
- else {
1015
- throw errString_1;
1016
- }
1017
- return [3 /*break*/, 3];
1018
- case 3: return [2 /*return*/];
1019
- }
1020
- });
1021
- }); })];
1022
- case 1: return [2 /*return*/, _a.sent()];
1023
- }
1024
- });
1025
- }); });
1026
- };
1027
- NFCComProtocol.prototype._onConnectionLost = function (error) {
1028
- if (this.connectionState !== api.ConnectionState.DISCONNECTED) {
1029
- this.setConnectionState(api.ConnectionState.DISCONNECTED);
1030
- }
1031
- };
1032
- return NFCComProtocol;
1033
- }(core.QueueComProtocol));
1034
- /**
1035
- * Convert error string returned by the plugin into an error object
1036
- * It only checks a few Android error string for now
1037
- *
1038
- * TODO complete implementation with other error types
1039
- *
1040
- * @param errString
1041
- */
1042
- function stringToError(errString) {
1043
- var errStringLc = errString.toLowerCase();
1044
- if (errStringLc.indexOf('tag was lost') >= 0) {
1045
- return exports.NfcError.tagLostError();
1046
- }
1047
- else if (errStringLc.indexOf('not connected') >= 0) {
1048
- return exports.NfcError.notConnectedError();
1049
- }
1050
- else {
1051
- return exports.NfcError.unknownError(errString);
1052
- }
1053
- }
852
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
853
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
854
+ return new (P || (P = Promise))(function (resolve, reject) {
855
+ function fulfilled(value) { try {
856
+ step(generator.next(value));
857
+ }
858
+ catch (e) {
859
+ reject(e);
860
+ } }
861
+ function rejected(value) { try {
862
+ step(generator["throw"](value));
863
+ }
864
+ catch (e) {
865
+ reject(e);
866
+ } }
867
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
868
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
869
+ });
870
+ };
871
+ var PromiseQueue = /** @class */ (function () {
872
+ function PromiseQueue() {
873
+ this.queue = Promise.resolve(true);
874
+ }
875
+ PromiseQueue.prototype.add = function (operation) {
876
+ var _this = this;
877
+ return new Promise(function (resolve, reject) {
878
+ _this.queue = _this.queue.then(operation).then(resolve).catch(reject);
879
+ });
880
+ };
881
+ return PromiseQueue;
882
+ }());
883
+ var NFCComProtocol = /** @class */ (function (_super) {
884
+ __extends(NFCComProtocol, _super);
885
+ function NFCComProtocol(options) {
886
+ if (options === void 0) { options = {
887
+ connect: {
888
+ timeout: 2000,
889
+ },
890
+ disconnect: {
891
+ timeout: 1000,
892
+ },
893
+ send: {
894
+ timeout: 1000,
895
+ },
896
+ }; }
897
+ var _this = _super.call(this) || this;
898
+ _this._sendQueue = new PromiseQueue();
899
+ _this.options = options;
900
+ if (typeof nfc == undefined) {
901
+ console.warn('NFC plugin has not been setup properly. Global variable NFC does not exist');
902
+ }
903
+ return _this;
904
+ }
905
+ NFCComProtocol.iOSProtocol = function () {
906
+ return new NFCComProtocol({
907
+ connect: {
908
+ timeout: 10000, // bigger timer on connect as connect launches a reading session
909
+ },
910
+ disconnect: {
911
+ timeout: 1000,
912
+ },
913
+ send: {
914
+ timeout: 1000,
915
+ },
916
+ });
917
+ };
918
+ /**
919
+ * We force tag connection with nfc as we need to refresh tag
920
+ * @param options
921
+ * @returns
922
+ */
923
+ NFCComProtocol.prototype.connect = function (options) {
924
+ var _this = this;
925
+ if (this.connectionState === api.ConnectionState.CONNECTED) {
926
+ return rxjs.defer(function () { return __awaiter(_this, void 0, void 0, function () {
927
+ var err_1;
928
+ return __generator(this, function (_a) {
929
+ switch (_a.label) {
930
+ case 0:
931
+ _a.trys.push([0, 2, , 3]);
932
+ return [4 /*yield*/, nfc.checkTapConnection(this.options.connect.timeout)];
933
+ case 1: return [2 /*return*/, _a.sent()];
934
+ case 2:
935
+ err_1 = _a.sent();
936
+ this.setConnectionState(api.ConnectionState.DISCONNECTED);
937
+ throw err_1;
938
+ case 3: return [2 /*return*/];
939
+ }
940
+ });
941
+ }); }).pipe(rxjs.switchMap(function (connectionCheckState) {
942
+ switch (connectionCheckState) {
943
+ case exports.CheckTapConnectionResult.IN_RANGE_READY:
944
+ return rxjs.of(undefined);
945
+ case exports.CheckTapConnectionResult.IN_RANGE_BUT_LEFT_FIELD:
946
+ _this.setConnectionState(api.ConnectionState.CONNECTING);
947
+ return _super.prototype.connect.call(_this, options);
948
+ case exports.CheckTapConnectionResult.NOT_IN_RANGE:
949
+ default:
950
+ _this.setConnectionState(api.ConnectionState.DISCONNECTED);
951
+ return rxjs.throwError(function () { return exports.NfcError.tagLostError(); });
952
+ }
953
+ }));
954
+ }
955
+ return _super.prototype.connect.call(this, options);
956
+ };
957
+ /**
958
+ * Not used as we have rewrote "connect()" function
959
+ * @param options
960
+ * @returns
961
+ */
962
+ NFCComProtocol.prototype._connect = function (options) {
963
+ var _this = this;
964
+ return rxjs.defer(function () { return __awaiter(_this, void 0, void 0, function () {
965
+ var err_2;
966
+ return __generator(this, function (_a) {
967
+ switch (_a.label) {
968
+ case 0:
969
+ debug('_connect', options);
970
+ _a.label = 1;
971
+ case 1:
972
+ _a.trys.push([1, 3, , 4]);
973
+ return [4 /*yield*/, nfc.connect('android.nfc.tech.NfcV', this.options.connect.timeout)];
974
+ case 2:
975
+ _a.sent();
976
+ return [3 /*break*/, 4];
977
+ case 3:
978
+ err_2 = _a.sent();
979
+ if (typeof err_2 === 'string') {
980
+ if (err_2 === 'Tag connection failed') {
981
+ throw exports.NfcError.tagConnectionFailed();
982
+ }
983
+ else {
984
+ throw exports.NfcError.unknownError(err_2);
985
+ }
986
+ }
987
+ throw err_2;
988
+ case 4: return [2 /*return*/];
989
+ }
990
+ });
991
+ }); });
992
+ };
993
+ NFCComProtocol.prototype._disconnect = function (options) {
994
+ var _this = this;
995
+ return rxjs.defer(function () { return __awaiter(_this, void 0, void 0, function () {
996
+ return __generator(this, function (_a) {
997
+ switch (_a.label) {
998
+ case 0: return [4 /*yield*/, nfc.close()];
999
+ case 1:
1000
+ _a.sent();
1001
+ this._sendQueue = new PromiseQueue();
1002
+ return [2 /*return*/];
1003
+ }
1004
+ });
1005
+ }); });
1006
+ };
1007
+ /**
1008
+ * Not used
1009
+ * @param options
1010
+ * @returns
1011
+ */
1012
+ NFCComProtocol.prototype.write = function (data) {
1013
+ return __awaiter(this, void 0, void 0, function () {
1014
+ return __generator(this, function (_a) {
1015
+ throw new Error('Method not implemented.');
1016
+ });
1017
+ });
1018
+ };
1019
+ /**
1020
+ * Not used
1021
+ * @param options
1022
+ * @returns
1023
+ */
1024
+ NFCComProtocol.prototype.read = function () {
1025
+ return __awaiter(this, void 0, void 0, function () {
1026
+ return __generator(this, function (_a) {
1027
+ throw new Error('Method not implemented.');
1028
+ });
1029
+ });
1030
+ };
1031
+ NFCComProtocol.prototype.send = function (data, options) {
1032
+ var _this = this;
1033
+ return rxjs.defer(function () { return __awaiter(_this, void 0, void 0, function () {
1034
+ var _this = this;
1035
+ return __generator(this, function (_a) {
1036
+ switch (_a.label) {
1037
+ case 0: return [4 /*yield*/, this._sendQueue.add(function () { return __awaiter(_this, void 0, void 0, function () {
1038
+ var response, errString_1, error;
1039
+ return __generator(this, function (_a) {
1040
+ switch (_a.label) {
1041
+ case 0:
1042
+ _a.trys.push([0, 2, , 3]);
1043
+ return [4 /*yield*/, nfc.transceiveTap(byteConverter.bufferToHexString(data))];
1044
+ case 1:
1045
+ response = _a.sent();
1046
+ if (typeof response != 'string') {
1047
+ throw exports.NfcError.internalError("Internal error. Plugin should respond a hexadecimal string");
1048
+ }
1049
+ debug('NFC plugin response: ', response);
1050
+ return [2 /*return*/, byteConverter.hexStringToBuffer(response)];
1051
+ case 2:
1052
+ errString_1 = _a.sent();
1053
+ if (typeof errString_1 === 'string') {
1054
+ error = stringToError(errString_1);
1055
+ if (error.code === exports.NfcError.ErrorCode.NotConnectedError ||
1056
+ error.code === exports.NfcError.ErrorCode.TagLostError) {
1057
+ this._onConnectionLost(error);
1058
+ }
1059
+ throw error;
1060
+ }
1061
+ else {
1062
+ throw errString_1;
1063
+ }
1064
+ return [3 /*break*/, 3];
1065
+ case 3: return [2 /*return*/];
1066
+ }
1067
+ });
1068
+ }); })];
1069
+ case 1: return [2 /*return*/, _a.sent()];
1070
+ }
1071
+ });
1072
+ }); });
1073
+ };
1074
+ NFCComProtocol.prototype._onConnectionLost = function (error) {
1075
+ if (this.connectionState !== api.ConnectionState.DISCONNECTED) {
1076
+ this.setConnectionState(api.ConnectionState.DISCONNECTED);
1077
+ }
1078
+ };
1079
+ return NFCComProtocol;
1080
+ }(core.QueueComProtocol));
1081
+ /**
1082
+ * Convert error string returned by the plugin into an error object
1083
+ * It only checks a few Android error string for now
1084
+ *
1085
+ * TODO complete implementation with other error types
1086
+ *
1087
+ * @param errString
1088
+ */
1089
+ function stringToError(errString) {
1090
+ var errStringLc = errString.toLowerCase();
1091
+ if (errStringLc.indexOf('tag was lost') >= 0) {
1092
+ return exports.NfcError.tagLostError();
1093
+ }
1094
+ else if (errStringLc.indexOf('not connected') >= 0) {
1095
+ return exports.NfcError.notConnectedError();
1096
+ }
1097
+ else {
1098
+ return exports.NfcError.unknownError(errString);
1099
+ }
1100
+ }
1054
1101
 
1055
- /**
1056
- * We manage only on NDEF message with 3 records:
1057
- * record 0 = URI; record 1 = AAR; record 2 = BLE MAC ADDRESS / BSSID; record 3: universal link
1058
- */
1059
- function parseTapNdefMessage(messages) {
1060
- var result = {};
1061
- if (messages.length >= 1) {
1062
- var asciiUri = messages[0].payload;
1063
- result.uri = toAsciiString(asciiUri);
1064
- }
1065
- if (messages.length >= 2) {
1066
- result.aar = toAsciiString(messages[1].payload);
1067
- }
1068
- if (messages.length >= 3) {
1069
- var payload3 = messages[2].payload;
1070
- var type = payload3[0];
1071
- var content = payload3.slice(1);
1072
- result.type = type;
1073
- switch (type) {
1074
- case TapNdefProtocolType.BLE:
1075
- result.macAddress = convertBytesToBLEAddress(content);
1076
- break;
1077
- case TapNdefProtocolType.WiFi:
1078
- result.ssid = toAsciiString(content);
1079
- break;
1080
- }
1081
- }
1082
- if (messages.length >= 4) {
1083
- result.name = toAsciiString(messages[3].payload);
1084
- }
1085
- return result;
1086
- }
1087
- var TapNdefProtocolType;
1088
- (function (TapNdefProtocolType) {
1089
- TapNdefProtocolType[TapNdefProtocolType["WiFi"] = 32] = "WiFi";
1090
- TapNdefProtocolType[TapNdefProtocolType["BLE"] = 64] = "BLE";
1091
- })(TapNdefProtocolType || (TapNdefProtocolType = {}));
1092
- function convertBytesToBLEAddress(bytes) {
1093
- return bytes
1094
- .map(function (byte) {
1095
- if (byte < 0) {
1096
- byte += 256;
1097
- }
1098
- var byteString = '0' + byte.toString(16).toUpperCase();
1099
- byteString = byteString.slice(-2);
1100
- return byteString;
1101
- })
1102
- .reverse()
1103
- .join(':');
1104
- }
1102
+ /**
1103
+ * We manage only on NDEF message with 3 records:
1104
+ * record 0 = URI; record 1 = AAR; record 2 = BLE MAC ADDRESS / BSSID; record 3: universal link
1105
+ */
1106
+ function parseTapNdefMessage(messages) {
1107
+ var result = {};
1108
+ if (messages.length >= 1) {
1109
+ var asciiUri = messages[0].payload;
1110
+ result.uri = toAsciiString(asciiUri);
1111
+ }
1112
+ if (messages.length >= 2) {
1113
+ result.aar = toAsciiString(messages[1].payload);
1114
+ }
1115
+ if (messages.length >= 3) {
1116
+ var payload3 = messages[2].payload;
1117
+ var type = payload3[0];
1118
+ var content = payload3.slice(1);
1119
+ result.type = type;
1120
+ switch (type) {
1121
+ case TapNdefProtocolType.BLE:
1122
+ result.macAddress = convertBytesToBLEAddress(content);
1123
+ break;
1124
+ case TapNdefProtocolType.WiFi:
1125
+ result.ssid = toAsciiString(content);
1126
+ break;
1127
+ }
1128
+ }
1129
+ if (messages.length >= 4) {
1130
+ result.name = toAsciiString(messages[3].payload);
1131
+ }
1132
+ return result;
1133
+ }
1134
+ var TapNdefProtocolType;
1135
+ (function (TapNdefProtocolType) {
1136
+ TapNdefProtocolType[TapNdefProtocolType["WiFi"] = 32] = "WiFi";
1137
+ TapNdefProtocolType[TapNdefProtocolType["BLE"] = 64] = "BLE";
1138
+ })(TapNdefProtocolType || (TapNdefProtocolType = {}));
1139
+ function convertBytesToBLEAddress(bytes) {
1140
+ return bytes
1141
+ .map(function (byte) {
1142
+ if (byte < 0) {
1143
+ byte += 256;
1144
+ }
1145
+ var byteString = '0' + byte.toString(16).toUpperCase();
1146
+ byteString = byteString.slice(-2);
1147
+ return byteString;
1148
+ })
1149
+ .reverse()
1150
+ .join(':');
1151
+ }
1105
1152
 
1106
- /**
1107
- * Generated bundle index. Do not edit.
1108
- */
1153
+ /**
1154
+ * Generated bundle index. Do not edit.
1155
+ */
1109
1156
 
1110
- exports.NFCComProtocol = NFCComProtocol;
1111
- exports.WellKnownType = WellKnownType;
1112
- exports.encodeNDEFMessage = encodeNDEFMessage;
1113
- exports.encodeNDEFMessages = encodeNDEFMessages;
1114
- exports.parseNdefMessage = parseNdefMessage;
1115
- exports.parseNdefMessages = parseNdefMessages;
1116
- exports.parseTapNdefMessage = parseTapNdefMessage;
1157
+ exports.NFCComProtocol = NFCComProtocol;
1158
+ exports.WellKnownType = WellKnownType;
1159
+ exports.encodeNDEFMessage = encodeNDEFMessage;
1160
+ exports.encodeNDEFMessages = encodeNDEFMessages;
1161
+ exports.parseNdefMessage = parseNdefMessage;
1162
+ exports.parseNdefMessages = parseNdefMessages;
1163
+ exports.parseTapNdefMessage = parseTapNdefMessage;
1117
1164
 
1118
- Object.defineProperty(exports, '__esModule', { value: true });
1165
+ Object.defineProperty(exports, '__esModule', { value: true });
1119
1166
 
1120
1167
  }));
1121
1168
  //# sourceMappingURL=iotize-device-com-nfc.cordova.umd.js.map