@pendo/agent 2.337.3 → 2.339.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/dist/debugger-plugin.min.js +1 -1
- package/dist/dom.esm.js +20 -22
- package/dist/pendo.debugger.min.js +13 -8
- package/dist/pendo.module.js +2558 -1902
- package/dist/pendo.module.min.js +11 -11
- package/dist/pendo.preview.min.js +5 -5
- package/dist/replay.worker.min.js +1 -1
- package/dist/servers.json +8 -8
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license https://agent.pendo.io/licenses
|
|
3
3
|
*/
|
|
4
|
-
!function(){"use strict";class M{constructor(e,t){this.path=e,this.handler=t}}class W{routes={};addRoute(e,t){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new M(e,t))}removeRoute(e){this.routes[e].shift()}lookupRouteProvider(){return e=>this.routes[e]?this.routes[e][0].handler:undefined}}const u=(...e)=>s=>{return[].concat(e).reduce((e,t,i,n)=>{e=t(e,s);return e||n.splice(i,n.length-i),e},s)};let G=0;const i=(e,t,i)=>{if(!e||"string"!=typeof t)return i;let n=e;for(const s of t.split(".")){if(null==n)return i;n=n[s]}return n===undefined?i:n};const t=(t,i)=>{if(t&&i)if(Array.isArray(t))for(let e=0;e<t.length;e++)i(t[e],e,t);else if("object"==typeof t)for(const e in t)t.hasOwnProperty(e)&&i(t[e],e,t);return t},c=e=>"function"==typeof e,O=e=>!(null==e),d=()=>Date.now();class e{app=null;router=null;destination=window.parent||window.top;origin="*";constructor(e,t={}){this.app=e,this.router=e.router,this.config=t,this.events=e.PluginAPI.getEventable()}getConfig(e,t){return i(this.config,e,t)}getDestinationProvider(){return()=>this.destination}getOriginProvider(){return()=>this.origin}triggerOpened(){this.events.trigger("opened",{containerType:this.type})}triggerClosed(){this.events.trigger("closed",{containerType:this.type})}}var a={padding:"0 !important",margin:"0 !important","box-sizing":"border-box !important",border:"none !important",display:"block !important",visibility:"visible !important"},h=2147483647,g={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:p,MIN_WIDTH:l,WINDOW_MARGIN:f}=g;function r(t,i,n,s,o){let r=0,a=0,d=0,h=0;function u(e){e.preventDefault(),i.css({visibility:"hidden"}),t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",c),o()}function c(e){-1!==e.button||0===e.buttons?u(e):(e.preventDefault(),d=r-e.clientX,h=a-e.clientY,s(d,h))}t.addEventListener("pointerdown",function(e){0===e.button&&(e.preventDefault(),i.css({visibility:"visible"}),r=e.clientX,a=e.clientY,t.setPointerCapture(e.pointerId),t.addEventListener("pointermove",c),n())}),t.addEventListener("pointerup",u),t.addEventListener("pointercancel",u)}function F(e,t){const i=e.handle[0],n=e.container[0];let s=0,o=0;r(i,e.blockout,function(){i.style.cursor="grabbing",s=n.offsetLeft,o=n.offsetTop},function(e,t){n.style.left=m({offsetLeft:s,offsetWidth:n.offsetWidth},e)+"px",n.style.top=v({offsetTop:o,offsetHeight:n.offsetHeight},t)+"px"},function(){i.style.cursor="grab",t()})}function m(e,t){t=e.offsetLeft-t,e=window.innerWidth-e.offsetWidth-f;return t<f||e<f?f:e<t?e:t}function v(e,t){t=e.offsetTop-t,e=window.innerHeight-e.offsetHeight-f;return t<f||e<f?f:e<t?e:t}function U(e,t){var i=e.resizeHandle[0];const n=e.container[0];let s=0,o=0;r(i,e.blockout,function(){s=n.offsetWidth,o=n.offsetHeight},function(e,t){n.style.width=b({offsetWidth:s,offsetLeft:n.offsetLeft},e)+"px",n.style.height=w({offsetHeight:o,offsetTop:n.offsetTop},t)+"px"},t)}function b(e,t){t=e.offsetWidth-t,e=window.innerWidth-e.offsetLeft-f;return e<t?e:t<l?l:t}function w(e,t){t=e.offsetHeight-t,e=window.innerHeight-e.offsetTop-f;return e<t?e:t<p?p:t}class _ extends e{type="frame";destination=window.parent||window.top;origin=/^https?:/.test(window.location.protocol)?window.location.origin:"*";constructor(n,e){super(n,e);const{pendo:s,PluginAPI:o}=n;e=this.getConfig("containerId","pendo-client-app");this.container=s.dom(`<div id="${e}" class="pendo-ignore">`).css({...a,height:n.state.height,width:n.state.width,"z-index":h-1,"background-color":"#FFFFFF",position:"fixed","box-shadow":"rgb(136, 136, 136) 0px 0px 20px 0px",overflow:"hidden"}),this.handle=s.dom('<div id="pendo-app-draggable-handle">').css({...a,"z-index":h,height:g.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",()=>{n.state.minimized||(this.container.css({height:g.HEIGHT,width:g.WIDTH,transition:"all 250ms linear"}),setTimeout(()=>{this.container&&(this.container.css({transition:"none"}),this.saveSize())},250))}).appendTo(this.container),this.resizeHandle=s.dom('<div id="pendo-app-resize-handle">').css({...a,"z-index":h,visibility:this.app.state.minimized?"hidden":"visible",height:0,width:0,"border-left":"10px solid transparent","border-bottom":"10px solid rgb(136, 136, 136)",cursor:"nwse-resize",position:"absolute",bottom:0,right:0}).appendTo(this.container),this.frame=s.dom('<iframe id="pendo-agent-application" src="about:blank">').css({...a,height:"100%",width:"100%"}).on("load",()=>{if(o.ConfigReader.get("inlineStyleNonce")){const i=this.frame[0].contentDocument.createElement.bind(this.frame[0].contentDocument);this.frame[0].contentDocument.createElement=(e,...t)=>{t=i(e,...t);return"style"===e&&(e=o.ConfigReader.get("inlineStyleNonce"))&&t.setAttribute("nonce",e),t}}var e,t=document.createElement("script");t.src=((e=s)&&e.trustedTypesPolicy?e.trustedTypesPolicy:{createScriptURL(e){return e}}).createScriptURL(o.hosts.getAssetUrl(n.assetName)),t.setAttribute("data-pendo-font-base",o.hosts.getFontBaseUrl()),this.frame[0].contentDocument.body.appendChild(t),this.frame[0].contentWindow.ignoreIframeMonitor=!0,this.triggerOpened()}).appendTo(this.container),this.blockout=s.dom('<div id="pendo-app-dragging-blockout">').css({"z-index":h-2,position:"absolute",height:"100%",width:"100%",top:0,left:0,visibility:"hidden"}).appendTo(s.dom.getBody()),this.elements=[this.container,this.blockout],this.positionFrame=e=>{var{left:t,top:i,height:n}=e,{minimized:e,width:s}=e,t=t||g.LEFT,i=i||g.TOP,n=e?g.HEADER_HEIGHT:n;t=m({offsetLeft:t,offsetWidth:s},0),i=v({offsetTop:i,offsetHeight:n},0),this.container.css({left:t,top:i,height:n}),this.savePosition()},this.saveSize=()=>{var{offsetHeight:e,offsetWidth:t}=this.container[0];e&&t&&this.app.setProperties({height:e,width:t})},this.savePosition=()=>{var{offsetLeft:e,offsetTop:t}=this.container[0];e&&t&&this.app.setProperties({left:e,top:t})},this.toggleMinimize=()=>{this.app.setProperties({minimized:!this.app.state.minimized}),this.resizeHandle.css({visibility:this.app.state.minimized?"hidden":"visible"}),this.positionFrame(this.app.state)},this.positionFrame(this.app.state),F(this,this.savePosition),U(this,this.saveSize),window.addEventListener("resize",r),this.listeners=[["resize",r]];const t=s._.throttle(()=>{return e=this.container[0],0<(t=e.offsetLeft+e.offsetWidth+f-window.innerWidth)&&(e.style.left=m(e,t)+"px",e.offsetWidth>l)&&(e.style.width=b(e,t)+"px"),void(0<(t=e.offsetTop+e.offsetHeight+f-window.innerHeight)&&(e.style.top=v(e,t)+"px",e.offsetHeight>p)&&(e.style.height=w(e,t)+"px"));var e,t},10),i=s._.debounce(()=>{this.savePosition(),this.saveSize()},1e3);function r(){t(),i()}}open(){return this.router.addRoute("app::toggleMinimize",this.toggleMinimize),this.container.appendTo(this.app.pendo.dom.getBody()),Promise.resolve()}close(){this.router.removeRoute("app::toggleMinimize"),this.listeners.forEach(([e,t])=>window.removeEventListener(e,t)),this.elements.forEach(e=>e.remove()),this.triggerClosed()}}const y="promise";function T(e,t,i){this.name=e,this.type=t,this.data=i}T.prototype.toString=function(){return`Message.${this.type} - `+this.name};const B=(e,t,i)=>{e=new T(e,t,i);return t===y&&(e.requestId=""+(G+=1)),e},P=e=>{try{var{name:t,type:i,isResponse:n,data:s,requestId:o,sender:r}=e.data||{},a=new T(t,i,O(s)?JSON.parse(s):undefined);return a.requestId=o,a.sender=r,a.destination=e.source,a.isResponse=n,a}catch(d){return!1}},$=e=>{var t=((e,t)=>{if(!e||"object"!=typeof e)return{};var i=Array.isArray(t)?t:[t],n={};for(const s in e)e.hasOwnProperty(s)&&!i.includes(s)&&(n[s]=e[s]);return n})(e,["destination","toString","data"]);return t.data=JSON.stringify(e.data,(e,t)=>"function"==typeof t||t instanceof RegExp?t.toString?t.toString():undefined:t),t},n=e=>(e.isResponse=!0,e),s="disconnected",C={lastMessageReceivedAt:0,currentConnectionQuality:s,changeCallbacks:{},evalCallbacks:{}},o=e=>{e!==C.currentConnectionQuality&&(C.currentConnectionQuality=e,t(C.changeCallbacks,e=>{e(C.currentConnectionQuality)}))},q=()=>{var e;0===C.lastMessageReceivedAt?o(s):((e=d()-C.lastMessageReceivedAt)<1e4?o("connected"):1e4<e&&(3e4<e?o("dead_connection"):o(s)),t(C.evalCallbacks,e=>{e(C.currentConnectionQuality)}))};let I;let R=0;const j=()=>{C.currentConnectionQuality=s,C.lastMessageReceivedAt=0},E={appName:undefined,connectionName:undefined,frameId:undefined,pendingRequests:{},topics:{},senderIds:{},originProvider:undefined,destinationProvider:undefined},H=()=>""+E.appName+E.connectionName+`(${E.frameId})`,S=e=>{e.sender||(e.sender=H());var t=e.destination||E.destinationProvider(),i=$(e),n=Q(e.sender),s=K(e.sender);n||s?n?n.postMessage(i):t.postMessage(i,E.originProvider()):(s=new MessageChannel,ee(s.port1,e.sender),t.postMessage(i,E.originProvider(),[s.port2]))},A=(s,o,r=1e3)=>new Promise((e,t)=>{const i=B(s,y,o),n=setTimeout(()=>{t(s+" timeout"),z(i),ie(i)},r);J(i,()=>clearTimeout(n),e,t),S(i)}),D=e=>{var t;return E.senderIds[e]||(t=e,E.senderIds[t])||(E.senderIds[t]={port:undefined,hasTriedToUpgradeToMessageChannel:!1}),E.senderIds[e]},Q=e=>D(e).port,K=e=>D(e).hasTriedToUpgradeToMessageChannel,J=(e,t,i,n)=>{E.pendingRequests[e.requestId]={message:e,clearTimeoutfn:t,resolve:i,reject:n}};const z=e=>{var t=e["requestId"];return E.pendingRequests[t].clearTimeoutfn(),delete E.pendingRequests[t],e};const k="message::ping";var X;const Y=u(e=>{var t=E.pendingRequests[e.requestId];return t&&(t.resolve(e.data),z(e)),e},t=>{var e=E.topics[t.name];return e&&e.forEach(e=>e(t.data)),t},t=>{var e;return t&&!t.isResponse&&(t.name===k?S(n(t)):(e=E.routeHandlerLookup(t.name))?e(t,e=>{t.data=e,S(n(t))}):console.log(H(),"No route handler for "+t.name,t)),t},(X=()=>{var e;e=d(),C.lastMessageReceivedAt=e},(e,...t)=>(X(e,...t),e))),V=e=>("*"===E.originProvider()||e.origin===E.originProvider())&&e,Z=e=>{var t=i(e,"data.sender");return!(!t||"string"!=typeof t||!t.includes(E.appName))&&e},ee=(e,t)=>{t=D(t);t.port=e,t.hasTriedToUpgradeToMessageChannel=!0,t.port.onmessage=u(P,Y)},te=(e,t)=>{return!D(e.sender).hasTriedToUpgradeToMessageChannel&&t.ports&&t.ports[0]&&ee(t.ports[0],e.sender),e},ie=e=>{e=e.sender;(e=D(e)).port=undefined,e.hasTriedToUpgradeToMessageChannel=!1};let L=()=>{};const ne=()=>{L(),L=()=>{},I&&I(),j()},se=((n,s)=>{let o,r=0,a;return function(...e){var t=d(),i=s-(t-r);return i<=0||s<i?(o&&(clearTimeout(o),o=null),r=t,a=n.apply(this,e)):!o&&0<s&&(o=setTimeout(()=>{r=d(),o=null,a=n.apply(this,e)},i)),a}})(e=>{"connected"!==e&&E.usePingAutoReconnect&&A(k)["catch"](()=>{})},1e3),oe=(e,t,i,n,s,o=!1,r)=>{if(window.addEventListener){E.appName=e,E.frameId=t,E.routeHandlerLookup=i,E.usePingAutoReconnect=o,E.connectionName=r||"",E.originProvider=n||(()=>window.location.origin||"*"),E.destinationProvider=s||(()=>window.parent||window.top);{const d=setInterval(q,100);I=()=>clearInterval(d)}e=se;if(c(e)){const h=R++;C.evalCallbacks[h]=e}const a=u(V,Z,P,te,Y);window.addEventListener("message",a),L=()=>window.removeEventListener("message",a)}},re=e=>{if(c(e)){const t=R++;C.changeCallbacks[t]=e}};class ae extends e{type="window";testUrl="";realUrl=undefined;getTitle(){return this.getConfig("title",this.getName())}getName(){return this.getConfig("name","Agent_Application")}open(){return this.router.addRoute("app::windowClosed",()=>{this.app.setProperties({containerType:"frame"}),this.app.stop()}),this.testConnection().then(()=>{this.triggerOpened()})["catch"](()=>{return this.createWindow(),s=this.app,o=1e3,new Promise((e,t)=>{const i=d(),n=()=>{s.getConnectionStatus()?e():d()-i>o?t():setTimeout(n,50)};n()});var s,o})}testConnection(){return this.destination=window.open(this.testUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`),A("app::reconnect")}createWindow(){this.realUrl&&(this.destination=window.open(this.realUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`));var e=document.createElement("script");e.src=this.app.PluginAPI.hosts.getAssetUrl(this.app.assetName),e.setAttribute("data-pendo-font-base",this.app.PluginAPI.hosts.getFontBaseUrl()),this.destination.document.body.appendChild(e),this.destination.document.title=this.getTitle()}close(){this.router.removeRoute("app::windowClosed"),this.destination.close(),this.triggerClosed()}}const de=()=>({});class he{defaultState={containerType:"frame",minimized:!1,height:g.HEIGHT,width:g.WIDTH,left:g.LEFT,top:g.TOP};state={};containerClosedCallbacks=[];container=null;isConnected=!1;constructor(e,t,i,n,s,o=de,r=de){this.appName=e,this.assetName=t,this.assetStorageKey=i,this.connectionName=n,this.frameConfigProvider=o,this.windowConfigProvider=r,s&&Object.assign(this.defaultState,s),this.router=new W}init(e,t){this.pendo=e,this.PluginAPI=t,this.events=t.getEventable(),this.router.addRoute("app::ping",(e,t)=>{t()}),this.router.addRoute("app::setProperties",({data:e})=>{this.setProperties(e)}),this.router.addRoute("app::toggleContainer",()=>{this.setProperties({minimized:!1}),this.toggleContainerType()}),this.router.addRoute("app::windowClosed",()=>{}),this.loadState(),this.prepContainer(),this.start()}prepContainer(){this.container="window"===this.state.containerType?new ae(this,this.windowConfigProvider()):new _(this,this.frameConfigProvider())}setConnectionStatus(e){this.isConnected="connected"===e}getConnectionStatus(){return this.isConnected}setProperties(e){Object.assign(this.state,e),this.writeState()}getDefaultState(){return this.defaultState||{}}loadState(){try{var e=this.PluginAPI.agentStorage.read(this.assetStorageKey);this.state=Object.assign({},this.getDefaultState(),this.state,e)}catch(t){this.PluginAPI.log.error(t),this.state=Object.assign({},this.getDefaultState(),this.state)}}writeState(){this.PluginAPI.agentStorage.write(this.assetStorageKey,this.state)}toggleContainerType(){var e="frame"===this.state.containerType?"window":"frame";this.setProperties({containerType:e}),this.stop(),this.start()}start(){this.container||this.prepContainer();var e=this.PluginAPI.EventTracer.addTracerIds({})["frameId"];oe(this.appName,e,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),re(e=>{this.setConnectionStatus(e)}),this.container.open().then(()=>{this.events.trigger("mounted")})["catch"](()=>{"window"===this.state.containerType?(this.setProperties({containerType:"frame"}),this.prepContainer(),this.start()):(this.PluginAPI.log(`Failed to start ${this.appName} in either window or frame.`),this.stop())})}stop(){this.container.close(),this.container=null,this.events.trigger("unmounted"),ne()}}const ue=()=>{try{return performance.getEntries()}catch(e){return[{failedGetEntries:!0,message:e.message,stack:e.stack}]}};class ce extends he{constructor(){super("Debugger","pendo.debugger.min.js","debug-enabled","AgentPlugin",null,()=>({containerId:"pendo-client-debugger"}),()=>({title:"Pendo Debugger"}))}initialize(s,o){o.restartDebugger=this.start.bind(this),super.init(s,o),o.Events.on("leaderChanged",()=>{this.container&&!o.store.getters["frames/isLeader"]()&&this.stop()}),this.router.addRoute("debugger::connect",(e,t)=>{var i;t({config:o.ConfigReader.audit(),env:{apiKey:(i=s).apiKey,environment:i.debugging.isStagingServer()?"staging":"production",device:i.debugging.isMobileUserAgent()?"mobile":"desktop",browserCookies:window.navigator.cookieEnabled,guideStatus:i.areGuidesDisabled()?"off":i.areGuidesDelayed()?"delayed":"on",foundShadowRoot:!!(i=i.debugging.observer.shadowDom).foundShadowRoots||(i.findShadowRoots(document,Infinity,()=>{}),i.foundShadowRoots)},container:this.state,events:o.store.state["debugger"].eventsCaptured,timeOrigin:performance.timeOrigin})}),this.router.addRoute("debugger::stop",()=>{s.disableDebugging()}),this.router.addRoute("debugger::showGuideById",(e,t)=>{t(s.showGuideById(e.data))}),this.router.addRoute("debugger::toggleGuideLoop",e=>{e.data?s.startGuides():s.stopGuides()}),this.router.addRoute("debugger::tombstoneGuide",e=>{e=s.findGuideById(e.data);o.Tombstone.addGuide(e)}),this.router.addRoute("debugger::openGuidePage",e=>{e=e.data,n=s,t=o.hosts.SERVER;var t,i,n=(i=n.findGuideById(e))&&n._.get(i,"attributes.resourceCenter")?i.attributes.resourceCenter.isTopLevel?`${t}/resource-center/${i.id}/draft`:(n=n.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter())&&n.id?`${t}/resource-center/${n.id}/module/`+i.id:"":t+"/guides/"+e;n&&window.open(n,"_blank")}),this.router.addRoute("debugger::restore",({data:e})=>{if(e&&e.length){const t=document.createElement("iframe");t.sandbox="allow-same-origin",t.src="about:blank",t.hidden=!0,document.body.appendChild(t),t.contentWindow.ignoreIframeMonitor=!0,e.forEach(e=>{e.id.split(".").reduce((e,t,i,n)=>i===n.length-1?(e.destination[t]=e.source[t],e.destination[t]):(e.destination=e.destination[t],e.source=e.source[t],e),{destination:window,source:t.contentWindow})}),document.body.removeChild(t)}}),this.router.addRoute("debugger::sync",(e,i)=>{const t=o.store.subscribe((e,t)=>{"debugger/eventsCaptured"===e.type&&i({action:"events/eventsCaptured",data:t["debugger"].eventsCaptured})}),n=setInterval(()=>{i({action:"agent/sync",data:o.store.state}),i({action:"environment/validateEnvironment",data:s.validateEnvironment(!0)}),i({action:"performance/sync",data:ue()})},500);this.events.on("unmounted",()=>{clearInterval(n),t(),o.store.dispatch("debugger/clearHighlight")})}),this.router.addRoute("debugger::enableEventLogging",({data:e})=>{this.setProperties({enableEventLogging:e}),o.store.dispatch("debugger/enableEventLogging",e)}),this.router.addRoute("debugger::clearEventsCaptured",()=>{o.store.dispatch("debugger/clearEventsCaptured")}),this.router.addRoute("debugger::checkGuideEligibility",({data:e},t)=>{o.store.dispatch("debugger/checkGuideEligibility",{guideId:e,response:t})}),this.router.addRoute("debugger::testSelector",({data:e},t)=>{o.store.dispatch("debugger/testSelector",{selector:e,response:t})}),this.router.addRoute("debugger::highlightElement",({data:e},t)=>{var{selector:e,targetFrame:i,outlineFrame:n}=e||{};o.store.dispatch("debugger/highlightElement",{selector:e,targetFrame:i,outlineFrame:n,response:t})}),this.router.addRoute("debugger::clearHighlight",()=>{o.store.dispatch("debugger/clearHighlight")})}teardown(){super.stop(),this.setProperties({enabled:!1,containerType:"frame"})}}var N=new ce,ge={initialize(e,t){N.initialize(e,t);const i=e.disableDebugging;e.disableDebugging=()=>{N.teardown(),i(),e.disableDebugging=i}},teardown(){N.teardown()}},pe=document.getElementById("pendo-debugger-plugin");let x="pendo";pe&&(x=pe.getAttribute("data-pendo-global-key")||"pendo"),window[x].addExtension&&window[x].addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:ge})}();
|
|
4
|
+
!function(){"use strict";class M{constructor(e,t){this.path=e,this.handler=t}}class W{routes={};addRoute(e,t){this.routes[e]||(this.routes[e]=[]),this.routes[e].unshift(new M(e,t))}removeRoute(e){this.routes[e].shift()}lookupRouteProvider(){return e=>this.routes[e]?this.routes[e][0].handler:undefined}}const g=(...e)=>s=>{return[].concat(e).reduce((e,t,i,n)=>{e=t(e,s);return e||n.splice(i,n.length-i),e},s)};let G=0;const i=(e,t,i)=>{if(!e||"string"!=typeof t)return i;let n=e;for(const s of t.split(".")){if(null==n)return i;n=n[s]}return n===undefined?i:n};const t=(t,i)=>{if(t&&i)if(Array.isArray(t))for(let e=0;e<t.length;e++)i(t[e],e,t);else if("object"==typeof t)for(const e in t)t.hasOwnProperty(e)&&i(t[e],e,t);return t},c=e=>"function"==typeof e,O=e=>!(null==e),d=()=>Date.now();class e{app=null;router=null;destination=window.parent||window.top;origin="*";constructor(e,t={}){this.app=e,this.router=e.router,this.config=t,this.events=e.PluginAPI.getEventable()}getConfig(e,t){return i(this.config,e,t)}getDestinationProvider(){return()=>this.destination}getOriginProvider(){return()=>this.origin}triggerOpened(){this.events.trigger("opened",{containerType:this.type})}triggerClosed(){this.events.trigger("closed",{containerType:this.type})}}var a={padding:"0 !important",margin:"0 !important","box-sizing":"border-box !important",border:"none !important",display:"block !important",visibility:"visible !important"},h=2147483647,u={WINDOW_MARGIN:10,HEADER_HEIGHT:50,TOP:100,LEFT:100,HEIGHT:700,WIDTH:500,MIN_HEIGHT:500,MIN_WIDTH:500};const{MIN_HEIGHT:l,MIN_WIDTH:p,WINDOW_MARGIN:f}=u;function r(t,i,n,s,o){let r=0,a=0,d=0,h=0;function u(e){e.preventDefault(),i.css({visibility:"hidden"}),t.releasePointerCapture(e.pointerId),t.removeEventListener("pointermove",g),o()}function g(e){-1!==e.button||0===e.buttons?u(e):(e.preventDefault(),d=r-e.clientX,h=a-e.clientY,s(d,h))}t.addEventListener("pointerdown",function(e){0===e.button&&(e.preventDefault(),i.css({visibility:"visible"}),r=e.clientX,a=e.clientY,t.setPointerCapture(e.pointerId),t.addEventListener("pointermove",g),n())}),t.addEventListener("pointerup",u),t.addEventListener("pointercancel",u)}function F(e,t){const i=e.handle[0],n=e.container[0];let s=0,o=0;r(i,e.blockout,function(){i.style.cursor="grabbing",s=n.offsetLeft,o=n.offsetTop},function(e,t){n.style.left=m({offsetLeft:s,offsetWidth:n.offsetWidth},e)+"px",n.style.top=v({offsetTop:o,offsetHeight:n.offsetHeight},t)+"px"},function(){i.style.cursor="grab",t()})}function m(e,t){t=e.offsetLeft-t,e=window.innerWidth-e.offsetWidth-f;return t<f||e<f?f:e<t?e:t}function v(e,t){t=e.offsetTop-t,e=window.innerHeight-e.offsetHeight-f;return t<f||e<f?f:e<t?e:t}function U(e,t){var i=e.resizeHandle[0];const n=e.container[0];let s=0,o=0;r(i,e.blockout,function(){s=n.offsetWidth,o=n.offsetHeight},function(e,t){n.style.width=b({offsetWidth:s,offsetLeft:n.offsetLeft},e)+"px",n.style.height=w({offsetHeight:o,offsetTop:n.offsetTop},t)+"px"},t)}function b(e,t){t=e.offsetWidth-t,e=window.innerWidth-e.offsetLeft-f;return e<t?e:t<p?p:t}function w(e,t){t=e.offsetHeight-t,e=window.innerHeight-e.offsetTop-f;return e<t?e:t<l?l:t}class _ extends e{type="frame";destination=window.parent||window.top;origin=/^https?:/.test(window.location.protocol)?window.location.origin:"*";constructor(n,e){super(n,e);const{pendo:s,PluginAPI:o}=n;e=this.getConfig("containerId","pendo-client-app");this.container=s.dom(`<div id="${e}" class="pendo-ignore">`).css({...a,height:n.state.height,width:n.state.width,"z-index":h-1,"background-color":"#FFFFFF",position:"fixed","box-shadow":"rgb(136, 136, 136) 0px 0px 20px 0px",overflow:"hidden"}),this.handle=s.dom('<div id="pendo-app-draggable-handle">').css({...a,"z-index":h,height:u.HEADER_HEIGHT,width:"calc(100% - 100px)",position:"absolute",cursor:"grab"}).on("dblclick",()=>{n.state.minimized||(this.container.css({height:u.HEIGHT,width:u.WIDTH,transition:"all 250ms linear"}),setTimeout(()=>{this.container&&(this.container.css({transition:"none"}),this.saveSize())},250))}).appendTo(this.container),this.resizeHandle=s.dom('<div id="pendo-app-resize-handle">').css({...a,"z-index":h,visibility:this.app.state.minimized?"hidden":"visible",height:0,width:0,"border-left":"10px solid transparent","border-bottom":"10px solid rgb(136, 136, 136)",cursor:"nwse-resize",position:"absolute",bottom:0,right:0}).appendTo(this.container),this.frame=s.dom('<iframe id="pendo-agent-application" src="about:blank">').css({...a,height:"100%",width:"100%"}).on("load",()=>{if(o.ConfigReader.get("inlineStyleNonce")){const i=this.frame[0].contentDocument.createElement.bind(this.frame[0].contentDocument);this.frame[0].contentDocument.createElement=(e,...t)=>{t=i(e,...t);return"style"===e&&(e=o.ConfigReader.get("inlineStyleNonce"))&&t.setAttribute("nonce",e),t}}var e,t=document.createElement("script");t.src=((e=s)&&e.trustedTypesPolicy?e.trustedTypesPolicy:{createScriptURL(e){return e}}).createScriptURL(o.hosts.getAssetUrl(n.assetName)),t.setAttribute("data-pendo-font-base",o.hosts.getFontBaseUrl()),this.frame[0].contentDocument.body.appendChild(t),this.frame[0].contentWindow.ignoreIframeMonitor=!0,this.triggerOpened()}).appendTo(this.container),this.blockout=s.dom('<div id="pendo-app-dragging-blockout">').css({"z-index":h-2,position:"absolute",height:"100%",width:"100%",top:0,left:0,visibility:"hidden"}).appendTo(s.dom.getBody()),this.elements=[this.container,this.blockout],this.positionFrame=e=>{var{left:t,top:i,height:n}=e,{minimized:e,width:s}=e,t=t||u.LEFT,i=i||u.TOP,n=e?u.HEADER_HEIGHT:n;t=m({offsetLeft:t,offsetWidth:s},0),i=v({offsetTop:i,offsetHeight:n},0),this.container.css({left:t,top:i,height:n}),this.savePosition()},this.saveSize=()=>{var{offsetHeight:e,offsetWidth:t}=this.container[0];e&&t&&this.app.setProperties({height:e,width:t})},this.savePosition=()=>{var{offsetLeft:e,offsetTop:t}=this.container[0];e&&t&&this.app.setProperties({left:e,top:t})},this.toggleMinimize=()=>{this.app.setProperties({minimized:!this.app.state.minimized}),this.resizeHandle.css({visibility:this.app.state.minimized?"hidden":"visible"}),this.positionFrame(this.app.state)},this.positionFrame(this.app.state),F(this,this.savePosition),U(this,this.saveSize),window.addEventListener("resize",r),this.listeners=[["resize",r]];const t=s._.throttle(()=>{return e=this.container[0],0<(t=e.offsetLeft+e.offsetWidth+f-window.innerWidth)&&(e.style.left=m(e,t)+"px",e.offsetWidth>p)&&(e.style.width=b(e,t)+"px"),void(0<(t=e.offsetTop+e.offsetHeight+f-window.innerHeight)&&(e.style.top=v(e,t)+"px",e.offsetHeight>l)&&(e.style.height=w(e,t)+"px"));var e,t},10),i=s._.debounce(()=>{this.savePosition(),this.saveSize()},1e3);function r(){t(),i()}}open(){return this.router.addRoute("app::toggleMinimize",this.toggleMinimize),this.container.appendTo(this.app.pendo.dom.getBody()),Promise.resolve()}close(){this.router.removeRoute("app::toggleMinimize"),this.listeners.forEach(([e,t])=>window.removeEventListener(e,t)),this.elements.forEach(e=>e.remove()),this.triggerClosed()}}const y="promise";function T(e,t,i){this.name=e,this.type=t,this.data=i}T.prototype.toString=function(){return`Message.${this.type} - `+this.name};const B=(e,t,i)=>{e=new T(e,t,i);return t===y&&(e.requestId=""+(G+=1)),e},C=e=>{try{var{name:t,type:i,isResponse:n,data:s,requestId:o,sender:r}=e.data||{},a=new T(t,i,O(s)?JSON.parse(s):undefined);return a.requestId=o,a.sender=r,a.destination=e.source,a.origin=e.origin,a.isResponse=n,a}catch(d){return!1}},$=e=>{var t=((e,t)=>{if(!e||"object"!=typeof e)return{};var i=Array.isArray(t)?t:[t],n={};for(const s in e)e.hasOwnProperty(s)&&!i.includes(s)&&(n[s]=e[s]);return n})(e,["destination","origin","toString","data"]);return t.data=JSON.stringify(e.data,(e,t)=>"function"==typeof t||t instanceof RegExp?t.toString?t.toString():undefined:t),t},n=e=>(e.isResponse=!0,e),s="disconnected",P={lastMessageReceivedAt:0,currentConnectionQuality:s,changeCallbacks:{},evalCallbacks:{}},o=e=>{e!==P.currentConnectionQuality&&(P.currentConnectionQuality=e,t(P.changeCallbacks,e=>{e(P.currentConnectionQuality)}))},q=()=>{var e;0===P.lastMessageReceivedAt?o(s):((e=d()-P.lastMessageReceivedAt)<1e4?o("connected"):1e4<e&&(3e4<e?o("dead_connection"):o(s)),t(P.evalCallbacks,e=>{e(P.currentConnectionQuality)}))};let I;let R=0;const j=()=>{P.currentConnectionQuality=s,P.lastMessageReceivedAt=0},E={appName:undefined,connectionName:undefined,frameId:undefined,pendingRequests:{},topics:{},senderIds:{},originProvider:undefined,isOriginAllowed:undefined,destinationProvider:undefined},H=()=>""+E.appName+E.connectionName+`(${E.frameId})`,Q=e=>e.origin&&"null"!==e.origin?e.origin:E.originProvider(),S=e=>{e.sender||(e.sender=H());var t=e.destination||E.destinationProvider(),i=Q(e),n=$(e),s=K(e.sender),o=J(e.sender);s||o?s?s.postMessage(n):t.postMessage(n,i):(o=new MessageChannel,te(o.port1,e.sender),t.postMessage(n,i,[o.port2]))},A=(s,o,r=1e3)=>new Promise((e,t)=>{const i=B(s,y,o),n=setTimeout(()=>{t(s+" timeout"),z(i),ne(i)},r);X(i,()=>clearTimeout(n),e,t),S(i)}),D=e=>{var t;return E.senderIds[e]||(t=e,E.senderIds[t])||(E.senderIds[t]={port:undefined,hasTriedToUpgradeToMessageChannel:!1}),E.senderIds[e]},K=e=>D(e).port,J=e=>D(e).hasTriedToUpgradeToMessageChannel,X=(e,t,i,n)=>{E.pendingRequests[e.requestId]={message:e,clearTimeoutfn:t,resolve:i,reject:n}};const z=e=>{var t=e["requestId"];return E.pendingRequests[t].clearTimeoutfn(),delete E.pendingRequests[t],e};const k="message::ping";var Y;const V=g(e=>{var t=E.pendingRequests[e.requestId];return t&&(t.resolve(e.data),z(e)),e},t=>{var e=E.topics[t.name];return e&&e.forEach(e=>e(t.data)),t},t=>{var e;return t&&!t.isResponse&&(t.name===k?S(n(t)):(e=E.routeHandlerLookup(t.name))?e(t,e=>{t.data=e,S(n(t))}):console.log(H(),"No route handler for "+t.name,t)),t},(Y=()=>{var e;e=d(),P.lastMessageReceivedAt=e},(e,...t)=>(Y(e,...t),e))),Z=e=>E.isOriginAllowed?!!E.isOriginAllowed(e.origin)&&e:("*"===E.originProvider()||e.origin===E.originProvider())&&e,ee=e=>{var t=i(e,"data.sender");return!(!t||"string"!=typeof t||!t.includes(E.appName))&&e},te=(e,t)=>{t=D(t);t.port=e,t.hasTriedToUpgradeToMessageChannel=!0,t.port.onmessage=g(C,V)},ie=(e,t)=>{return!D(e.sender).hasTriedToUpgradeToMessageChannel&&t.ports&&t.ports[0]&&te(t.ports[0],e.sender),e},ne=e=>{e=e.sender;(e=D(e)).port=undefined,e.hasTriedToUpgradeToMessageChannel=!1};let L=()=>{};const se=()=>{L(),L=()=>{},I&&I(),j()},oe=((n,s)=>{let o,r=0,a;return function(...e){var t=d(),i=s-(t-r);return i<=0||s<i?(o&&(clearTimeout(o),o=null),r=t,a=n.apply(this,e)):!o&&0<s&&(o=setTimeout(()=>{r=d(),o=null,a=n.apply(this,e)},i)),a}})(e=>{"connected"!==e&&E.usePingAutoReconnect&&A(k)["catch"](()=>{})},1e3),re=(e,t,i,n,s,o=!1,r,a)=>{if(window.addEventListener){E.appName=e,E.frameId=t,E.routeHandlerLookup=i,E.usePingAutoReconnect=o,E.connectionName=r||"",E.isOriginAllowed="function"==typeof a?a:undefined,E.originProvider=n||(()=>window.location.origin||"*"),E.destinationProvider=s||(()=>window.parent||window.top);{const h=setInterval(q,100);I=()=>clearInterval(h)}e=oe;if(c(e)){const u=R++;P.evalCallbacks[u]=e}const d=g(Z,ee,C,ie,V);window.addEventListener("message",d),L=()=>window.removeEventListener("message",d)}},ae=e=>{if(c(e)){const t=R++;P.changeCallbacks[t]=e}};class de extends e{type="window";testUrl="";realUrl=undefined;getTitle(){return this.getConfig("title",this.getName())}getName(){return this.getConfig("name","Agent_Application")}open(){return this.router.addRoute("app::windowClosed",()=>{this.app.setProperties({containerType:"frame"}),this.app.stop()}),this.testConnection().then(()=>{this.triggerOpened()})["catch"](()=>{return this.createWindow(),s=this.app,o=1e3,new Promise((e,t)=>{const i=d(),n=()=>{s.getConnectionStatus()?e():d()-i>o?t():setTimeout(n,50)};n()});var s,o})}testConnection(){return this.destination=window.open(this.testUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`),A("app::reconnect")}createWindow(){this.realUrl&&(this.destination=window.open(this.realUrl,this.getName(),`width=${this.app.state.width},height=${this.app.state.height},resizable=yes,scrollbars=yes,status=yes,location=no`));var e=document.createElement("script");e.src=this.app.PluginAPI.hosts.getAssetUrl(this.app.assetName),e.setAttribute("data-pendo-font-base",this.app.PluginAPI.hosts.getFontBaseUrl()),this.destination.document.body.appendChild(e),this.destination.document.title=this.getTitle()}close(){this.router.removeRoute("app::windowClosed"),this.destination.close(),this.triggerClosed()}}const he=()=>({});class ue{defaultState={containerType:"frame",minimized:!1,height:u.HEIGHT,width:u.WIDTH,left:u.LEFT,top:u.TOP};state={};containerClosedCallbacks=[];container=null;isConnected=!1;constructor(e,t,i,n,s,o=he,r=he){this.appName=e,this.assetName=t,this.assetStorageKey=i,this.connectionName=n,this.frameConfigProvider=o,this.windowConfigProvider=r,s&&Object.assign(this.defaultState,s),this.router=new W}init(e,t){this.pendo=e,this.PluginAPI=t,this.events=t.getEventable(),this.router.addRoute("app::ping",(e,t)=>{t()}),this.router.addRoute("app::setProperties",({data:e})=>{this.setProperties(e)}),this.router.addRoute("app::toggleContainer",()=>{this.setProperties({minimized:!1}),this.toggleContainerType()}),this.router.addRoute("app::windowClosed",()=>{}),this.loadState(),this.prepContainer(),this.start()}prepContainer(){this.container="window"===this.state.containerType?new de(this,this.windowConfigProvider()):new _(this,this.frameConfigProvider())}setConnectionStatus(e){this.isConnected="connected"===e}getConnectionStatus(){return this.isConnected}setProperties(e){Object.assign(this.state,e),this.writeState()}getDefaultState(){return this.defaultState||{}}loadState(){try{var e=this.PluginAPI.agentStorage.read(this.assetStorageKey);this.state=Object.assign({},this.getDefaultState(),this.state,e)}catch(t){this.PluginAPI.log.error(t),this.state=Object.assign({},this.getDefaultState(),this.state)}}writeState(){this.PluginAPI.agentStorage.write(this.assetStorageKey,this.state)}toggleContainerType(){var e="frame"===this.state.containerType?"window":"frame";this.setProperties({containerType:e}),this.stop(),this.start()}start(){this.container||this.prepContainer();var e=this.PluginAPI.EventTracer.addTracerIds({})["frameId"];re(this.appName,e,this.router.lookupRouteProvider(),this.container.getOriginProvider(),this.container.getDestinationProvider(),!0,this.connectionName),ae(e=>{this.setConnectionStatus(e)}),this.container.open().then(()=>{this.events.trigger("mounted")})["catch"](()=>{"window"===this.state.containerType?(this.setProperties({containerType:"frame"}),this.prepContainer(),this.start()):(this.PluginAPI.log(`Failed to start ${this.appName} in either window or frame.`),this.stop())})}stop(){this.container.close(),this.container=null,this.events.trigger("unmounted"),se()}}const ge=()=>{try{return performance.getEntries()}catch(e){return[{failedGetEntries:!0,message:e.message,stack:e.stack}]}};class ce extends ue{constructor(){super("Debugger","pendo.debugger.min.js","debug-enabled","AgentPlugin",null,()=>({containerId:"pendo-client-debugger"}),()=>({title:"Pendo Debugger"}))}initialize(s,o){o.restartDebugger=this.start.bind(this),super.init(s,o),o.Events.on("leaderChanged",()=>{this.container&&!o.store.getters["frames/isLeader"]()&&this.stop()}),this.router.addRoute("debugger::connect",(e,t)=>{var i;t({config:o.ConfigReader.audit(),env:{apiKey:(i=s).apiKey,environment:i.debugging.isStagingServer()?"staging":"production",device:i.debugging.isMobileUserAgent()?"mobile":"desktop",browserCookies:window.navigator.cookieEnabled,guideStatus:i.areGuidesDisabled()?"off":i.areGuidesDelayed()?"delayed":"on",foundShadowRoot:!!(i=i.debugging.observer.shadowDom).foundShadowRoots||(i.findShadowRoots(document,Infinity,()=>{}),i.foundShadowRoots)},container:this.state,events:o.store.state["debugger"].eventsCaptured,timeOrigin:performance.timeOrigin})}),this.router.addRoute("debugger::stop",()=>{s.disableDebugging()}),this.router.addRoute("debugger::showGuideById",(e,t)=>{t(s.showGuideById(e.data))}),this.router.addRoute("debugger::toggleGuideLoop",e=>{e.data?s.startGuides():s.stopGuides()}),this.router.addRoute("debugger::tombstoneGuide",e=>{e=s.findGuideById(e.data);o.Tombstone.addGuide(e)}),this.router.addRoute("debugger::openGuidePage",e=>{e=e.data,n=s,t=o.hosts.SERVER;var t,i,n=(i=n.findGuideById(e))&&n._.get(i,"attributes.resourceCenter")?i.attributes.resourceCenter.isTopLevel?`${t}/resource-center/${i.id}/draft`:(n=n.BuildingBlocks.BuildingBlockResourceCenter.getResourceCenter())&&n.id?`${t}/resource-center/${n.id}/module/`+i.id:"":t+"/guides/"+e;n&&window.open(n,"_blank")}),this.router.addRoute("debugger::restore",({data:e})=>{if(e&&e.length){const t=document.createElement("iframe");t.sandbox="allow-same-origin",t.src="about:blank",t.hidden=!0,document.body.appendChild(t),t.contentWindow.ignoreIframeMonitor=!0,e.forEach(e=>{e.id.split(".").reduce((e,t,i,n)=>i===n.length-1?(e.destination[t]=e.source[t],e.destination[t]):(e.destination=e.destination[t],e.source=e.source[t],e),{destination:window,source:t.contentWindow})}),document.body.removeChild(t)}}),this.router.addRoute("debugger::sync",(e,i)=>{const t=o.store.subscribe((e,t)=>{"debugger/eventsCaptured"===e.type&&i({action:"events/eventsCaptured",data:t["debugger"].eventsCaptured})}),n=setInterval(()=>{i({action:"agent/sync",data:o.store.state}),i({action:"environment/validateEnvironment",data:s.validateEnvironment(!0)}),i({action:"performance/sync",data:ge()})},500);this.events.on("unmounted",()=>{clearInterval(n),t(),o.store.dispatch("debugger/clearHighlight")})}),this.router.addRoute("debugger::enableEventLogging",({data:e})=>{this.setProperties({enableEventLogging:e}),o.store.dispatch("debugger/enableEventLogging",e)}),this.router.addRoute("debugger::clearEventsCaptured",()=>{o.store.dispatch("debugger/clearEventsCaptured")}),this.router.addRoute("debugger::checkGuideEligibility",({data:e},t)=>{o.store.dispatch("debugger/checkGuideEligibility",{guideId:e,response:t})}),this.router.addRoute("debugger::testSelector",({data:e},t)=>{o.store.dispatch("debugger/testSelector",{selector:e,response:t})}),this.router.addRoute("debugger::highlightElement",({data:e},t)=>{var{selector:e,targetFrame:i,outlineFrame:n}=e||{};o.store.dispatch("debugger/highlightElement",{selector:e,targetFrame:i,outlineFrame:n,response:t})}),this.router.addRoute("debugger::clearHighlight",()=>{o.store.dispatch("debugger/clearHighlight")})}teardown(){super.stop(),this.setProperties({enabled:!1,containerType:"frame"})}}var N=new ce,le={initialize(e,t){N.initialize(e,t);const i=e.disableDebugging;e.disableDebugging=()=>{N.teardown(),i(),e.disableDebugging=i}},teardown(){N.teardown()}},pe=document.getElementById("pendo-debugger-plugin");let x="pendo";pe&&(x=pe.getAttribute("data-pendo-global-key")||"pendo"),window[x].addExtension&&window[x].addExtension({name:"Debugger",version:"1.0.0",type:"agent",use:"plugin",uri:le})}();
|
package/dist/dom.esm.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// Resolve the global object without relying on a bare `window` identifier.
|
|
2
|
-
// `window` is only a bound global in a normal browser realm;
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
// `window` is only a bound global in a normal browser realm; the compat builds
|
|
3
|
+
// bind it via their `(function(window, document){...})` wrapper, but the npm
|
|
4
|
+
// module build has no wrapper, so its module scope can be evaluated in realms
|
|
5
|
+
// where `window` is undeclared (a Web Worker, or a customer bundler re-chunking
|
|
6
|
+
// the module into worker-reachable code) and a bare reference throws a
|
|
7
|
+
// ReferenceError at module-load. `globalThis` resolves in every realm; the
|
|
8
|
+
// `self`/`window` fallbacks cover engines that predate it. APP-160669, APP-165809.
|
|
6
9
|
function getGlobalScope() {
|
|
7
10
|
if (typeof globalThis !== 'undefined') {
|
|
8
11
|
return globalThis;
|
|
@@ -2105,18 +2108,6 @@ var underscore = {exports: {}};
|
|
|
2105
2108
|
var underscoreExports = underscore.exports;
|
|
2106
2109
|
var _ = /*@__PURE__*/getDefaultExportFromCjs(underscoreExports);
|
|
2107
2110
|
|
|
2108
|
-
/*
|
|
2109
|
-
* @license MIT - https://github.com/taylorhakes/promise-polyfill
|
|
2110
|
-
*/
|
|
2111
|
-
// Modified to not affect global environment: the `var` keeps the binding module-local
|
|
2112
|
-
// so the polyfill never assigns to the real global `Promise`.
|
|
2113
|
-
//
|
|
2114
|
-
// Main-thread only. Reading `window` here is safe because rollup's `inject` is skipped
|
|
2115
|
-
// for the nested worker build (see `skipPlugins` on webWorkerLoader in
|
|
2116
|
-
// rollup/web-sdk.config.mjs): a worker realm has a native Promise and no `window`, so
|
|
2117
|
-
// injecting this polyfill there was both unreachable and fatal — it threw
|
|
2118
|
-
// `ReferenceError: window is not defined` at worker startup and stopped session replay
|
|
2119
|
-
// with a WORKER_ERROR. APP-163474.
|
|
2120
2111
|
var Promise$1;
|
|
2121
2112
|
|
|
2122
2113
|
Promise$1 = (function (global, factory) {
|
|
@@ -2126,7 +2117,7 @@ Promise$1 = (function (global, factory) {
|
|
|
2126
2117
|
}
|
|
2127
2118
|
|
|
2128
2119
|
return nativePromise;
|
|
2129
|
-
}(
|
|
2120
|
+
}(globalScope, (function () {
|
|
2130
2121
|
/**
|
|
2131
2122
|
* @this {Promise}
|
|
2132
2123
|
*/
|
|
@@ -7302,7 +7293,14 @@ function isMobileUserAgent() {
|
|
|
7302
7293
|
}
|
|
7303
7294
|
function isSafari(userAgent) {
|
|
7304
7295
|
if (userAgent === void 0) { userAgent = getUA(); }
|
|
7305
|
-
return userAgent.indexOf('Safari') >= 0 && !userAgent
|
|
7296
|
+
return userAgent.indexOf('Safari') >= 0 && !isChromium(userAgent);
|
|
7297
|
+
}
|
|
7298
|
+
// Every Chromium UA carries a trailing Safari/ token, so Chrome, Edge, Opera,
|
|
7299
|
+
// Brave and Electron all have to be excluded from isSafari(). Chromium builds
|
|
7300
|
+
// report Chromium/ without a Chrome/ token, hence both checks.
|
|
7301
|
+
function isChromium(userAgent) {
|
|
7302
|
+
if (userAgent === void 0) { userAgent = getUA(); }
|
|
7303
|
+
return userAgent.indexOf('Chrome') >= 0 || userAgent.indexOf('Chromium') >= 0;
|
|
7306
7304
|
}
|
|
7307
7305
|
var sniffer = {
|
|
7308
7306
|
supportsHistoryApi: shouldWrapNativeHistory,
|
|
@@ -7531,11 +7529,11 @@ function applyMatrix2dRect(matrix2d, rect) {
|
|
|
7531
7529
|
return transformedRect;
|
|
7532
7530
|
}
|
|
7533
7531
|
|
|
7534
|
-
var VERSION = '2.
|
|
7532
|
+
var VERSION = '2.339.0_';
|
|
7535
7533
|
|
|
7536
|
-
var decodeURIComponent = _.isFunction(
|
|
7534
|
+
var decodeURIComponent = _.isFunction(globalScope.decodeURIComponent) ? globalScope.decodeURIComponent : _.identity;
|
|
7537
7535
|
|
|
7538
|
-
var encodeURIComponent = _.isFunction(
|
|
7536
|
+
var encodeURIComponent = _.isFunction(globalScope.encodeURIComponent) ? globalScope.encodeURIComponent : _.identity;
|
|
7539
7537
|
|
|
7540
7538
|
var allowKeys = function () {
|
|
7541
7539
|
var allowKeys = ConfigReader.get('storage.allowKeys') || '*';
|
|
@@ -10102,7 +10100,7 @@ var WeakRef = (function(global, factory) {
|
|
|
10102
10100
|
}
|
|
10103
10101
|
|
|
10104
10102
|
return nativeWeakRef;
|
|
10105
|
-
})(
|
|
10103
|
+
})(globalScope, WeakRefFactory);
|
|
10106
10104
|
|
|
10107
10105
|
var trimString = function (str, limit) {
|
|
10108
10106
|
var len = str.length;
|