@zoom/cobrowsesdk 2.8.2 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/esm/agent.js +1 -1
- package/esm/customer.js +1 -1
- package/esm/global-cache.js +1 -0
- package/esm/sdk-channel.js +1 -1
- package/esm/sdk-client-agent.js +1 -1
- package/esm/sdk-client.js +1 -1
- package/esm/sdk-controller.js +1 -1
- package/esm/sdk-core-css.js +1 -1
- package/esm/sdk-core.js +1 -1
- package/esm/sdk-polyfill.js +1 -0
- package/esm/sdk-portal-agent.js +1 -1
- package/esm/sdk-portal-customer.js +1 -1
- package/package.json +1 -1
- package/umd/agent.js +1 -1
- package/umd/customer.js +1 -1
- package/esm/base.js +0 -1
package/esm/base.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */t=function(){return r};var e,r={},n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function l(t,r,n,i){var o=r&&r.prototype instanceof d?r:d,a=Object.create(o.prototype);return f(a,"_invoke",function(t,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var s=P(u,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var c=h(t,r,n);if("normal"===c.type){if(i=n.done?4:2,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=4,n.method="throw",n.arg=c.arg)}}}(t,n,new k(i||[])),!0),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=l;var p={};function d(){}function v(){}function m(){}var y={};f(y,u,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(I([])));b&&b!==n&&i.call(b,u)&&(y=b);var E=m.prototype=d.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(n,a,u,s){var c=h(t[n],t,a);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==o(l)&&i.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,u,s)}),(function(t){r("throw",t,u,s)})):e.resolve(l).then((function(t){f.value=t,u(f)}),(function(t){return r("throw",t,u,s)}))}s(c.arg)}var n;f(this,"_invoke",(function(t,i){function o(){return new e((function(e,n){r(t,i,e,n)}))}return n=n?n.then(o,o):o()}),!0)}function P(t,r){var n=r.method,i=t.i[n];if(i===e)return r.delegate=null,"throw"===n&&t.i.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=h(i,t.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var a=o.arg;return a?a.done?(r[t.r]=a.value,r.next=t.n,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function R(t){this.tryEntries.push(t)}function T(t){var r=t[4]||{};r.type="normal",r.arg=e,t[4]=r}function k(t){this.tryEntries=[[-1]],t.forEach(R,this),this.reset(!0)}function I(t){if(null!=t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function r(){for(;++n<t.length;)if(i.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(o(t)+" is not iterable")}return v.prototype=m,f(E,"constructor",m),f(m,"constructor",v),v.displayName=f(m,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,f(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},w(O.prototype),f(O.prototype,s,(function(){return this})),r.AsyncIterator=O,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new O(l(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(E),f(E,c,"Generator"),f(E,u,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},r.values=I,k.prototype={constructor:k,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e){a.type="throw",a.arg=t,r.next=e}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],u=this.prev,s=o[1],c=o[2];if(-1===o[0])return n("end"),!1;if(!s&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=u){if(u<s)return this.method="next",this.arg=e,n(s),!0;if(u<c)return n(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===t||"continue"===t)&&i[0]<=e&&e<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i[2],p):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),T(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={i:I(t),r:r,n:n},"next"===this.method&&(this.arg=e),p}},r}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function n(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(t){o(t)}}function u(t){try{s(n.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))}function u(t){if("object"===("undefined"==typeof window?"undefined":o(window))){var e=encodeURI(t);return btoa(e)}return Buffer.from(t).toString("base64")}var s=function(t){return u(t)},c=function(){function t(r){var n=r.requestOrigin,i=r.parentFrameId;e(this,t),this.parentFrameId=i;var o=s(n);i&&(o=i+"--"+o),this.frameId=o}return n(t,[{key:"equal",value:function(t){var e=t.requestOrigin,r=t.parentFrameId;return r===this.parentFrameId&&this.frameId===r+"--"+s(e)}},{key:"isParentFrame",value:function(t){return this.frameId===t}},{key:"isSubFrame",value:function(t){return this.parentFrameId===t}}]),t}(),f=function(){function t(r){e(this,t),this.frames=new Map,this.tabId=r}return n(t,[{key:"getFrame",value:function(t){var e=t.requestOrigin,r=t.parentFrameId,n=null;return this.frames.forEach((function(t){t.equal({requestOrigin:e,parentFrameId:r})&&(n=t)})),n}},{key:"checkAddFrame",value:function(t){var e=this,r=t.requestOrigin,n=t.parentFrameId,i=this.getFrame({requestOrigin:r,parentFrameId:n});if(i)return i;if(this.tabId===n)return this.addFrame({requestOrigin:r,parentFrameId:n});var o=null;return this.frames.forEach((function(t){o||t.isParentFrame(n)&&(o=e.addFrame({requestOrigin:r,parentFrameId:n}))})),o}},{key:"getSubFrames",value:function(t){var e=[];return this.frames.forEach((function(r){r.isSubFrame(t)&&e.push(r)})),e}},{key:"addFrame",value:function(t){var e=t.requestOrigin,r=t.parentFrameId,n=new c({requestOrigin:e,parentFrameId:r});return this.frames.set(n.frameId,n),n}}]),t}(),l=function(){function t(){e(this,t),this.tabs=new Map}return n(t,[{key:"makeRequest",value:function(t){var e=t.requestOrigin,r=t.parentFrameId,n="";return r?(this.tabs.forEach((function(t){if(!n){var i=t.checkAddFrame({requestOrigin:e,parentFrameId:r});i&&(n=i.frameId)}})),n):this.tabs.size?(this.tabs.forEach((function(t,e){n||(n=e)})),n):(n=s(e),this.tabs.set(n,new f(n)),n)}},{key:"makeViewerRequest",value:function(t){var e=t.parentFrameId,r="";return this.tabs.forEach((function(t){var n;if(e){if(r)return;var i=t.getSubFrames(e);r=(null===(n=i[0])||void 0===n?void 0:n.frameId)||""}else r=t.tabId})),r}}]),t}(),h=new(function(){function t(){e(this,t),this.rooms=new Map}return n(t,[{key:"makeRequest",value:function(t){var e=t.roomId,r=t.requestOrigin,n=t.parentFrameId,i=t.isViewer;this.rooms.get(e)||this.rooms.set(e,new l);var o=this.rooms.get(e);return o?i?o.makeViewerRequest({parentFrameId:n}):o.makeRequest({requestOrigin:r,parentFrameId:n}):""}}]),t}());"undefined"!=typeof global&&(global.cpsRoomManager=h);var p,d,v,m=function(t,e){return"".concat(t).concat(e)};!function t(e,r){var n={},i=function(){var i=e[a];"string"==typeof i?n[a]=m(r,i):"function"==typeof i?n[a]=function(){return m(r,i.apply(void 0,arguments))}:"object"===o(i)&&(i instanceof RegExp||(n[a]=t(i,r)))};for(var a in e)i();return n}({log:{report:"/report-log"},blob:{uploadBlob:"/upload-blob",getBlobUrl:function(t){return"/cps-blob-".concat(t)},getBlobUrlReg:/cps-blob-([^?#\/]+)/}},"/co-browsing"),function(t){t.LOCAL="local",t.PROD="prod"}(p||(p={})),function(t){t.LEADER="1",t.FOLLOWER="2",t.RECORDER="11"}(d||(d={})),function(t){t.IMG="IMG",t.SOURCE="SOURCE",t.LINK="LINK",t.A="A",t.AUDIO="AUDIO",t.IFRAME="IFRAME",t.FORM="FORM",t.SCRIPT="SCRIPT",t.STYLE="STYLE"}(v||(v={}));var y,g,b,E,w,O,P,R;!function(t){t.LEADER="HR",t.FOLLOWER="VR"}(y||(y={})),new RegExp("(.+)(HTTPS?)/(.+)/".concat("CPS-SEP-FLAG","/(").concat(y.FOLLOWER,"|").concat(y.LEADER,")")),function(t){t[t.TYPE_UNKNOWN=-1]="TYPE_UNKNOWN",t[t.TYPE_TOP=1]="TYPE_TOP",t[t.TYPE_FRAME=2]="TYPE_FRAME",t[t.TYPE_AUX=3]="TYPE_AUX",t[t.TYPE_SCRIPT=4]="TYPE_SCRIPT",t[t.TYPE_MODULE=5]="TYPE_MODULE",t[t.TYPE_LINK=6]="TYPE_LINK",t[t.TYPE_XHR=7]="TYPE_XHR",t[t.TYPE_RESOURCE=8]="TYPE_RESOURCE",t[t.TYPE_WORKER=9]="TYPE_WORKER",t[t.TYPE_WORKER_SCOPE=10]="TYPE_WORKER_SCOPE",t[t.TYPE_REDIRECT=11]="TYPE_REDIRECT",t[t.TYPE_PAWS=12]="TYPE_PAWS",t[t.TYPE_CONTINUATION=13]="TYPE_CONTINUATION"}(g||(g={})),function(t){t.UNKNOW="unknow",t.BROWSER="browser",t.BROWSER_WORKER="worker",t.NODE="node",t.NODE_WORKER="node_worker"}(b||(b={})),E="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,w="undefined"!=typeof window,O="function"==typeof importScripts,P=E&&!O,R=!E&&!w,O?b.BROWSER_WORKER:w?b.BROWSER:R?b.NODE:P?b.NODE_WORKER:b.UNKNOW;var T,k,I=n((function t(){var r=this;e(this,t),this.promise=new Promise((function(t,e){r.reject=e,r.resolve=t})),this.promise.then((function(t){return r.resolved=!0,t})).catch((function(){r.resolved=!1})).finally((function(){r.finished=!0,r.finishedTimestamp=Date.now()}))}));!function(t){t.PING="zcb-sdk-ping",t.PONG="zcb-sdk-pong"}(T||(T={})),function(t){t.CSS="text/css",t.JS="application/javascript"}(k||(k={}));var _=function(){function r(t){e(this,r),this.options=t,this._initTimer=null,this._bindedPongHandler=null,this.receivedPong=!1,this.codeBlobMap=new Map,this.enableBlob=!1;var n=this.options.doc;this.doc=n,this.ping()}return n(r,[{key:"ping",value:function(){this.addListener();try{if(window.parent===window)return void this.initCallback(!0);window.parent.postMessage("sdk-ping","*")}catch(t){return this.stopInitTimer(),void this.initCallback(!0)}this.startInitTimer()}},{key:"startInitTimer",value:function(){var t=this,e=(this.options||{}).pingPongTimeout,r=void 0===e?500:e;this.stopInitTimer(),this._initTimer=setTimeout((function(){t.receivedPong||t.initCallback(!0)}),r)}},{key:"stopInitTimer",value:function(){this.removeListener(),this._initTimer&&(clearTimeout(this._initTimer),this._initTimer=null)}},{key:"addListener",value:function(){this._bindedPongHandler=this.handlePong.bind(this),window.addEventListener("message",this._bindedPongHandler)}},{key:"removeListener",value:function(){this._bindedPongHandler&&window.removeEventListener("message",this._bindedPongHandler)}},{key:"handlePong",value:function(t){var e;try{t.data===T.PING&&(null===(e=t.source)||void 0===e||e.postMessage(T.PONG,"*")),t.data===T.PONG&&(this.receivedPong=!0,this.initCallback(!1))}catch(t){this.stopInitTimer(),this.initCallback(!0)}}},{key:"initCallback",value:function(e){return a(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),e)})))}},{key:"addScript",value:function(t,e,r,n,i){var o=t.createElement("script");if(o.type="text/javascript",this.enableBlob?(o.src=r,o.async=!1):o.textContent=r,o.id=i,n)for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);e.appendChild(o)}},{key:"addLink",value:function(t,e,r,n,i){var o=this.enableBlob?"link":"style",a=t.createElement(o);if(this.enableBlob?(a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href",r)):a.textContent=r,a.setAttribute("class","CBS-internal-block"),a.id=i,n)for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);e.appendChild(a)}},{key:"appendByFragment",value:function(e,r,n,i,o){return a(this,void 0,void 0,t().mark((function a(){var u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=e.createDocumentFragment(),t.next=3,this.getTrunkBlobUrl(r,n);case 3:t.sent.forEach((function(t){var r=t.url,n=t.attrs,o=t.name;i(e,u,r,n,o)})),o.appendChild(u);case 6:case"end":return t.stop()}}),a,this)})))}},{key:"getTrunkBlobUrl",value:function(e,r){return a(this,void 0,void 0,t().mark((function n(){var i=this;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.enableBlob){t.next=6;break}return t.next=3,Promise.all(e.map((function(t){var e=t.url,n=t.lazyContent;if(i.codeBlobMap.get(e))return Promise.resolve(null);var o=new I;return i.codeBlobMap.set(e,o),n.then((function(t){return i.getBlobUrl(t.default,r)})).then((function(t){o.resolve(t)})).catch((function(t){o.reject(t),i.codeBlobMap.delete(e)}))})));case 3:return t.abrupt("return",Promise.all(e.map((function(t){var e=t.url,r=t.attrs,n=t.name;return i.codeBlobMap.get(e).promise.then((function(t){return{url:t,attrs:r,name:n}}))}))));case 6:return t.abrupt("return",Promise.all(e.map((function(t){var e=t.lazyContent,r=t.attrs,n=t.name;return e.then((function(t){return{url:t.default,attrs:r,name:n}}))}))));case 7:case"end":return t.stop()}}),n,this)})))}},{key:"getBlobUrl",value:function(t,e){var r=new Blob([t],{type:e});return URL.createObjectURL(r)}}]),r}();export{I as D,_ as S,k as T,a as _};
|