3 lines
2.0 KiB
JavaScript
3 lines
2.0 KiB
JavaScript
!function(){"use strict";var n="undefined"!=typeof window?window:void 0,o="undefined"!=typeof globalThis?globalThis:n,r=null==o?void 0:o.navigator;null==o||o.document,null==o||o.location,null==o||o.fetch,null!=o&&o.XMLHttpRequest&&"withCredentials"in new o.XMLHttpRequest&&o.XMLHttpRequest,null==o||o.AbortController,null==r||r.userAgent;var i=null!=n?n:{},e=function(o,r){var{debugEnabled:t}=void 0===r?{}:r,l={o:function(r){if(n&&(i.POSTHOG_DEBUG||t)&&void 0!==n.console&&n.console){for(var e=("__rrweb_original__"in n.console[r]?n.console[r].__rrweb_original__:n.console[r]),l=arguments.length,a=new Array(l>1?l-1:0),u=1;u<l;u++)a[u-1]=arguments[u];e(o,...a)}},info:function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];l.o("log",...o)},warn:function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];l.o("warn",...o)},error:function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];l.o("error",...o)},critical:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];console.error(o,...r)},uninitializedWarning:n=>{l.error("You must initialize PostHog before calling "+n)},createLogger:(n,r)=>e(o+" "+n,r)};return l},t=(0,e("[PostHog.js]").createLogger)("[PostHog Intercom integration]"),l=new Set,a=void 0;i.__PosthogExtensions__=i.__PosthogExtensions__||{},i.__PosthogExtensions__.integrations=i.__PosthogExtensions__.integrations||{},i.__PosthogExtensions__.integrations.intercom={start:n=>{var o;if(null!=(o=n.config.integrations)&&o.intercom){var r=i.Intercom;if(r){a=n.onSessionId((o=>{var i,e;l.has(o)||(i=n.get_session_replay_url(),e=n.requestRouter.endpointFor("ui","/project/"+n.config.token+"/person/"+n.get_distinct_id()),r("update",{latestPosthogReplayURL:i,latestPosthogPersonURL:e}),r("trackEvent","posthog:sessionInfo",{replayUrl:i,personUrl:e}),l.add(o))})),t.info("integration started")}else t.warn("Intercom not found while initializing the integration")}},stop:()=>{null==a||a(),a=void 0}}}();
|
|
//# sourceMappingURL=intercom-integration.js.map
|