@reactoo/watchtogether-sdk-js 2.7.49 → 2.7.50

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,581 @@
1
+ /*!
2
+ * @reactoo/watchtogether-sdk-js
3
+ * @version 2.7.49
4
+ */
5
+ (function webpackUniversalModuleDefinition(root, factory) {
6
+ if(typeof exports === 'object' && typeof module === 'object')
7
+ module.exports = factory();
8
+ else if(typeof define === 'function' && define.amd)
9
+ define("WatchTogetherSDK", [], factory);
10
+ else if(typeof exports === 'object')
11
+ exports["WatchTogetherSDK"] = factory();
12
+ else
13
+ root["WatchTogetherSDK"] = factory();
14
+ })(typeof self !== 'undefined' ? self : this, function() {
15
+ return /******/ (function() { // webpackBootstrap
16
+ /******/ var __webpack_modules__ = ({
17
+
18
+ /***/ "./src/modules/wt-iot-worker.worker.js?2d49":
19
+ /*!*********************************************!*\
20
+ !*** ./src/modules/wt-iot-worker.worker.js ***!
21
+ \*********************************************/
22
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
23
+
24
+ "use strict";
25
+ __webpack_require__.r(__webpack_exports__);
26
+ /* harmony import */ var aws_iot_device_sdk_v2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! aws-iot-device-sdk-v2 */ "./node_modules/aws-iot-device-sdk-v2/dist/browser.js");
27
+ /* harmony import */ var aws_iot_device_sdk_v2__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(aws_iot_device_sdk_v2__WEBPACK_IMPORTED_MODULE_0__);
28
+ /* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js");
29
+ /* harmony import */ var process__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! process */ "./node_modules/process/browser.js");
30
+ /* harmony import */ var process__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(process__WEBPACK_IMPORTED_MODULE_2__);
31
+
32
+
33
+
34
+
35
+ // Provide a global object for the worker environment
36
+ self.global = self;
37
+ self.Buffer = buffer__WEBPACK_IMPORTED_MODULE_1__.Buffer;
38
+ self.process = (process__WEBPACK_IMPORTED_MODULE_2___default());
39
+ console.log('Worker: Starting up');
40
+ let connection = null;
41
+ self.onmessage = function (event) {
42
+ const {
43
+ type,
44
+ params,
45
+ topic,
46
+ message
47
+ } = event.data;
48
+ console.log(`Worker: Received message of type: ${type}`);
49
+ switch (type) {
50
+ case 'connect':
51
+ connect(params);
52
+ break;
53
+ case 'disconnect':
54
+ disconnect();
55
+ break;
56
+ case 'is_connected':
57
+ isConnected();
58
+ break;
59
+ case 'clear_topics':
60
+ // No action needed in the worker
61
+ break;
62
+ case 'subscribe':
63
+ subscribe(topic);
64
+ break;
65
+ case 'unsubscribe':
66
+ unsubscribe(topic);
67
+ break;
68
+ case 'send':
69
+ send(topic, message);
70
+ break;
71
+ }
72
+ };
73
+ function connect(params) {
74
+ console.log('Worker: Attempting to connect');
75
+ const {
76
+ apiMqttUrl,
77
+ apiMqttClientId,
78
+ region,
79
+ accessKeyId,
80
+ secretAccessKey,
81
+ sessionToken
82
+ } = params;
83
+ const configBuilder = aws_iot_device_sdk_v2__WEBPACK_IMPORTED_MODULE_0__.iot.AwsIotMqttConnectionConfigBuilder.new_with_websockets();
84
+ configBuilder.with_clean_session(true);
85
+ configBuilder.with_client_id(apiMqttClientId);
86
+ configBuilder.with_endpoint(apiMqttUrl);
87
+ configBuilder.with_credentials(region, accessKeyId, secretAccessKey, sessionToken);
88
+ configBuilder.with_keep_alive_seconds(30);
89
+ configBuilder.with_ping_timeout_ms(3000);
90
+ configBuilder.with_reconnect_max_sec(5);
91
+ configBuilder.with_reconnect_min_sec(1);
92
+ const config = configBuilder.build();
93
+ const client = new aws_iot_device_sdk_v2__WEBPACK_IMPORTED_MODULE_0__.mqtt.MqttClient();
94
+ connection = client.new_connection(config);
95
+ setupConnectionListeners();
96
+ connection.connect().then(() => {
97
+ console.log('Worker: Connection successful');
98
+ self.postMessage({
99
+ type: 'connect_result',
100
+ success: true
101
+ });
102
+ }).catch(error => {
103
+ console.error('Worker: Connection failed', error);
104
+ self.postMessage({
105
+ type: 'connect_result',
106
+ success: false,
107
+ error: error.message
108
+ });
109
+ });
110
+ }
111
+ function disconnect() {
112
+ if (connection) {
113
+ connection.disconnect().then(() => {
114
+ self.postMessage({
115
+ type: 'disconnect_result',
116
+ success: true
117
+ });
118
+ }).catch(error => {
119
+ self.postMessage({
120
+ type: 'disconnect_result',
121
+ success: false,
122
+ error: error.message
123
+ });
124
+ });
125
+ } else {
126
+ self.postMessage({
127
+ type: 'disconnect_result',
128
+ success: true
129
+ });
130
+ }
131
+ }
132
+ function isConnected() {
133
+ const connected = connection && connection.currentState === 0 && connection.desiredState === 0;
134
+ self.postMessage({
135
+ type: 'is_connected_result',
136
+ connected
137
+ });
138
+ }
139
+ function subscribe(topic) {
140
+ if (connection && connection.currentState === 0 && connection.desiredState === 0) {
141
+ connection.subscribe(topic, aws_iot_device_sdk_v2__WEBPACK_IMPORTED_MODULE_0__.mqtt.QoS.AtLeastOnce).then(() => {
142
+ self.postMessage({
143
+ type: 'subscribe_result',
144
+ success: true
145
+ });
146
+ }).catch(error => {
147
+ self.postMessage({
148
+ type: 'subscribe_result',
149
+ success: false,
150
+ error: error.message
151
+ });
152
+ });
153
+ } else {
154
+ self.postMessage({
155
+ type: 'subscribe_result',
156
+ success: false,
157
+ error: 'Not connected'
158
+ });
159
+ }
160
+ }
161
+ function unsubscribe(topic) {
162
+ if (connection && connection.currentState === 0 && connection.desiredState === 0) {
163
+ connection.unsubscribe(topic).then(() => {
164
+ self.postMessage({
165
+ type: 'unsubscribe_result',
166
+ success: true
167
+ });
168
+ }).catch(error => {
169
+ self.postMessage({
170
+ type: 'unsubscribe_result',
171
+ success: false,
172
+ error: error.message
173
+ });
174
+ });
175
+ } else {
176
+ self.postMessage({
177
+ type: 'unsubscribe_result',
178
+ success: false,
179
+ error: 'Not connected'
180
+ });
181
+ }
182
+ }
183
+ function send(topic, message) {
184
+ if (connection && connection.currentState === 0 && connection.desiredState === 0) {
185
+ connection.publish(topic, message, aws_iot_device_sdk_v2__WEBPACK_IMPORTED_MODULE_0__.mqtt.QoS.AtLeastOnce, false);
186
+ } else {
187
+ console.error('Cannot send message: Not connected');
188
+ }
189
+ }
190
+ function setupConnectionListeners() {
191
+ connection.on('connect', () => {
192
+ self.postMessage({
193
+ type: 'connect'
194
+ });
195
+ });
196
+ connection.on('disconnect', () => {
197
+ self.postMessage({
198
+ type: 'disconnect'
199
+ });
200
+ });
201
+ connection.on('error', error => {
202
+ self.postMessage({
203
+ type: 'error',
204
+ data: error
205
+ });
206
+ });
207
+ connection.on('interrupt', error => {
208
+ self.postMessage({
209
+ type: 'interrupt',
210
+ data: error
211
+ });
212
+ });
213
+ connection.on('resume', error => {
214
+ self.postMessage({
215
+ type: 'resume',
216
+ data: error
217
+ });
218
+ });
219
+ connection.on('message', (topic, payload) => {
220
+ self.postMessage({
221
+ type: 'message',
222
+ data: {
223
+ topic,
224
+ payload
225
+ }
226
+ });
227
+ });
228
+ connection.on('connection_success', error => {
229
+ self.postMessage({
230
+ type: 'connection_success',
231
+ data: error
232
+ });
233
+ });
234
+ connection.on('connection_failure', error => {
235
+ self.postMessage({
236
+ type: 'connection_failure',
237
+ data: error
238
+ });
239
+ });
240
+
241
+ // Add a general error handler for uncaught exceptions
242
+ self.addEventListener('error', error => {
243
+ console.error('Worker: Uncaught error', error);
244
+ self.postMessage({
245
+ type: 'uncaught_error',
246
+ error: error.message
247
+ });
248
+ });
249
+ }
250
+
251
+ // Add this at the end of the file
252
+ console.log('Worker: Setup complete');
253
+
254
+ /***/ }),
255
+
256
+ /***/ "?1610":
257
+ /*!*********************!*\
258
+ !*** net (ignored) ***!
259
+ \*********************/
260
+ /***/ (function() {
261
+
262
+ /* (ignored) */
263
+
264
+ /***/ }),
265
+
266
+ /***/ "?bb9b":
267
+ /*!*********************!*\
268
+ !*** tls (ignored) ***!
269
+ \*********************/
270
+ /***/ (function() {
271
+
272
+ /* (ignored) */
273
+
274
+ /***/ }),
275
+
276
+ /***/ "?91a4":
277
+ /*!**********************!*\
278
+ !*** util (ignored) ***!
279
+ \**********************/
280
+ /***/ (function() {
281
+
282
+ /* (ignored) */
283
+
284
+ /***/ }),
285
+
286
+ /***/ "?9bd2":
287
+ /*!**********************!*\
288
+ !*** util (ignored) ***!
289
+ \**********************/
290
+ /***/ (function() {
291
+
292
+ /* (ignored) */
293
+
294
+ /***/ }),
295
+
296
+ /***/ "?a3fc":
297
+ /*!**********************!*\
298
+ !*** util (ignored) ***!
299
+ \**********************/
300
+ /***/ (function() {
301
+
302
+ /* (ignored) */
303
+
304
+ /***/ }),
305
+
306
+ /***/ "?c28c":
307
+ /*!**********************!*\
308
+ !*** util (ignored) ***!
309
+ \**********************/
310
+ /***/ (function() {
311
+
312
+ /* (ignored) */
313
+
314
+ /***/ }),
315
+
316
+ /***/ "?9157":
317
+ /*!************************!*\
318
+ !*** crypto (ignored) ***!
319
+ \************************/
320
+ /***/ (function() {
321
+
322
+ /* (ignored) */
323
+
324
+ /***/ }),
325
+
326
+ /***/ "?4f7e":
327
+ /*!********************************!*\
328
+ !*** ./util.inspect (ignored) ***!
329
+ \********************************/
330
+ /***/ (function() {
331
+
332
+ /* (ignored) */
333
+
334
+ /***/ }),
335
+
336
+ /***/ "?ed1b":
337
+ /*!**********************!*\
338
+ !*** util (ignored) ***!
339
+ \**********************/
340
+ /***/ (function() {
341
+
342
+ /* (ignored) */
343
+
344
+ /***/ }),
345
+
346
+ /***/ "?d17e":
347
+ /*!**********************!*\
348
+ !*** util (ignored) ***!
349
+ \**********************/
350
+ /***/ (function() {
351
+
352
+ /* (ignored) */
353
+
354
+ /***/ })
355
+
356
+ /******/ });
357
+ /************************************************************************/
358
+ /******/ // The module cache
359
+ /******/ var __webpack_module_cache__ = {};
360
+ /******/
361
+ /******/ // The require function
362
+ /******/ function __webpack_require__(moduleId) {
363
+ /******/ // Check if module is in cache
364
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
365
+ /******/ if (cachedModule !== undefined) {
366
+ /******/ return cachedModule.exports;
367
+ /******/ }
368
+ /******/ // Create a new module (and put it into the cache)
369
+ /******/ var module = __webpack_module_cache__[moduleId] = {
370
+ /******/ id: moduleId,
371
+ /******/ loaded: false,
372
+ /******/ exports: {}
373
+ /******/ };
374
+ /******/
375
+ /******/ // Execute the module function
376
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
377
+ /******/
378
+ /******/ // Flag the module as loaded
379
+ /******/ module.loaded = true;
380
+ /******/
381
+ /******/ // Return the exports of the module
382
+ /******/ return module.exports;
383
+ /******/ }
384
+ /******/
385
+ /******/ // expose the modules object (__webpack_modules__)
386
+ /******/ __webpack_require__.m = __webpack_modules__;
387
+ /******/
388
+ /******/ // the startup function
389
+ /******/ __webpack_require__.x = function() {
390
+ /******/ // Load entry module and return exports
391
+ /******/ // This entry module depends on other loaded chunks and execution need to be delayed
392
+ /******/ var __webpack_exports__ = __webpack_require__.O(undefined, [0], function() { return __webpack_require__("./src/modules/wt-iot-worker.worker.js?2d49"); })
393
+ /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
394
+ /******/ return __webpack_exports__;
395
+ /******/ };
396
+ /******/
397
+ /************************************************************************/
398
+ /******/ /* webpack/runtime/chunk loaded */
399
+ /******/ !function() {
400
+ /******/ var deferred = [];
401
+ /******/ __webpack_require__.O = function(result, chunkIds, fn, priority) {
402
+ /******/ if(chunkIds) {
403
+ /******/ priority = priority || 0;
404
+ /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
405
+ /******/ deferred[i] = [chunkIds, fn, priority];
406
+ /******/ return;
407
+ /******/ }
408
+ /******/ var notFulfilled = Infinity;
409
+ /******/ for (var i = 0; i < deferred.length; i++) {
410
+ /******/ var chunkIds = deferred[i][0];
411
+ /******/ var fn = deferred[i][1];
412
+ /******/ var priority = deferred[i][2];
413
+ /******/ var fulfilled = true;
414
+ /******/ for (var j = 0; j < chunkIds.length; j++) {
415
+ /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {
416
+ /******/ chunkIds.splice(j--, 1);
417
+ /******/ } else {
418
+ /******/ fulfilled = false;
419
+ /******/ if(priority < notFulfilled) notFulfilled = priority;
420
+ /******/ }
421
+ /******/ }
422
+ /******/ if(fulfilled) {
423
+ /******/ deferred.splice(i--, 1)
424
+ /******/ var r = fn();
425
+ /******/ if (r !== undefined) result = r;
426
+ /******/ }
427
+ /******/ }
428
+ /******/ return result;
429
+ /******/ };
430
+ /******/ }();
431
+ /******/
432
+ /******/ /* webpack/runtime/compat get default export */
433
+ /******/ !function() {
434
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
435
+ /******/ __webpack_require__.n = function(module) {
436
+ /******/ var getter = module && module.__esModule ?
437
+ /******/ function() { return module['default']; } :
438
+ /******/ function() { return module; };
439
+ /******/ __webpack_require__.d(getter, { a: getter });
440
+ /******/ return getter;
441
+ /******/ };
442
+ /******/ }();
443
+ /******/
444
+ /******/ /* webpack/runtime/define property getters */
445
+ /******/ !function() {
446
+ /******/ // define getter functions for harmony exports
447
+ /******/ __webpack_require__.d = function(exports, definition) {
448
+ /******/ for(var key in definition) {
449
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
450
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
451
+ /******/ }
452
+ /******/ }
453
+ /******/ };
454
+ /******/ }();
455
+ /******/
456
+ /******/ /* webpack/runtime/ensure chunk */
457
+ /******/ !function() {
458
+ /******/ __webpack_require__.f = {};
459
+ /******/ // This file contains only the entry chunk.
460
+ /******/ // The chunk loading function for additional chunks
461
+ /******/ __webpack_require__.e = function(chunkId) {
462
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {
463
+ /******/ __webpack_require__.f[key](chunkId, promises);
464
+ /******/ return promises;
465
+ /******/ }, []));
466
+ /******/ };
467
+ /******/ }();
468
+ /******/
469
+ /******/ /* webpack/runtime/get javascript chunk filename */
470
+ /******/ !function() {
471
+ /******/ // This function allow to reference async chunks and sibling chunks for the entrypoint
472
+ /******/ __webpack_require__.u = function(chunkId) {
473
+ /******/ // return url for filenames based on template
474
+ /******/ return "" + chunkId + ".watchtogether-sdk.js";
475
+ /******/ };
476
+ /******/ }();
477
+ /******/
478
+ /******/ /* webpack/runtime/global */
479
+ /******/ !function() {
480
+ /******/ __webpack_require__.g = (function() {
481
+ /******/ if (typeof globalThis === 'object') return globalThis;
482
+ /******/ try {
483
+ /******/ return this || new Function('return this')();
484
+ /******/ } catch (e) {
485
+ /******/ if (typeof window === 'object') return window;
486
+ /******/ }
487
+ /******/ })();
488
+ /******/ }();
489
+ /******/
490
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
491
+ /******/ !function() {
492
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
493
+ /******/ }();
494
+ /******/
495
+ /******/ /* webpack/runtime/make namespace object */
496
+ /******/ !function() {
497
+ /******/ // define __esModule on exports
498
+ /******/ __webpack_require__.r = function(exports) {
499
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
500
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
501
+ /******/ }
502
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
503
+ /******/ };
504
+ /******/ }();
505
+ /******/
506
+ /******/ /* webpack/runtime/node module decorator */
507
+ /******/ !function() {
508
+ /******/ __webpack_require__.nmd = function(module) {
509
+ /******/ module.paths = [];
510
+ /******/ if (!module.children) module.children = [];
511
+ /******/ return module;
512
+ /******/ };
513
+ /******/ }();
514
+ /******/
515
+ /******/ /* webpack/runtime/publicPath */
516
+ /******/ !function() {
517
+ /******/ __webpack_require__.p = "";
518
+ /******/ }();
519
+ /******/
520
+ /******/ /* webpack/runtime/importScripts chunk loading */
521
+ /******/ !function() {
522
+ /******/ // no baseURI
523
+ /******/
524
+ /******/ // object to store loaded chunks
525
+ /******/ // "1" means "already loaded"
526
+ /******/ var installedChunks = {
527
+ /******/ "src_modules_wt-iot-worker_worker_js": 1
528
+ /******/ };
529
+ /******/
530
+ /******/ // importScripts chunk loading
531
+ /******/ var installChunk = function(data) {
532
+ /******/ var chunkIds = data[0];
533
+ /******/ var moreModules = data[1];
534
+ /******/ var runtime = data[2];
535
+ /******/ for(var moduleId in moreModules) {
536
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
537
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
538
+ /******/ }
539
+ /******/ }
540
+ /******/ if(runtime) runtime(__webpack_require__);
541
+ /******/ while(chunkIds.length)
542
+ /******/ installedChunks[chunkIds.pop()] = 1;
543
+ /******/ parentChunkLoadingFunction(data);
544
+ /******/ };
545
+ /******/ __webpack_require__.f.i = function(chunkId, promises) {
546
+ /******/ // "1" is the signal for "already loaded"
547
+ /******/ if(!installedChunks[chunkId]) {
548
+ /******/ if(true) { // all chunks have JS
549
+ /******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
550
+ /******/ }
551
+ /******/ }
552
+ /******/ };
553
+ /******/
554
+ /******/ var chunkLoadingGlobal = Object(typeof self !== 'undefined' ? self : this)["webpackChunkWatchTogetherSDK"] = Object(typeof self !== 'undefined' ? self : this)["webpackChunkWatchTogetherSDK"] || [];
555
+ /******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
556
+ /******/ chunkLoadingGlobal.push = installChunk;
557
+ /******/
558
+ /******/ // no HMR
559
+ /******/
560
+ /******/ // no HMR manifest
561
+ /******/ }();
562
+ /******/
563
+ /******/ /* webpack/runtime/startup chunk dependencies */
564
+ /******/ !function() {
565
+ /******/ var next = __webpack_require__.x;
566
+ /******/ __webpack_require__.x = function() {
567
+ /******/ return __webpack_require__.e(0).then(next);
568
+ /******/ };
569
+ /******/ }();
570
+ /******/
571
+ /************************************************************************/
572
+ /******/
573
+ /******/ // run startup
574
+ /******/ var __webpack_exports__ = __webpack_require__.x();
575
+ /******/ __webpack_exports__ = __webpack_exports__["default"];
576
+ /******/
577
+ /******/ return __webpack_exports__;
578
+ /******/ })()
579
+ ;
580
+ });
581
+ //# sourceMappingURL=src_modules_wt-iot-worker_worker_js.watchtogether-sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src_modules_wt-iot-worker_worker_js.watchtogether-sdk.js","mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;;;;ACVkD;AAClB;AACF;;AAE9B;AACAI,IAAI,CAACC,MAAM,GAAGD,IAAI;AAClBA,IAAI,CAACF,MAAM,GAAGA,0CAAM;AACpBE,IAAI,CAACD,OAAO,GAAGA,gDAAO;AAEtBG,OAAO,CAACC,GAAG,CAAC,qBAAqB,CAAC;AAElC,IAAIC,UAAU,GAAG,IAAI;AAErBJ,IAAI,CAACK,SAAS,GAAG,UAASC,KAAK,EAAE;EAC7B,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC,KAAK;IAAEC;EAAQ,CAAC,GAAGJ,KAAK,CAACK,IAAI;EACnDT,OAAO,CAACC,GAAG,CAAC,qCAAqCI,IAAI,EAAE,CAAC;EAExD,QAAQA,IAAI;IACR,KAAK,SAAS;MACVK,OAAO,CAACJ,MAAM,CAAC;MACf;IACJ,KAAK,YAAY;MACbK,UAAU,CAAC,CAAC;MACZ;IACJ,KAAK,cAAc;MACfC,WAAW,CAAC,CAAC;MACb;IACJ,KAAK,cAAc;MACf;MACA;IACJ,KAAK,WAAW;MACZC,SAAS,CAACN,KAAK,CAAC;MAChB;IACJ,KAAK,aAAa;MACdO,WAAW,CAACP,KAAK,CAAC;MAClB;IACJ,KAAK,MA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A;UACA;;;;;WCrCA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA;WACA;WACA,kBAAkB,qBAAqB;WACvC,oHAAoH,iDAAiD;WACrK;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC7BA;WACA;WACA;WACA,eAAe,4BAA4B;WAC3C,eAAe;WACf,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,EAAE;WACF;;;;;WCRA;WACA;WACA;WACA;WACA;;;;;WCJA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;;;;;WCJA;;;;;WCAA;;WAEA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,aAAa;WACb;WACA;WACA;WACA;;WAEA;WACA;WACA;;WAEA;;WAEA;;;;;WCtCA;WACA;WACA;WACA;;;;;UEHA;UACA","sources":["webpack://WatchTogetherSDK/webpack/universalModuleDefinition","webpack://WatchTogetherSDK/./src/modules/wt-iot-worker.worker.js","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/aws-crt/node_modules/mqtt/lib/connect|net","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/aws-crt/node_modules/mqtt/lib/connect|tls","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/aws-crt/node_modules/readable-stream/lib/internal/streams|util","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/aws-crt/node_modules/readable-stream/lib|util","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/bl/node_modules/readable-stream/lib/internal/streams|util","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/bl/node_modules/readable-stream/lib|util","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/crypto-js|crypto","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/object-inspect|./util.inspect","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/readable-stream/lib/internal/streams|util","webpack://WatchTogetherSDK/ignored|/Users/romanlabis/Projects/WR-SDK/node_modules/readable-stream/lib|util","webpack://WatchTogetherSDK/webpack/bootstrap","webpack://WatchTogetherSDK/webpack/runtime/chunk loaded","webpack://WatchTogetherSDK/webpack/runtime/compat get default export","webpack://WatchTogetherSDK/webpack/runtime/define property getters","webpack://WatchTogetherSDK/webpack/runtime/ensure chunk","webpack://WatchTogetherSDK/webpack/runtime/get javascript chunk filename","webpack://WatchTogetherSDK/webpack/runtime/global","webpack://WatchTogetherSDK/webpack/runtime/hasOwnProperty shorthand","webpack://WatchTogetherSDK/webpack/runtime/make namespace object","webpack://WatchTogetherSDK/webpack/runtime/node module decorator","webpack://WatchTogetherSDK/webpack/runtime/publicPath","webpack://WatchTogetherSDK/webpack/runtime/importScripts chunk loading","webpack://WatchTogetherSDK/webpack/runtime/startup chunk dependencies","webpack://WatchTogetherSDK/webpack/before-startup","webpack://WatchTogetherSDK/webpack/startup","webpack://WatchTogetherSDK/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"WatchTogetherSDK\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"WatchTogetherSDK\"] = factory();\n\telse\n\t\troot[\"WatchTogetherSDK\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn ","import { mqtt, iot } from 'aws-iot-device-sdk-v2';\nimport { Buffer } from 'buffer';\nimport process from 'process';\n\n// Provide a global object for the worker environment\nself.global = self;\nself.Buffer = Buffer;\nself.process = process;\n\nconsole.log('Worker: Starting up');\n\nlet connection = null;\n\nself.onmessage = function(event) {\n const { type, params, topic, message } = event.data;\n console.log(`Worker: Received message of type: ${type}`);\n\n switch (type) {\n case 'connect':\n connect(params);\n break;\n case 'disconnect':\n disconnect();\n break;\n case 'is_connected':\n isConnected();\n break;\n case 'clear_topics':\n // No action needed in the worker\n break;\n case 'subscribe':\n subscribe(topic);\n break;\n case 'unsubscribe':\n unsubscribe(topic);\n break;\n case 'send':\n send(topic, message);\n break;\n }\n};\n\nfunction connect(params) {\n console.log('Worker: Attempting to connect');\n const { apiMqttUrl, apiMqttClientId, region, accessKeyId, secretAccessKey, sessionToken } = params;\n\n const configBuilder = iot.AwsIotMqttConnectionConfigBuilder.new_with_websockets();\n\n configBuilder.with_clean_session(true);\n configBuilder.with_client_id(apiMqttClientId);\n configBuilder.with_endpoint(apiMqttUrl);\n configBuilder.with_credentials(region, accessKeyId, secretAccessKey, sessionToken);\n configBuilder.with_keep_alive_seconds(30);\n configBuilder.with_ping_timeout_ms(3000);\n configBuilder.with_reconnect_max_sec(5);\n configBuilder.with_reconnect_min_sec(1);\n\n const config = configBuilder.build();\n\n const client = new mqtt.MqttClient();\n connection = client.new_connection(config);\n\n setupConnectionListeners();\n\n connection.connect()\n .then(() => {\n console.log('Worker: Connection successful');\n self.postMessage({ type: 'connect_result', success: true });\n })\n .catch((error) => {\n console.error('Worker: Connection failed', error);\n self.postMessage({ type: 'connect_result', success: false, error: error.message });\n });\n}\n\nfunction disconnect() {\n if (connection) {\n connection.disconnect()\n .then(() => {\n self.postMessage({ type: 'disconnect_result', success: true });\n })\n .catch((error) => {\n self.postMessage({ type: 'disconnect_result', success: false, error: error.message });\n });\n } else {\n self.postMessage({ type: 'disconnect_result', success: true });\n }\n}\n\nfunction isConnected() {\n const connected = connection && connection.currentState === 0 && connection.desiredState === 0;\n self.postMessage({ type: 'is_connected_result', connected });\n}\n\nfunction subscribe(topic) {\n if (connection && connection.currentState === 0 && connection.desiredState === 0) {\n connection.subscribe(topic, mqtt.QoS.AtLeastOnce)\n .then(() => {\n self.postMessage({ type: 'subscribe_result', success: true });\n })\n .catch((error) => {\n self.postMessage({ type: 'subscribe_result', success: false, error: error.message });\n });\n } else {\n self.postMessage({ type: 'subscribe_result', success: false, error: 'Not connected' });\n }\n}\n\nfunction unsubscribe(topic) {\n if (connection && connection.currentState === 0 && connection.desiredState === 0) {\n connection.unsubscribe(topic)\n .then(() => {\n self.postMessage({ type: 'unsubscribe_result', success: true });\n })\n .catch((error) => {\n self.postMessage({ type: 'unsubscribe_result', success: false, error: error.message });\n });\n } else {\n self.postMessage({ type: 'unsubscribe_result', success: false, error: 'Not connected' });\n }\n}\n\nfunction send(topic, message) {\n if (connection && connection.currentState === 0 && connection.desiredState === 0) {\n connection.publish(topic, message, mqtt.QoS.AtLeastOnce, false);\n } else {\n console.error('Cannot send message: Not connected');\n }\n}\n\nfunction setupConnectionListeners() {\n connection.on('connect', () => {\n self.postMessage({ type: 'connect' });\n });\n\n connection.on('disconnect', () => {\n self.postMessage({ type: 'disconnect' });\n });\n\n connection.on('error', (error) => {\n self.postMessage({ type: 'error', data: error });\n });\n\n connection.on('interrupt', (error) => {\n self.postMessage({ type: 'interrupt', data: error });\n });\n\n connection.on('resume', (error) => {\n self.postMessage({ type: 'resume', data: error });\n });\n\n connection.on('message', (topic, payload) => {\n self.postMessage({ type: 'message', data: { topic, payload } });\n });\n\n connection.on('connection_success', (error) => {\n self.postMessage({ type: 'connection_success', data: error });\n });\n\n connection.on('connection_failure', (error) => {\n self.postMessage({ type: 'connection_failure', data: error });\n });\n\n // Add a general error handler for uncaught exceptions\n self.addEventListener('error', (error) => {\n console.error('Worker: Uncaught error', error);\n self.postMessage({ type: 'uncaught_error', error: error.message });\n });\n}\n\n// Add this at the end of the file\nconsole.log('Worker: Setup complete');\n","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = function() {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [0], function() { return __webpack_require__(\"./src/modules/wt-iot-worker.worker.js?2d49\"); })\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".watchtogether-sdk.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"\";","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t\"src_modules_wt-iot-worker_worker_js\": 1\n};\n\n// importScripts chunk loading\nvar installChunk = function(data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = function(chunkId, promises) {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = Object(typeof self !== 'undefined' ? self : this)[\"webpackChunkWatchTogetherSDK\"] = Object(typeof self !== 'undefined' ? self : this)[\"webpackChunkWatchTogetherSDK\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","var next = __webpack_require__.x;\n__webpack_require__.x = function() {\n\treturn __webpack_require__.e(0).then(next);\n};","","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n",""],"names":["mqtt","iot","Buffer","process","self","global","console","log","connection","onmessage","event","type","params","topic","message","data","connect","disconnect","isConnected","subscribe","unsubscribe","send","apiMqttUrl","apiMqttClientId","region","accessKeyId","secretAccessKey","sessionToken","configBuilder","AwsIotMqttConnectionConfigBuilder","new_with_websockets","with_clean_session","with_client_id","with_endpoint","with_credentials","with_keep_alive_seconds","with_ping_timeout_ms","with_reconnect_max_sec","with_reconnect_min_sec","config","build","client","MqttClient","new_connection","setupConnectionListeners","then","postMessage","success","catch","error","connected","currentState","desiredState","QoS","AtLeastOnce","publish","on","payload","addEventListener"],"sourceRoot":""}