module.exports = (function() { var __MODS__ = {}; var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; __DEFINE__(1744442642936, function(require, module, exports) { !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("tim-wx-sdk")):"function"==typeof define&&define.amd?define(["tim-wx-sdk"],e):"object"==typeof exports?exports.TSignaling=e(require("tim-wx-sdk")):t.TSignaling=e(t.TIM)}(window,(function(t){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=7)}([function(t,e,n){n.d(e,"e",(function(){return I})),n.d(e,"g",(function(){return h})),n.d(e,"c",(function(){return g})),n.d(e,"f",(function(){return v})),n.d(e,"b",(function(){return m})),n.d(e,"d",(function(){return T})),n.d(e,"a",(function(){return S})),n.d(e,"h",(function(){return b}));const i="undefined"!=typeof window,o=("undefined"!=typeof wx&&wx.getSystemInfoSync,i&&window.navigator&&window.navigator.userAgent||""),r=/AppleWebKit\/([\d.]+)/i.exec(o),s=(r&&parseFloat(r.pop()),/iPad/i.test(o)),a=/iPhone/i.test(o)&&!s,u=/iPod/i.test(o),l=a||s||u,c=(function(){const t=o.match(/OS (\d+)_/i);t&&t[1]&&t[1]}(),/Android/i.test(o)),d=function(){const t=o.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const e=t[1]&&parseFloat(t[1]),n=t[2]&&parseFloat(t[2]);return e&&n?parseFloat(t[1]+"."+t[2]):e||null}(),f=(c&&/webkit/i.test(o),/Firefox/i.test(o),/Edge/i.test(o)),_=!f&&/Chrome/i.test(o),p=(function(){const t=o.match(/Chrome\/(\d+)/);t&&t[1]&&parseFloat(t[1])}(),/MSIE/.test(o),/MSIE\s8\.0/.test(o),function(){const t=/MSIE\s(\d+)\.\d/.exec(o);let e=t&&parseFloat(t[1]);!e&&/Trident\/7.0/i.test(o)&&/rv:11.0/.test(o)&&(e=11)}(),/Safari/i.test(o),/TBS\/\d+/i.test(o));(function(){const t=o.match(/TBS\/(\d+)/i);if(t&&t[1])t[1]})(),!p&&/MQQBrowser\/\d+/i.test(o),!p&&/ QQBrowser\/\d+/i.test(o),/(micromessenger|webbrowser)/i.test(o),/Windows/i.test(o),/MAC OS X/i.test(o),/MicroMessenger/i.test(o);n(2),n(1);const I=function(t){return"map"===y(t)},h=function(t){return"set"===y(t)},g=function(t){return"file"===y(t)},v=function(t){if("object"!=typeof t||null===t)return!1;const e=Object.getPrototypeOf(t);if(null===e)return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},E=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"array"===y(t)},m=function(t){return E(t)||function(t){return null!==t&&"object"==typeof t}(t)},T=function(t){return t instanceof Error},y=function(t){return Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase()};let D=0;Date.now||(Date.now=function(){return(new Date).getTime()});const S={now:function(){0===D&&(D=Date.now()-1);const t=Date.now()-D;return t>4294967295?(D+=4294967295,Date.now()-D):t},utc:function(){return Math.round(Date.now()/1e3)}},b=function(t){return JSON.stringify(t,["message","code"])}},function(t,e,n){n.r(e);var i=n(3),o=n(0);let r=0;const s=new Map;function a(){const t=new Date;return"TSignaling "+t.toLocaleTimeString("en-US",{hour12:!1})+"."+function(t){let e;switch(t.toString().length){case 1:e="00"+t;break;case 2:e="0"+t;break;default:e=t}return e}(t.getMilliseconds())+":"}const u={_data:[],_length:0,_visible:!1,arguments2String(t){let e;if(1===t.length)e=a()+t[0];else{e=a();for(let n=0,i=t.length;n0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]t.weight>e.weight),this}_getCallbacks(t){return r(this)._callbacks[t]}_getCallbackIndex(t,e){return this._has(t)?this._getCallbacks(t).findIndex(t=>t.callback===e):null}_achieveMaxListener(t){return null!==r(this)._maxListeners&&r(this)._maxListeners<=this.listenersNumber(t)}_callbackIsExists(t,e,n){const i=this._getCallbackIndex(t,e),o=-1!==i?this._getCallbacks(t)[i]:void 0;return-1!==i&&o&&o.context===n}_has(t){return r(this)._events.has(t)}on(t,e,n=null,i=1){const o=r(this);if("function"!=typeof e)throw new TypeError(e+" is not a function");return this._has(t)?(this._achieveMaxListener(t)&&o._console.warn(`Max listeners (${o._maxListeners}) for event "${t}" is reached!`),this._callbackIsExists(...arguments)&&o._console.warn(`Event "${t}" already has the callback ${e}.`)):(o._events.add(t),o._callbacks[t]=[]),this._addCallback(...arguments),this}once(t,e,n=null,o=1){const r=(...o)=>(this.off(t,r),i.call(e,n,o));return this.on(t,r,n,o)}off(t,e=null){const n=r(this);let i;return this._has(t)&&(null===e?(n._events.delete(t),n._callbacks[t]=null):(i=this._getCallbackIndex(t,e),-1!==i&&(n._callbacks[t].splice(i,1),this.off(...arguments)))),this}emit(t,...e){return this._has(t)&&this._getCallbacks(t).forEach(t=>i.call(t.callback,t.context,e)),this}clear(){const t=r(this);return t._events.clear(),t._callbacks={},this}listenersNumber(t){return this._has(t)?this._getCallbacks(t).length:null}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){n.r(e);var i=n(0);const o=Object.prototype.hasOwnProperty;e.default=function(t){if(null==t)return!0;if("boolean"==typeof t)return!1;if("number"==typeof t)return 0===t;if("string"==typeof t)return 0===t.length;if("function"==typeof t)return 0===t.length;if(Array.isArray(t))return 0===t.length;if(t instanceof Error)return""===t.message;if(Object(i.f)(t)){for(const e in t)if(o.call(t,e))return!1;return!0}return!!(Object(i.e)(t)||Object(i.g)(t)||Object(i.c)(t))&&0===t.size}},function(t,e,n){n.r(e);class i extends Error{constructor(t){super(),this.code=t.code,this.message=t.message,this.data=t.data||{}}}e.default=i},function(t,e,n){n.r(e);var i=n(1),o=n(4),r=n.n(o);e.default=class{constructor(){this._funcMap=new Map}defense(t,e,n){if("string"!=typeof t)return null;if(0===t.length)return null;if("function"!=typeof e)return null;if(this._funcMap.has(t)&&this._funcMap.get(t).has(e))return this._funcMap.get(t).get(e);this._funcMap.has(t)||this._funcMap.set(t,new Map);let i=null;return this._funcMap.get(t).has(e)?i=this._funcMap.get(t).get(e):(i=this._pack(t,e,n),this._funcMap.get(t).set(e,i)),i}defenseOnce(t,e,n){return"function"!=typeof e?null:this._pack(t,e,n)}find(t,e){return"string"!=typeof t||0===t.length||"function"!=typeof e?null:this._funcMap.has(t)?this._funcMap.get(t).has(e)?this._funcMap.get(t).get(e):(i.default.log(`SafetyCallback.find: 找不到 func —— ${t}/${""!==e.name?e.name:"[anonymous]"}`),null):(i.default.log(`SafetyCallback.find: 找不到 eventName-${t} 对应的 func`),null)}delete(t,e){return"function"==typeof e&&(!!this._funcMap.has(t)&&(!!this._funcMap.get(t).has(e)&&(this._funcMap.get(t).delete(e),0===this._funcMap.get(t).size&&this._funcMap.delete(t),!0)))}_pack(t,e,n){return function(){try{e.apply(n,Array.from(arguments))}catch(e){const n=Object.values(r.a).indexOf(t),o=Object.keys(r.a)[n];i.default.error(`接入侧事件 EVENT.${o} 对应的回调函数逻辑存在问题,请检查!`,e)}}}}},function(t,e,n){ /** * UUID.js - RFC-compliant UUID Generator for JavaScript * * @file * @author LiosK * @version v4.2.12 * @license Apache License 2.0: Copyright (c) 2010-2022 LiosK */ var i;i=function(e){function i(){var t=o._getRandomInt;this.timestamp=0,this.tick=0,this.sequence=t(14),this.node=1099511627776*(1|t(8))+t(40)}function o(){}return o.generate=function(){var t=o._getRandomInt,e=o._hexAligner;return e(t(32),8)+"-"+e(t(16),4)+"-"+e(16384|t(12),4)+"-"+e(32768|t(14),4)+"-"+e(t(48),12)},o._getRandomInt=function(t){if(t<0||t>53)return NaN;var e=0|1073741824*Math.random();return t>30?e+1073741824*(0|Math.random()*(1<>>30-t},o._hexAligner=function(t,e){for(var n=t.toString(16),i=e-n.length,o="0";i>0;i>>>=1,o+=o)1&i&&(n=o+n);return n},o.overwrittenUUID=e,function(){var t=o._getRandomInt;o.useMathRandom=function(){o._getRandomInt=t};var e=null,i=t;"undefined"!=typeof window&&(e=window.crypto||window.msCrypto)?e.getRandomValues&&"undefined"!=typeof Uint32Array&&(i=function(t){if(t<0||t>53)return NaN;var n=new Uint32Array(t>32?2:1);return n=e.getRandomValues(n)||n,t>32?n[0]+4294967296*(n[1]>>>64-t):n[0]>>>32-t}):(e=n(14))&&e.randomBytes&&(i=function(t){if(t<0||t>53)return NaN;var n=e.randomBytes(t>32?8:4),i=n.readUInt32BE(0);return t>32?i+4294967296*(n.readUInt32BE(4)>>>64-t):i>>>32-t}),o._getRandomInt=i}(),o.FIELD_NAMES=["timeLow","timeMid","timeHiAndVersion","clockSeqHiAndReserved","clockSeqLow","node"],o.FIELD_SIZES=[32,16,16,8,8,48],o.genV4=function(){var t=o._getRandomInt;return(new o)._init(t(32),t(16),16384|t(12),128|t(6),t(8),t(48))},o.parse=function(t){var e;if(e=/^\s*(urn:uuid:|\{)?([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{12})(\})?\s*$/i.exec(t)){var n=e[1]||"",i=e[8]||"";if(n+i===""||"{"===n&&"}"===i||"urn:uuid:"===n.toLowerCase()&&""===i)return(new o)._init(parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16),parseInt(e[5],16),parseInt(e[6],16),parseInt(e[7],16))}return null},o.prototype._init=function(){var t=o.FIELD_NAMES,e=o.FIELD_SIZES,n=o._binAligner,i=o._hexAligner;this.intFields=new Array(6),this.bitFields=new Array(6),this.hexFields=new Array(6);for(var r=0;r<6;r++){var s=parseInt(arguments[r]||0);this.intFields[r]=this.intFields[t[r]]=s,this.bitFields[r]=this.bitFields[t[r]]=n(s,e[r]),this.hexFields[r]=this.hexFields[t[r]]=i(s,e[r]>>>2)}return this.version=this.intFields.timeHiAndVersion>>>12&15,this.bitString=this.bitFields.join(""),this.hexNoDelim=this.hexFields.join(""),this.hexString=this.hexFields[0]+"-"+this.hexFields[1]+"-"+this.hexFields[2]+"-"+this.hexFields[3]+this.hexFields[4]+"-"+this.hexFields[5],this.urn="urn:uuid:"+this.hexString,this},o._binAligner=function(t,e){for(var n=t.toString(2),i=e-n.length,o="0";i>0;i>>>=1,o+=o)1&i&&(n=o+n);return n},o.prototype.toString=function(){return this.hexString},o.prototype.equals=function(t){if(!(t instanceof o))return!1;for(var e=0;e<6;e++)if(this.intFields[e]!==t.intFields[e])return!1;return!0},o.NIL=(new o)._init(0,0,0,0,0,0),o.genV1=function(){null==o._state&&o.resetState();var t=(new Date).getTime(),e=o._state;t!=e.timestamp?(t>>8|128,a=255&e.sequence;return(new o)._init(i,n.mid,r,s,a,e.node)},o.resetState=function(){o._state=new i},o._tsRatio=1/4,o._state=null,o._getTimeFieldValues=function(t){var e=t-Date.UTC(1582,9,15),n=e/4294967296*1e4&268435455;return{low:1e4*(268435455&e)%4294967296,mid:65535&n,hi:n>>>16,timestamp:e}},"object"==typeof t.exports&&(t.exports=o),o}(i)},function(t,e){},function(t){t.exports=JSON.parse('{"name":"tsignaling","version":"1.0.6","description":"腾讯云 Web 信令 SDK","main":"./src/index.ts","scripts":{"lint":"./node_modules/.bin/eslint ./src","fix":"./node_modules/.bin/eslint --fix ./src","ts2js":"tsc src/index.ts --outDir build/ts2js","doc":"npm run ts2js && npm run doc:clean && npm run doc:build","doc:build":"./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc.json && node ./build/jsdoc/fix-doc.js","doc:clean":"node ./build/jsdoc/clean-doc.js","build:wx":"cross-env NODE_ENV=wx webpack --config webpack.prod.config.js","build:web":"node node_modules/cross-env/src/bin/cross-env.js NODE_ENV=web node_modules/webpack/bin/webpack.js --config webpack.prod.config.js","build:package":"node build/package-bundle.js","prerelease":"npm run changelog && npm run build:web && npm run build:wx && npm run build:package && node ./build/copy.js","start:wx":"cross-env NODE_ENV=wx webpack-dev-server --config webpack.config.js","start:web":"node node_modules/cross-env/src/bin/cross-env.js NODE_ENV=web node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.dev.config.js","build_withcopy":"npm run build:web && cp dist/npm/tsignaling-js.js ../TIM-demo-web/node_modules/tsignaling/tsignaling-js.js","build_withcopy:mp":"npm run build:wx && cp dist/npm/tsignaling-wx.js ../TIM-demo-mini/static/component/TRTCCalling/utils/tsignaling-wx.js","changelog":"cp CHANGELOG.md build/jsdoc/tutorials/CHANGELOG.md"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"lint-staged":{"*.{.ts,.tsx}":["eslint","git add"]},"keywords":["腾讯云","即时通信","信令"],"author":"","license":"ISC","devDependencies":{"conventional-changelog-cli":"^2.1.1","cross-env":"^7.0.2","fs-extra":"^9.0.1","html-webpack-plugin":"^4.3.0","ts-loader":"^7.0.5","typescript":"^3.9.9","webpack":"^4.43.0","@types/node":"18.11.9","webpack-cli":"^3.3.11","webpack-dev-server":"^3.11.0"},"dependencies":{"@typescript-eslint/eslint-plugin":"^4.22.1","@typescript-eslint/parser":"^4.22.1","EventEmitter":"^1.0.0","docdash-blue":"1.1.9","eslint":"^5.16.0","eslint-config-google":"^0.13.0","eslint-plugin-classes":"^0.1.1","jsdoc":"^3.6.4","jsdoc-plugin-typescript":"^2.0.5","pretty":"^2.0.0","replace":"^1.2.0","uuidjs":"^4.2.5"}}')},function(t,e,n){var i,o=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{u(i.next(t))}catch(t){r(t)}}function a(t){try{u(i.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0&&u.lastMessage.lastTime&&1e3*u.lastMessage.lastTime>this.currentTime-this.expiredTime&&t.push(u);return[2,t]}}))}))},e}(l),f=function(t){function e(e){var n=t.call(this)||this;return n.tim=null,n.expiredTime=3e4,n.tim=e.tim,n}return o(e,t),e.prototype.doFilter=function(t){return r(this,void 0,void 0,(function(){var e,n,i,o,r,a,l,c,d=this;return s(this,(function(s){switch(s.label){case 0:e=[],n=0,s.label=1;case 1:return nd.currentTime-d.expiredTime}))),s.label=3;case 3:return n++,[3,1];case 4:return[2,e.flat().sort((function(t,e){return t.time-e.time}))]}}))}))},e}(l),_=function(t){function e(){return t.call(this)||this}return o(e,t),e.prototype.doFilter=function(t){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,t.filter((function(t){var e=!1;try{e=JSON.parse(t.payload.data).businessID===a.BusinessID.SIGNAL}catch(t){}return e}))]}))}))},e}(l),p=function(t){function e(){return t.call(this)||this}return o(e,t),e.prototype.doFilter=function(t){return r(this,void 0,void 0,(function(){var e,n,i;return s(this,(function(o){return Array.isArray(t)?0===t.length?[2,[]]:(e=new Map,t.forEach((function(t,n){var i=JSON.parse(t.payload.data),o=i.inviteID,r=i.actionType;!e.has(o)||e.get(o).actionType!==a.ActionType.INVITE||r!==a.ActionType.CANCEL_INVITE&&r!==a.ActionType.ACCEPT_INVITE&&r!==a.ActionType.REJECT_INVITE&&r!==a.ActionType.INVITE_TIMEOUT?e.set(o,{index:n,actionType:r}):e.delete(o)})),n=[],e.forEach((function(t){t.actionType===a.ActionType.INVITE&&n.push(t.index)})),0===n.length?[2,[]]:(i=[],n.sort((function(t,e){return t-e})).forEach((function(e){i.push(t[e])})),[2,i])):[2,[]]}))}))},e}(l),I=function(){function t(t){this.tim=null;var e=t.tim;this.tim=e}return t.prototype.getHistoricalSignaling=function(){return r(this,void 0,void 0,(function(){var t;return s(this,(function(e){return(t=new c).register(new d({tim:this.tim})),t.register(new f({tim:this.tim})),t.register(new _),t.register(new p),[2,t.run()]}))}))},t}();e.default=I}]).default})); }, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) return __REQUIRE__(1744442642936); })() //miniprogram-npm-outsideDeps=["tim-wx-sdk"] //# sourceMappingURL=index.js.map