@cuekit-ai/react 1.3.2 → 1.3.4

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.
package/dist/index.mjs CHANGED
@@ -1,25 +1,26 @@
1
1
  import {
2
- Participant,
2
+ ConnectionState,
3
+ GlobalStore,
3
4
  ParticipantEvent,
4
5
  RoomEvent,
5
6
  Track,
6
- createAudioAnalyser
7
- } from "./chunk-H44FBEX3.mjs";
8
- import {
9
- GlobalStore,
10
7
  WEBRTC_BACKEND_SERVER_URL,
8
+ __commonJS,
9
+ __export,
10
+ __require,
11
+ __toESM,
11
12
  _apiKey,
12
13
  _appId,
13
14
  authenticate,
14
15
  captureFullDOMStructure,
15
16
  connectToRoom,
17
+ createAudioAnalyser,
16
18
  disconnectFromRoom,
17
19
  executeAction,
18
20
  getFullDOMStructure,
19
21
  getParticipants,
20
22
  getRoom,
21
23
  getRoomName,
22
- isConnected,
23
24
  onStateChange,
24
25
  sendData,
25
26
  sendRuntimeData,
@@ -33,12 +34,7 @@ import {
33
34
  setServerUrl,
34
35
  setWebRTCCallbacks,
35
36
  setWebRTCConfig
36
- } from "./chunk-Y2Q57RZJ.mjs";
37
- import {
38
- __commonJS,
39
- __export,
40
- __toESM
41
- } from "./chunk-R7POPVJR.mjs";
37
+ } from "./chunk-ZGHSIEXZ.mjs";
42
38
 
43
39
  // node_modules/inline-style-parser/index.js
44
40
  var require_inline_style_parser = __commonJS({
@@ -370,6 +366,802 @@ var require_extend = __commonJS({
370
366
  }
371
367
  });
372
368
 
369
+ // (disabled):crypto
370
+ var require_crypto = __commonJS({
371
+ "(disabled):crypto"() {
372
+ "use strict";
373
+ }
374
+ });
375
+
376
+ // node_modules/crypto-js/core.js
377
+ var require_core = __commonJS({
378
+ "node_modules/crypto-js/core.js"(exports, module) {
379
+ "use strict";
380
+ (function(root4, factory) {
381
+ if (typeof exports === "object") {
382
+ module.exports = exports = factory();
383
+ } else if (typeof define === "function" && define.amd) {
384
+ define([], factory);
385
+ } else {
386
+ root4.CryptoJS = factory();
387
+ }
388
+ })(exports, function() {
389
+ var CryptoJS = CryptoJS || function(Math2, undefined2) {
390
+ var crypto;
391
+ if (typeof window !== "undefined" && window.crypto) {
392
+ crypto = window.crypto;
393
+ }
394
+ if (typeof self !== "undefined" && self.crypto) {
395
+ crypto = self.crypto;
396
+ }
397
+ if (typeof globalThis !== "undefined" && globalThis.crypto) {
398
+ crypto = globalThis.crypto;
399
+ }
400
+ if (!crypto && typeof window !== "undefined" && window.msCrypto) {
401
+ crypto = window.msCrypto;
402
+ }
403
+ if (!crypto && typeof global !== "undefined" && global.crypto) {
404
+ crypto = global.crypto;
405
+ }
406
+ if (!crypto && typeof __require === "function") {
407
+ try {
408
+ crypto = require_crypto();
409
+ } catch (err) {
410
+ }
411
+ }
412
+ var cryptoSecureRandomInt = function() {
413
+ if (crypto) {
414
+ if (typeof crypto.getRandomValues === "function") {
415
+ try {
416
+ return crypto.getRandomValues(new Uint32Array(1))[0];
417
+ } catch (err) {
418
+ }
419
+ }
420
+ if (typeof crypto.randomBytes === "function") {
421
+ try {
422
+ return crypto.randomBytes(4).readInt32LE();
423
+ } catch (err) {
424
+ }
425
+ }
426
+ }
427
+ throw new Error("Native crypto module could not be used to get secure random number.");
428
+ };
429
+ var create2 = Object.create || /* @__PURE__ */ function() {
430
+ function F2() {
431
+ }
432
+ return function(obj) {
433
+ var subtype;
434
+ F2.prototype = obj;
435
+ subtype = new F2();
436
+ F2.prototype = null;
437
+ return subtype;
438
+ };
439
+ }();
440
+ var C = {};
441
+ var C_lib = C.lib = {};
442
+ var Base = C_lib.Base = /* @__PURE__ */ function() {
443
+ return {
444
+ /**
445
+ * Creates a new object that inherits from this object.
446
+ *
447
+ * @param {Object} overrides Properties to copy into the new object.
448
+ *
449
+ * @return {Object} The new object.
450
+ *
451
+ * @static
452
+ *
453
+ * @example
454
+ *
455
+ * var MyType = CryptoJS.lib.Base.extend({
456
+ * field: 'value',
457
+ *
458
+ * method: function () {
459
+ * }
460
+ * });
461
+ */
462
+ extend: function(overrides) {
463
+ var subtype = create2(this);
464
+ if (overrides) {
465
+ subtype.mixIn(overrides);
466
+ }
467
+ if (!subtype.hasOwnProperty("init") || this.init === subtype.init) {
468
+ subtype.init = function() {
469
+ subtype.$super.init.apply(this, arguments);
470
+ };
471
+ }
472
+ subtype.init.prototype = subtype;
473
+ subtype.$super = this;
474
+ return subtype;
475
+ },
476
+ /**
477
+ * Extends this object and runs the init method.
478
+ * Arguments to create() will be passed to init().
479
+ *
480
+ * @return {Object} The new object.
481
+ *
482
+ * @static
483
+ *
484
+ * @example
485
+ *
486
+ * var instance = MyType.create();
487
+ */
488
+ create: function() {
489
+ var instance = this.extend();
490
+ instance.init.apply(instance, arguments);
491
+ return instance;
492
+ },
493
+ /**
494
+ * Initializes a newly created object.
495
+ * Override this method to add some logic when your objects are created.
496
+ *
497
+ * @example
498
+ *
499
+ * var MyType = CryptoJS.lib.Base.extend({
500
+ * init: function () {
501
+ * // ...
502
+ * }
503
+ * });
504
+ */
505
+ init: function() {
506
+ },
507
+ /**
508
+ * Copies properties into this object.
509
+ *
510
+ * @param {Object} properties The properties to mix in.
511
+ *
512
+ * @example
513
+ *
514
+ * MyType.mixIn({
515
+ * field: 'value'
516
+ * });
517
+ */
518
+ mixIn: function(properties) {
519
+ for (var propertyName in properties) {
520
+ if (properties.hasOwnProperty(propertyName)) {
521
+ this[propertyName] = properties[propertyName];
522
+ }
523
+ }
524
+ if (properties.hasOwnProperty("toString")) {
525
+ this.toString = properties.toString;
526
+ }
527
+ },
528
+ /**
529
+ * Creates a copy of this object.
530
+ *
531
+ * @return {Object} The clone.
532
+ *
533
+ * @example
534
+ *
535
+ * var clone = instance.clone();
536
+ */
537
+ clone: function() {
538
+ return this.init.prototype.extend(this);
539
+ }
540
+ };
541
+ }();
542
+ var WordArray = C_lib.WordArray = Base.extend({
543
+ /**
544
+ * Initializes a newly created word array.
545
+ *
546
+ * @param {Array} words (Optional) An array of 32-bit words.
547
+ * @param {number} sigBytes (Optional) The number of significant bytes in the words.
548
+ *
549
+ * @example
550
+ *
551
+ * var wordArray = CryptoJS.lib.WordArray.create();
552
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
553
+ * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
554
+ */
555
+ init: function(words, sigBytes) {
556
+ words = this.words = words || [];
557
+ if (sigBytes != undefined2) {
558
+ this.sigBytes = sigBytes;
559
+ } else {
560
+ this.sigBytes = words.length * 4;
561
+ }
562
+ },
563
+ /**
564
+ * Converts this word array to a string.
565
+ *
566
+ * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
567
+ *
568
+ * @return {string} The stringified word array.
569
+ *
570
+ * @example
571
+ *
572
+ * var string = wordArray + '';
573
+ * var string = wordArray.toString();
574
+ * var string = wordArray.toString(CryptoJS.enc.Utf8);
575
+ */
576
+ toString: function(encoder) {
577
+ return (encoder || Hex).stringify(this);
578
+ },
579
+ /**
580
+ * Concatenates a word array to this word array.
581
+ *
582
+ * @param {WordArray} wordArray The word array to append.
583
+ *
584
+ * @return {WordArray} This word array.
585
+ *
586
+ * @example
587
+ *
588
+ * wordArray1.concat(wordArray2);
589
+ */
590
+ concat: function(wordArray) {
591
+ var thisWords = this.words;
592
+ var thatWords = wordArray.words;
593
+ var thisSigBytes = this.sigBytes;
594
+ var thatSigBytes = wordArray.sigBytes;
595
+ this.clamp();
596
+ if (thisSigBytes % 4) {
597
+ for (var i2 = 0; i2 < thatSigBytes; i2++) {
598
+ var thatByte = thatWords[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255;
599
+ thisWords[thisSigBytes + i2 >>> 2] |= thatByte << 24 - (thisSigBytes + i2) % 4 * 8;
600
+ }
601
+ } else {
602
+ for (var j2 = 0; j2 < thatSigBytes; j2 += 4) {
603
+ thisWords[thisSigBytes + j2 >>> 2] = thatWords[j2 >>> 2];
604
+ }
605
+ }
606
+ this.sigBytes += thatSigBytes;
607
+ return this;
608
+ },
609
+ /**
610
+ * Removes insignificant bits.
611
+ *
612
+ * @example
613
+ *
614
+ * wordArray.clamp();
615
+ */
616
+ clamp: function() {
617
+ var words = this.words;
618
+ var sigBytes = this.sigBytes;
619
+ words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8;
620
+ words.length = Math2.ceil(sigBytes / 4);
621
+ },
622
+ /**
623
+ * Creates a copy of this word array.
624
+ *
625
+ * @return {WordArray} The clone.
626
+ *
627
+ * @example
628
+ *
629
+ * var clone = wordArray.clone();
630
+ */
631
+ clone: function() {
632
+ var clone = Base.clone.call(this);
633
+ clone.words = this.words.slice(0);
634
+ return clone;
635
+ },
636
+ /**
637
+ * Creates a word array filled with random bytes.
638
+ *
639
+ * @param {number} nBytes The number of random bytes to generate.
640
+ *
641
+ * @return {WordArray} The random word array.
642
+ *
643
+ * @static
644
+ *
645
+ * @example
646
+ *
647
+ * var wordArray = CryptoJS.lib.WordArray.random(16);
648
+ */
649
+ random: function(nBytes) {
650
+ var words = [];
651
+ for (var i2 = 0; i2 < nBytes; i2 += 4) {
652
+ words.push(cryptoSecureRandomInt());
653
+ }
654
+ return new WordArray.init(words, nBytes);
655
+ }
656
+ });
657
+ var C_enc = C.enc = {};
658
+ var Hex = C_enc.Hex = {
659
+ /**
660
+ * Converts a word array to a hex string.
661
+ *
662
+ * @param {WordArray} wordArray The word array.
663
+ *
664
+ * @return {string} The hex string.
665
+ *
666
+ * @static
667
+ *
668
+ * @example
669
+ *
670
+ * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
671
+ */
672
+ stringify: function(wordArray) {
673
+ var words = wordArray.words;
674
+ var sigBytes = wordArray.sigBytes;
675
+ var hexChars = [];
676
+ for (var i2 = 0; i2 < sigBytes; i2++) {
677
+ var bite = words[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255;
678
+ hexChars.push((bite >>> 4).toString(16));
679
+ hexChars.push((bite & 15).toString(16));
680
+ }
681
+ return hexChars.join("");
682
+ },
683
+ /**
684
+ * Converts a hex string to a word array.
685
+ *
686
+ * @param {string} hexStr The hex string.
687
+ *
688
+ * @return {WordArray} The word array.
689
+ *
690
+ * @static
691
+ *
692
+ * @example
693
+ *
694
+ * var wordArray = CryptoJS.enc.Hex.parse(hexString);
695
+ */
696
+ parse: function(hexStr) {
697
+ var hexStrLength = hexStr.length;
698
+ var words = [];
699
+ for (var i2 = 0; i2 < hexStrLength; i2 += 2) {
700
+ words[i2 >>> 3] |= parseInt(hexStr.substr(i2, 2), 16) << 24 - i2 % 8 * 4;
701
+ }
702
+ return new WordArray.init(words, hexStrLength / 2);
703
+ }
704
+ };
705
+ var Latin1 = C_enc.Latin1 = {
706
+ /**
707
+ * Converts a word array to a Latin1 string.
708
+ *
709
+ * @param {WordArray} wordArray The word array.
710
+ *
711
+ * @return {string} The Latin1 string.
712
+ *
713
+ * @static
714
+ *
715
+ * @example
716
+ *
717
+ * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
718
+ */
719
+ stringify: function(wordArray) {
720
+ var words = wordArray.words;
721
+ var sigBytes = wordArray.sigBytes;
722
+ var latin1Chars = [];
723
+ for (var i2 = 0; i2 < sigBytes; i2++) {
724
+ var bite = words[i2 >>> 2] >>> 24 - i2 % 4 * 8 & 255;
725
+ latin1Chars.push(String.fromCharCode(bite));
726
+ }
727
+ return latin1Chars.join("");
728
+ },
729
+ /**
730
+ * Converts a Latin1 string to a word array.
731
+ *
732
+ * @param {string} latin1Str The Latin1 string.
733
+ *
734
+ * @return {WordArray} The word array.
735
+ *
736
+ * @static
737
+ *
738
+ * @example
739
+ *
740
+ * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
741
+ */
742
+ parse: function(latin1Str) {
743
+ var latin1StrLength = latin1Str.length;
744
+ var words = [];
745
+ for (var i2 = 0; i2 < latin1StrLength; i2++) {
746
+ words[i2 >>> 2] |= (latin1Str.charCodeAt(i2) & 255) << 24 - i2 % 4 * 8;
747
+ }
748
+ return new WordArray.init(words, latin1StrLength);
749
+ }
750
+ };
751
+ var Utf8 = C_enc.Utf8 = {
752
+ /**
753
+ * Converts a word array to a UTF-8 string.
754
+ *
755
+ * @param {WordArray} wordArray The word array.
756
+ *
757
+ * @return {string} The UTF-8 string.
758
+ *
759
+ * @static
760
+ *
761
+ * @example
762
+ *
763
+ * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
764
+ */
765
+ stringify: function(wordArray) {
766
+ try {
767
+ return decodeURIComponent(escape(Latin1.stringify(wordArray)));
768
+ } catch (e2) {
769
+ throw new Error("Malformed UTF-8 data");
770
+ }
771
+ },
772
+ /**
773
+ * Converts a UTF-8 string to a word array.
774
+ *
775
+ * @param {string} utf8Str The UTF-8 string.
776
+ *
777
+ * @return {WordArray} The word array.
778
+ *
779
+ * @static
780
+ *
781
+ * @example
782
+ *
783
+ * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
784
+ */
785
+ parse: function(utf8Str) {
786
+ return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
787
+ }
788
+ };
789
+ var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
790
+ /**
791
+ * Resets this block algorithm's data buffer to its initial state.
792
+ *
793
+ * @example
794
+ *
795
+ * bufferedBlockAlgorithm.reset();
796
+ */
797
+ reset: function() {
798
+ this._data = new WordArray.init();
799
+ this._nDataBytes = 0;
800
+ },
801
+ /**
802
+ * Adds new data to this block algorithm's buffer.
803
+ *
804
+ * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
805
+ *
806
+ * @example
807
+ *
808
+ * bufferedBlockAlgorithm._append('data');
809
+ * bufferedBlockAlgorithm._append(wordArray);
810
+ */
811
+ _append: function(data) {
812
+ if (typeof data == "string") {
813
+ data = Utf8.parse(data);
814
+ }
815
+ this._data.concat(data);
816
+ this._nDataBytes += data.sigBytes;
817
+ },
818
+ /**
819
+ * Processes available data blocks.
820
+ *
821
+ * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
822
+ *
823
+ * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
824
+ *
825
+ * @return {WordArray} The processed data.
826
+ *
827
+ * @example
828
+ *
829
+ * var processedData = bufferedBlockAlgorithm._process();
830
+ * var processedData = bufferedBlockAlgorithm._process(!!'flush');
831
+ */
832
+ _process: function(doFlush) {
833
+ var processedWords;
834
+ var data = this._data;
835
+ var dataWords = data.words;
836
+ var dataSigBytes = data.sigBytes;
837
+ var blockSize = this.blockSize;
838
+ var blockSizeBytes = blockSize * 4;
839
+ var nBlocksReady = dataSigBytes / blockSizeBytes;
840
+ if (doFlush) {
841
+ nBlocksReady = Math2.ceil(nBlocksReady);
842
+ } else {
843
+ nBlocksReady = Math2.max((nBlocksReady | 0) - this._minBufferSize, 0);
844
+ }
845
+ var nWordsReady = nBlocksReady * blockSize;
846
+ var nBytesReady = Math2.min(nWordsReady * 4, dataSigBytes);
847
+ if (nWordsReady) {
848
+ for (var offset = 0; offset < nWordsReady; offset += blockSize) {
849
+ this._doProcessBlock(dataWords, offset);
850
+ }
851
+ processedWords = dataWords.splice(0, nWordsReady);
852
+ data.sigBytes -= nBytesReady;
853
+ }
854
+ return new WordArray.init(processedWords, nBytesReady);
855
+ },
856
+ /**
857
+ * Creates a copy of this object.
858
+ *
859
+ * @return {Object} The clone.
860
+ *
861
+ * @example
862
+ *
863
+ * var clone = bufferedBlockAlgorithm.clone();
864
+ */
865
+ clone: function() {
866
+ var clone = Base.clone.call(this);
867
+ clone._data = this._data.clone();
868
+ return clone;
869
+ },
870
+ _minBufferSize: 0
871
+ });
872
+ var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
873
+ /**
874
+ * Configuration options.
875
+ */
876
+ cfg: Base.extend(),
877
+ /**
878
+ * Initializes a newly created hasher.
879
+ *
880
+ * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
881
+ *
882
+ * @example
883
+ *
884
+ * var hasher = CryptoJS.algo.SHA256.create();
885
+ */
886
+ init: function(cfg) {
887
+ this.cfg = this.cfg.extend(cfg);
888
+ this.reset();
889
+ },
890
+ /**
891
+ * Resets this hasher to its initial state.
892
+ *
893
+ * @example
894
+ *
895
+ * hasher.reset();
896
+ */
897
+ reset: function() {
898
+ BufferedBlockAlgorithm.reset.call(this);
899
+ this._doReset();
900
+ },
901
+ /**
902
+ * Updates this hasher with a message.
903
+ *
904
+ * @param {WordArray|string} messageUpdate The message to append.
905
+ *
906
+ * @return {Hasher} This hasher.
907
+ *
908
+ * @example
909
+ *
910
+ * hasher.update('message');
911
+ * hasher.update(wordArray);
912
+ */
913
+ update: function(messageUpdate) {
914
+ this._append(messageUpdate);
915
+ this._process();
916
+ return this;
917
+ },
918
+ /**
919
+ * Finalizes the hash computation.
920
+ * Note that the finalize operation is effectively a destructive, read-once operation.
921
+ *
922
+ * @param {WordArray|string} messageUpdate (Optional) A final message update.
923
+ *
924
+ * @return {WordArray} The hash.
925
+ *
926
+ * @example
927
+ *
928
+ * var hash = hasher.finalize();
929
+ * var hash = hasher.finalize('message');
930
+ * var hash = hasher.finalize(wordArray);
931
+ */
932
+ finalize: function(messageUpdate) {
933
+ if (messageUpdate) {
934
+ this._append(messageUpdate);
935
+ }
936
+ var hash = this._doFinalize();
937
+ return hash;
938
+ },
939
+ blockSize: 512 / 32,
940
+ /**
941
+ * Creates a shortcut function to a hasher's object interface.
942
+ *
943
+ * @param {Hasher} hasher The hasher to create a helper for.
944
+ *
945
+ * @return {Function} The shortcut function.
946
+ *
947
+ * @static
948
+ *
949
+ * @example
950
+ *
951
+ * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
952
+ */
953
+ _createHelper: function(hasher) {
954
+ return function(message, cfg) {
955
+ return new hasher.init(cfg).finalize(message);
956
+ };
957
+ },
958
+ /**
959
+ * Creates a shortcut function to the HMAC's object interface.
960
+ *
961
+ * @param {Hasher} hasher The hasher to use in this HMAC helper.
962
+ *
963
+ * @return {Function} The shortcut function.
964
+ *
965
+ * @static
966
+ *
967
+ * @example
968
+ *
969
+ * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
970
+ */
971
+ _createHmacHelper: function(hasher) {
972
+ return function(message, key) {
973
+ return new C_algo.HMAC.init(hasher, key).finalize(message);
974
+ };
975
+ }
976
+ });
977
+ var C_algo = C.algo = {};
978
+ return C;
979
+ }(Math);
980
+ return CryptoJS;
981
+ });
982
+ }
983
+ });
984
+
985
+ // node_modules/crypto-js/md5.js
986
+ var require_md5 = __commonJS({
987
+ "node_modules/crypto-js/md5.js"(exports, module) {
988
+ "use strict";
989
+ (function(root4, factory) {
990
+ if (typeof exports === "object") {
991
+ module.exports = exports = factory(require_core());
992
+ } else if (typeof define === "function" && define.amd) {
993
+ define(["./core"], factory);
994
+ } else {
995
+ factory(root4.CryptoJS);
996
+ }
997
+ })(exports, function(CryptoJS) {
998
+ (function(Math2) {
999
+ var C = CryptoJS;
1000
+ var C_lib = C.lib;
1001
+ var WordArray = C_lib.WordArray;
1002
+ var Hasher = C_lib.Hasher;
1003
+ var C_algo = C.algo;
1004
+ var T = [];
1005
+ (function() {
1006
+ for (var i2 = 0; i2 < 64; i2++) {
1007
+ T[i2] = Math2.abs(Math2.sin(i2 + 1)) * 4294967296 | 0;
1008
+ }
1009
+ })();
1010
+ var MD52 = C_algo.MD5 = Hasher.extend({
1011
+ _doReset: function() {
1012
+ this._hash = new WordArray.init([
1013
+ 1732584193,
1014
+ 4023233417,
1015
+ 2562383102,
1016
+ 271733878
1017
+ ]);
1018
+ },
1019
+ _doProcessBlock: function(M3, offset) {
1020
+ for (var i2 = 0; i2 < 16; i2++) {
1021
+ var offset_i = offset + i2;
1022
+ var M_offset_i = M3[offset_i];
1023
+ M3[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
1024
+ }
1025
+ var H3 = this._hash.words;
1026
+ var M_offset_0 = M3[offset + 0];
1027
+ var M_offset_1 = M3[offset + 1];
1028
+ var M_offset_2 = M3[offset + 2];
1029
+ var M_offset_3 = M3[offset + 3];
1030
+ var M_offset_4 = M3[offset + 4];
1031
+ var M_offset_5 = M3[offset + 5];
1032
+ var M_offset_6 = M3[offset + 6];
1033
+ var M_offset_7 = M3[offset + 7];
1034
+ var M_offset_8 = M3[offset + 8];
1035
+ var M_offset_9 = M3[offset + 9];
1036
+ var M_offset_10 = M3[offset + 10];
1037
+ var M_offset_11 = M3[offset + 11];
1038
+ var M_offset_12 = M3[offset + 12];
1039
+ var M_offset_13 = M3[offset + 13];
1040
+ var M_offset_14 = M3[offset + 14];
1041
+ var M_offset_15 = M3[offset + 15];
1042
+ var a = H3[0];
1043
+ var b2 = H3[1];
1044
+ var c = H3[2];
1045
+ var d = H3[3];
1046
+ a = FF(a, b2, c, d, M_offset_0, 7, T[0]);
1047
+ d = FF(d, a, b2, c, M_offset_1, 12, T[1]);
1048
+ c = FF(c, d, a, b2, M_offset_2, 17, T[2]);
1049
+ b2 = FF(b2, c, d, a, M_offset_3, 22, T[3]);
1050
+ a = FF(a, b2, c, d, M_offset_4, 7, T[4]);
1051
+ d = FF(d, a, b2, c, M_offset_5, 12, T[5]);
1052
+ c = FF(c, d, a, b2, M_offset_6, 17, T[6]);
1053
+ b2 = FF(b2, c, d, a, M_offset_7, 22, T[7]);
1054
+ a = FF(a, b2, c, d, M_offset_8, 7, T[8]);
1055
+ d = FF(d, a, b2, c, M_offset_9, 12, T[9]);
1056
+ c = FF(c, d, a, b2, M_offset_10, 17, T[10]);
1057
+ b2 = FF(b2, c, d, a, M_offset_11, 22, T[11]);
1058
+ a = FF(a, b2, c, d, M_offset_12, 7, T[12]);
1059
+ d = FF(d, a, b2, c, M_offset_13, 12, T[13]);
1060
+ c = FF(c, d, a, b2, M_offset_14, 17, T[14]);
1061
+ b2 = FF(b2, c, d, a, M_offset_15, 22, T[15]);
1062
+ a = GG(a, b2, c, d, M_offset_1, 5, T[16]);
1063
+ d = GG(d, a, b2, c, M_offset_6, 9, T[17]);
1064
+ c = GG(c, d, a, b2, M_offset_11, 14, T[18]);
1065
+ b2 = GG(b2, c, d, a, M_offset_0, 20, T[19]);
1066
+ a = GG(a, b2, c, d, M_offset_5, 5, T[20]);
1067
+ d = GG(d, a, b2, c, M_offset_10, 9, T[21]);
1068
+ c = GG(c, d, a, b2, M_offset_15, 14, T[22]);
1069
+ b2 = GG(b2, c, d, a, M_offset_4, 20, T[23]);
1070
+ a = GG(a, b2, c, d, M_offset_9, 5, T[24]);
1071
+ d = GG(d, a, b2, c, M_offset_14, 9, T[25]);
1072
+ c = GG(c, d, a, b2, M_offset_3, 14, T[26]);
1073
+ b2 = GG(b2, c, d, a, M_offset_8, 20, T[27]);
1074
+ a = GG(a, b2, c, d, M_offset_13, 5, T[28]);
1075
+ d = GG(d, a, b2, c, M_offset_2, 9, T[29]);
1076
+ c = GG(c, d, a, b2, M_offset_7, 14, T[30]);
1077
+ b2 = GG(b2, c, d, a, M_offset_12, 20, T[31]);
1078
+ a = HH(a, b2, c, d, M_offset_5, 4, T[32]);
1079
+ d = HH(d, a, b2, c, M_offset_8, 11, T[33]);
1080
+ c = HH(c, d, a, b2, M_offset_11, 16, T[34]);
1081
+ b2 = HH(b2, c, d, a, M_offset_14, 23, T[35]);
1082
+ a = HH(a, b2, c, d, M_offset_1, 4, T[36]);
1083
+ d = HH(d, a, b2, c, M_offset_4, 11, T[37]);
1084
+ c = HH(c, d, a, b2, M_offset_7, 16, T[38]);
1085
+ b2 = HH(b2, c, d, a, M_offset_10, 23, T[39]);
1086
+ a = HH(a, b2, c, d, M_offset_13, 4, T[40]);
1087
+ d = HH(d, a, b2, c, M_offset_0, 11, T[41]);
1088
+ c = HH(c, d, a, b2, M_offset_3, 16, T[42]);
1089
+ b2 = HH(b2, c, d, a, M_offset_6, 23, T[43]);
1090
+ a = HH(a, b2, c, d, M_offset_9, 4, T[44]);
1091
+ d = HH(d, a, b2, c, M_offset_12, 11, T[45]);
1092
+ c = HH(c, d, a, b2, M_offset_15, 16, T[46]);
1093
+ b2 = HH(b2, c, d, a, M_offset_2, 23, T[47]);
1094
+ a = II(a, b2, c, d, M_offset_0, 6, T[48]);
1095
+ d = II(d, a, b2, c, M_offset_7, 10, T[49]);
1096
+ c = II(c, d, a, b2, M_offset_14, 15, T[50]);
1097
+ b2 = II(b2, c, d, a, M_offset_5, 21, T[51]);
1098
+ a = II(a, b2, c, d, M_offset_12, 6, T[52]);
1099
+ d = II(d, a, b2, c, M_offset_3, 10, T[53]);
1100
+ c = II(c, d, a, b2, M_offset_10, 15, T[54]);
1101
+ b2 = II(b2, c, d, a, M_offset_1, 21, T[55]);
1102
+ a = II(a, b2, c, d, M_offset_8, 6, T[56]);
1103
+ d = II(d, a, b2, c, M_offset_15, 10, T[57]);
1104
+ c = II(c, d, a, b2, M_offset_6, 15, T[58]);
1105
+ b2 = II(b2, c, d, a, M_offset_13, 21, T[59]);
1106
+ a = II(a, b2, c, d, M_offset_4, 6, T[60]);
1107
+ d = II(d, a, b2, c, M_offset_11, 10, T[61]);
1108
+ c = II(c, d, a, b2, M_offset_2, 15, T[62]);
1109
+ b2 = II(b2, c, d, a, M_offset_9, 21, T[63]);
1110
+ H3[0] = H3[0] + a | 0;
1111
+ H3[1] = H3[1] + b2 | 0;
1112
+ H3[2] = H3[2] + c | 0;
1113
+ H3[3] = H3[3] + d | 0;
1114
+ },
1115
+ _doFinalize: function() {
1116
+ var data = this._data;
1117
+ var dataWords = data.words;
1118
+ var nBitsTotal = this._nDataBytes * 8;
1119
+ var nBitsLeft = data.sigBytes * 8;
1120
+ dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
1121
+ var nBitsTotalH = Math2.floor(nBitsTotal / 4294967296);
1122
+ var nBitsTotalL = nBitsTotal;
1123
+ dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 16711935 | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 4278255360;
1124
+ dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 16711935 | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 4278255360;
1125
+ data.sigBytes = (dataWords.length + 1) * 4;
1126
+ this._process();
1127
+ var hash = this._hash;
1128
+ var H3 = hash.words;
1129
+ for (var i2 = 0; i2 < 4; i2++) {
1130
+ var H_i = H3[i2];
1131
+ H3[i2] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
1132
+ }
1133
+ return hash;
1134
+ },
1135
+ clone: function() {
1136
+ var clone = Hasher.clone.call(this);
1137
+ clone._hash = this._hash.clone();
1138
+ return clone;
1139
+ }
1140
+ });
1141
+ function FF(a, b2, c, d, x, s, t) {
1142
+ var n = a + (b2 & c | ~b2 & d) + x + t;
1143
+ return (n << s | n >>> 32 - s) + b2;
1144
+ }
1145
+ function GG(a, b2, c, d, x, s, t) {
1146
+ var n = a + (b2 & d | c & ~d) + x + t;
1147
+ return (n << s | n >>> 32 - s) + b2;
1148
+ }
1149
+ function HH(a, b2, c, d, x, s, t) {
1150
+ var n = a + (b2 ^ c ^ d) + x + t;
1151
+ return (n << s | n >>> 32 - s) + b2;
1152
+ }
1153
+ function II(a, b2, c, d, x, s, t) {
1154
+ var n = a + (c ^ (b2 | ~d)) + x + t;
1155
+ return (n << s | n >>> 32 - s) + b2;
1156
+ }
1157
+ C.MD5 = Hasher._createHelper(MD52);
1158
+ C.HmacMD5 = Hasher._createHmacHelper(MD52);
1159
+ })(Math);
1160
+ return CryptoJS.MD5;
1161
+ });
1162
+ }
1163
+ });
1164
+
373
1165
  // src/providers/cuekit-provider.tsx
374
1166
  import React, { createContext, useContext, useEffect, useState } from "react";
375
1167
 
@@ -477,16 +1269,10 @@ var CuekitProvider = ({
477
1269
  useEffect(() => {
478
1270
  if (apiKey) {
479
1271
  try {
480
- console.log("\u{1F3A4} CuekitProvider: Starting WebRTC initialization...", {
481
- apiKey: apiKey.substring(0, 10) + "..."
482
- });
483
1272
  initWebRTC(apiKey);
484
- console.log("\u{1F3A4} CuekitProvider: WebRTC initialized successfully");
485
1273
  } catch (error) {
486
- console.error("\u{1F3A4} CuekitProvider: Failed to initialize WebRTC:", error);
487
1274
  }
488
1275
  } else {
489
- console.warn("\u{1F3A4} CuekitProvider: No API key provided, skipping WebRTC initialization");
490
1276
  }
491
1277
  }, [apiKey]);
492
1278
  useEffect(() => {
@@ -496,18 +1282,14 @@ var CuekitProvider = ({
496
1282
  };
497
1283
  }, [navigationHandler]);
498
1284
  useEffect(() => {
499
- import("./webrtc-service-TL73OATV.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
1285
+ import("./webrtc-service-SDVOO4LS.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
500
1286
  setWebRTCCallbacks2({
501
1287
  onNavigationCommand: (command) => {
502
- console.log("\u{1F9ED} Processing navigation command:", command);
503
1288
  switch (command.type) {
504
1289
  case "static_data_ready":
505
- console.log("\u{1F4E6} Static data ready:", command.data);
506
1290
  break;
507
1291
  case "ai_intent":
508
- console.log("\u{1F3AF} AI Intent:", command.text, "->", command.actionType);
509
1292
  if (command.actionType === "navigate" && command.current_page) {
510
- console.log(`\u{1F9ED} Navigating to: ${command.current_page}`);
511
1293
  if (navigationHandler) {
512
1294
  navigationHandler(command.current_page, {
513
1295
  intent: command.intent,
@@ -518,13 +1300,10 @@ var CuekitProvider = ({
518
1300
  }
519
1301
  break;
520
1302
  case "user_speech_text":
521
- console.log("\u{1F464} User said:", command.text);
522
1303
  break;
523
1304
  case "ai_speech_text":
524
- console.log("\u{1F916} AI said:", command.text);
525
1305
  break;
526
1306
  default:
527
- console.log("\u{1F50D} Unknown command type:", command.type);
528
1307
  }
529
1308
  },
530
1309
  onConnectionStateChange: (state) => {
@@ -613,7 +1392,7 @@ import { useState as useState3, useCallback as useCallback2, useRef as useRef2 }
613
1392
  // src/hooks/use-webrtc.ts
614
1393
  import { useState as useState2, useEffect as useEffect2, useCallback, useRef, useMemo } from "react";
615
1394
  var useWebRTC = (options) => {
616
- const [isConnected2, setIsConnected] = useState2(false);
1395
+ const [isConnected, setIsConnected] = useState2(false);
617
1396
  const [isConnecting, setIsConnecting] = useState2(false);
618
1397
  const [connectionState, setConnectionState] = useState2(null);
619
1398
  const [participants, setParticipants] = useState2([]);
@@ -624,10 +1403,9 @@ var useWebRTC = (options) => {
624
1403
  setAudioContainer(audioContainerRef);
625
1404
  }, []);
626
1405
  useEffect2(() => {
627
- const handleConnectionStateChange = async (state) => {
628
- const { ConnectionState: ConnectionState2 } = await import("./livekit-client.esm-33GHDCYA.mjs");
629
- setIsConnected(state === ConnectionState2.Connected);
630
- setIsConnecting(state === ConnectionState2.Connecting);
1406
+ const handleConnectionStateChange = (state) => {
1407
+ setIsConnected(state === ConnectionState.Connected);
1408
+ setIsConnecting(state === ConnectionState.Connecting);
631
1409
  setConnectionState(state);
632
1410
  options?.onConnectionStateChange?.(state);
633
1411
  };
@@ -662,7 +1440,6 @@ var useWebRTC = (options) => {
662
1440
  setIsConnected(true);
663
1441
  return authData;
664
1442
  } catch (err) {
665
- console.error("Connection failed:", err);
666
1443
  setError(err.message || "Failed to connect");
667
1444
  setIsConnected(false);
668
1445
  } finally {
@@ -674,20 +1451,11 @@ var useWebRTC = (options) => {
674
1451
  setIsConnected(false);
675
1452
  setRoom(null);
676
1453
  }, []);
677
- useEffect2(() => {
678
- const checkConnection = async () => {
679
- const connected = await isConnected();
680
- setIsConnected(connected);
681
- };
682
- checkConnection();
683
- const interval = setInterval(checkConnection, 5e3);
684
- return () => clearInterval(interval);
685
- }, []);
686
1454
  const memoizedParticipants = useMemo(() => {
687
1455
  return getParticipants().map((p) => p.identity);
688
1456
  }, [participants]);
689
1457
  return {
690
- isConnected: isConnected2,
1458
+ isConnected,
691
1459
  isConnecting,
692
1460
  connectionState,
693
1461
  room,
@@ -756,7 +1524,7 @@ var useCuekit = (options) => {
756
1524
  const [micState, setMicState] = useState3("idle");
757
1525
  const [status, setStatus] = useState3("");
758
1526
  const handleNavigationCommand = (event) => {
759
- console.log(`\u{1F9E0} Processing event in useCuekit: ${event.type}`, event);
1527
+ console.log(`\u2B07\uFE0F Received event from backend: ${event.type}`, event);
760
1528
  switch (event.type) {
761
1529
  case "user_speech_chunk":
762
1530
  case "ai_speech_chunk": {
@@ -4639,9 +5407,9 @@ function factoryTitle(effects, ok3, nok, type, markerType, stringType) {
4639
5407
  return atBreak(code4);
4640
5408
  }
4641
5409
  effects.consume(code4);
4642
- return code4 === 92 ? escape : inside;
5410
+ return code4 === 92 ? escape2 : inside;
4643
5411
  }
4644
- function escape(code4) {
5412
+ function escape2(code4) {
4645
5413
  if (code4 === marker || code4 === 92) {
4646
5414
  effects.consume(code4);
4647
5415
  return inside;
@@ -13537,9 +14305,9 @@ var SunIcon = ({ width = 24, height = 24, className, ...props }) => {
13537
14305
  viewBox: "0 0 24 24",
13538
14306
  fill: "none",
13539
14307
  stroke: "currentColor",
13540
- "stroke-width": "2",
13541
- "stroke-linecap": "round",
13542
- "stroke-linejoin": "round",
14308
+ strokeWidth: "2",
14309
+ strokeLinecap: "round",
14310
+ strokeLinejoin: "round",
13543
14311
  className,
13544
14312
  ...props
13545
14313
  },
@@ -13568,9 +14336,9 @@ var MoonIcon = ({ width = 24, height = 24, className, ...props }) => {
13568
14336
  viewBox: "0 0 24 24",
13569
14337
  fill: "none",
13570
14338
  stroke: "currentColor",
13571
- "stroke-width": "2",
13572
- "stroke-linecap": "round",
13573
- "stroke-linejoin": "round",
14339
+ strokeWidth: "2",
14340
+ strokeLinecap: "round",
14341
+ strokeLinejoin: "round",
13574
14342
  className,
13575
14343
  ...props
13576
14344
  },
@@ -13591,9 +14359,9 @@ var CloseIcon = ({ width = 24, height = 24, className, ...props }) => {
13591
14359
  viewBox: "0 0 24 24",
13592
14360
  fill: "none",
13593
14361
  stroke: "currentColor",
13594
- "stroke-width": "2",
13595
- "stroke-linecap": "round",
13596
- "stroke-linejoin": "round",
14362
+ strokeWidth: "2",
14363
+ strokeLinecap: "round",
14364
+ strokeLinejoin: "round",
13597
14365
  className,
13598
14366
  ...props
13599
14367
  },
@@ -13615,9 +14383,9 @@ var PhoneOffIcon = ({ width = 24, height = 24, className, ...props }) => {
13615
14383
  viewBox: "0 0 24 24",
13616
14384
  fill: "none",
13617
14385
  stroke: "currentColor",
13618
- "stroke-width": "2",
13619
- "stroke-linecap": "round",
13620
- "stroke-linejoin": "round",
14386
+ strokeWidth: "2",
14387
+ strokeLinecap: "round",
14388
+ strokeLinejoin: "round",
13621
14389
  className,
13622
14390
  ...props
13623
14391
  },
@@ -13638,7 +14406,7 @@ var ChatPopup = ({
13638
14406
  onSendText,
13639
14407
  onEndCall,
13640
14408
  messages,
13641
- isConnected: isConnected2,
14409
+ isConnected,
13642
14410
  micState,
13643
14411
  error,
13644
14412
  currentTheme = "dark",
@@ -14225,7 +14993,7 @@ var ChatPopup = ({
14225
14993
  }
14226
14994
  }
14227
14995
  ),
14228
- isConnected2 && onEndCall && /* @__PURE__ */ React6.createElement(
14996
+ isConnected && onEndCall && /* @__PURE__ */ React6.createElement(
14229
14997
  "button",
14230
14998
  {
14231
14999
  type: "submit",
@@ -16238,19 +17006,6 @@ var VoiceIntensityBars = ({
16238
17006
  return null;
16239
17007
  }
16240
17008
  let trackRef = null;
16241
- console.log("VoiceIntensityVisualizer Debug:", {
16242
- participants: participants.length,
16243
- localParticipant: !!localParticipant,
16244
- isActive
16245
- });
16246
- console.log(
16247
- "All participants:",
16248
- participants.map((p) => ({
16249
- identity: p.identity,
16250
- isLocal: p instanceof Participant,
16251
- hasAudio: p.getTrackPublication(Track.Source.Microphone)?.track !== void 0
16252
- }))
16253
- );
16254
17009
  let speakingParticipant = null;
16255
17010
  let highestAudioLevel = 0;
16256
17011
  participants.forEach((participant) => {
@@ -16263,15 +17018,8 @@ var VoiceIntensityBars = ({
16263
17018
  if (!speakingParticipant || highestAudioLevel === 0) {
16264
17019
  speakingParticipant = participants.find((p) => p.isSpeaking) || (participants.length > 0 ? participants[0] : null);
16265
17020
  if (speakingParticipant) {
16266
- console.log("Fallback to speaking status or first participant:", speakingParticipant.identity);
16267
17021
  }
16268
17022
  } else {
16269
- console.log(
16270
- "Using participant with highest audio level:",
16271
- speakingParticipant.identity,
16272
- "level:",
16273
- highestAudioLevel
16274
- );
16275
17023
  }
16276
17024
  if (speakingParticipant) {
16277
17025
  const audioTrack = speakingParticipant.getTrackPublication(Track.Source.Microphone);
@@ -16335,9 +17083,9 @@ var MicIcon = ({ width = 24, height = 24, className, ...props }) => {
16335
17083
  viewBox: "0 0 24 24",
16336
17084
  fill: "none",
16337
17085
  stroke: "currentColor",
16338
- "stroke-width": "2",
16339
- "stroke-linecap": "round",
16340
- "stroke-linejoin": "round",
17086
+ strokeWidth: "2",
17087
+ strokeLinecap: "round",
17088
+ strokeLinejoin: "round",
16341
17089
  className,
16342
17090
  ...props
16343
17091
  },
@@ -16360,9 +17108,9 @@ var LoaderIcon = ({ width = 24, height = 24, className, ...props }) => {
16360
17108
  viewBox: "0 0 24 24",
16361
17109
  fill: "none",
16362
17110
  stroke: "currentColor",
16363
- "stroke-width": "2",
16364
- "stroke-linecap": "round",
16365
- "stroke-linejoin": "round",
17111
+ strokeWidth: "2",
17112
+ strokeLinecap: "round",
17113
+ strokeLinejoin: "round",
16366
17114
  className,
16367
17115
  ...props
16368
17116
  },
@@ -16415,7 +17163,7 @@ var MicButton = ({
16415
17163
  const aiSpeechTimeoutRef = useRef7(null);
16416
17164
  const activeAITracksRef = useRef7(/* @__PURE__ */ new Set());
16417
17165
  const {
16418
- isConnected: isConnected2,
17166
+ isConnected,
16419
17167
  isConnecting,
16420
17168
  error: voiceError,
16421
17169
  connect: voiceConnect,
@@ -16442,10 +17190,6 @@ var MicButton = ({
16442
17190
  appId
16443
17191
  });
16444
17192
  useEffect10(() => {
16445
- console.log("\u{1F3A4} MicButton received messages:", JSON.stringify(messageManagerMessages, null, 2));
16446
- }, [messageManagerMessages]);
16447
- useEffect10(() => {
16448
- if (typeof window === "undefined") return;
16449
17193
  const checkTheme = () => {
16450
17194
  if (typeof document !== "undefined") {
16451
17195
  let newTheme;
@@ -16459,7 +17203,6 @@ var MicButton = ({
16459
17203
  }
16460
17204
  };
16461
17205
  checkTheme();
16462
- if (typeof window === "undefined") return;
16463
17206
  if (defaultTheme === "system") {
16464
17207
  const observer = new MutationObserver(checkTheme);
16465
17208
  observer.observe(document.documentElement, {
@@ -16495,74 +17238,27 @@ var MicButton = ({
16495
17238
  }, [showBorderGlow]);
16496
17239
  const handleAISpeech = useCallback5(
16497
17240
  (isSpeaking, trackId) => {
16498
- console.log("\u{1F3A4} MicButton: ===== AI SPEECH EVENT START =====");
16499
- console.log("\u{1F3A4} MicButton: Event type:", isSpeaking ? "START" : "END");
16500
- console.log("\u{1F3A4} MicButton: Track ID:", trackId);
16501
- console.log("\u{1F3A4} MicButton: Current AI speaking state:", aiSpeakingRef.current);
16502
- console.log("\u{1F3A4} MicButton: Current active AI tracks:", Array.from(activeAITracksRef.current));
16503
- console.log("\u{1F3A4} MicButton: Current status:", status);
16504
- console.log("\u{1F3A4} MicButton: Current mic state:", micState);
16505
- console.log("\u{1F3A4} MicButton: Is listening:", isConnected2);
16506
- console.log("\u{1F3A4} MicButton: Is connected:", isConnected2);
16507
17241
  if (isSpeaking && trackId) {
16508
- console.log("\u{1F3A4} MicButton: ===== AI SPEECH START =====");
16509
- console.log("\u{1F3A4} MicButton: Adding track to active set:", trackId);
16510
17242
  activeAITracksRef.current.add(trackId);
16511
17243
  aiSpeakingRef.current = true;
16512
- console.log("\u{1F3A4} MicButton: After adding track:");
16513
- console.log("\u{1F3A4} MicButton: - Active tracks:", Array.from(activeAITracksRef.current));
16514
- console.log("\u{1F3A4} MicButton: - AI speaking state:", aiSpeakingRef.current);
16515
- console.log("\u{1F3A4} MicButton: - Status set to: AI is speaking...");
16516
17244
  if (aiSpeechTimeoutRef.current) {
16517
- console.log("\u{1F3A4} MicButton: Clearing existing AI speech timeout");
16518
17245
  clearTimeout(aiSpeechTimeoutRef.current);
16519
17246
  }
16520
- console.log(
16521
- "\u{1F3A4} MicButton: AI speech started, active tracks:",
16522
- Array.from(activeAITracksRef.current)
16523
- );
16524
17247
  } else if (!isSpeaking && trackId) {
16525
- console.log("\u{1F3A4} MicButton: ===== AI SPEECH END =====");
16526
- console.log("\u{1F3A4} MicButton: Removing track from active set:", trackId);
16527
17248
  activeAITracksRef.current.delete(trackId);
16528
- console.log("\u{1F3A4} MicButton: After removing track:");
16529
- console.log("\u{1F3A4} MicButton: - Active tracks:", Array.from(activeAITracksRef.current));
16530
- console.log("\u{1F3A4} MicButton: - Active tracks size:", activeAITracksRef.current.size);
16531
17249
  if (activeAITracksRef.current.size === 0) {
16532
- console.log("\u{1F3A4} MicButton: ===== ALL AI TRACKS ENDED =====");
16533
- console.log("\u{1F3A4} MicButton: No more active tracks, resetting AI speaking state");
16534
17250
  aiSpeakingRef.current = false;
16535
- console.log("\u{1F3A4} MicButton: After reset:");
16536
- console.log("\u{1F3A4} MicButton: - AI speaking state:", aiSpeakingRef.current);
16537
- console.log("\u{1F3A4} MicButton: - Status set to: Listening");
16538
- console.log("\u{1F3A4} MicButton: All AI tracks ended, voice recognition re-enabled");
16539
17251
  } else {
16540
- console.log("\u{1F3A4} MicButton: Still have active tracks, keeping AI speaking state");
16541
- console.log("\u{1F3A4} MicButton: Remaining tracks:", Array.from(activeAITracksRef.current));
16542
17252
  }
16543
17253
  } else if (!isSpeaking && !trackId) {
16544
- console.log("\u{1F3A4} MicButton: ===== MANUAL RESET =====");
16545
- console.log("\u{1F3A4} MicButton: Manual reset triggered");
16546
17254
  activeAITracksRef.current.clear();
16547
17255
  aiSpeakingRef.current = false;
16548
- console.log("\u{1F3A4} MicButton: After manual reset:");
16549
- console.log("\u{1F3A4} MicButton: - Active tracks cleared");
16550
- console.log("\u{1F3A4} MicButton: - AI speaking state:", aiSpeakingRef.current);
16551
- console.log("\u{1F3A4} MicButton: - Status set to: Listening");
16552
- console.log("\u{1F3A4} MicButton: AI speech manually reset");
16553
17256
  }
16554
- console.log("\u{1F3A4} MicButton: ===== AI SPEECH EVENT END =====");
16555
- console.log("\u{1F3A4} MicButton: Final state:");
16556
- console.log("\u{1F3A4} MicButton: - AI speaking:", aiSpeakingRef.current);
16557
- console.log("\u{1F3A4} MicButton: - Active tracks:", Array.from(activeAITracksRef.current));
16558
- console.log("\u{1F3A4} MicButton: - Status:", status);
16559
- console.log("\u{1F3A4} MicButton: ================================");
16560
17257
  },
16561
- [status, micState, isConnected2]
17258
+ [status, micState, isConnected]
16562
17259
  );
16563
17260
  useEffect10(() => {
16564
17261
  if (audioContainerRef.current) {
16565
- console.log("\u{1F3A4} MicButton: Setting up audio container on mount");
16566
17262
  setAudioContainer(audioContainerRef);
16567
17263
  }
16568
17264
  return () => {
@@ -16571,9 +17267,9 @@ var MicButton = ({
16571
17267
  }
16572
17268
  };
16573
17269
  }, [handleAISpeech]);
16574
- const isListening = isConnected2;
16575
- const getUserFriendlyStatus = (micState2, isConnected3) => {
16576
- if (!isConnected3) {
17270
+ const isListening = isConnected;
17271
+ const getUserFriendlyStatus = (micState2, isConnected2) => {
17272
+ if (!isConnected2) {
16577
17273
  return "Connecting...";
16578
17274
  }
16579
17275
  if (status && !status.includes("error") && !status.includes("failed") && !status.includes("Connection error") && !status.includes("Unable to")) {
@@ -16583,61 +17279,45 @@ var MicButton = ({
16583
17279
  if (micState2 === "thinking") return "Thinking...";
16584
17280
  if (micState2 === "replying") return "Responding...";
16585
17281
  if (micState2 === "idle") {
16586
- if (isConnected3) return "Listening...";
17282
+ if (isConnected2) return "Listening...";
16587
17283
  return "Connecting...";
16588
17284
  }
16589
- return isConnected3 ? "Ready" : "Connecting...";
17285
+ return isConnected2 ? "Ready" : "Connecting...";
16590
17286
  };
16591
17287
  useEffect10(() => {
16592
- if (isConnected2) {
16593
- console.log("\u{1F3A4} MicButton: WebRTC and SSE connections established - ready for commands");
17288
+ if (isConnected) {
16594
17289
  } else {
16595
- console.log("\u{1F3A4} MicButton: WebRTC not yet connected - ignoring speech");
16596
17290
  }
16597
- }, [isConnected2]);
17291
+ }, [isConnected]);
16598
17292
  useEffect10(() => {
16599
- console.log("\u{1F3A4} MicButton: Auto-open check:", {
16600
- isConnected: isConnected2,
16601
- chatIsOpen: isChatOpen
16602
- });
16603
- if (isConnected2 && !isChatOpen) {
16604
- console.log("\u{1F3A4} MicButton: Auto-opening chat popup");
17293
+ if (isConnected && !isChatOpen) {
16605
17294
  openChat();
16606
17295
  }
16607
- }, [isConnected2, isChatOpen, openChat]);
17296
+ }, [isConnected, isChatOpen, openChat]);
16608
17297
  useEffect10(() => {
16609
17298
  if (messageManagerMessages.length > 0 && !isChatOpen) {
16610
- console.log("\u{1F3A4} MicButton: Auto-opening chat popup due to messages");
16611
17299
  openChat();
16612
17300
  }
16613
17301
  }, [messageManagerMessages.length, isChatOpen, openChat]);
16614
17302
  const handleMicClick = useCallback5(() => {
16615
- const shouldStop = micState === "listening" && isConnected2;
17303
+ const shouldStop = micState === "listening" && isConnected;
16616
17304
  if (shouldStop) {
16617
- console.log("\u{1F3A4} MicButton: User wants to stop - closing everything");
16618
17305
  voiceDisconnect().then(() => {
16619
- console.log("\u{1F3A4} MicButton: Stopped and disconnected");
16620
17306
  }).catch((error) => {
16621
- console.error("\u{1F3A4} MicButton: Error during disconnect:", error);
16622
17307
  });
16623
17308
  } else {
16624
- console.log("\u{1F3A4} MicButton: User wants to start - connecting everything");
16625
17309
  voiceConnect(`user_${Date.now()}`, apiKey, appId).then(() => {
16626
- console.log("\u{1F3A4} MicButton: WebRTC and SSE connections started");
16627
17310
  if (showBorderGlow) setShowBodyGlow(true);
16628
17311
  openChat();
16629
- console.log("\u{1F3A4} MicButton: Started listening");
16630
17312
  setTimeout(() => {
16631
- console.log("\u{1F3A4} MicButton: Force opening chat popup after connection");
16632
17313
  openChat();
16633
17314
  }, 500);
16634
17315
  }).catch((error) => {
16635
- console.error("\u{1F3A4} MicButton: Failed to start connections:", error);
16636
17316
  });
16637
17317
  }
16638
17318
  }, [
16639
17319
  micState,
16640
- isConnected2,
17320
+ isConnected,
16641
17321
  voiceDisconnect,
16642
17322
  voiceConnect,
16643
17323
  apiKey,
@@ -16646,14 +17326,12 @@ var MicButton = ({
16646
17326
  showBorderGlow
16647
17327
  ]);
16648
17328
  const handleSendText = async (textToSend) => {
16649
- console.log("\u{1F3A4} MicButton: handleSendText called with:", textToSend);
16650
17329
  setMicState("thinking");
16651
17330
  if (showBorderGlow) setShowBodyGlow(true);
16652
17331
  if (!isChatOpen) {
16653
17332
  openChat();
16654
17333
  }
16655
- if (isConnected2) {
16656
- console.log("\u{1F3A4} MicButton: Sending via WebRTC");
17334
+ if (isConnected) {
16657
17335
  try {
16658
17336
  await sendUserCommand2(textToSend);
16659
17337
  setMicState("replying");
@@ -16662,27 +17340,21 @@ var MicButton = ({
16662
17340
  if (showBorderGlow) setShowBodyGlow(true);
16663
17341
  }, 1e3);
16664
17342
  } catch (error) {
16665
- console.error("\u{1F3A4} MicButton: Failed to send text:", error);
16666
17343
  } finally {
16667
17344
  setMicState("listening");
16668
17345
  if (showBorderGlow) setShowBodyGlow(true);
16669
17346
  }
16670
17347
  } else {
16671
- console.log("\u{1F3A4} MicButton: WebRTC not connected, cannot send message");
16672
17348
  setMicState("listening");
16673
17349
  if (showBorderGlow) setShowBodyGlow(true);
16674
17350
  }
16675
- console.log("\u{1F3A4} MicButton: Text sent via WebRTC");
16676
17351
  };
16677
17352
  const handleEndCall = async () => {
16678
- console.log("\u{1F3A4} MicButton: Ending call completely...");
16679
17353
  try {
16680
17354
  await voiceDisconnect();
16681
17355
  await voiceDisconnect();
16682
17356
  closeChat();
16683
- console.log("\u{1F3A4} MicButton: Call ended successfully");
16684
17357
  } catch (error) {
16685
- console.error("\u{1F3A4} MicButton: Error ending call:", error);
16686
17358
  }
16687
17359
  };
16688
17360
  const getIcon = () => {
@@ -16849,13 +17521,13 @@ var MicButton = ({
16849
17521
  text: msg.text,
16850
17522
  sender: msg.role === "ai" ? "assistant" : "user"
16851
17523
  })),
16852
- isConnected: isConnected2 ?? false,
17524
+ isConnected: isConnected ?? false,
16853
17525
  micState,
16854
17526
  participants,
16855
17527
  error: voiceError,
16856
17528
  currentTheme,
16857
17529
  onThemeToggle: setCurrentTheme,
16858
- status: getUserFriendlyStatus(micState, isConnected2 ?? false),
17530
+ status: getUserFriendlyStatus(micState, isConnected ?? false),
16859
17531
  anchor: { position: screenPosition, bottom: bottomSpace, size: buttonSize }
16860
17532
  }
16861
17533
  ), isChatOpen && isChatMinimized && /* @__PURE__ */ React11.createElement(
@@ -16882,6 +17554,14 @@ var MicButton = ({
16882
17554
  /* @__PURE__ */ React11.createElement("span", { style: { fontSize: 12, fontWeight: 600, color: "hsl(var(--voice-text))" } }, "Open chat")
16883
17555
  ), /* @__PURE__ */ React11.createElement("div", { ref: audioContainerRef, style: { display: "none" } }), showBorderGlow && showBodyGlow && /* @__PURE__ */ React11.createElement(border_glow_default, { isActive: true }));
16884
17556
  };
17557
+
17558
+ // src/utils/instrumentation.ts
17559
+ var import_md5 = __toESM(require_md5());
17560
+ function generateDynamicId(routePath, elementIdentifier) {
17561
+ const combinedString = `${routePath}:${elementIdentifier}`;
17562
+ const hash = (0, import_md5.default)(combinedString).toString();
17563
+ return hash.substring(0, 8);
17564
+ }
16885
17565
  export {
16886
17566
  border_glow_default as BorderGlow,
16887
17567
  ChatPopup,
@@ -16892,6 +17572,7 @@ export {
16892
17572
  captureFullDOMStructure,
16893
17573
  configureWebRTCServer,
16894
17574
  executeAction,
17575
+ generateDynamicId,
16895
17576
  getFullDOMStructure,
16896
17577
  getWebRTCServerConfig,
16897
17578
  initWebRTC,